记得上下班打卡 | git大法好,push需谨慎

Commit a44fecde authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev_merchant' into dev_merchant

parents f7000c02 f023b74c
...@@ -17,7 +17,7 @@ public class MerchantAuthorizationRecordParam implements java.io.Serializable{ ...@@ -17,7 +17,7 @@ public class MerchantAuthorizationRecordParam implements java.io.Serializable{
@NotBlank @NotBlank
private String performanceId; private String performanceId;
@ApiModelProperty(position = 11, required = true, value = "权利人演出角色 checker,目前仅验票员") @ApiModelProperty(position = 11, required = true, value = "权利人演出角色 CHECKER")
@NotBlank @NotBlank
private String uidRole; private String uidRole;
@ApiModelProperty(position = 12, required = true, value = "权利人UID") @ApiModelProperty(position = 12, required = true, value = "权利人UID")
......
...@@ -16,7 +16,7 @@ public interface IMerchantFieldsService { ...@@ -16,7 +16,7 @@ public interface IMerchantFieldsService {
List<MerchantFieldCheckersVo> checkers(String cuid, String fieldId); 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); void checkerDel(String cuid, String fieldId, String uid);
} }
...@@ -10,7 +10,7 @@ spring: ...@@ -10,7 +10,7 @@ spring:
cloud: cloud:
config: config:
# uri: http://127.0.0.1:7002/support-config # uri: http://127.0.0.1:7002/support-config
# uri: http://39.106.122.201:7002/support-config # uri: http://39.107.71.112:7002/support-config
name: ${spring.application.name},${spring.application.name}-druid #默认为spring.application.name name: ${spring.application.name},${spring.application.name}-druid #默认为spring.application.name
profile: ${liquidnet.cloudConfig.profile} profile: ${liquidnet.cloudConfig.profile}
discovery: discovery:
......
...@@ -69,9 +69,9 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -69,9 +69,9 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
List<String> updatedUids3 = this.performanceFielder(performanceId, fieldId); List<String> updatedUids3 = this.performanceFielder(performanceId, fieldId);
updatedUids.addAll(updatedUids3); updatedUids.addAll(updatedUids3);
// 聚合角色及权限 vo // 聚合角色及权限 vo mongo
for (String uid: updatedUids) { for (String uid: updatedUids) {
merchantMongoUtil.syncAndSetAuthorizationPerformanceVo(performanceId, uid); merchantMongoUtil.getAndSyncAuthorizationPerformanceVo(performanceId, uid);
} }
} }
......
...@@ -49,7 +49,7 @@ public class MerchantMongoUtil { ...@@ -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()); return mongoTemplate.findOne(Query.query(Criteria.where("performanceId").is(performanceId).and("uid").is(uid)), MerchantAuthorizationPerformanceVo.class, MerchantAuthorizationPerformanceVo.class.getSimpleName());
} }
public void syncAndSetAuthorizationPerformanceVo(String performanceId, String uid) { public MerchantAuthorizationPerformanceVo getAndSyncAuthorizationPerformanceVo(String performanceId, String uid) {
// 聚合角色及权限 // 聚合角色及权限
Query recordsQuery = Query.query(Criteria.where("performanceId").is(performanceId).and("uid").is(uid).and("deletedAt").is(null)); 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()); List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = mongoTemplate.find(recordsQuery, MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
...@@ -74,6 +74,7 @@ public class MerchantMongoUtil { ...@@ -74,6 +74,7 @@ public class MerchantMongoUtil {
Document document = (Document)mongoConverter.convertToMongoType(vo); Document document = (Document)mongoConverter.convertToMongoType(vo);
Update update = Update.fromDocument(document); Update update = Update.fromDocument(document);
mongoTemplate.upsert(query, update, MerchantAuthorizationPerformanceVo.class, MerchantAuthorizationPerformanceVo.class.getSimpleName()); mongoTemplate.upsert(query, update, MerchantAuthorizationPerformanceVo.class, MerchantAuthorizationPerformanceVo.class.getSimpleName());
return vo;
} }
public List<MerchantFieldAppliesVo> getFieldAppliesVosByUid(String uid) { public List<MerchantFieldAppliesVo> getFieldAppliesVosByUid(String uid) {
......
...@@ -61,9 +61,7 @@ public class MerchantAuthorizationsController { ...@@ -61,9 +61,7 @@ public class MerchantAuthorizationsController {
public ResponseDto<Object> recordsCheckerAdd(@Valid @RequestBody MerchantAuthorizationRecordParam parameter) { public ResponseDto<Object> recordsCheckerAdd(@Valid @RequestBody MerchantAuthorizationRecordParam parameter) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
authorizationRecordsService.performanceRecordCheckerAdd(currentUid, parameter); return ResponseDto.success(authorizationRecordsService.performanceRecordCheckerAdd(currentUid, parameter));
return ResponseDto.success();
} }
@ApiOperationSupport(order = 22) @ApiOperationSupport(order = 22)
......
...@@ -122,9 +122,7 @@ public class MerchantFieldsController { ...@@ -122,9 +122,7 @@ public class MerchantFieldsController {
@RequestParam(required = true) String name){ @RequestParam(required = true) String name){
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
merchantFieldsService.checkerAdd(currentUid, fieldId, uid, mobile, name); return ResponseDto.success(merchantFieldsService.checkerAdd(currentUid, fieldId, uid, mobile, name));
return ResponseDto.success();
} }
@ApiOperationSupport(order = 32) @ApiOperationSupport(order = 32)
......
...@@ -51,7 +51,7 @@ public class MerchantMongoService { ...@@ -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()); return mongoTemplate.findOne(Query.query(Criteria.where("performanceId").is(performanceId).and("uid").is(uid)), MerchantAuthorizationPerformanceVo.class, MerchantAuthorizationPerformanceVo.class.getSimpleName());
} }
public void syncAndSetAuthorizationPerformanceVo(String performanceId, String uid) { public MerchantAuthorizationPerformanceVo getAndSyncAuthorizationPerformanceVo(String performanceId, String uid) {
// 聚合角色及权限 // 聚合角色及权限
Query recordsQuery = Query.query(Criteria.where("performanceId").is(performanceId).and("uid").is(uid).and("deletedAt").is(null)); 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()); List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = mongoTemplate.find(recordsQuery, MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
...@@ -76,6 +76,7 @@ public class MerchantMongoService { ...@@ -76,6 +76,7 @@ public class MerchantMongoService {
Document document = (Document)mongoConverter.convertToMongoType(vo); Document document = (Document)mongoConverter.convertToMongoType(vo);
Update update = Update.fromDocument(document); Update update = Update.fromDocument(document);
mongoTemplate.upsert(query, update, MerchantAuthorizationPerformanceVo.class, MerchantAuthorizationPerformanceVo.class.getSimpleName()); mongoTemplate.upsert(query, update, MerchantAuthorizationPerformanceVo.class, MerchantAuthorizationPerformanceVo.class.getSimpleName());
return vo;
} }
......
...@@ -53,9 +53,11 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -53,9 +53,11 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
public List<MerchantAuthorizationRecordsVo> performanceRecordCheckers(String cuid, String performanceId) { public List<MerchantAuthorizationRecordsVo> performanceRecordCheckers(String cuid, String performanceId) {
List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = merchantMongoService.getAuthorizationRecordsCheckersVosByCuid(cuid, performanceId); List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = merchantMongoService.getAuthorizationRecordsCheckersVosByCuid(cuid, performanceId);
for (MerchantAuthorizationRecordsVo recordsVo: authorizationRecordsVos) { if (!CollectionUtil.isEmpty(authorizationRecordsVos)) {
if (null != recordsVo.getMobile() && recordsVo.getMobile().length() > 4) { for (MerchantAuthorizationRecordsVo recordsVo: authorizationRecordsVos) {
recordsVo.setMobile(StringUtil.hiddenMobile(recordsVo.getMobile())); if (null != recordsVo.getMobile() && recordsVo.getMobile().length() > 4) {
recordsVo.setMobile(StringUtil.hiddenMobile(recordsVo.getMobile()));
}
} }
} }
...@@ -82,11 +84,21 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -82,11 +84,21 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
salesPermissionParam = permissionParam; salesPermissionParam = permissionParam;
} }
} }
// 至少选择一个授权权限
if (null == checkPermissionParam && null == salesPermissionParam) { if (null == checkPermissionParam && null == salesPermissionParam) {
// 至少选择一个授权权限
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13305"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13305");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); 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()); MerchantAuthorizationConst.PerformanceRole maxPerformanceRole = this.getMaxPerformanceRole(cuid, parameter.getPerformanceId());
if (null == maxPerformanceRole || maxPerformanceRole.getLevel() <= MerchantAuthorizationConst.PerformanceRole.CHECKER.getLevel()) { if (null == maxPerformanceRole || maxPerformanceRole.getLevel() <= MerchantAuthorizationConst.PerformanceRole.CHECKER.getLevel()) {
...@@ -149,8 +161,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -149,8 +161,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
mongoTemplate.insert(authorizationRecordsVo, MerchantAuthorizationRecordsVo.class.getSimpleName()); mongoTemplate.insert(authorizationRecordsVo, MerchantAuthorizationRecordsVo.class.getSimpleName());
log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s);
// 聚合角色及权限 vo // 聚合角色及权限 vo mongo
merchantMongoService.syncAndSetAuthorizationPerformanceVo(authorizationRecordsVo.getPerformanceId(), authorizationRecordsVo.getUid()); merchantMongoService.getAndSyncAuthorizationPerformanceVo(authorizationRecordsVo.getPerformanceId(), authorizationRecordsVo.getUid());
// sql // sql
LinkedList<String> toMqSqls = CollectionUtil.linkedListString(); LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
...@@ -206,8 +218,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -206,8 +218,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
mongoTemplate.remove(Query.query(Criteria.where("authorizationRecordId").is(authorizationRecordId)), MerchantAuthorizationRecordsVo.class.getSimpleName()); mongoTemplate.remove(Query.query(Criteria.where("authorizationRecordId").is(authorizationRecordId)), MerchantAuthorizationRecordsVo.class.getSimpleName());
log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s);
// 聚合角色及权限 vo // 聚合角色及权限 vo mongo
merchantMongoService.syncAndSetAuthorizationPerformanceVo(authorizationRecordsVo.getPerformanceId(), authorizationRecordsVo.getUid()); merchantMongoService.getAndSyncAuthorizationPerformanceVo(authorizationRecordsVo.getPerformanceId(), authorizationRecordsVo.getUid());
// sql // sql
LinkedList<String> toMqSqls = CollectionUtil.linkedListString(); LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
......
...@@ -147,9 +147,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -147,9 +147,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
List<MerchantFieldCheckersVo> fieldCheckersVos = merchantRdmService.getFieldCheckersVosByFieldId(fieldId); List<MerchantFieldCheckersVo> fieldCheckersVos = merchantRdmService.getFieldCheckersVosByFieldId(fieldId);
for (MerchantFieldCheckersVo checkersVo : fieldCheckersVos) { if (!CollectionUtil.isEmpty(fieldCheckersVos)) {
if (null != checkersVo.getMobile() && checkersVo.getMobile().length() > 4) { for (MerchantFieldCheckersVo checkersVo : fieldCheckersVos) {
checkersVo.setMobile(StringUtil.hiddenMobile(checkersVo.getMobile())); if (null != checkersVo.getMobile() && checkersVo.getMobile().length() > 4) {
checkersVo.setMobile(StringUtil.hiddenMobile(checkersVo.getMobile()));
}
} }
} }
...@@ -157,11 +159,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -157,11 +159,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
} }
@Override @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); this.checkFieldAccount(cuid, fieldId);
// 场地默认验票员,是否已经添加 // 场地默认验票员,不能授权自己,不能重复添加
if (cuid.equals(uid)) { if (cuid.equals(uid)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13105"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13105");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
...@@ -207,6 +209,8 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -207,6 +209,8 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
SqlMapping.gets(toMqSqls, fieldCheckerInsertObjs) SqlMapping.gets(toMqSqls, fieldCheckerInsertObjs)
); );
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
return fieldCheckersVo.getFieldCheckerId();
} }
@Override @Override
......
...@@ -32,8 +32,9 @@ ...@@ -32,8 +32,9 @@
13301=无授权权限 13301=无授权权限
13302=无权限授于统计权限 13302=无权限授于统计权限
13303=授权时间有误 13303=授权时间有误
13304=不能授权自己权限 13304=不能授权自己
13305=至少选择一个授权权限 13305=至少选择一个授权权限
13306=授权已经已存在
......
...@@ -18,9 +18,9 @@ liquidnet: ...@@ -18,9 +18,9 @@ liquidnet:
username: admin username: admin
password: admin password: admin
config: config:
# location: /Users/color/company_project/java/liquidnet-bus-v1-1/liquidnet-bus-config/liquidnet-config # location: /Users/color/company_project/java/liquidnet-bus-v1-1/liquidnet-bus-config/liquidnet-config
# location: /Users/Tice/Company/Liquidnet/Liquidnet_Bus/liquidnet-bus-config/liquidnet-config
# location: /Users/hujiachen/IdeaProjects/liquidnet-bus-v1/liquidnet-bus-config/liquidnet-config # location: /Users/hujiachen/IdeaProjects/liquidnet-bus-v1/liquidnet-bus-config/liquidnet-config
# location: /Users/Tice/Company/Liquidnet/Liquidnet_Bus/liquidnet-bus-config/liquidnet-config
location: /app/support-config location: /app/support-config
# end-dev-这里是配置信息基本值 # end-dev-这里是配置信息基本值
......
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