From 5d641bb8873c878294ef084b5358ca8acf37f26f Mon Sep 17 00:00:00 2001 From: Bill <771989711@qq.com> Date: Wed, 8 Nov 2023 09:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E6=8E=A7=E5=88=B6=E6=B4=BB=E5=8A=A8=E7=9A=84=E5=8F=AF?= =?UTF-8?q?=E8=A7=81=E8=8C=83=E5=9B=B4=201.=E7=A4=BE=E5=8C=BA=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E7=9C=8B=E5=88=B0=E8=87=AA=E5=B7=B1=E7=9A=84=202.?= =?UTF-8?q?=E4=B8=8A=E7=BA=A7=E5=8F=AF=E4=BB=A5=E7=9C=8B=E5=88=B0=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=203.=E6=B4=BB=E5=8A=A8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E5=80=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/work/ActPageFormDTO.java | 5 +++++ .../main/java/com/epmet/controller/WorkActController.java | 8 ++++++++ .../java/com/epmet/service/impl/WorkActServiceImpl.java | 4 ++++ .../src/main/resources/mapper/ActInfoDao.xml | 5 ++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/code/smart-community/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPageFormDTO.java b/code/smart-community/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPageFormDTO.java index 1c8b9f50..18ac64b3 100644 --- a/code/smart-community/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPageFormDTO.java +++ b/code/smart-community/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPageFormDTO.java @@ -33,4 +33,9 @@ public class ActPageFormDTO extends PageFormDTO implements Serializable { */ private String customerId; private String userId; + + /** + * 组织ID + */ + private String agencyId; } diff --git a/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index 86195a32..826ad49e 100644 --- a/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -2,8 +2,11 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.ActConstant; @@ -11,6 +14,7 @@ import com.epmet.dto.form.work.*; import com.epmet.dto.result.work.*; import com.epmet.service.WorkActService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -323,6 +327,10 @@ public class WorkActController { public Result> pageList(@LoginUser TokenDto tokenDto, @RequestBody ActPageFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); + if(!StringUtils.hasText(formDTO.getAgencyId())) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + formDTO.setAgencyId(staffInfoCacheResult.getAgencyId()); + } PageData page = workActService.pageList(formDTO); return new Result>().ok(page); } diff --git a/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 37b56f14..10b1d845 100644 --- a/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -417,6 +417,10 @@ public class WorkActServiceImpl implements WorkActService { Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); if(result.success()&&null!=result.getData()){ actInfoEntity.setPid(result.getData().getPid()); + + if(StringUtils.isEmpty(actInfoEntity.getSponsorPath()) || actInfoEntity.getSponsorPath().indexOf(":") == -1) { + actInfoEntity.setSponsorPath(result.getData().getPids()); + } }else{ logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId()); } diff --git a/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 9881a235..0c482378 100644 --- a/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/code/smart-community/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -849,6 +849,9 @@ AND ai.ACT_STATUS = #{status} + + AND (ai.SPONSOR_ID = #{agencyId} or ai.SPONSOR_PATH like concat('%',#{agencyId},'%') ) + AND ai.TITLE like concat('%',#{title},'%') @@ -860,6 +863,6 @@ and ai.CUSTOMER_ID= #{customerId} and ai.act_type = 'heart' - order by ai.CREATED_TIME desc + order by ai.ACT_START_TIME desc