|  |  | @ -209,10 +209,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 		String draftId = draftEntity.getId(); | 
			
		
	
		
			
				
					|  |  |  | 		fromDTO.setDraftId(draftId); | 
			
		
	
		
			
				
					|  |  |  | 		draftContentList = buildDraftContent(tokenDto, fromDTO); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		Map<String, Object> draftIdMap = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  | 		draftIdMap.put(ModuleConstant.FIELD_DRAFT_ID, fromDTO.getDraftId()); | 
			
		
	
		
			
				
					|  |  |  | 		draftContentDao.deleteByMap(draftIdMap); | 
			
		
	
		
			
				
					|  |  |  | 		//物理删除 草稿内容
 | 
			
		
	
		
			
				
					|  |  |  | 		draftContentDao.deleteByDraftId(fromDTO.getDraftId()); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(draftContentList)) { | 
			
		
	
		
			
				
					|  |  |  | 			draftContentService.insertBatch(draftContentList); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
	
		
			
				
					|  |  | @ -271,6 +269,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 		DraftEntity draftEntity = checkDraftStatus(fromDTO.getDraftId()); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		//构建标签
 | 
			
		
	
		
			
				
					|  |  |  | 		draftEntity.setTags(null); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(fromDTO.getTagNameList())) { | 
			
		
	
		
			
				
					|  |  |  | 			List<String> tagNameList = fromDTO.getTagNameList(); | 
			
		
	
		
			
				
					|  |  |  | 			tagNameList = tagNameList.stream().distinct().collect(Collectors.toList()); | 
			
		
	
	
		
			
				
					|  |  | @ -342,6 +341,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 			log.warn("saveOrUpdateAttr publisher is blank"); | 
			
		
	
		
			
				
					|  |  |  | 			throw new RenException("发布单位不能为空"); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		if (StringUtils.isBlank(fromDTO.getPublishDate())) { | 
			
		
	
		
			
				
					|  |  |  | 			log.warn("saveOrUpdateAttr publishDate is blank"); | 
			
		
	
		
			
				
					|  |  |  | 			throw new RenException("发布时间不能为空"); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return saveDraftAttr(tokenDto, fromDTO); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -360,13 +364,13 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 	@Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  | 	public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List<DraftPublishRangeEntity> publishRangeEntityList) { | 
			
		
	
		
			
				
					|  |  |  | 		Map<String,Object> draftIdMap = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  | 		draftIdMap.put(ModuleConstant.FIELD_DRAFT_ID, draftEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  | 		draftCoverDao.deleteByMap(draftIdMap); | 
			
		
	
		
			
				
					|  |  |  | 		//物理删除
 | 
			
		
	
		
			
				
					|  |  |  | 		draftCoverDao.deleteByDraftId(draftEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  | 		if (coverEntity != null){ | 
			
		
	
		
			
				
					|  |  |  | 			draftCoverDao.insert(coverEntity); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		draftPublishRangeDao.deleteByMap(draftIdMap); | 
			
		
	
		
			
				
					|  |  |  | 		//物理删除
 | 
			
		
	
		
			
				
					|  |  |  | 		draftPublishRangeDao.deleteByDraftId(draftEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(publishRangeEntityList)){ | 
			
		
	
		
			
				
					|  |  |  | 			publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
	
		
			
				
					|  |  | @ -1040,7 +1044,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 		} 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())); | 
			
		
	
		
			
				
					|  |  |  | 			this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); | 
			
		
	
		
			
				
					|  |  |  | 			throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
	
		
			
				
					|  |  | @ -1093,6 +1096,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	@Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  | 	public DraftContentSaveResultDTO saveDraft(TokenDto tokenDto, DraftContentFromDTO fromDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		return this.saveOrUpdateContent(tokenDto, fromDTO, false); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
	
		
			
				
					|  |  | @ -1109,10 +1113,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 		return epmetMessageOpenFeignClient.saveUserMessage(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	private void updateDraftPublishStatus(String draftId,String statusFlag){ | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public void updateDraftPublishStatus(String draftId,String statusFlag){ | 
			
		
	
		
			
				
					|  |  |  | 		draftDao.updateAuditStatusById(draftId,statusFlag); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  | 	 * @Description  更新DB的标签使用次数		政府端 | 
			
		
	
		
			
				
					|  |  |  | 	 * @param draftId | 
			
		
	
	
		
			
				
					|  |  | 
 |