From 719951d71b0afb7435212b5d4f95f70e0ffa9371 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 5 Jun 2020 09:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ArticleServiceImpl.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 5219c1de67..b5e4cb2a44 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -23,9 +23,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; 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.page.PageData; 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.DateUtils; 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.result.*; import com.epmet.entity.*; +import com.epmet.feign.EpmetUserClientFeignClient; import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.redis.ArticleRedis; import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticlePublishRangeService; import com.epmet.service.ArticleService; -import com.epmet.utils.ModuleConstant; import com.epmet.service.ArticleVisitRecordService; +import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -92,6 +95,10 @@ public class ArticleServiceImpl extends BaseServiceImpl 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.setTitle(fromDTO.getTitle()); draftEntity.setCustomerId(tokenDto.getCustomerId()); draftEntity.setIsTop(DraftConstant.UN_TOP); draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); - draftEntity.setOrgId(""); - draftEntity.setOrgIdPath(""); + draftEntity.setOrgId(loginUserDetails.getData().getAgencyId()); + draftEntity.setOrgIdPath(loginUserDetails.getData().getOrgIdPath()); draftEntity.setGridId(""); - draftEntity.setDepartmentId(""); + draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); draftEntity.setDelFlag(NumConstant.ZERO_STR); - draftDao.insert(draftEntity); } @@ -348,7 +363,7 @@ public class ArticleServiceImpl extends BaseServiceImpl publishRangeEntityList = new ArrayList<>(); List agencyGridNameList = new ArrayList<>(); - ArticleGridResultDTO articleGridResultDTO = agencyGridList(tokenDto); + ArticleGridResultDTO articleGridResultDTO = this.agencyGridList(tokenDto); if (articleGridResultDTO == null) { log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); throw new RenException("参数错误"); @@ -422,6 +437,8 @@ public class ArticleServiceImpl extends BaseServiceImpl