diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java index 3d8405232b..0a3947a0af 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java @@ -157,18 +157,20 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(IssueConstant.REVIEW_ISSUE,comment)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + 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 textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(IssueConstant.REVIEW_ISSUE, comment)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } } } IssueSatisfactionDetailEntity entity = new IssueSatisfactionDetailEntity(); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java index fcefe8e5b4..55a6425703 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java @@ -189,19 +189,21 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(ProjectConstant.REVIEW_PROJECT,comment)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + 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 textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(ProjectConstant.REVIEW_PROJECT, comment)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } } } ProjectSatisfactionDetailEntity entity = new ProjectSatisfactionDetailEntity(); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index 0f0108348f..ae74578dcd 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -165,19 +165,21 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(TopicConstant.REVIEW_TOPIC,commentContent)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + if (StringUtils.isNotBlank(commentContent)) { + //评论话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(commentContent); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.REVIEW_TOPIC, commentContent)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } } } //1.判断当前用户是否被禁言 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index da1b435b8a..9b007b526a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -217,19 +217,21 @@ public class ResiTopicServiceImpl extends BaseServiceImpl attachmentList = resiTopicPublishFormDTO.getAttachmentList(); - //创建话题内容审核 - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setContent(topicContent); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(TopicConstant.CREATE_TOPIC,topicContent)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + if (StringUtils.isNotBlank(topicContent)) { + //创建话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(topicContent); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.CREATE_TOPIC, topicContent)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } } } //创建话题图片审核 @@ -1099,24 +1101,26 @@ public class ResiTopicServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(TopicConstant.SHIFT_ISSUE,issueTitle,suggestion)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) { + TextScanParamDTO textScan = new TextScanParamDTO(); + //标题 + TextTaskDTO taskTitle = new TextTaskDTO(); + taskTitle.setContent(issueTitle); + taskTitle.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScan.getTasks().add(taskTitle); + //建议 + TextTaskDTO taskSuggestion = new TextTaskDTO(); + taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskSuggestion.setContent(suggestion); + textScan.getTasks().add(taskSuggestion); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } } } //1.统一时间(群组服务 -> 议题服务)