From 25dd13b59db28848f29330fb75c9497ed853cfc7 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 25 May 2022 16:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=82=E7=BA=A7=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partyOrg/result/BranchListResultDTO.java | 34 +++++++++++++++++++ .../controller/IcPartyOrgController.java | 13 +++++++ .../modules/partyOrg/dao/IcPartyOrgDao.java | 9 +++++ .../partyOrg/service/IcPartyOrgService.java | 11 ++++++ .../service/impl/IcPartyOrgServiceImpl.java | 22 +++++++++--- .../mapper/partyOrg/IcPartyOrgDao.xml | 18 ++++++++++ 6 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchListResultDTO.java diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchListResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchListResultDTO.java new file mode 100644 index 0000000000..bec618639d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchListResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-05-25 11:15 + **/ +@Data +public class BranchListResultDTO implements Serializable { + + /** + * 工作人员所属组织ID + */ + private String agencyId; + + /** + * 工作人员所属组织ID的pids + */ + private String agencyPIds; + + /** + * 工作人员所属组织名称 + */ + private String agencyName; + + private List children = new ArrayList<>(); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java index 3e5a8b1fa6..eba6ae8d69 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java @@ -15,6 +15,7 @@ import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -95,6 +96,18 @@ public class IcPartyOrgController { return icPartyOrgService.getTreelist(formDTO); } + /** + * @describe: 当前登录用户所属行政组织,及下级的党组织(只限支部) + * @author wangtong + * @date 2022/5/25 15:24 + * @params [tokenDto] + * @return com.epmet.commons.tools.utils.Result + */ + @GetMapping("branchlist") + public Result branchlist(@LoginUser TokenDto tokenDto){ + return icPartyOrgService.branchlist(tokenDto); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java index f66f4d0721..e7be138e08 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java @@ -64,4 +64,13 @@ public interface IcPartyOrgDao extends BaseDao { * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity */ IcPartyOrgEntity selectLevelOneOrgByCustomerId(@Param("customerId") String customerId); + + /** + * @describe: 查询行政组织下的所有支部党组织 + * @author wangtong + * @date 2022/5/25 15:30 + * @params [agencyId, customerId] + * @return java.util.List + */ + List selectAllBranchByAgencyId(@Param("agencyId") String agencyId,@Param("customerId") String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java index b3b3845808..db1a7a6162 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java @@ -2,10 +2,12 @@ package com.epmet.modules.partyOrg.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import java.util.List; @@ -87,4 +89,13 @@ public interface IcPartyOrgService extends BaseService { * @return com.epmet.commons.tools.page.PageData */ Result> getTreelist(PartyOrgTreeListDTO formDTO); + + /** + * @describe: 当前登录用户所属行政组织,及下级的党组织(只限支部) + * @author wangtong + * @date 2022/5/25 15:25 + * @params [tokenDto] + * @return com.epmet.commons.tools.utils.Result + */ + Result branchlist(TokenDto tokenDto); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java index 4ec08a0eb4..4ae7051cf2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java @@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.PartyOrgTypeEnum; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.enums.OrgLevelEnums; @@ -19,6 +22,7 @@ import com.epmet.modules.partymember.dao.IcPartyMemberDao; import com.epmet.modules.partymember.entity.IcPartyMemberEntity; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -81,24 +85,24 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl>().ok(build(list)); } + @Override + public Result branchlist(TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + BranchListResultDTO result = ConvertUtils.sourceToTarget(staffInfo, BranchListResultDTO.class); + result.setChildren(baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(),tokenDto.getCustomerId())); + return new Result().ok(result); + } + /** * 构建树节点 */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml index a27b7ae5f9..549c7f1695 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -68,6 +68,24 @@ where DEL_FLAG='0' and CUSTOMER_ID=#{customerId} +