From 27dec0dc17f041036856a5fe160aecd83278bb4c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Dec 2021 17:05:38 +0800 Subject: [PATCH] =?UTF-8?q?pc=E6=8C=87=E6=B4=BE=E6=97=B6=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E8=80=85=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9=E4=B8=BA=EF=BC=8C?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BB=84=E7=BB=87=E5=8F=8A=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=BF=97=E6=84=BF=E8=80=85=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcUserDemandRecController.java | 2 +- .../controller/ResiVolunteerController.java | 2 +- .../java/com/epmet/dao/VolunteerInfoDao.java | 8 ++++++ .../epmet/service/VolunteerInfoService.java | 2 +- .../impl/VolunteerInfoServiceImpl.java | 27 +++++++++++++++++-- .../resources/mapper/VolunteerInfoDao.xml | 10 +++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 4 +-- 7 files changed, 48 insertions(+), 7 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 06c991b31c..3e736641e0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -85,7 +85,7 @@ public class IcUserDemandRecController { formDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) { - return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getServiceName())); + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getStaffId(),formDTO.getServiceName())); } else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) { ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class); return new Result>().ok(societyOrgService.queryServiceList(formDTO)); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index e1d18e5536..749f8dfc3f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -125,7 +125,7 @@ public class ResiVolunteerController { */ @PostMapping("listprofile") public Result> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ - return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getServiceName())); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java index ab0b65bf9c..5dcd379c4b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java @@ -74,4 +74,12 @@ public interface VolunteerInfoDao extends BaseDao { * @date 2020.08.13 10:06 **/ List selectVolunteerIds(@Param("customerId")String customerId); + + /** + * + * @param customerId + * @param pids 查询当前组织及下级,所有的志愿者 + * @return + */ + List selectVolunteerByPids(@Param("customerId") String customerId, @Param("pids") String pids); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 6a84fb67a1..0e1e309594 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -94,7 +94,7 @@ public interface VolunteerInfoService extends BaseService { * @param customerId * @return */ - List queryListVolunteer(String customerId,String userRealName); + List queryListVolunteer(String customerId,String staffId,String userRealName); List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index ac87cc6b4c..7c2ba743c7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -22,13 +22,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -231,10 +235,29 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryListVolunteer(String customerId, String userRealName) { + public List queryListVolunteer(String customerId, String staffId,String userRealName) { + CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(customerId,staffId); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询工作人员信息异常"); + } + // 如果是根级组织的工作人员,agencyPids="";正常是以英文冒号隔开 + String pids=""; + if(StringUtils.isBlank(staffInfo.getAgencyPIds())||NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())){ + pids=staffInfo.getAgencyId(); + }else{ + pids=staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId()); + } List resultList = new ArrayList<>(); - List userIds = baseDao.selectVolunteerIds(customerId); + List userIds = baseDao.selectVolunteerByPids(customerId,pids); if (CollectionUtils.isEmpty(userIds)) { return resultList; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml index 4dc80881f2..9f3f83baa4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -75,4 +75,14 @@ AND CUSTOMER_ID = #{customerId} order by CREATED_TIME asc + + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 7aaf02f34e..e503f80275 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -23,8 +23,8 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) public interface EpmetUserOpenFeignClient { /**