Browse Source

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

dev
jianjun 5 years ago
parent
commit
2c3ad5b389
  1. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  2. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java
  3. 16
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

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

@ -231,7 +231,7 @@ public class ArticleController {
log.error("scanContent draftId:{} return result null", draftId);
}
if (syncScanResult.isAllPass()) {
articleService.scanAllPassPublishArticle(tokenDto, draftId);
articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult);
} else {
articleService.updateAuditStatusFailById(draftId, syncScanResult);
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java

@ -176,7 +176,7 @@ public interface ArticleService extends BaseService<ArticleEntity> {
*/
SyncScanResult scanContent(TokenDto tokenDto, String draftId);
void scanAllPassPublishArticle(TokenDto tokenDto, String draftId);
void scanAllPassPublishArticle(TokenDto tokenDto, String draftId, SyncScanResult syncScanResult);
/**
* desc:修改审核状态为失败

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

@ -61,6 +61,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -850,7 +851,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
baseDao.insert(article);
if(null != draftContents && draftContents.size() > NumConstant.ZERO){
draftContents.forEach(content -> {
content.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
//content.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
content.setOrderNum(content.getOrderNum());
ArticleContentEntity contentToInsert = ConvertUtils.sourceToTarget(content,ArticleContentEntity.class);
@ -858,7 +859,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
contentToInsert.setId(null);
articleContentDao.insert(contentToInsert);
draftContentDao.updateById(content);
//draftContentDao.updateById(content);
});
}
if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){
@ -869,14 +870,14 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
articlePublishRangeDao.insert(rangeToInsert);
});
if(null != draftCover){
draftCover.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
//draftCover.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
ArticleCoverEntity coverToInsert = ConvertUtils.sourceToTarget(draftCover,ArticleCoverEntity.class);
coverToInsert.setArticleId(article.getId());
coverToInsert.setId(null);
articleCoverDao.insert(coverToInsert);
draftCoverDao.updateById(draftCover);
//draftCoverDao.updateById(draftCover);
}
}
@ -986,12 +987,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
this.sendMsg(draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
}
log.debug("scanContent result", JSON.toJSONString(result));
log.debug("scanContent result:{}", JSON.toJSONString(result));
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void scanAllPassPublishArticle(TokenDto tokenDto, String draftId){
@Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
public void scanAllPassPublishArticle(TokenDto tokenDto, String draftId, SyncScanResult syncScanResult){
DraftEntity draft = draftDao.selectById(draftId);
if (draft == null) {
@ -1000,6 +1001,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
try {
//审核通过
updateAuditStatusFailById(draftId, syncScanResult);
this.publishDraftToArticle(draft);
UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId);
List<UpdateGridTagCacheDTO> updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO);

Loading…
Cancel
Save