|  |  | @ -18,6 +18,7 @@ | 
			
		
	
		
			
				
					|  |  |  | package com.epmet.service.impl; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.AppClientConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.FieldConstant; | 
			
		
	
	
		
			
				
					|  |  | @ -29,6 +30,10 @@ import com.epmet.commons.tools.exception.EpmetException; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.exception.RenException; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.page.PageData; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.RedisKeys; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerOrgRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.scan.param.ImgScanParamDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.scan.param.ImgTaskDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -125,6 +130,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 	private ArticleTagsDao articleTagsDao; | 
			
		
	
		
			
				
					|  |  |  | 	@Autowired | 
			
		
	
		
			
				
					|  |  |  | 	private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | 	@Autowired | 
			
		
	
		
			
				
					|  |  |  | 	private ArticleTagsService articleTagsService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Value("${openapi.scan.server.url}") | 
			
		
	
		
			
				
					|  |  |  | 	private String scanApiUrl; | 
			
		
	
	
		
			
				
					|  |  | @ -1261,9 +1268,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 	public UpdateCustomerTagCacheDTO updateCustomerTag(TokenDto tokenDto, String draftId) { | 
			
		
	
		
			
				
					|  |  |  | 		//获取草稿基本信息
 | 
			
		
	
		
			
				
					|  |  |  | 		DraftDTO draft = draftService.get(draftId); | 
			
		
	
		
			
				
					|  |  |  | 		String tags = draft.getTags(); | 
			
		
	
		
			
				
					|  |  |  | 		String customerId = draft.getCustomerId(); | 
			
		
	
		
			
				
					|  |  |  | 		String userId = tokenDto.getUserId(); | 
			
		
	
		
			
				
					|  |  |  | 		return updateCustomerTagV2(tokenDto.getUserId(), draft.getCustomerId(), draft.getTags()); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  | 	 * Desc: | 
			
		
	
		
			
				
					|  |  |  | 	 * @param userId | 
			
		
	
		
			
				
					|  |  |  | 	 * @param customerId | 
			
		
	
		
			
				
					|  |  |  | 	 * @param tags eg: aa|bb|cc | 
			
		
	
		
			
				
					|  |  |  | 	 * @author zxc | 
			
		
	
		
			
				
					|  |  |  | 	 * @date 2022/6/30 16:14 | 
			
		
	
		
			
				
					|  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  | 	public UpdateCustomerTagCacheDTO updateCustomerTagV2(String userId,String customerId,String tags){ | 
			
		
	
		
			
				
					|  |  |  | 		UpdateCustomerTagCacheDTO result = null; | 
			
		
	
		
			
				
					|  |  |  | 		if (StringUtils.isNotBlank(tags)) { | 
			
		
	
		
			
				
					|  |  |  | 			result = new UpdateCustomerTagCacheDTO(); | 
			
		
	
	
		
			
				
					|  |  | @ -1277,8 +1293,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 			result.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			result.setTagsInfo(tagsInfo); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		return result; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -1317,13 +1331,17 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 		//获取草稿基本信息
 | 
			
		
	
		
			
				
					|  |  |  | 		DraftDTO draft = draftService.get(draftId); | 
			
		
	
		
			
				
					|  |  |  | 		String customerId = draft.getCustomerId(); | 
			
		
	
		
			
				
					|  |  |  | 		List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo(); | 
			
		
	
		
			
				
					|  |  |  | 		String userId = tokenDto.getUserId(); | 
			
		
	
		
			
				
					|  |  |  | 		//根据草稿id查询发布范围id集合
 | 
			
		
	
		
			
				
					|  |  |  | 		List<String> gridIds = draftPublishRangeDao.selectGridIdByDraftId(draftId); | 
			
		
	
		
			
				
					|  |  |  | 		if (gridIds.size() == NumConstant.ZERO) { | 
			
		
	
		
			
				
					|  |  |  | 			throw new RenException(TagConstant.SELECT_GRIDIDLIST_FAILURE); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		return updateGridTagV2(formDto,customerId,gridIds,userId); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	public List<UpdateGridTagCacheDTO> updateGridTagV2(UpdateCustomerTagCacheDTO formDto,String customerId,List<String> gridIds,String userId){ | 
			
		
	
		
			
				
					|  |  |  | 		List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo(); | 
			
		
	
		
			
				
					|  |  |  | 		List<UpdateGridTagsFormDTO> gridTags = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  | 		List<UpdateGridTagCacheDTO> gridTagCache = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  | 		gridIds.forEach(gridId -> { | 
			
		
	
	
		
			
				
					|  |  | @ -1379,23 +1397,22 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 	 * @author zxc | 
			
		
	
		
			
				
					|  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  | 	public void addArticleTags(UpdateCustomerTagCacheDTO formDto, String draftId, TokenDto tokenDto, Date createdTime) { | 
			
		
	
		
			
				
					|  |  |  | 		List<AddArticleTagsFormDTO> addArticleTags = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  | 		List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo(); | 
			
		
	
		
			
				
					|  |  |  | 		DraftDTO draft = draftService.get(draftId); | 
			
		
	
		
			
				
					|  |  |  | 		String customerId = draft.getCustomerId(); | 
			
		
	
		
			
				
					|  |  |  | 		String userId = tokenDto.getUserId(); | 
			
		
	
		
			
				
					|  |  |  | 		String articleId = articleDao.getArticleIdByDraftId(draftId); | 
			
		
	
		
			
				
					|  |  |  | 		addArticleTagsV2(formDto,customerId,articleId); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	public void addArticleTagsV2(UpdateCustomerTagCacheDTO formDto,String customerId,String articleId){ | 
			
		
	
		
			
				
					|  |  |  | 		List<ArticleTagsEntity> articleTags = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  | 		List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo(); | 
			
		
	
		
			
				
					|  |  |  | 		tagsInfo.forEach(resultDTO -> { | 
			
		
	
		
			
				
					|  |  |  | 			AddArticleTagsFormDTO addArticleTag = new AddArticleTagsFormDTO(); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTag.setCreatedBy(userId); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTag.setUpdatedBy(userId); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTag.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTag.setArticleId(articleId); | 
			
		
	
		
			
				
					|  |  |  | 			BeanUtils.copyProperties(resultDTO, addArticleTag); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTag.setCreatedTime(createdTime); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTags.add(addArticleTag); | 
			
		
	
		
			
				
					|  |  |  | 			ArticleTagsEntity e = ConvertUtils.sourceToTarget(resultDTO, ArticleTagsEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			e.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			e.setArticleId(articleId); | 
			
		
	
		
			
				
					|  |  |  | 			articleTags.add(e); | 
			
		
	
		
			
				
					|  |  |  | 		}); | 
			
		
	
		
			
				
					|  |  |  | 		articleTagsDao.addArticleTags(addArticleTags); | 
			
		
	
		
			
				
					|  |  |  | 		articleTagsService.insertBatch(articleTags); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	/** | 
			
		
	
	
		
			
				
					|  |  | @ -1453,6 +1470,100 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 		return baseDao.selectArticleListByTag(tagId, pageNo, pageSize); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  | 	 * Desc: 发布文章/存草稿 | 
			
		
	
		
			
				
					|  |  |  | 	 * @param formDTO | 
			
		
	
		
			
				
					|  |  |  | 	 * @author zxc | 
			
		
	
		
			
				
					|  |  |  | 	 * @date 2022/6/30 14:03 | 
			
		
	
		
			
				
					|  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  | 	@Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |     public void addOrSaveDraft(AddOrSaveDraftFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		String customerId = formDTO.getCustomerId(); | 
			
		
	
		
			
				
					|  |  |  | 		CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, formDTO.getUserId()); | 
			
		
	
		
			
				
					|  |  |  | 		if (null == staffInfo){ | 
			
		
	
		
			
				
					|  |  |  | 			throw new EpmetException("未查询到当前工作人员信息:"+formDTO.getUserId()); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  | 		if (null == agencyInfo){ | 
			
		
	
		
			
				
					|  |  |  | 			throw new EpmetException("未查询到组织信息:"+staffInfo.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 		// 发文章
 | 
			
		
	
		
			
				
					|  |  |  | 		if (formDTO.getType().equals(ArticleConstant.SAVE_TYPE_ARTICLE)){ | 
			
		
	
		
			
				
					|  |  |  | 			// 1.文章
 | 
			
		
	
		
			
				
					|  |  |  | 			ArticleEntity article = ConvertUtils.sourceToTarget(formDTO, ArticleEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			article.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			// 按照之前逻辑存成客户ID
 | 
			
		
	
		
			
				
					|  |  |  | 			article.setDepartmentId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			article.setStatusFlag(DraftConstant.PUBLISHED); | 
			
		
	
		
			
				
					|  |  |  | 			article.setPublishWay(ArticleConstant.PUBLISH_WAY_MANUAL); | 
			
		
	
		
			
				
					|  |  |  | 			if (formDTO.getPublisherType().equals(DraftConstant.GRID)){ | 
			
		
	
		
			
				
					|  |  |  | 				article.setGridId(formDTO.getPublisher()); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 			article.setTitleAuditStatus(ArticleConstant.AUDIT_WAY_NO_AUDIT); | 
			
		
	
		
			
				
					|  |  |  | 			article.setPreviewContent(formDTO.getContent().length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? formDTO.getContent().substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : formDTO.getContent()); | 
			
		
	
		
			
				
					|  |  |  | 			article.setPublisherId(formDTO.getPublisher()); | 
			
		
	
		
			
				
					|  |  |  | 			article.setPublishRangeDesc(formDTO.getPublishRangeDesc().stream().collect(Collectors.joining("、"))); | 
			
		
	
		
			
				
					|  |  |  | 			article.setTags(CollectionUtils.isEmpty(formDTO.getTagNameList()) ? "" : formDTO.getTagNameList().stream().collect(Collectors.joining("|"))); | 
			
		
	
		
			
				
					|  |  |  | 			article.setOrgId(staffInfo.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  | 			article.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId())); | 
			
		
	
		
			
				
					|  |  |  | 			baseDao.insert(article); | 
			
		
	
		
			
				
					|  |  |  | 			// 2.内容
 | 
			
		
	
		
			
				
					|  |  |  | 			ArticleContentEntity articleContent = ConvertUtils.sourceToTarget(article, ArticleContentEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 			articleContent.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			articleContent.setArticleId(article.getId()); | 
			
		
	
		
			
				
					|  |  |  | 			articleContent.setContent(formDTO.getContent()); | 
			
		
	
		
			
				
					|  |  |  | 			articleContent.setContentType("rich_text"); | 
			
		
	
		
			
				
					|  |  |  | 			articleContent.setAuditStatus(ArticleConstant.AUDIT_WAY_NO_AUDIT); | 
			
		
	
		
			
				
					|  |  |  | 			articleContent.setOrderNum(NumConstant.ZERO); | 
			
		
	
		
			
				
					|  |  |  | 			articleContentDao.insert(articleContent); | 
			
		
	
		
			
				
					|  |  |  | 			// 3.操作记录
 | 
			
		
	
		
			
				
					|  |  |  | 			ArticleOperateRecordEntity articleOperateRecord = new ArticleOperateRecordEntity(); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setArticleId(article.getId()); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setGridIds(formDTO.getGridIdList().stream().collect(Collectors.joining(":"))); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setOpUser(staffInfo.getAgencyName().concat("-").concat(staffInfo.getRealName())); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setContent(formDTO.getContent()); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setOpType(ArticleConstant.PUBLISH); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecord.setOpTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  | 			articleOperateRecordService.insert(articleOperateRecord); | 
			
		
	
		
			
				
					|  |  |  | 			// 4.发布范围
 | 
			
		
	
		
			
				
					|  |  |  | 			List<ArticlePublishRangeEntity> rangeList = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  | 			formDTO.getGridIdList().forEach(g -> { | 
			
		
	
		
			
				
					|  |  |  | 				GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(g); | 
			
		
	
		
			
				
					|  |  |  | 				if (null == gridInfo){ | 
			
		
	
		
			
				
					|  |  |  | 					throw new EpmetException("未查询到网格信息:"+g); | 
			
		
	
		
			
				
					|  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  | 				ArticlePublishRangeEntity articlePublishRange = ConvertUtils.sourceToTarget(gridInfo,ArticlePublishRangeEntity.class); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setCustomerId(customerId); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setArticleId(article.getId()); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setGridId(g); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setAgencyGridName(gridInfo.getGridNamePath()); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setAgencyId(gridInfo.getPid()); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setPublishStatus(ArticleConstant.PUBLISHED); | 
			
		
	
		
			
				
					|  |  |  | 				articlePublishRange.setId(null); | 
			
		
	
		
			
				
					|  |  |  | 				rangeList.add(articlePublishRange); | 
			
		
	
		
			
				
					|  |  |  | 			}); | 
			
		
	
		
			
				
					|  |  |  | 			articlePublishRangeService.insertBatch(rangeList); | 
			
		
	
		
			
				
					|  |  |  | 			// 5.文章标签
 | 
			
		
	
		
			
				
					|  |  |  | 			UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = updateCustomerTagV2(formDTO.getUserId(), formDTO.getCustomerId(), article.getTags()); | 
			
		
	
		
			
				
					|  |  |  | 			addArticleTagsV2(updateCustomerTagCacheDTO,customerId,article.getId()); | 
			
		
	
		
			
				
					|  |  |  | 			// 6.更新网格tag
 | 
			
		
	
		
			
				
					|  |  |  | 			List<UpdateGridTagCacheDTO> updateGridTagCacheDTOS = updateGridTagV2(updateCustomerTagCacheDTO, customerId, formDTO.getGridIdList(), formDTO.getUserId()); | 
			
		
	
		
			
				
					|  |  |  | 			// 7.更新redis
 | 
			
		
	
		
			
				
					|  |  |  | 			try { | 
			
		
	
		
			
				
					|  |  |  | 				this.updateCacheCustomerTag(updateCustomerTagCacheDTO); | 
			
		
	
		
			
				
					|  |  |  | 				this.updateCacheGridTag(updateGridTagCacheDTOS); | 
			
		
	
		
			
				
					|  |  |  | 			} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  | 				log.error("scanAllPassPublishArticle update redis exception", e); | 
			
		
	
		
			
				
					|  |  |  | 				throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		}else {// 存草稿
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public PageData<PublishedListResultDTO> articleListV2(ArticleListFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		//1.获取工作人员缓存信息
 | 
			
		
	
	
		
			
				
					|  |  | @ -1477,4 +1588,43 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		return new PageData<>(list, pageInfo.getTotal()); | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  | 	public PublishedListResultDTO detailV2(ArticleListFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  | 		PublishedListResultDTO resultDTO = new PublishedListResultDTO(); | 
			
		
	
		
			
				
					|  |  |  | 		//1.查询文章主表信息
 | 
			
		
	
		
			
				
					|  |  |  | 		List<PublishedListResultDTO> list = baseDao.selectAllArticle(formDTO); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		if (!CollectionUtils.isEmpty(list)) { | 
			
		
	
		
			
				
					|  |  |  | 			resultDTO = list.get(NumConstant.ZERO); | 
			
		
	
		
			
				
					|  |  |  | 			//查询文章涉及的发布范围网络Id列表
 | 
			
		
	
		
			
				
					|  |  |  | 			LambdaQueryWrapper<ArticlePublishRangeEntity> tWrapper = new LambdaQueryWrapper<>(); | 
			
		
	
		
			
				
					|  |  |  | 			tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId()); | 
			
		
	
		
			
				
					|  |  |  | 			tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR); | 
			
		
	
		
			
				
					|  |  |  | 			//【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】
 | 
			
		
	
		
			
				
					|  |  |  | 			if("offline".equals(resultDTO.getStatusFlag())){ | 
			
		
	
		
			
				
					|  |  |  | 				tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline"); | 
			
		
	
		
			
				
					|  |  |  | 			}else { | 
			
		
	
		
			
				
					|  |  |  | 				tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published"); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 			List<ArticlePublishRangeEntity> entityList = articlePublishRangeDao.selectList(tWrapper); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(entityList)) { | 
			
		
	
		
			
				
					|  |  |  | 				List<String> contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  | 				resultDTO.setGridIdList(contentList); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 			//查询文章内容
 | 
			
		
	
		
			
				
					|  |  |  | 			LambdaQueryWrapper<ArticleContentEntity> tWrapper1 = new LambdaQueryWrapper<>(); | 
			
		
	
		
			
				
					|  |  |  | 			tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId()); | 
			
		
	
		
			
				
					|  |  |  | 			tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR); | 
			
		
	
		
			
				
					|  |  |  | 			tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum); | 
			
		
	
		
			
				
					|  |  |  | 			List<ArticleContentEntity> contentEntityList = articleContentDao.selectList(tWrapper1); | 
			
		
	
		
			
				
					|  |  |  | 			if (!CollectionUtils.isEmpty(entityList)) { | 
			
		
	
		
			
				
					|  |  |  | 				LinkedList<String> contentList = (LinkedList)contentEntityList.stream().map(ArticleContentEntity::getContent).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  | 				resultDTO.setContentList(contentList); | 
			
		
	
		
			
				
					|  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 		return resultDTO; | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |