| 
						
						
							
								
							
						
						
					 | 
					@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.AppClientConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.AppClientConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.FieldConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.FieldConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -65,6 +66,7 @@ import org.springframework.transaction.annotation.Propagation; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.transaction.annotation.Transactional; | 
					 | 
					 | 
					import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.util.CollectionUtils; | 
					 | 
					 | 
					import org.springframework.util.CollectionUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import javax.swing.text.StringContent; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.*; | 
					 | 
					 | 
					import java.util.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.concurrent.atomic.AtomicBoolean; | 
					 | 
					 | 
					import java.util.concurrent.atomic.AtomicBoolean; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.stream.Collectors; | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -868,8 +870,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//1.查找草稿内容
 | 
					 | 
					 | 
							//1.查找草稿内容
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if(null != draft){ | 
					 | 
					 | 
							if(null != draft){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draft.setStatusFlag(DraftConstant.PUBLISHED); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftDao.updateById(draft); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								//2.查找草稿内容、封面、发布范围
 | 
					 | 
					 | 
								//2.查找草稿内容、封面、发布范围
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								String draftId = draft.getId(); | 
					 | 
					 | 
								String draftId = draft.getId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								//直接查询改草稿的 封面及内容
 | 
					 | 
					 | 
								//直接查询改草稿的 封面及内容
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -884,15 +884,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								baseDao.insert(article); | 
					 | 
					 | 
								baseDao.insert(article); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if(null != draftContents && draftContents.size() > NumConstant.ZERO){ | 
					 | 
					 | 
								if(null != draftContents && draftContents.size() > NumConstant.ZERO){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									draftContents.forEach(content -> { | 
					 | 
					 | 
									draftContents.forEach(content -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										//content.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										content.setOrderNum(content.getOrderNum()); | 
					 | 
					 | 
										content.setOrderNum(content.getOrderNum()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										ArticleContentEntity contentToInsert = ConvertUtils.sourceToTarget(content,ArticleContentEntity.class); | 
					 | 
					 | 
										ArticleContentEntity contentToInsert = ConvertUtils.sourceToTarget(content,ArticleContentEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										contentToInsert.setArticleId(article.getId()); | 
					 | 
					 | 
										contentToInsert.setArticleId(article.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										contentToInsert.setId(null); | 
					 | 
					 | 
										contentToInsert.setId(null); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										articleContentDao.insert(contentToInsert); | 
					 | 
					 | 
										articleContentDao.insert(contentToInsert); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										//draftContentDao.updateById(content);
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									}); | 
					 | 
					 | 
									}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){ | 
					 | 
					 | 
								if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -905,14 +901,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										draftPublishRangeDao.updateById(range); | 
					 | 
					 | 
										draftPublishRangeDao.updateById(range); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									}); | 
					 | 
					 | 
									}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									if(null != draftCover){ | 
					 | 
					 | 
									if(null != draftCover){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										//draftCover.setAuditStatus(ModuleConstant.AUDIT_STATUS_PASS);
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										ArticleCoverEntity coverToInsert = ConvertUtils.sourceToTarget(draftCover,ArticleCoverEntity.class); | 
					 | 
					 | 
										ArticleCoverEntity coverToInsert = ConvertUtils.sourceToTarget(draftCover,ArticleCoverEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										coverToInsert.setArticleId(article.getId()); | 
					 | 
					 | 
										coverToInsert.setArticleId(article.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										coverToInsert.setId(null); | 
					 | 
					 | 
										coverToInsert.setId(null); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										articleCoverDao.insert(coverToInsert); | 
					 | 
					 | 
										articleCoverDao.insert(coverToInsert); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										//draftCoverDao.updateById(draftCover);
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} | 
					 | 
					 | 
									} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -921,7 +913,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); | 
					 | 
					 | 
								ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								recordEntity.setCustomerId(article.getCustomerId()); | 
					 | 
					 | 
								recordEntity.setCustomerId(article.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								recordEntity.setArticleId(article.getId()); | 
					 | 
					 | 
								recordEntity.setArticleId(article.getId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								recordEntity.setOpUser(article.getPublisherName() + "-" + staffDTO.getRealName()); | 
					 | 
					 | 
								recordEntity.setOpUser(article.getPublisherName() + StrConstant.HYPHEN + staffDTO.getRealName()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								recordEntity.setContent(String.format(ArticleConstant.PUBLISH_ARTICLE_MSG, article.getPublisherName(), staffDTO.getRealName(), article.getTitle())); | 
					 | 
					 | 
								recordEntity.setContent(String.format(ArticleConstant.PUBLISH_ARTICLE_MSG, article.getPublisherName(), staffDTO.getRealName(), article.getTitle())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								recordEntity.setOpType(ArticleConstant.OFFLINE); | 
					 | 
					 | 
								recordEntity.setOpType(ArticleConstant.OFFLINE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								recordEntity.setOpTime(new Date()); | 
					 | 
					 | 
								recordEntity.setOpTime(new Date()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -963,7 +955,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								DraftCoverDTO draftCoverDTO = draftCoverDao.selectCoverIdAndUrlByDraftId(draftId); | 
					 | 
					 | 
								DraftCoverDTO draftCoverDTO = draftCoverDao.selectCoverIdAndUrlByDraftId(draftId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if (draftCoverDTO != null) { | 
					 | 
					 | 
								if (draftCoverDTO != null) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									ImgTaskDTO taskDTO = new ImgTaskDTO(); | 
					 | 
					 | 
									ImgTaskDTO taskDTO = new ImgTaskDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
									taskDTO.setDataId(ModuleConstant.SCAN_COVER_PREFIX.concat(draftCoverDTO.getId())); | 
					 | 
					 | 
									taskDTO.setDataId(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE).concat(draftCoverDTO.getId())); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
									taskDTO.setUrl(draftCoverDTO.getImgUrl()); | 
					 | 
					 | 
									taskDTO.setUrl(draftCoverDTO.getImgUrl()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									imgScanParamDTO.getTasks().add(taskDTO); | 
					 | 
					 | 
									imgScanParamDTO.getTasks().add(taskDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -972,7 +964,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									contentDTOList.forEach(content -> { | 
					 | 
					 | 
									contentDTOList.forEach(content -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										String contentType = content.getContentType(); | 
					 | 
					 | 
										String contentType = content.getContentType(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										if (DraftConstant.TEXT.equals(contentType)) { | 
					 | 
					 | 
										if (DraftConstant.TEXT.equals(contentType)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											//todo 内容叠加审核吧 id拼起来
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											TextTaskDTO textTaskDTO = new TextTaskDTO(); | 
					 | 
					 | 
											TextTaskDTO textTaskDTO = new TextTaskDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											textTaskDTO.setDataId(content.getId()); | 
					 | 
					 | 
											textTaskDTO.setDataId(content.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											textTaskDTO.setContent(content.getContent()); | 
					 | 
					 | 
											textTaskDTO.setContent(content.getContent()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -1036,7 +1027,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							try { | 
					 | 
					 | 
							try { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								//审核通过
 | 
					 | 
					 | 
								//审核通过
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								updateAuditStatusFailById(draftId, syncScanResult); | 
					 | 
					 | 
								this.updateAuditStatusFailById(draftId, syncScanResult); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								this.publishDraftToArticle(draft); | 
					 | 
					 | 
								this.publishDraftToArticle(draft); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId); | 
					 | 
					 | 
								UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if (updateCustomerTagCacheDTO == null){ | 
					 | 
					 | 
								if (updateCustomerTagCacheDTO == null){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -1068,13 +1059,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								log.error("updateAuditStatusFailById draftId:{} is not exist in db", draftId); | 
					 | 
					 | 
								log.error("updateAuditStatusFailById draftId:{} is not exist in db", draftId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); | 
					 | 
					 | 
								throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							if (syncScanResult.isAllPass()){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							}else{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); | 
					 | 
					 | 
								this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							boolean coverFail = false,contentFail = false; | 
					 | 
					 | 
							boolean coverFail = false,contentFail = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							try { | 
					 | 
					 | 
							try { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								List<String> failDataIds = syncScanResult.getFailDataIds(); | 
					 | 
					 | 
								List<String> failDataIds = syncScanResult.getFailDataIds(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								for(String id:failDataIds) { | 
					 | 
					 | 
								for(String id:failDataIds) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { | 
					 | 
					 | 
									if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
										draftCoverDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL); | 
					 | 
					 | 
										draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE),""), ModuleConstant.AUDIT_STATUS_FAIL); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
										coverFail = true; | 
					 | 
					 | 
										coverFail = true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} else { | 
					 | 
					 | 
									} else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL); | 
					 | 
					 | 
										draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -1084,7 +1080,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								List<String> successDataIds = syncScanResult.getSuccessDataIds(); | 
					 | 
					 | 
								List<String> successDataIds = syncScanResult.getSuccessDataIds(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								successDataIds.forEach(id -> { | 
					 | 
					 | 
								successDataIds.forEach(id -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { | 
					 | 
					 | 
									if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
										draftCoverDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS); | 
					 | 
					 | 
										draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE),""), ModuleConstant.AUDIT_STATUS_PASS); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
									} else { | 
					 | 
					 | 
									} else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS); | 
					 | 
					 | 
										draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} | 
					 | 
					 | 
									} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |