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) {
String comment = formDTO.getComment();
//议题评论内容审核
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()){
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<SyncScanResult> 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();

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)
public void projectEvaluate(ProjectEvaluateFormDTO formDTO) {
String comment = formDTO.getComment();
//项目满意度评价内容审核
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()){
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<SyncScanResult> 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();

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)
public Result commentTopic(TokenDto tokenDto, ResiPublishCommentFormDTO resiCommentFormDTO) {
String commentContent = resiCommentFormDTO.getCommentContent();
//评论话题内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(commentContent);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> 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<SyncScanResult> 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.判断当前用户是否被禁言

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) {
String topicContent = resiTopicPublishFormDTO.getTopicContent();
List<String> 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<SyncScanResult> 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<SyncScanResult> 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<ResiTopicDao, ResiTopi
//话题转议题审核:标题、建议
String issueTitle = topicTurnIssueFromDTO.getIssueTitle();
String suggestion = topicTurnIssueFromDTO.getSuggestion();
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<SyncScanResult> 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<SyncScanResult> 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.统一时间(群组服务 -> 议题服务)

Loading…
Cancel
Save