Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into develop

master
yinzuomei 4 years ago
parent
commit
97b6f5e34e
  1. 11
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
  2. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  3. 30
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  4. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java
  5. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  6. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml

11
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java

@ -15,7 +15,8 @@ import java.io.Serializable;
@Data
public class ApplyCreateGroupFormDTO implements Serializable {
private static final long serialVersionUID = 1570620480398949075L;
public interface AddUserInternalGroup {
}
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
@ -27,7 +28,7 @@ public class ApplyCreateGroupFormDTO implements Serializable {
/**
* 当前登录用户id由TokenDto赋值
*/
@NotBlank(message = "当前用户id不能为空")
@NotBlank(message = "当前用户id不能为空",groups ={AddUserInternalGroup.class})
private String userId;
/**
@ -53,19 +54,19 @@ public class ApplyCreateGroupFormDTO implements Serializable {
/**
* 当前网格所属客户id
*/
@NotBlank(message = "当前网格所属客户id不能为空")
@NotBlank(message = "当前网格所属客户id不能为空",groups ={AddUserInternalGroup.class})
private String customerId;
/**
* 当前网格id
*/
@NotBlank(message = "当前网格id不能为空")
@NotBlank(message = "当前网格id不能为空",groups ={AddUserInternalGroup.class})
private String gridId;
/**
* 当前登录用户来源从token中获取
*/
@NotBlank(message = "app不能为空")
@NotBlank(message = "app不能为空",groups ={AddUserInternalGroup.class})
private String app;
/**

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -157,7 +157,7 @@ public class ResiGroupController {
@RequestBody ApplyCreateGroupFormDTO applyCreateGroupFormDTO) {
applyCreateGroupFormDTO.setUserId(tokenDto.getUserId());
applyCreateGroupFormDTO.setApp(tokenDto.getApp());
ValidatorUtils.validateEntity(applyCreateGroupFormDTO);
ValidatorUtils.validateEntity(applyCreateGroupFormDTO,ApplyCreateGroupFormDTO.AddUserShowGroup.class,ApplyCreateGroupFormDTO.AddUserInternalGroup.class);
resiGroupService.applyCreateGroup(applyCreateGroupFormDTO);
return new Result();
}

30
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -1599,7 +1599,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
logger.error("调用内容审核服务审核文本发生错误:{}", textSyncScanResult.getInternalMsg());
logger.warn("调用内容审核服务审核文本发生错误:{}", textSyncScanResult.getInternalMsg());
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
@ -1608,19 +1608,21 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
}
// 图片内容审核
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(groupHeadPhoto);
imgScanParamDTO.getTasks().add(task);
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
logger.error("调用内容审核服务审核图片发生错误:{}", textSyncScanResult.getInternalMsg());
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg());
if(StringUtils.isNotBlank(groupHeadPhoto)){
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(groupHeadPhoto);
imgScanParamDTO.getTasks().add(task);
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
logger.warn("调用内容审核服务审核图片发生错误:{}", textSyncScanResult.getInternalMsg());
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg());
}
}
}
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java

@ -494,9 +494,13 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD
Result<UserInfoOnEnterGridResultDTO> result=resiGuideFeignClient.enterGrid(userEnterGridFormDTO);
if (!result.success() || null == result.getData()) {
logger.warn(String.format("用户同意邀请进组,进入网格失败。入参:userId【%s】、invitationId【%s】、groupId【%s】、customerId【%s】、gridId【%s】",
formDTO.getUserId(), formDTO.getInvitationId(),
groupInvitationDTO.getResiGroupId()),
resiGroupDTO.getCustomerId(), resiGroupDTO.getGridId());
formDTO.getUserId(),
formDTO.getInvitationId(),
groupInvitationDTO.getResiGroupId(),
resiGroupDTO.getCustomerId(),
resiGroupDTO.getGridId()
)
);
logger.warn(String.format("用户同意邀请进组,进入网格失败。当前接口返回8000,调用enterGrid接口返回", result.toString()));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}

14
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

@ -18,6 +18,7 @@
package com.epmet.modules.notice.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -512,10 +513,11 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
logger.error("safetyCheck textScan return failed,result:"+ JSON.toJSONString(textSyncScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
logger.error(String.format(TopicConstant.CREATE_TOPIC, word));
logger.warn(EpmetErrorCode.TEXT_SCAN_FAILED.getMsg().concat(String.format(TopicConstant.CREATE_TOPIC, word)));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
@ -532,12 +534,14 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()) {
logger.error("safetyCheck imgScan return failed,result:"+ JSON.toJSONString(imgScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode());
}
}
if (!imgScanResult.getData().isAllPass()) {
logger.warn(EpmetErrorCode.IMG_SCAN_FAILED.getMsg());
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode());
}
}
}

1
epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml

@ -47,6 +47,7 @@
<if test='customerUserId != "" and customerUserId != null'>
AND la.customer_user_id = #{customerUserId}
</if>
order by la.CREATED_TIME desc limit 1
</select>
<update id="updateByLatestId">

Loading…
Cancel
Save