Browse Source

添加日志

master
jianjun 5 years ago
parent
commit
bc05301fc8
  1. 20
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  2. 12
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

20
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -225,14 +225,18 @@ public class ArticleController {
@Async @Async
public void scanContent(TokenDto tokenDto,String draftId){ public void scanContent(TokenDto tokenDto,String draftId){
SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); try {
if (syncScanResult == null) { SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId);
log.error("scanContent draftId:{} return result null", draftId); if (syncScanResult == null) {
} log.error("scanContent draftId:{} return result null", draftId);
if (syncScanResult.isAllPass()) { }
articleService.scanAllPassPublishArticle(tokenDto, draftId); if (syncScanResult.isAllPass()) {
} else { articleService.scanAllPassPublishArticle(tokenDto, draftId);
articleService.updateAuditStatusFailById(draftId, syncScanResult); } else {
articleService.updateAuditStatusFailById(draftId, syncScanResult);
}
} catch (Exception e) {
log.error("scanContent exception draftId:{} return result null", e);
} }
} }

12
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -951,10 +951,17 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
SyncScanResult imgSyncScanResult = null; SyncScanResult imgSyncScanResult = null;
SyncScanResult textSyncScanResult = null; SyncScanResult textSyncScanResult = null;
if(!CollectionUtils.isEmpty(imgScanParamDTO.getTasks())){
log.info("scanContent imgScanParamDTO:{}", JSON.toJSONString(imgScanParamDTO)); log.info("scanContent imgScanParamDTO:{}", JSON.toJSONString(imgScanParamDTO));
imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiHost.concat(imgSyncScanMethod), imgScanParamDTO);
log.info("scanContent imgSyncScanResult:{}", JSON.toJSONString(imgSyncScanResult));
}
if(!CollectionUtils.isEmpty(textScanParamDTO.getTasks())){
log.info("scanContent textScanParamDTO:{}", JSON.toJSONString(textScanParamDTO)); log.info("scanContent textScanParamDTO:{}", JSON.toJSONString(textScanParamDTO));
imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiHost.concat(imgSyncScanMethod), imgScanParamDTO); textSyncScanResult = ScanContentUtils.textSyncScan(scanApiHost.concat(textSyncScanMethod), textScanParamDTO);
textSyncScanResult = ScanContentUtils.textSyncScan(scanApiHost.concat(textSyncScanMethod), textScanParamDTO); log.info("scanContent textSyncScanResult:{}", JSON.toJSONString(textSyncScanResult));
}
result = new SyncScanResult(); result = new SyncScanResult();
if (imgSyncScanResult.isAllPass()) { if (imgSyncScanResult.isAllPass()) {
@ -972,6 +979,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
this.sendMsg(draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle())); this.sendMsg(draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
} }
log.error("scanContent result", JSON.toJSONString(result));
return result; return result;
} }
@Override @Override

Loading…
Cancel
Save