记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
董敬伟
liquidnet-bus-v1
Commits
66894ef6
Commit
66894ef6
authored
Dec 02, 2021
by
Tice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不允许重复添加
parent
e5fe2f52
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
20 deletions
+31
-20
MerchantAuthorizationRecordParam.java
.../merchant/dto/param/MerchantAuthorizationRecordParam.java
+1
-1
IMerchantFieldsService.java
...dnet/service/merchant/service/IMerchantFieldsService.java
+1
-1
MerchantAuthorizationRecordsAdminServiceImpl.java
...ce/impl/MerchantAuthorizationRecordsAdminServiceImpl.java
+2
-2
MerchantMongoUtil.java
...ient/admin/zhengzai/merchant/utils/MerchantMongoUtil.java
+2
-1
MerchantAuthorizationsController.java
...merchant/controller/MerchantAuthorizationsController.java
+1
-3
MerchantFieldsController.java
...service/merchant/controller/MerchantFieldsController.java
+1
-3
MerchantMongoService.java
...uidnet/service/merchant/service/MerchantMongoService.java
+2
-1
MerchantAuthorizationRecordsServiceImpl.java
...service/impl/MerchantAuthorizationRecordsServiceImpl.java
+15
-5
MerchantFieldsServiceImpl.java
...vice/merchant/service/impl/MerchantFieldsServiceImpl.java
+4
-2
errors.properties
...ervice-merchant-impl/src/main/resources/errors.properties
+2
-1
No files found.
liquidnet-bus-api/liquidnet-service-merchant-api/src/main/java/com/liquidnet/service/merchant/dto/param/MerchantAuthorizationRecordParam.java
View file @
66894ef6
...
...
@@ -17,7 +17,7 @@ public class MerchantAuthorizationRecordParam implements java.io.Serializable{
@NotBlank
private
String
performanceId
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"权利人演出角色
checker,目前仅验票员
"
)
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"权利人演出角色
CHECKER
"
)
@NotBlank
private
String
uidRole
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"权利人UID"
)
...
...
liquidnet-bus-api/liquidnet-service-merchant-api/src/main/java/com/liquidnet/service/merchant/service/IMerchantFieldsService.java
View file @
66894ef6
...
...
@@ -16,7 +16,7 @@ public interface IMerchantFieldsService {
List
<
MerchantFieldCheckersVo
>
checkers
(
String
cuid
,
String
fieldId
);
void
checkerAdd
(
String
cuid
,
String
fieldId
,
String
uid
,
String
mobile
,
String
name
);
String
checkerAdd
(
String
cuid
,
String
fieldId
,
String
uid
,
String
mobile
,
String
name
);
void
checkerDel
(
String
cuid
,
String
fieldId
,
String
uid
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/merchant/service/impl/MerchantAuthorizationRecordsAdminServiceImpl.java
View file @
66894ef6
...
...
@@ -69,9 +69,9 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
List
<
String
>
updatedUids3
=
this
.
performanceFielder
(
performanceId
,
fieldId
);
updatedUids
.
addAll
(
updatedUids3
);
// 聚合角色及权限 vo
// 聚合角色及权限 vo
mongo
for
(
String
uid:
updatedUids
)
{
merchantMongoUtil
.
syncAndSet
AuthorizationPerformanceVo
(
performanceId
,
uid
);
merchantMongoUtil
.
getAndSync
AuthorizationPerformanceVo
(
performanceId
,
uid
);
}
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/merchant/utils/MerchantMongoUtil.java
View file @
66894ef6
...
...
@@ -49,7 +49,7 @@ public class MerchantMongoUtil {
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"uid"
).
is
(
uid
)),
MerchantAuthorizationPerformanceVo
.
class
,
MerchantAuthorizationPerformanceVo
.
class
.
getSimpleName
());
}
public
void
syncAndSet
AuthorizationPerformanceVo
(
String
performanceId
,
String
uid
)
{
public
MerchantAuthorizationPerformanceVo
getAndSync
AuthorizationPerformanceVo
(
String
performanceId
,
String
uid
)
{
// 聚合角色及权限
Query
recordsQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"uid"
).
is
(
uid
).
and
(
"deletedAt"
).
is
(
null
));
List
<
MerchantAuthorizationRecordsVo
>
authorizationRecordsVos
=
mongoTemplate
.
find
(
recordsQuery
,
MerchantAuthorizationRecordsVo
.
class
,
MerchantAuthorizationRecordsVo
.
class
.
getSimpleName
());
...
...
@@ -74,6 +74,7 @@ public class MerchantMongoUtil {
Document
document
=
(
Document
)
mongoConverter
.
convertToMongoType
(
vo
);
Update
update
=
Update
.
fromDocument
(
document
);
mongoTemplate
.
upsert
(
query
,
update
,
MerchantAuthorizationPerformanceVo
.
class
,
MerchantAuthorizationPerformanceVo
.
class
.
getSimpleName
());
return
vo
;
}
public
List
<
MerchantFieldAppliesVo
>
getFieldAppliesVosByUid
(
String
uid
)
{
...
...
liquidnet-bus-service/liquidnet-service-merchant/liquidnet-service-merchant-impl/src/main/java/com/liquidnet/service/merchant/controller/MerchantAuthorizationsController.java
View file @
66894ef6
...
...
@@ -61,9 +61,7 @@ public class MerchantAuthorizationsController {
public
ResponseDto
<
Object
>
recordsCheckerAdd
(
@Valid
@RequestBody
MerchantAuthorizationRecordParam
parameter
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
authorizationRecordsService
.
performanceRecordCheckerAdd
(
currentUid
,
parameter
);
return
ResponseDto
.
success
();
return
ResponseDto
.
success
(
authorizationRecordsService
.
performanceRecordCheckerAdd
(
currentUid
,
parameter
));
}
@ApiOperationSupport
(
order
=
22
)
...
...
liquidnet-bus-service/liquidnet-service-merchant/liquidnet-service-merchant-impl/src/main/java/com/liquidnet/service/merchant/controller/MerchantFieldsController.java
View file @
66894ef6
...
...
@@ -122,9 +122,7 @@ public class MerchantFieldsController {
@RequestParam
(
required
=
true
)
String
name
){
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
merchantFieldsService
.
checkerAdd
(
currentUid
,
fieldId
,
uid
,
mobile
,
name
);
return
ResponseDto
.
success
();
return
ResponseDto
.
success
(
merchantFieldsService
.
checkerAdd
(
currentUid
,
fieldId
,
uid
,
mobile
,
name
));
}
@ApiOperationSupport
(
order
=
32
)
...
...
liquidnet-bus-service/liquidnet-service-merchant/liquidnet-service-merchant-impl/src/main/java/com/liquidnet/service/merchant/service/MerchantMongoService.java
View file @
66894ef6
...
...
@@ -51,7 +51,7 @@ public class MerchantMongoService {
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"uid"
).
is
(
uid
)),
MerchantAuthorizationPerformanceVo
.
class
,
MerchantAuthorizationPerformanceVo
.
class
.
getSimpleName
());
}
public
void
syncAndSet
AuthorizationPerformanceVo
(
String
performanceId
,
String
uid
)
{
public
MerchantAuthorizationPerformanceVo
getAndSync
AuthorizationPerformanceVo
(
String
performanceId
,
String
uid
)
{
// 聚合角色及权限
Query
recordsQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"uid"
).
is
(
uid
).
and
(
"deletedAt"
).
is
(
null
));
List
<
MerchantAuthorizationRecordsVo
>
authorizationRecordsVos
=
mongoTemplate
.
find
(
recordsQuery
,
MerchantAuthorizationRecordsVo
.
class
,
MerchantAuthorizationRecordsVo
.
class
.
getSimpleName
());
...
...
@@ -76,6 +76,7 @@ public class MerchantMongoService {
Document
document
=
(
Document
)
mongoConverter
.
convertToMongoType
(
vo
);
Update
update
=
Update
.
fromDocument
(
document
);
mongoTemplate
.
upsert
(
query
,
update
,
MerchantAuthorizationPerformanceVo
.
class
,
MerchantAuthorizationPerformanceVo
.
class
.
getSimpleName
());
return
vo
;
}
...
...
liquidnet-bus-service/liquidnet-service-merchant/liquidnet-service-merchant-impl/src/main/java/com/liquidnet/service/merchant/service/impl/MerchantAuthorizationRecordsServiceImpl.java
View file @
66894ef6
...
...
@@ -82,11 +82,21 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
salesPermissionParam
=
permissionParam
;
}
}
// 至少选择一个授权权限
if
(
null
==
checkPermissionParam
&&
null
==
salesPermissionParam
)
{
// 至少选择一个授权权限
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"13305"
);
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
}
// 不能重复授权
List
<
MerchantAuthorizationRecordsVo
>
authorizationRecordsVos
=
merchantMongoService
.
getAuthorizationRecordsCheckersVosByCuid
(
cuid
,
parameter
.
getPerformanceId
());
if
(!
CollectionUtil
.
isEmpty
(
authorizationRecordsVos
))
{
for
(
MerchantAuthorizationRecordsVo
vo
:
authorizationRecordsVos
)
{
if
(
vo
.
getUid
().
equals
(
parameter
.
getUid
()))
{
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"13306"
);
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
}
}
}
// 获取最大权限角色
MerchantAuthorizationConst
.
PerformanceRole
maxPerformanceRole
=
this
.
getMaxPerformanceRole
(
cuid
,
parameter
.
getPerformanceId
());
if
(
null
==
maxPerformanceRole
||
maxPerformanceRole
.
getLevel
()
<=
MerchantAuthorizationConst
.
PerformanceRole
.
CHECKER
.
getLevel
())
{
...
...
@@ -149,8 +159,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
mongoTemplate
.
insert
(
authorizationRecordsVo
,
MerchantAuthorizationRecordsVo
.
class
.
getSimpleName
());
log
.
debug
(
"#MONGO耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
// 聚合角色及权限 vo
merchantMongoService
.
syncAndSet
AuthorizationPerformanceVo
(
authorizationRecordsVo
.
getPerformanceId
(),
authorizationRecordsVo
.
getUid
());
// 聚合角色及权限 vo
mongo
merchantMongoService
.
getAndSync
AuthorizationPerformanceVo
(
authorizationRecordsVo
.
getPerformanceId
(),
authorizationRecordsVo
.
getUid
());
// sql
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
...
...
@@ -206,8 +216,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
mongoTemplate
.
remove
(
Query
.
query
(
Criteria
.
where
(
"authorizationRecordId"
).
is
(
authorizationRecordId
)),
MerchantAuthorizationRecordsVo
.
class
.
getSimpleName
());
log
.
debug
(
"#MONGO耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
// 聚合角色及权限 vo
merchantMongoService
.
syncAndSet
AuthorizationPerformanceVo
(
authorizationRecordsVo
.
getPerformanceId
(),
authorizationRecordsVo
.
getUid
());
// 聚合角色及权限 vo
mongo
merchantMongoService
.
getAndSync
AuthorizationPerformanceVo
(
authorizationRecordsVo
.
getPerformanceId
(),
authorizationRecordsVo
.
getUid
());
// sql
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
...
...
liquidnet-bus-service/liquidnet-service-merchant/liquidnet-service-merchant-impl/src/main/java/com/liquidnet/service/merchant/service/impl/MerchantFieldsServiceImpl.java
View file @
66894ef6
...
...
@@ -157,11 +157,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
}
@Override
public
void
checkerAdd
(
String
cuid
,
String
fieldId
,
String
uid
,
String
mobile
,
String
name
)
{
public
String
checkerAdd
(
String
cuid
,
String
fieldId
,
String
uid
,
String
mobile
,
String
name
)
{
// 当前用户是否管理该场地
this
.
checkFieldAccount
(
cuid
,
fieldId
);
// 场地默认验票员,
是否已经
添加
// 场地默认验票员,
不能授权自己,不能重复
添加
if
(
cuid
.
equals
(
uid
))
{
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"13105"
);
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
...
...
@@ -207,6 +207,8 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
SqlMapping
.
gets
(
toMqSqls
,
fieldCheckerInsertObjs
)
);
log
.
debug
(
"#MQ耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
return
fieldCheckersVo
.
getFieldCheckerId
();
}
@Override
...
...
liquidnet-bus-service/liquidnet-service-merchant/liquidnet-service-merchant-impl/src/main/resources/errors.properties
View file @
66894ef6
...
...
@@ -32,8 +32,9 @@
13301
=
无授权权限
13302
=
无权限授于统计权限
13303
=
授权时间有误
13304
=
不能授权自己
权限
13304
=
不能授权自己
13305
=
至少选择一个授权权限
13306
=
授权已经已存在
...
...
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