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