|  | @ -23,9 +23,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
		
			
				
					|  |  | 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.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; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.security.dto.TokenDto; |  |  | import com.epmet.commons.tools.security.dto.TokenDto; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.commons.tools.security.user.LoginUserUtil; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.utils.ConvertUtils; |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.utils.DateUtils; |  |  | import com.epmet.commons.tools.utils.DateUtils; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.utils.Result; |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
	
		
		
			
				
					|  | @ -43,13 +45,14 @@ import com.epmet.dto.feign.GovOrgSelfFeignClient; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.form.*; |  |  | import com.epmet.dto.form.*; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.result.*; |  |  | import com.epmet.dto.result.*; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.entity.*; |  |  | import com.epmet.entity.*; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.feign.EpmetUserClientFeignClient; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.feign.EpmetUserSelfFeignClient; |  |  | import com.epmet.feign.EpmetUserSelfFeignClient; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.redis.ArticleRedis; |  |  | import com.epmet.redis.ArticleRedis; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.ArticleOperateRecordService; |  |  | import com.epmet.service.ArticleOperateRecordService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.ArticlePublishRangeService; |  |  | import com.epmet.service.ArticlePublishRangeService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.ArticleService; |  |  | import com.epmet.service.ArticleService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.utils.ModuleConstant; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.ArticleVisitRecordService; |  |  | import com.epmet.service.ArticleVisitRecordService; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.utils.ModuleConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.github.pagehelper.PageHelper; |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
		
			
				
					|  |  | import com.github.pagehelper.PageInfo; |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
		
			
				
					|  |  | import lombok.extern.slf4j.Slf4j; |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
	
		
		
			
				
					|  | @ -92,6 +95,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
		
			
				
					|  |  | 	private DraftCoverDao draftCoverDao; |  |  | 	private DraftCoverDao draftCoverDao; | 
			
		
	
		
		
			
				
					|  |  | 	@Autowired |  |  | 	@Autowired | 
			
		
	
		
		
			
				
					|  |  | 	private DraftPublishRangeDao draftPublishRangeDao; |  |  | 	private DraftPublishRangeDao draftPublishRangeDao; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	@Autowired | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private EpmetUserClientFeignClient epmetUserClientFeignClient; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	@Autowired | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	private LoginUserUtil loginUserUtil; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 	private static final String AGENCY = "agency"; |  |  | 	private static final String AGENCY = "agency"; | 
			
		
	
		
		
			
				
					|  |  | 	private static final String GRID = "grid"; |  |  | 	private static final String GRID = "grid"; | 
			
		
	
	
		
		
			
				
					|  | @ -195,17 +202,25 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
		
			
				
					|  |  | 			draftDao.updateById(draftEntity); |  |  | 			draftDao.updateById(draftEntity); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 		} else { |  |  | 		} else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			LoginUserDetailsFormDTO detailsFormDTO = new LoginUserDetailsFormDTO(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			detailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			detailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			detailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			Result<LoginUserDetailsResultDTO> loginUserDetails = epmetUserClientFeignClient.getLoginUserDetails(detailsFormDTO); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			if (loginUserDetails == null || loginUserDetails.getData() == null){ | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				log.warn("saveOrUpdateContent getloginUserDetails return null"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				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()); | 
			
		
	
		
		
			
				
					|  |  | 			draftEntity.setCustomerId(tokenDto.getCustomerId()); |  |  | 			draftEntity.setCustomerId(tokenDto.getCustomerId()); | 
			
		
	
		
		
			
				
					|  |  | 			draftEntity.setIsTop(DraftConstant.UN_TOP); |  |  | 			draftEntity.setIsTop(DraftConstant.UN_TOP); | 
			
		
	
		
		
			
				
					|  |  | 			draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); |  |  | 			draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); | 
			
		
	
		
		
			
				
					
					|  |  | 			draftEntity.setOrgId(""); |  |  | 			draftEntity.setOrgId(loginUserDetails.getData().getAgencyId()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			draftEntity.setOrgIdPath(""); |  |  | 			draftEntity.setOrgIdPath(loginUserDetails.getData().getOrgIdPath()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 			draftEntity.setGridId(""); |  |  | 			draftEntity.setGridId(""); | 
			
		
	
		
		
			
				
					
					|  |  | 			draftEntity.setDepartmentId(""); |  |  | 			draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 			draftEntity.setDelFlag(NumConstant.ZERO_STR); |  |  | 			draftEntity.setDelFlag(NumConstant.ZERO_STR); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			draftDao.insert(draftEntity); |  |  | 			draftDao.insert(draftEntity); | 
			
		
	
		
		
			
				
					|  |  | 		} |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -348,7 +363,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
		
			
				
					|  |  | 		List<DraftPublishRangeEntity> publishRangeEntityList = new ArrayList<>(); |  |  | 		List<DraftPublishRangeEntity> publishRangeEntityList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					|  |  | 		List<String> agencyGridNameList = new ArrayList<>(); |  |  | 		List<String> agencyGridNameList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  | 		ArticleGridResultDTO articleGridResultDTO = agencyGridList(tokenDto); |  |  | 		ArticleGridResultDTO articleGridResultDTO = this.agencyGridList(tokenDto); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 		if (articleGridResultDTO == null) { |  |  | 		if (articleGridResultDTO == null) { | 
			
		
	
		
		
			
				
					|  |  | 			log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); |  |  | 			log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); | 
			
		
	
		
		
			
				
					|  |  | 			throw new RenException("参数错误"); |  |  | 			throw new RenException("参数错误"); | 
			
		
	
	
		
		
			
				
					|  | @ -422,6 +437,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit | 
			
		
	
		
		
			
				
					|  |  | 					draftPublishRangeEntity.setPublishStatus(DraftConstant.UNPUBLISH); |  |  | 					draftPublishRangeEntity.setPublishStatus(DraftConstant.UNPUBLISH); | 
			
		
	
		
		
			
				
					|  |  | 					draftPublishRangeEntity.setRevision(0); |  |  | 					draftPublishRangeEntity.setRevision(0); | 
			
		
	
		
		
			
				
					|  |  | 					draftPublishRangeEntity.setDelFlag(NumConstant.ZERO_STR); |  |  | 					draftPublishRangeEntity.setDelFlag(NumConstant.ZERO_STR); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					draftPublishRangeEntity.setPids(articleGridResultDTO.getPids()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 					draftPublishRangeEntity.setAllParentName(articleGridResultDTO.getAllParentName()); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 					publishRangeEntityList.add(draftPublishRangeEntity); |  |  | 					publishRangeEntityList.add(draftPublishRangeEntity); | 
			
		
	
		
		
			
				
					|  |  | 				} |  |  | 				} | 
			
		
	
	
		
		
			
				
					|  | 
 |