| 
						
						
							
								
							
						
						
					 | 
					@ -166,9 +166,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Override | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Transactional(rollbackFor = Exception.class) | 
					 | 
					 | 
						@Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
						public String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { | 
					 | 
					 | 
						public DraftContentSaveResultDTO saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO, boolean required) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO)); | 
					 | 
					 | 
							log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							ValidatorUtils.validateEntity(fromDTO, AddGroup.class, DefaultGroup.class); | 
					 | 
					 | 
							if (required) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								ValidatorUtils.validateEntity(fromDTO, AddGroup.class, DefaultGroup.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							DraftEntity draftEntity = null; | 
					 | 
					 | 
							DraftEntity draftEntity = null; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<DraftContentEntity> draftContentList = null; | 
					 | 
					 | 
							List<DraftContentEntity> draftContentList = null; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -178,20 +180,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									log.warn("saveOrUpdateContent draftId is not exist in db"); | 
					 | 
					 | 
									log.warn("saveOrUpdateContent draftId is not exist in db"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									throw new RenException("参数错误"); | 
					 | 
					 | 
									throw new RenException("参数错误"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								draftEntity.setTitle(draftEntity.getTitle()); | 
					 | 
					 | 
								draftEntity.setTitle(StringUtils.isBlank(draftEntity.getTitle()) ? "" : draftEntity.getTitle()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setPreviewContent(""); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								buildPreviewContent(fromDTO, draftEntity); | 
					 | 
					 | 
								buildPreviewContent(fromDTO, draftEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftDao.updateById(draftEntity); | 
					 | 
					 | 
								draftDao.updateById(draftEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} else { | 
					 | 
					 | 
							} else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								LoginUserDetailsFormDTO detailsFormDTO = new LoginUserDetailsFormDTO(); | 
					 | 
					 | 
								LoginUserDetailsFormDTO detailsFormDTO = new LoginUserDetailsFormDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								detailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); | 
					 | 
					 | 
								detailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								detailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); | 
					 | 
					 | 
								detailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								detailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); | 
					 | 
					 | 
								detailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								Result<LoginUserDetailsResultDTO> loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(detailsFormDTO); | 
					 | 
					 | 
								Result<LoginUserDetailsResultDTO> loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(detailsFormDTO); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								if (loginUserDetails == null || loginUserDetails.getData() == null){ | 
					 | 
					 | 
								if (loginUserDetails == null || loginUserDetails.getData() == null) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
									log.warn("saveOrUpdateContent getloginUserDetails return null"); | 
					 | 
					 | 
									log.warn("saveOrUpdateContent getloginUserDetails return null"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
									throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),EpmetErrorCode.SERVER_ERROR.getMsg()); | 
					 | 
					 | 
									throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity = new DraftEntity(); | 
					 | 
					 | 
								draftEntity = new DraftEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setTitle(fromDTO.getTitle()); | 
					 | 
					 | 
								draftEntity.setTitle(fromDTO.getTitle()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -203,7 +203,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setGridId(""); | 
					 | 
					 | 
								draftEntity.setGridId(""); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); | 
					 | 
					 | 
								draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setDelFlag(NumConstant.ZERO_STR); | 
					 | 
					 | 
								draftEntity.setDelFlag(NumConstant.ZERO_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setPreviewContent(""); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								buildPreviewContent(fromDTO, draftEntity); | 
					 | 
					 | 
								buildPreviewContent(fromDTO, draftEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftDao.insert(draftEntity); | 
					 | 
					 | 
								draftDao.insert(draftEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -211,19 +210,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							String draftId = draftEntity.getId(); | 
					 | 
					 | 
							String draftId = draftEntity.getId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							fromDTO.setDraftId(draftId); | 
					 | 
					 | 
							fromDTO.setDraftId(draftId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							draftContentList = buildDraftContent(tokenDto, fromDTO); | 
					 | 
					 | 
							draftContentList = buildDraftContent(tokenDto, fromDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (CollectionUtils.isEmpty(draftContentList)) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								log.warn("saveOrUpdateContent contentList is empty"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								throw new RenException("参数错误"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Map<String, Object> draftIdMap = new HashMap<>(); | 
					 | 
					 | 
							Map<String, Object> draftIdMap = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							draftIdMap.put(ModuleConstant.FIELD_DRAFT_ID, fromDTO.getDraftId()); | 
					 | 
					 | 
							draftIdMap.put(ModuleConstant.FIELD_DRAFT_ID, fromDTO.getDraftId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							draftContentDao.deleteByMap(draftIdMap); | 
					 | 
					 | 
							draftContentDao.deleteByMap(draftIdMap); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							draftContentService.insertBatch(draftContentList); | 
					 | 
					 | 
							if (!CollectionUtils.isEmpty(draftContentList)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							return draftId; | 
					 | 
					 | 
								draftContentService.insertBatch(draftContentList); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							return new DraftContentSaveResultDTO(draftId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						private void buildPreviewContent(DraftContentFromDTO fromDTO, DraftEntity draftEntity) { | 
					 | 
					 | 
						private void buildPreviewContent(DraftContentFromDTO fromDTO, DraftEntity draftEntity) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    	if (CollectionUtils.isEmpty(fromDTO.getContentList())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							    draftEntity.setPreviewContent(""); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							    return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							for (int i = 0; i < fromDTO.getContentList().size(); i++) { | 
					 | 
					 | 
							for (int i = 0; i < fromDTO.getContentList().size(); i++) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if (DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { | 
					 | 
					 | 
								if (DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									String content = fromDTO.getContentList().get(i).getContent(); | 
					 | 
					 | 
									String content = fromDTO.getContentList().get(i).getContent(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -444,9 +445,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						 * @return | 
					 | 
					 | 
						 * @return | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						 */ | 
					 | 
					 | 
						 */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						private List<DraftContentEntity> buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { | 
					 | 
					 | 
						private List<DraftContentEntity> buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							List<DraftContentFromDTO.DraftContentDTO> contentList = fromDTO.getContentList(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							if (CollectionUtils.isEmpty(contentList)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								return null; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<DraftContentEntity> newContentList = new ArrayList<>(); | 
					 | 
					 | 
							List<DraftContentEntity> newContentList = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<DraftContentFromDTO.DraftContentDTO> contentList = fromDTO.getContentList(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							for (int i = 0; i < contentList.size(); i++) { | 
					 | 
					 | 
							for (int i = 0; i < contentList.size(); i++) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								DraftContentFromDTO.DraftContentDTO content = contentList.get(i); | 
					 | 
					 | 
								DraftContentFromDTO.DraftContentDTO content = contentList.get(i); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -460,6 +464,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								newContentList.add(entity); | 
					 | 
					 | 
								newContentList.add(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							return newContentList; | 
					 | 
					 | 
							return newContentList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -999,6 +1004,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							}); | 
					 | 
					 | 
							}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						public DraftContentSaveResultDTO saveDraft(TokenDto tokenDto, DraftContentFromDTO fromDTO) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							return this.saveOrUpdateContent(tokenDto, fromDTO, false); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						public Result sendMsg(String title,String content) { | 
					 | 
					 | 
						public Result sendMsg(String title,String content) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							UserMessageFormDTO formDTO = new UserMessageFormDTO(); | 
					 | 
					 | 
							UserMessageFormDTO formDTO = new UserMessageFormDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							formDTO.setCustomerId(loginUserUtil.getLoginUserApp()); | 
					 | 
					 | 
							formDTO.setCustomerId(loginUserUtil.getLoginUserApp()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |