| 
						
						
							
								
							
						
						
					 | 
					@ -179,16 +179,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									throw new RenException("参数错误"); | 
					 | 
					 | 
									throw new RenException("参数错误"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftEntity.setTitle(draftEntity.getTitle()); | 
					 | 
					 | 
								draftEntity.setTitle(draftEntity.getTitle()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								for (int i = 0; i < fromDTO.getContentList().size(); i++) { | 
					 | 
					 | 
								draftEntity.setPreviewContent(""); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
									if(DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { | 
					 | 
					 | 
								buildPreviewContent(fromDTO, draftEntity); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
										String content = fromDTO.getContentList().get(i).getContent(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										if(content.length() > 50) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											content = content.substring(0, 50); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										draftEntity.setPreviewContent(content); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										break; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								draftDao.updateById(draftEntity); | 
					 | 
					 | 
								draftDao.updateById(draftEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} else { | 
					 | 
					 | 
							} else { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -211,16 +203,8 @@ 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); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								for (int i = 0; i < fromDTO.getContentList().size(); i++) { | 
					 | 
					 | 
								draftEntity.setPreviewContent(""); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
									if(DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { | 
					 | 
					 | 
								buildPreviewContent(fromDTO, draftEntity); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
										String content = fromDTO.getContentList().get(i).getContent(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										if(content.length() > 50) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											content = content.substring(0, 50); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										draftEntity.setPreviewContent(content); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										break; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								draftDao.insert(draftEntity); | 
					 | 
					 | 
								draftDao.insert(draftEntity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -233,12 +217,25 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Map<String, Object> draftIdMap = new HashMap<>(); | 
					 | 
					 | 
							Map<String, Object> draftIdMap = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); | 
					 | 
					 | 
							draftIdMap.put(ModuleConstant.FIELD_DRAFT_ID, fromDTO.getDraftId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							draftContentDao.deleteByMap(draftIdMap); | 
					 | 
					 | 
							draftContentDao.deleteByMap(draftIdMap); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							draftContentService.insertBatch(draftContentList); | 
					 | 
					 | 
							draftContentService.insertBatch(draftContentList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							return draftId; | 
					 | 
					 | 
							return draftId; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						private void buildPreviewContent(DraftContentFromDTO fromDTO, DraftEntity draftEntity) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							for (int i = 0; i < fromDTO.getContentList().size(); i++) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								if (DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									String content = fromDTO.getContentList().get(i).getContent(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									if (content.length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
										content = content.substring(NumConstant.ZERO, DraftConstant.PREVIEW_CONTENT_MAX_LENGTH); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									draftEntity.setPreviewContent(content); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
									break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Override | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						public GovArticleDetailResultDTO queryGovArticleDetail(String articleId) { | 
					 | 
					 | 
						public GovArticleDetailResultDTO queryGovArticleDetail(String articleId) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							GovArticleDetailResultDTO articleDetail = baseDao.queryGovArticleDetail(articleId); | 
					 | 
					 | 
							GovArticleDetailResultDTO articleDetail = baseDao.queryGovArticleDetail(articleId); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -323,7 +320,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Override | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { | 
					 | 
					 | 
						public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//校验参数
 | 
					 | 
					 | 
							//校验参数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							if (fromDTO.getIsTop() == 1 && StringUtils.isBlank(fromDTO.getCoverImg())) { | 
					 | 
					 | 
							if (DraftConstant.TOP.equals(fromDTO.getIsTop()) && StringUtils.isBlank(fromDTO.getCoverImg())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								log.warn("saveOrUpdateAttr isTop=1 but coverImg is blank"); | 
					 | 
					 | 
								log.warn("saveOrUpdateAttr isTop=1 but coverImg is blank"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								throw new RenException("文章封面不能为空"); | 
					 | 
					 | 
								throw new RenException("文章封面不能为空"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -354,7 +351,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Transactional(rollbackFor = Exception.class) | 
					 | 
					 | 
						@Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List<DraftPublishRangeEntity> publishRangeEntityList) { | 
					 | 
					 | 
						public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List<DraftPublishRangeEntity> publishRangeEntityList) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Map<String,Object> draftIdMap = new HashMap<>(); | 
					 | 
					 | 
							Map<String,Object> draftIdMap = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							draftIdMap.put("DRAFT_ID", draftEntity.getId()); | 
					 | 
					 | 
							draftIdMap.put(ModuleConstant.FIELD_DRAFT_ID, draftEntity.getId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							draftCoverDao.deleteByMap(draftIdMap); | 
					 | 
					 | 
							draftCoverDao.deleteByMap(draftIdMap); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (coverEntity != null){ | 
					 | 
					 | 
							if (coverEntity != null){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								draftCoverDao.insert(coverEntity); | 
					 | 
					 | 
								draftCoverDao.insert(coverEntity); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |