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
aabd74f8
Commit
aabd74f8
authored
Apr 25, 2022
by
33
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Api版权接口
parent
4f0360ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
19 deletions
+50
-19
ResultCode.java
...common/src/main/java/com/fzm/common/enums/ResultCode.java
+16
-1
CopyrightOwnerOO.java
...m/fzm/common/open/entity/openobject/CopyrightOwnerOO.java
+2
-2
CopyrightApiServiceImpl.java
...fzm/common/open/service/impl/CopyrightApiServiceImpl.java
+1
-0
CopyrightApiController.java
...om/fzm/portal/controller/open/CopyrightApiController.java
+31
-16
No files found.
joying-common/src/main/java/com/fzm/common/enums/ResultCode.java
View file @
aabd74f8
...
...
@@ -25,7 +25,22 @@ public enum ResultCode implements IErrorCode {
PAY_FAILED
(
422
,
"支付失败"
),
REFUND_FAILED
(
422
,
"退款失败"
),
signature_wrong
(
440
,
"签名错误"
),
app_key_wrong
(
440
,
"app_key错误"
),
biz_id_wrong
(
440
,
"biz_id错误"
),
signature_wrong
(
440
,
"signature错误"
),
publish_state_wrong
(
440
,
"发表状态错误"
),
first_publish_date_wrong
(
440
,
"首次发表日期错误"
),
first_publish_city_wrong
(
440
,
"首次发表城市错误"
),
first_publish_province_wrong
(
440
,
"首次发表省份错误"
),
sign_type_wrong
(
440
,
"署名类型错误"
),
owner_type_wrong
(
440
,
"著作权人类型错误"
),
is_effective_wrong
(
440
,
"证件是否长期有效错误"
),
effective_end_date_wrong
(
440
,
"证件有效终止时间错误"
),
id_type_wrong
(
440
,
"证件类型错误"
),
positive_photo_wrong
(
440
,
"正面照片错误"
),
back_photo_wrong
(
440
,
"反面照片错误"
),
personal_photo_wrong
(
440
,
"手持身份证照片错误"
),
certificates_photo_wrong
(
440
,
"证件照片错误"
),
;
...
...
joying-common/src/main/java/com/fzm/common/open/entity/openobject/CopyrightOwnerOO.java
View file @
aabd74f8
...
...
@@ -16,7 +16,7 @@ import java.util.Date;
@Data
public
class
CopyrightOwnerOO
{
@NotNull
(
message
=
"著作权人类型不能为空"
)
@ApiModelProperty
(
value
=
"
类别
0-自然人 1-法人"
)
@ApiModelProperty
(
value
=
"
著作权人类型
0-自然人 1-法人"
)
private
Integer
type
;
@NotBlank
(
message
=
"著作权人不能为空"
)
...
...
@@ -28,7 +28,7 @@ public class CopyrightOwnerOO {
private
String
idNumber
;
@NotNull
(
message
=
"证件是否长期有效不能为空"
)
@ApiModelProperty
(
value
=
"是否长期有效 0-否 1-是"
)
@ApiModelProperty
(
value
=
"
证件
是否长期有效 0-否 1-是"
)
private
Integer
isEffective
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
...
...
joying-common/src/main/java/com/fzm/common/open/service/impl/CopyrightApiServiceImpl.java
View file @
aabd74f8
...
...
@@ -190,6 +190,7 @@ public class CopyrightApiServiceImpl extends ServiceImpl<CopyrightApiMapper, Cop
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
pass
(
Integer
id
)
{
RLock
lock
=
redisson
.
getLock
(
"copyright:api:apply:"
+
id
);
boolean
tryLock
;
...
...
joying-portal/src/main/java/com/fzm/portal/controller/open/CopyrightApiController.java
View file @
aabd74f8
...
...
@@ -44,12 +44,12 @@ public class CopyrightApiController {
String
appKey
=
baseOO
.
getAppKey
();
OpenKeyDO
openKeyDO
=
openKeyService
.
getByAppKey
(
appKey
);
if
(
openKeyDO
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
app_key_wrong
);
}
String
bizId
=
baseOO
.
getBizId
();
if
(
StringUtils
.
isBlank
(
bizId
))
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
biz_id_wrong
);
}
String
signature
=
baseOO
.
getSignature
();
...
...
@@ -66,21 +66,30 @@ public class CopyrightApiController {
}
Integer
publishState
=
copyrightOO
.
getPublishState
();
if
(
publishState
==
null
||
publishState
!=
0
&&
publishState
!=
1
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
if
(
publishState
!=
0
&&
publishState
!=
1
)
{
throw
GlobalException
.
newException
(
ResultCode
.
publish_state_wrong
);
}
// 如果发表状态是已发表的话,需要传入首次发表日期和省市
if
(
SystemConstant
.
BOOLEAN_DATA_TRUE
.
equals
(
publishState
)
&&
(
copyrightOO
.
getFirstPublishDate
()
==
null
||
StringUtils
.
isAnyBlank
(
copyrightOO
.
getFirstPublishCity
(),
copyrightOO
.
getFirstPublishProvince
())))
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
if
(
SystemConstant
.
BOOLEAN_DATA_TRUE
.
equals
(
publishState
))
{
Date
firstPublishDate
=
copyrightOO
.
getFirstPublishDate
();
if
(
firstPublishDate
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
first_publish_date_wrong
);
}
String
firstPublishCity
=
copyrightOO
.
getFirstPublishCity
();
if
(
StringUtils
.
isBlank
(
firstPublishCity
))
{
throw
GlobalException
.
newException
(
ResultCode
.
first_publish_city_wrong
);
}
String
firstPublishProvince
=
copyrightOO
.
getFirstPublishProvince
();
if
(
StringUtils
.
isBlank
(
firstPublishProvince
))
{
throw
GlobalException
.
newException
(
ResultCode
.
first_publish_province_wrong
);
}
}
List
<
CopyrightAuthorOO
>
authors
=
copyrightOO
.
getAuthors
();
for
(
CopyrightAuthorOO
author
:
authors
)
{
String
signType
=
author
.
getSignType
();
if
(!
"本名"
.
equals
(
signType
)
&&
!
"别名"
.
equals
(
signType
)
&&
!
"匿名"
.
equals
(
signType
))
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
sign_type_wrong
);
}
}
...
...
@@ -88,33 +97,39 @@ public class CopyrightApiController {
for
(
CopyrightOwnerOO
owner
:
owners
)
{
Integer
type
=
owner
.
getType
();
if
(
type
!=
0
&&
type
!=
1
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
owner_type_wrong
);
}
Integer
isEffective
=
owner
.
getIsEffective
();
if
(
isEffective
!=
0
&&
isEffective
!=
1
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
is_effective_wrong
);
}
if
(
isEffective
==
0
)
{
Date
endDate
=
owner
.
getEffectiveEndDate
();
if
(
endDate
==
null
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
effective_end_date_wrong
);
}
}
Integer
idType
=
owner
.
getIdType
();
if
(
idType
<
0
||
idType
>
7
)
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
id_type_wrong
);
}
if
(
idType
==
0
)
{
String
positivePhoto
=
owner
.
getPositivePhoto
();
if
(
StringUtils
.
isBlank
(
positivePhoto
))
{
throw
GlobalException
.
newException
(
ResultCode
.
positive_photo_wrong
);
}
String
backPhoto
=
owner
.
getBackPhoto
();
if
(
StringUtils
.
isBlank
(
backPhoto
))
{
throw
GlobalException
.
newException
(
ResultCode
.
back_photo_wrong
);
}
String
personalPhoto
=
owner
.
getPersonalPhoto
();
if
(
StringUtils
.
is
AnyBlank
(
positivePhoto
,
backPhoto
,
personalPhoto
))
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
if
(
StringUtils
.
is
Blank
(
personalPhoto
))
{
throw
GlobalException
.
newException
(
ResultCode
.
personal_photo_wrong
);
}
}
else
{
String
certificatesPhoto
=
owner
.
getCertificatesPhoto
();
if
(
StringUtils
.
isBlank
(
certificatesPhoto
))
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
);
throw
GlobalException
.
newException
(
ResultCode
.
certificates_photo_wrong
);
}
}
}
...
...
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