Browse Source

Merge remote-tracking branch 'origin/dev_voice' into dev_voice

dev_shibei_match
zhaoqifeng 5 years ago
parent
commit
362f2f785c
  1. 19
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

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

@ -1039,15 +1039,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
log.error("updateAuditStatusFailById draftId:{} is not exist in db", draftId);
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
boolean coverFail = false,contentFail = false;
try {
List<String> failDataIds = syncScanResult.getFailDataIds();
failDataIds.forEach(id -> {
for(String id:failDataIds) {
if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) {
draftCoverDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL);
coverFail = true;
} else {
draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL);
contentFail = true;
}
});
}
List<String> successDataIds = syncScanResult.getSuccessDataIds();
successDataIds.forEach(id -> {
if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= 0) {
@ -1056,6 +1059,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS);
}
});
if (coverFail || contentFail){
String auditMsg = "";
if (coverFail&&contentFail){
auditMsg = "内容和封面";
}else if (contentFail){
auditMsg = "内容";
}else if (coverFail){
auditMsg = "封面";
}
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle(),auditMsg));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
}
} catch (Exception e) {
log.error("scanAllPassPublishArticle update db exception", e);
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle()));

Loading…
Cancel
Save