Browse Source

各种审核

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

26
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<IssueSat
public void evaluate(EvaluateFormDTO formDTO) { public void evaluate(EvaluateFormDTO formDTO) {
String comment = formDTO.getComment(); String comment = formDTO.getComment();
//议题评论内容审核 //议题评论内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); if (StringUtils.isNotBlank(comment)) {
TextTaskDTO taskDTO = new TextTaskDTO(); TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
taskDTO.setContent(comment); TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); taskDTO.setContent(comment);
textScanParamDTO.getTasks().add(taskDTO); taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); textScanParamDTO.getTasks().add(taskDTO);
if (!textSyncScanResult.success()){ Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); if (!textSyncScanResult.success()) {
} else { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
if (!textSyncScanResult.getData().isAllPass()) { } else {
log.error(String.format(IssueConstant.REVIEW_ISSUE,comment)); if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); log.error(String.format(IssueConstant.REVIEW_ISSUE, comment));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
} }
} }
IssueSatisfactionDetailEntity entity = new IssueSatisfactionDetailEntity(); IssueSatisfactionDetailEntity entity = new IssueSatisfactionDetailEntity();

28
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<Projec
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void projectEvaluate(ProjectEvaluateFormDTO formDTO) { public void projectEvaluate(ProjectEvaluateFormDTO formDTO) {
String comment = formDTO.getComment(); String comment = formDTO.getComment();
//项目满意度评价内容审核 if (StringUtils.isNotBlank(comment)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); //项目满意度评价内容审核
TextTaskDTO taskDTO = new TextTaskDTO(); TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
taskDTO.setContent(comment); TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); taskDTO.setContent(comment);
textScanParamDTO.getTasks().add(taskDTO); taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); textScanParamDTO.getTasks().add(taskDTO);
if (!textSyncScanResult.success()){ Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); if (!textSyncScanResult.success()) {
} else { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
if (!textSyncScanResult.getData().isAllPass()) { } else {
log.error(String.format(ProjectConstant.REVIEW_PROJECT,comment)); if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); log.error(String.format(ProjectConstant.REVIEW_PROJECT, comment));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
} }
} }
ProjectSatisfactionDetailEntity entity = new ProjectSatisfactionDetailEntity(); ProjectSatisfactionDetailEntity entity = new ProjectSatisfactionDetailEntity();

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

66
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<ResiTopicDao, ResiTopi
public Result createTopic(TokenDto tokenDto, ResiTopicPublishFormDTO resiTopicPublishFormDTO) { public Result createTopic(TokenDto tokenDto, ResiTopicPublishFormDTO resiTopicPublishFormDTO) {
String topicContent = resiTopicPublishFormDTO.getTopicContent(); String topicContent = resiTopicPublishFormDTO.getTopicContent();
List<String> attachmentList = resiTopicPublishFormDTO.getAttachmentList(); List<String> attachmentList = resiTopicPublishFormDTO.getAttachmentList();
//创建话题内容审核 if (StringUtils.isNotBlank(topicContent)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); //创建话题内容审核
TextTaskDTO taskDTO = new TextTaskDTO(); TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
taskDTO.setContent(topicContent); TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); taskDTO.setContent(topicContent);
textScanParamDTO.getTasks().add(taskDTO); taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); textScanParamDTO.getTasks().add(taskDTO);
if (!textSyncScanResult.success()){ Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); if (!textSyncScanResult.success()) {
} else { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
if (!textSyncScanResult.getData().isAllPass()) { } else {
log.error(String.format(TopicConstant.CREATE_TOPIC,topicContent)); if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); 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<ResiTopicDao, ResiTopi
//话题转议题审核:标题、建议 //话题转议题审核:标题、建议
String issueTitle = topicTurnIssueFromDTO.getIssueTitle(); String issueTitle = topicTurnIssueFromDTO.getIssueTitle();
String suggestion = topicTurnIssueFromDTO.getSuggestion(); String suggestion = topicTurnIssueFromDTO.getSuggestion();
TextScanParamDTO textScan = new TextScanParamDTO(); if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) {
//标题 TextScanParamDTO textScan = new TextScanParamDTO();
TextTaskDTO taskTitle = new TextTaskDTO(); //标题
taskTitle.setContent(issueTitle); TextTaskDTO taskTitle = new TextTaskDTO();
taskTitle.setDataId(UUID.randomUUID().toString().replace("-", "")); taskTitle.setContent(issueTitle);
textScan.getTasks().add(taskTitle); taskTitle.setDataId(UUID.randomUUID().toString().replace("-", ""));
//建议 textScan.getTasks().add(taskTitle);
TextTaskDTO taskSuggestion = new TextTaskDTO(); //建议
taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", "")); TextTaskDTO taskSuggestion = new TextTaskDTO();
taskSuggestion.setContent(suggestion); taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScan.getTasks().add(taskSuggestion); taskSuggestion.setContent(suggestion);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); textScan.getTasks().add(taskSuggestion);
if (!textSyncScanResult.success()){ Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); if (!textSyncScanResult.success()) {
} else { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
if (!textSyncScanResult.getData().isAllPass()) { } else {
log.error(String.format(TopicConstant.SHIFT_ISSUE,issueTitle,suggestion)); if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
} }
} }
//1.统一时间(群组服务 -> 议题服务) //1.统一时间(群组服务 -> 议题服务)

Loading…
Cancel
Save