Commit aa5a62be authored by tangtuo's avatar tangtuo

修改bug

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