Browse Source

各种审核

master
zxc 5 years ago
parent
commit
092fdcb08f
  1. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java
  2. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java
  3. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  4. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

6
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java

@ -157,20 +157,22 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl<IssueSat
public void evaluate(EvaluateFormDTO formDTO) {
String comment = formDTO.getComment();
//议题评论内容审核
if (StringUtils.isNotBlank(comment)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(comment);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
log.error(String.format(IssueConstant.REVIEW_ISSUE,comment));
log.error(String.format(IssueConstant.REVIEW_ISSUE, comment));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
IssueSatisfactionDetailEntity entity = new IssueSatisfactionDetailEntity();
BeanUtils.copyProperties(formDTO,entity);
InitEvaluationFormDTO initEvaluation = new InitEvaluationFormDTO();

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java

@ -189,6 +189,7 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl<Projec
@Transactional(rollbackFor = Exception.class)
public void projectEvaluate(ProjectEvaluateFormDTO formDTO) {
String comment = formDTO.getComment();
if (StringUtils.isNotBlank(comment)) {
//项目满意度评价内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
@ -196,14 +197,15 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl<Projec
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
log.error(String.format(ProjectConstant.REVIEW_PROJECT,comment));
log.error(String.format(ProjectConstant.REVIEW_PROJECT, comment));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
ProjectSatisfactionDetailEntity entity = new ProjectSatisfactionDetailEntity();
BeanUtils.copyProperties(formDTO,entity);
//校验是否评价

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java

@ -165,6 +165,7 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
@Transactional(rollbackFor = Exception.class)
public Result commentTopic(TokenDto tokenDto, ResiPublishCommentFormDTO resiCommentFormDTO) {
String commentContent = resiCommentFormDTO.getCommentContent();
if (StringUtils.isNotBlank(commentContent)) {
//评论话题内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
@ -172,14 +173,15 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
log.error(String.format(TopicConstant.REVIEW_TOPIC,commentContent));
log.error(String.format(TopicConstant.REVIEW_TOPIC, commentContent));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//1.判断当前用户是否被禁言
ResiTopicDTO topic = resiTopicService.get(resiCommentFormDTO.getTopicId());
if(null == topic){

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -217,6 +217,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
public Result createTopic(TokenDto tokenDto, ResiTopicPublishFormDTO resiTopicPublishFormDTO) {
String topicContent = resiTopicPublishFormDTO.getTopicContent();
List<String> attachmentList = resiTopicPublishFormDTO.getAttachmentList();
if (StringUtils.isNotBlank(topicContent)) {
//创建话题内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
@ -224,14 +225,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
log.error(String.format(TopicConstant.CREATE_TOPIC,topicContent));
log.error(String.format(TopicConstant.CREATE_TOPIC, topicContent));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//创建话题图片审核
if (attachmentList.size() != NumConstant.ZERO){
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
@ -1099,6 +1101,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//话题转议题审核:标题、建议
String issueTitle = topicTurnIssueFromDTO.getIssueTitle();
String suggestion = topicTurnIssueFromDTO.getSuggestion();
if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) {
TextScanParamDTO textScan = new TextScanParamDTO();
//标题
TextTaskDTO taskTitle = new TextTaskDTO();
@ -1111,14 +1114,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
taskSuggestion.setContent(suggestion);
textScan.getTasks().add(taskSuggestion);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan);
if (!textSyncScanResult.success()){
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
log.error(String.format(TopicConstant.SHIFT_ISSUE,issueTitle,suggestion));
log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//1.统一时间(群组服务 -> 议题服务)
Date now = new Date();
//2.调用gov-org获取数据权限

Loading…
Cancel
Save