|
|
|
@ -26,6 +26,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.EventsNoticeConstant; |
|
|
|
@ -148,24 +149,21 @@ public class EventCommentServiceImpl extends BaseServiceImpl<EventCommentDao, Ev |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result submit(SubmitCommentFormDTO commentFormDTO) { |
|
|
|
//内容审核
|
|
|
|
CheckResultDTO checkResult = CheckDataUtils.checkContent(null,commentFormDTO.getContent()); |
|
|
|
if(checkResult != null && 200 == checkResult.getDetails().get(0).getCode()){ |
|
|
|
if(!checkResult.getAllPass()){ |
|
|
|
SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); |
|
|
|
record.setUserId(commentFormDTO.getUserId()); |
|
|
|
record.setName(commentFormDTO.getUserName()); |
|
|
|
record.setCategory("2");//居民
|
|
|
|
record.setDecision("1");//系统判定
|
|
|
|
record.setModule("issue_comment");//党群议事-议题项目-评论
|
|
|
|
record.setContent(commentFormDTO.getContent()); |
|
|
|
record.setSuggestion(checkResult.getDetails().get(0).getResults().get(0).getSuggestion()); |
|
|
|
record.setLabel(checkResult.getDetails().get(0).getResults().get(0).getLabel()); |
|
|
|
record.setRate(checkResult.getDetails().get(0).getResults().get(0).getRate()); |
|
|
|
List<String> textList = new ArrayList<>(); |
|
|
|
textList.add(commentFormDTO.getContent()); |
|
|
|
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); |
|
|
|
if (contentResult != null && 200 == contentResult.getDetails().get(0).getCode()) { |
|
|
|
if (!contentResult.getAllPass()) { |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getViolationsRecords(commentFormDTO.getUserId(), |
|
|
|
commentFormDTO.getUserName(), "2", "1", "issue_comment", commentFormDTO.getContent(), |
|
|
|
null, contentResult, null); |
|
|
|
|
|
|
|
contentSecurityFeign.insertViolationsRecord(record); |
|
|
|
return new Result().error("内容审核未通过,请修改后重新提交!"); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.error("解析审核结果异常:"+checkResult); |
|
|
|
} else { |
|
|
|
logger.error("解析审核结果异常:" + contentResult); |
|
|
|
} |
|
|
|
|
|
|
|
IssueEntity issueEntity = null; |
|
|
|
@ -269,20 +267,15 @@ public class EventCommentServiceImpl extends BaseServiceImpl<EventCommentDao, Ev |
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
|
|
|
|
//判断是否为待审核
|
|
|
|
if(checkResult != null |
|
|
|
&& 200 == checkResult.getDetails().get(0).getCode() |
|
|
|
&& "review".equals(checkResult.getDetails().get(0).getResults().get(0).getSuggestion())){ |
|
|
|
SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); |
|
|
|
record.setUserId(commentFormDTO.getUserId()); |
|
|
|
record.setName(commentFormDTO.getUserName()); |
|
|
|
record.setCategory("2");//居民
|
|
|
|
record.setModule("issue_comment");//党群议事-议题项目-评论
|
|
|
|
record.setContent(commentFormDTO.getContent()); |
|
|
|
record.setRelationId(commentEntity.getId()); |
|
|
|
record.setSuggestion(checkResult.getDetails().get(0).getResults().get(0).getSuggestion()); |
|
|
|
record.setLabel(checkResult.getDetails().get(0).getResults().get(0).getLabel()); |
|
|
|
record.setRate(checkResult.getDetails().get(0).getResults().get(0).getRate()); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
if (contentResult != null && 200 == contentResult.getDetails().get(0).getCode()) { |
|
|
|
CheckResultMessageDTO twoTypes = CheckDataUtils.checkTwoTypes(contentResult, null); |
|
|
|
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getUnCheckRecords(commentFormDTO.getUserId(), |
|
|
|
commentFormDTO.getUserName(), "2", "issue_comment", commentFormDTO.getContent(), |
|
|
|
null, commentEntity.getId(), twoTypes); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
}//如果是审核状态是pass,不作任何处理
|
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|