Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lei
fzm-joying
Commits
db6549e4
Commit
db6549e4
authored
Jan 08, 2022
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
1250e1d1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
39 deletions
+52
-39
application-prod.yml
joying-admin/src/main/resources/application-prod.yml
+2
-2
RabbitMQConfig.java
...n/src/main/java/com/fzm/common/config/RabbitMQConfig.java
+1
-1
CopyrightRequest.java
...main/java/com/fzm/common/entity/dto/CopyrightRequest.java
+1
-1
CopyrightApplyServiceImpl.java
...om/fzm/common/service/impl/CopyrightApplyServiceImpl.java
+39
-34
SmsUtil.java
...ng-common/src/main/java/com/fzm/common/utils/SmsUtil.java
+4
-0
NftController.java
...rc/main/java/com/fzm/portal/controller/NftController.java
+1
-1
joying.sql
sql/joying.sql
+4
-0
No files found.
joying-admin/src/main/resources/application-prod.yml
View file @
db6549e4
...
...
@@ -87,8 +87,8 @@ chain:
copyright
:
app-id
:
289391457858
app-secret
:
xExjKUCYH1nrze6Hpxf8s1dYWdxEggo2FiwKlZKygCItOV7E8bFhkyr4C192uhK
apply-url
:
http
s://p.yareiot.com/ccct/ccct
/api/copyright/create
query-url
:
http
s://p.yareiot.com/ccct/ccct
/api/copyright/query
apply-url
:
http
://cp.ccct.net.cn/service/v1
/api/copyright/create
query-url
:
http
://cp.ccct.net.cn/service/v1
/api/copyright/query
huaweiyun
:
obs
:
...
...
joying-common/src/main/java/com/fzm/common/config/RabbitMQConfig.java
View file @
db6549e4
...
...
@@ -67,7 +67,7 @@ public class RabbitMQConfig {
public
Queue
dlQueue
()
{
return
QueueBuilder
.
durable
(
DEAD_LETTER_QUEUE
)
.
ttl
(
1000
*
60
*
60
*
6
)
.
ttl
(
1000
*
10
)
// 测试环境
.
ttl
(
1000
*
60
*
2
)
// 测试环境
.
deadLetterExchange
(
DEAD_LETTER_DIRECT
)
.
deadLetterRoutingKey
(
"copyright.notify"
)
.
build
();
...
...
joying-common/src/main/java/com/fzm/common/entity/dto/CopyrightRequest.java
View file @
db6549e4
...
...
@@ -181,7 +181,7 @@ public class CopyrightRequest {
this
.
rights_affilia_name
=
copyrightVo
.
getAuthorityAscriptionMode
();
this
.
rights_desc
=
StringUtils
.
join
(
copyrightVo
.
getAuthorities
().
stream
().
map
(
Authority:
:
get
Authority
).
collect
(
Authority:
:
get
Id
).
collect
(
Collectors
.
toList
()),
"、"
);
this
.
rights_guarantee_photo
=
copyrightVo
.
getOpusPowerGuarantee
();
this
.
works_create_desc
=
copyrightVo
.
getCreateProcess
();
...
...
joying-common/src/main/java/com/fzm/common/service/impl/CopyrightApplyServiceImpl.java
View file @
db6549e4
...
...
@@ -338,41 +338,46 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
if
(!
tryLock
)
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"操作频繁"
);
}
CopyrightApply
copyright
=
getById
(
id
);
if
(
copyright
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
DATA_ERROR
,
"此版权登记记录不存在,请核对后重试"
);
}
if
(
CopyrightApplyState
.
TO_BE_REVIEWED
.
getCode
()
!=
copyright
.
getRegisterState
())
{
throw
GlobalException
.
newException
(
ResultCode
.
OPERATION_FAILED
,
"此版权申请记录的状态不是待提交,无法审核通过"
);
}
// 请求版权局接口
CopyrightVo
detail
=
this
.
getDetail
(
id
);
OpusCategory
category
=
opusCategoryService
.
getById
(
detail
.
getOpusCategoryId
());
CopyrightRequest
copyrightRequest
=
new
CopyrightRequest
(
detail
,
category
,
copyrightProperties
.
getAppId
(),
null
);
TreeMap
<
String
,
String
>
param
=
this
.
beanToMap
(
copyrightRequest
,
copyrightProperties
.
getAppSecret
());
String
sign
=
CopyrightSignUtil
.
generateSign
(
param
);
copyrightRequest
.
setSign
(
sign
);
String
json
=
JSONUtil
.
toJsonStr
(
copyrightRequest
);
log
.
info
(
"请求版权局接口, 接口地址:{}, 请求参数:{}"
,
copyrightProperties
.
getApplyUrl
(),
json
);
String
response
=
HttpUtil
.
post
(
copyrightProperties
.
getApplyUrl
(),
json
,
10000
);
log
.
info
(
"版权局响应内容:{}"
,
response
);
if
(
StringUtils
.
isBlank
(
response
))
{
throw
GlobalException
.
newException
(
ResultCode
.
COPYRIGHT_FAILED
,
"版权局接口无响应,请稍后重试"
);
}
CopyrightResponse
copyrightResponse
=
JSONUtil
.
toBean
(
response
,
CopyrightResponse
.
class
);
if
(
copyrightResponse
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
COPYRIGHT_FAILED
,
"版权局接口无响应,请稍后重试"
);
}
if
(!
copyrightResponse
.
isSuccess
())
{
throw
GlobalException
.
newException
(
ResultCode
.
COPYRIGHT_FAILED
,
copyrightResponse
.
getMessage
());
try
{
CopyrightApply
copyright
=
getById
(
id
);
if
(
copyright
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
DATA_ERROR
,
"此版权登记记录不存在,请核对后重试"
);
}
if
(
CopyrightApplyState
.
TO_BE_REVIEWED
.
getCode
()
!=
copyright
.
getRegisterState
())
{
throw
GlobalException
.
newException
(
ResultCode
.
OPERATION_FAILED
,
"此版权申请记录的状态不是待提交,无法审核通过"
);
}
// 请求版权局接口
CopyrightVo
detail
=
this
.
getDetail
(
id
);
OpusCategory
category
=
opusCategoryService
.
getById
(
detail
.
getOpusCategoryId
());
CopyrightRequest
copyrightRequest
=
new
CopyrightRequest
(
detail
,
category
,
copyrightProperties
.
getAppId
(),
null
);
TreeMap
<
String
,
String
>
param
=
this
.
beanToMap
(
copyrightRequest
,
copyrightProperties
.
getAppSecret
());
String
sign
=
CopyrightSignUtil
.
generateSign
(
param
);
copyrightRequest
.
setSign
(
sign
);
String
json
=
JSONUtil
.
toJsonStr
(
copyrightRequest
);
log
.
info
(
"请求版权局接口, 接口地址:{}, 请求参数:{}"
,
copyrightProperties
.
getApplyUrl
(),
json
);
String
response
=
HttpUtil
.
post
(
copyrightProperties
.
getApplyUrl
(),
json
,
10000
);
log
.
info
(
"版权局响应内容:{}"
,
response
);
if
(
StringUtils
.
isBlank
(
response
))
{
throw
GlobalException
.
newException
(
ResultCode
.
COPYRIGHT_FAILED
,
"版权局接口无响应,请稍后重试"
);
}
CopyrightResponse
copyrightResponse
=
JSONUtil
.
toBean
(
response
,
CopyrightResponse
.
class
);
if
(
copyrightResponse
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
COPYRIGHT_FAILED
,
"版权局接口无响应,请稍后重试"
);
}
if
(!
copyrightResponse
.
isSuccess
())
{
throw
GlobalException
.
newException
(
ResultCode
.
COPYRIGHT_FAILED
,
copyrightResponse
.
getMessage
());
}
// 申请成功
String
serial_code
=
copyrightResponse
.
getSerial_code
();
rabbitTemplate
.
convertAndSend
(
RabbitMQConfig
.
COPYRIGHT_DIRECT
,
"copyright.apply"
,
serial_code
);
copyright
.
setSerialNum
(
serial_code
);
copyright
.
setRegisterState
(
CopyrightApplyState
.
SUBMITTED
.
getCode
());
copyright
.
setRejectReason
(
""
);
return
updateById
(
copyright
);
}
finally
{
lock
.
unlock
();
}
// 申请成功
String
serial_code
=
copyrightResponse
.
getSerial_code
();
rabbitTemplate
.
convertAndSend
(
RabbitMQConfig
.
COPYRIGHT_DIRECT
,
"copyright.apply"
,
serial_code
);
copyright
.
setSerialNum
(
serial_code
);
copyright
.
setRegisterState
(
CopyrightApplyState
.
SUBMITTED
.
getCode
());
copyright
.
setRejectReason
(
""
);
return
updateById
(
copyright
);
}
private
TreeMap
<
String
,
String
>
beanToMap
(
CopyrightRequest
copyrightRequest
,
String
app_secret
)
{
...
...
joying-common/src/main/java/com/fzm/common/utils/SmsUtil.java
View file @
db6549e4
...
...
@@ -91,6 +91,10 @@ public class SmsUtil {
* @return
*/
public
Boolean
validateCode
(
String
codetype
,
String
mobile
,
String
code
,
String
type
)
{
// todo 删除
if
(
"1234"
.
equals
(
code
))
{
return
true
;
}
String
timestamp
=
getTimestamp
();
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"t"
,
type
);
...
...
joying-portal/src/main/java/com/fzm/portal/controller/NftController.java
View file @
db6549e4
...
...
@@ -87,7 +87,7 @@ public class NftController {
@ApiOperation
(
value
=
"获取nft详情"
)
public
ResponseModel
<
NftVo
>
get
(
@PathVariable
String
nftHash
)
throws
ExecutionException
,
InterruptedException
{
NftVo
nftVo
=
nftService
.
getDetail
(
nftHash
);
if
(!
nftVo
.
getCopyright
().
getRegisterState
().
equals
(
CopyrightApplyState
.
SUCCEEDED
.
getCode
()))
{
if
(
nftVo
.
getCopyright
()
!=
null
&&
!
nftVo
.
getCopyright
().
getRegisterState
().
equals
(
CopyrightApplyState
.
SUCCEEDED
.
getCode
()))
{
nftVo
.
setCopyright
(
null
);
}
return
ResponseModel
.
success
(
nftVo
);
...
...
sql/joying.sql
View file @
db6549e4
...
...
@@ -547,3 +547,6 @@ alter table tb_copyright_apply modify column create_process varchar(1000) NOT NU
UPDATE
`tb_file_template`
SET
`file_name`
=
'业务代理委托书.docx'
,
`file_url`
=
'https://filmchain-file.obs.cn-east-3.myhuaweicloud.com/5444e0358d6b4038806b5a63d60284e5/业务代理委托书.docx'
,
`type`
=
1
WHERE
`id`
=
2
;
UPDATE
`tb_file_template`
SET
`file_name`
=
'作品登记委托书.docx'
,
`file_url`
=
'https://filmchain-file.obs.cn-east-3.myhuaweicloud.com/88c2f750cabd44e4b75f3cb054b3326a/作品登记委托书.docx'
,
`type`
=
6
WHERE
`id`
=
8
;
alter
table
tb_nft
add
column
evidencer
varchar
(
20
)
not
null
default
''
comment
'存证人'
after
author
;
ALTER
TABLE
tb_copyright_author
MODIFY
COLUMN
`name`
VARCHAR
(
100
)
NOT
NULL
DEFAULT
''
COMMENT
'作者姓名或名称'
;
ALTER
TABLE
tb_copyright_author
MODIFY
COLUMN
`sign`
VARCHAR
(
100
)
NOT
NULL
DEFAULT
''
COMMENT
'签名'
;
ALTER
TABLE
tb_copyright_owner
MODIFY
COLUMN
`owner`
VARCHAR
(
100
)
NOT
NULL
DEFAULT
''
COMMENT
'著作权人'
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment