Commit aa5a62be authored by tangtuo's avatar tangtuo

修改bug

parent a6c50668
...@@ -83,6 +83,9 @@ public class CopyrightApply { ...@@ -83,6 +83,9 @@ public class CopyrightApply {
@ApiModelProperty(value = "权力归属证明材料的文件地址") @ApiModelProperty(value = "权力归属证明材料的文件地址")
private String authorityAscriptionProve; private String authorityAscriptionProve;
@ApiModelProperty(value = "申请时间")
private Date applyTime;
@ApiModelProperty(value = "登记状态 0-待审核 1-登记成功 2-审核失败") @ApiModelProperty(value = "登记状态 0-待审核 1-登记成功 2-审核失败")
private Integer registerState; private Integer registerState;
......
...@@ -43,7 +43,7 @@ public class CopyrightApplyVo { ...@@ -43,7 +43,7 @@ public class CopyrightApplyVo {
private Integer registerState; private Integer registerState;
@ApiModelProperty(value = "申请时间") @ApiModelProperty(value = "申请时间")
private Date createDate; private Date applyTime;
} }
...@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
...@@ -97,6 +98,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, ...@@ -97,6 +98,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
// 首次提交,登记状态为待提交 // 首次提交,登记状态为待提交
copyrightApply.setRegisterState(CopyrightApplyState.TO_BE_REVIEWED.getCode()); copyrightApply.setRegisterState(CopyrightApplyState.TO_BE_REVIEWED.getCode());
copyrightApply.setUserId(user.getId()); copyrightApply.setUserId(user.getId());
copyrightApply.setApplyTime(new Date());
save(copyrightApply); save(copyrightApply);
// 保存附件 // 保存附件
ArrayList<CopyrightFile> files = new ArrayList<>(); ArrayList<CopyrightFile> files = new ArrayList<>();
...@@ -266,6 +268,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, ...@@ -266,6 +268,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
} }
copyrightApplyOwnerRelationService.saveBatch(owners); copyrightApplyOwnerRelationService.saveBatch(owners);
} }
copyrightApply.setApplyTime(new Date());
copyrightApply.setRegisterState(CopyrightApplyState.TO_BE_REVIEWED.getCode()); copyrightApply.setRegisterState(CopyrightApplyState.TO_BE_REVIEWED.getCode());
return updateById(copyrightApply); return updateById(copyrightApply);
} }
...@@ -315,7 +318,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, ...@@ -315,7 +318,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
String json = JSONUtil.toJsonStr(copyrightRequest); String json = JSONUtil.toJsonStr(copyrightRequest);
log.info("请求版权局接口, 请求参数:{}", json); log.info("请求版权局接口, 请求参数:{}", json);
String response = HttpUtil.post("https://p.yareiot.com/ccct/api/copyright/create", json, 10000); String response = HttpUtil.post("https://p.yareiot.com/ccct/api/copyright/create", json, 10000);
log.info("版权局响应内容:{}", response ); log.info("版权局响应内容:{}", response);
if (StringUtils.isBlank(response)) { if (StringUtils.isBlank(response)) {
throw GlobalException.newException(ResultCode.COPYRIGHT_FAILED, "版权局接口无响应,请稍后重试"); throw GlobalException.newException(ResultCode.COPYRIGHT_FAILED, "版权局接口无响应,请稍后重试");
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
c.register_state, c.register_state,
c.opus_name, c.opus_name,
c.nft_hash, c.nft_hash,
c.create_date, c.apply_time,
u.nickname, u.nickname,
u.telephone u.telephone
FROM tb_copyright_apply c FROM tb_copyright_apply c
...@@ -39,11 +39,12 @@ ...@@ -39,11 +39,12 @@
and c.register_state = #{registerState} and c.register_state = #{registerState}
</if> </if>
<if test="startDate != null"> <if test="startDate != null">
and c.create_date >= #{startDate} and c.apply_time >= #{startDate}
</if> </if>
<if test="endDate != null"> <if test="endDate != null">
and c.create_date &lt;= #{endDate} and c.apply_time &lt;= #{endDate}
</if> </if>
</where> </where>
order by c.apply_time desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -89,20 +89,17 @@ ...@@ -89,20 +89,17 @@
order by a.publish_time desc order by a.publish_time desc
</select> </select>
<select id="listCopyright" resultType="com.fzm.common.entity.vo.CollectionNftVo"> <select id="listCopyright" resultType="com.fzm.common.entity.vo.CollectionNftVo">
select a.id, SELECT a.id,
a.name, a.NAME,
a.cover, a.cover,
a.nft_id, a.nft_id,
a.nft_hash, a.nft_hash,
a.file_url, a.file_url,
a.is_commemorate, a.is_commemorate
b.category_name as category FROM tb_nft a
from tb_nft a WHERE a.user_id = #{userId}
left join tb_category b on a.category_id = b.id AND a.nft_hash != ''
where a.user_id = #{userId} AND nft_hash NOT IN ( SELECT nft_hash FROM tb_copyright_apply WHERE user_id = #{userId} AND register_state IN ( 0, 2, 4 ) )
and a.nft_hash != ''
and nft_hash not in (select nft_hash from tb_copyright_apply where user_id = #{userId}
and register_state in (2, 4))
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -202,6 +202,8 @@ public class NftController { ...@@ -202,6 +202,8 @@ public class NftController {
return ResponseModel.success(result); return ResponseModel.success(result);
} }
@Authentication
@ApiOperation(value = "查询用户还未成功申请版权的nft列表")
@GetMapping(value = "/list/copyright") @GetMapping(value = "/list/copyright")
public ResponseModel<List<CollectionNftVo>> listCopyright(@RequestHeader(value = "Authorization") String token){ public ResponseModel<List<CollectionNftVo>> listCopyright(@RequestHeader(value = "Authorization") String token){
Integer userId = JwtUtil.getUserIdFromToken(token); Integer userId = JwtUtil.getUserIdFromToken(token);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment