From 1fdc19d62bc70bba955aa79b321bf23165c0e69e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 17 Sep 2021 16:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BB=84=E7=BB=87=E7=BA=A7?= =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E7=BB=84=E7=BB=87=E7=BD=91=E6=A0=BC=E9=83=A8?= =?UTF-8?q?=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/govorg/form/SubOrgFormDTO.java | 4 + .../dto/govorg/result/OrgTreeResultDTO.java | 21 +++ .../controller/GovOrgController.java | 14 ++ .../dao/govorg/CustomerAgencyDao.java | 11 +- .../service/govorg/GovOrgService.java | 10 ++ .../govorg/impl/GovOrgServiceImpl.java | 18 +++ .../mapper/govorg/CustomerAgencyDao.xml | 121 ++++++++++++++++++ 7 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgTreeResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java index effc43d25c..dca75903ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java @@ -15,6 +15,10 @@ public class SubOrgFormDTO implements Serializable { private static final long serialVersionUID = -3651225675593357002L; @NotBlank(message = "组织ID不能为空") private String agencyId; + /** + * 所属端 居民端resi,工作端gov + */ + private String client; /** * 是否包括我(1 是,0 否) */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgTreeResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgTreeResultDTO.java new file mode 100644 index 0000000000..b9b6c724cd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgTreeResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/16 16:50 + */ +@Data +public class OrgTreeResultDTO implements Serializable { + private static final long serialVersionUID = -4304356050545598564L; + private String orgId; + private String orgName; + private String orgType; + private String orgPids; + private List subOrgList; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 561dff2acc..824fab2fae 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -165,4 +165,18 @@ public class GovOrgController { return new Result().ok(govOrgService.getSubOrg(formDTO)); } + /** + * @Description 当前组织级下级组织树 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< OrgTreeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/17 14:02 + */ + @PostMapping("agencytree") + public Result getAgencyTree(@LoginUser TokenDto tokenDto, @RequestBody SubOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(govOrgService.getAgencyTree(tokenDto, formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index 544f7387dd..673d317fe6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -18,10 +18,7 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; -import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO; -import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; -import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO; +import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -74,4 +71,10 @@ public interface CustomerAgencyDao extends BaseDao { * @return */ StaffOrgRelationResultDTO getStaffFromOrgType(@Param("staffId") String staffId); + + OrgTreeResultDTO getOrgTree(@Param("agencyId") String agencyId); + List getSubOrgList(@Param("pid") String pid); + + OrgTreeResultDTO getResiOrgTree(@Param("agencyId") String agencyId); + List getResiSubOrgList(@Param("pid") String pid); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index a641be3095..2e2b7c6e88 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -135,4 +135,14 @@ public interface GovOrgService { * @return */ StaffOrgRelationResultDTO getStaffFromOrgType(String staffId); + + /** + * @Description 当前组织级下级组织树 + * @Param tokenDto + * @Param formDTO + * @Return {@link OrgTreeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/17 14:03 + */ + OrgTreeResultDTO getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index b7b23299ab..45ee6810fe 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -491,4 +491,22 @@ public class GovOrgServiceImpl implements GovOrgService { return customerAgencyDao.getStaffFromOrgType(staffId); } + /** + * @param tokenDto + * @param formDTO + * @Description 当前组织级下级组织树 + * @Param tokenDto + * @Param formDTO + * @Return {@link OrgTreeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/17 14:03 + */ + @Override + public OrgTreeResultDTO getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO) { + if ("resi".equals(formDTO.getClient())) { + return customerAgencyDao.getResiOrgTree(formDTO.getAgencyId()); + } + return customerAgencyDao.getOrgTree(formDTO.getAgencyId()); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index 2573d8b674..d47b736984 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -142,4 +142,125 @@ SELECT STAFF_ID,ORG_ID,ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId} + + + + + + + + + + + + + + + + + + + + + + + +