diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java deleted file mode 100644 index d56cd7615a..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.epmet.commons.tools.enums; - -import com.epmet.commons.tools.utils.SpringContextUtils; -import org.springframework.core.env.Environment; - -/** - * 系统环境变量枚举类 - * dev|test|prod - * - * @author jianjun liu - * @date 2020-07-03 11:14 - **/ -public enum KongCunCustomerEnvEnum { - /** - * 环境变量枚举 - */ - DEV("dev", "开发环境", "613cc61a6b8ce4c70d21bd413dac72cc"), - TEST("test", "体验环境", "b272625617e53620b2b3cbc65d1ecbbb"), - PROD("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80"), - UN_KNOWN("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80") - ; - - private String code; - private String name; - private String customerId; - - - - KongCunCustomerEnvEnum(String code, String name, String customerId) { - this.code = code; - this.name = name; - this.customerId = customerId; - } - - public static KongCunCustomerEnvEnum getEnum(String code) { - KongCunCustomerEnvEnum[] values = KongCunCustomerEnvEnum.values(); - for (KongCunCustomerEnvEnum value : values) { - if (value.getCode().equals(code)) { - return value; - } - } - return KongCunCustomerEnvEnum.UN_KNOWN; - } - - public static KongCunCustomerEnvEnum getCurrentEnv(){ - try { - Environment environment = SpringContextUtils.getBean(Environment.class); - String[] activeProfiles = environment.getActiveProfiles(); - if (activeProfiles.length > 0) { - return getEnum(activeProfiles[0]); - } - } catch (Exception e) { - e.printStackTrace(); - } - return KongCunCustomerEnvEnum.UN_KNOWN; - } - - - public String getCode() { - return code; - } - - public String getName() { - return name; - } - - public String getCustomerId(){ - return customerId; - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java index 3462ad772b..97087745d0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java @@ -1,7 +1,9 @@ package com.epmet.commons.tools.enums; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import org.apache.commons.lang3.StringUtils; /** * 组织级别枚举类 @@ -42,6 +44,37 @@ public enum OrgLevelEnum { throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode()); } + /** + * desc: 获取下一等级的组织级别 + * + * @param parentAgencyLevel + * @return java.lang.String + * @author LiuJanJun + * @date 2021/8/5 1:57 下午 + * todo 加上数字 根据数据返回 + */ + public static String getSubOrgLevel(String parentAgencyLevel) { + String level = StrConstant.EPMETY_STR; + if (StringUtils.isBlank(parentAgencyLevel)) { + return level; + } + OrgLevelEnum anEnum = OrgLevelEnum.getEnum(parentAgencyLevel); + switch (anEnum){ + case PROVINCE: + return OrgLevelEnum.CITY.getCode(); + case CITY: + return OrgLevelEnum.DISTRICT.getCode(); + case DISTRICT: + return OrgLevelEnum.STREET.getCode(); + case STREET: + return OrgLevelEnum.COMMUNITY.getCode(); + case COMMUNITY: + return OrgLevelEnum.GRID.getCode(); + default: + return level; + } + } + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java new file mode 100644 index 0000000000..2f70659219 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.utils; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 树节点,所有需要实现树节点的,都需要继承该类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class TreeAreaCodeNode extends TreeStringNode implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private String areaCode; + /** + * 上级ID + */ + private String parentAreaCode; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java index 4272d9cfc6..c321fea717 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java @@ -131,4 +131,32 @@ public class TreeUtils { return result; } + /** + * 构建树节点 + */ + public static List buildTreeByAreaCode(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(T treeNode : treeNodes){ + nodeMap.put(treeNode.getAreaCode(), treeNode); + } + + for(T node : nodeMap.values()) { + T parent = nodeMap.get(node.getParentAreaCode()); + if(parent != null && !(node.getAreaCode().equals(parent.getAreaCode()))){ + if (parent.getChildren() == null){ + parent.setChildren(new ArrayList()); + } + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java new file mode 100644 index 0000000000..0eae55ef84 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form.govOrg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 各机关注册用户数入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:47 + */ +@Data +public class OrgTreeFormDTO implements Serializable { + + + private static final long serialVersionUID = 6649155066499141632L; + + private String mobile; + + private String customerId; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 6c71a15009..5adfa369d4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.dto.OrgTreeNode; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.govOrg.OrgTreeFormDTO; import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; @@ -129,4 +131,17 @@ public class AgencyController { ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class); return new Result().ok(agencyService.queryAgencyDetailMultiC(formDTO)); } + + /** + * desc: 获取组织树 含所有直线上级 但不含部门和网格 目前 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/8/3 5:17 下午 + */ + @PostMapping("getStaffAgencyTree") + public Result getStaffAgencyTree(@RequestBody OrgTreeFormDTO formDTO) { + return new Result().ok(agencyService.getStaffAgencyTree(formDTO)); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 04c509de8b..051a6ec3e6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -114,7 +114,7 @@ public interface ScreenCustomerAgencyDao { CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId); /** - * @Description 查询组织的下级组织ID + * @Description 查询组织的下级组织ID * @Param agencyId * @author zxc * @date 2020/10/28 10:33 上午 @@ -134,7 +134,7 @@ public interface ScreenCustomerAgencyDao { * @description 根据areaCode查询组织机构 * @Date 2021/2/4 21:51 **/ - List queryStaffAgencyTree(@Param("areaCode")String areaCode); + List queryStaffAgencyTree(@Param("areaCode") String areaCode); /** * @param areaCode @@ -143,7 +143,7 @@ public interface ScreenCustomerAgencyDao { * @description 查找组织下的部门 * @Date 2021/2/4 21:51 **/ - List selectDeptList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List selectDeptList(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); /** * @param areaCode @@ -152,27 +152,27 @@ public interface ScreenCustomerAgencyDao { * @description 查找组织下的网格 * @Date 2021/2/4 21:52 **/ - List selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List selectGridList(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); /** - * @return java.util.List * @param areaCode * @param agencyId + * @return java.util.List * @author yinzuomei * @description 下一级组织+直属网格 * @Date 2021/5/10 14:02 **/ - List getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); + List getNextAgencyIds(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); - List selectSubAgencyIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId); + List selectSubAgencyIds(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); /** - * @Description 根据agencyId查询网格 + * @Description 根据agencyId查询网格 * @Param agencyId * @author zxc * @date 2021/6/8 1:27 下午 */ - List selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode); + List selectGrid(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode); /** * 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询 @@ -190,13 +190,13 @@ public interface ScreenCustomerAgencyDao { * @param parentAgencyId * @return java.util.List */ - List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allCustomerIds") List allCustomerIds); + List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId, @Param("allCustomerIds") List allCustomerIds); - List selectPAgencyById(@Param("listStr")List pidList); + List selectPAgencyById(@Param("listStr") List pidList); /** - * @return com.epmet.dto.result.ScreenCustomerAgencyDTO * @param customerId + * @return com.epmet.dto.result.ScreenCustomerAgencyDTO * @author yinzuomei * @description 根据客户id,返回当前客户下的跟组织信息 * @Date 2021/6/24 17:43 @@ -204,4 +204,15 @@ public interface ScreenCustomerAgencyDao { ScreenCustomerAgencyDTO selectCustomerRootAgency(String customerId); ScreenCustomerAgencyDTO selectByAreaCode(String areaCode); -} \ No newline at end of file + + /** + * desc: 根据pids 或者 areaCode 获取所有下级组织 + * + * @param pids + * @param areaCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/8/5 11:01 上午 + */ + List selectAllSubAgencyList(@Param("pids") String pids, @Param("areaCode") String areaCode); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index aa142bed95..c95977c5bd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,10 +1,12 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.dto.AgencyInfoDTO; +import com.epmet.dto.OrgTreeNode; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.govOrg.OrgTreeFormDTO; import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.ScreenCustomerAgencyDTO; @@ -104,4 +106,14 @@ public interface AgencyService { * @return com.epmet.dto.result.AgencyDetailMulticResultDTO */ AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO); + + /** + * desc: 获取工作人员组织树 含所有直线上级组织 不含网格及部门 + * + * @param mobile + * @return com.epmet.dto.result.plugins.AgencyNodeDTO + * @author LiuJanJun + * @date 2021/8/3 5:03 下午 + */ + OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO mobile); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index c6dc8deba2..42e97e5b29 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -2,23 +2,26 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.AgencyTreeUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.TreeUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.datareport.redis.DataReportRedis; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; -import com.epmet.dto.AgencyInfoDTO; -import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.*; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.govOrg.OrgTreeFormDTO; import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.ParentListResultDTO; @@ -33,6 +36,7 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import lombok.extern.slf4j.Slf4j; @@ -70,6 +74,8 @@ public class AgencyServiceImpl implements AgencyService { private OperCrmOpenFeignClient operCrmOpenFeignClient; @Autowired private DataReportRedis dataReportRedis; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; /** * @Description 1、组织机构树 @@ -438,7 +444,7 @@ public class AgencyServiceImpl implements AgencyService { log.info("多客户版本parentList、level要重新赋值;agencysResultDTO.getParentAreaCode()="+agencysResultDTO.getParentAreaCode()); ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); if (null != parentAgency) { - agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); + agencysResultDTO.setLevel(OrgLevelEnum.getSubOrgLevel(parentAgency.getLevel())); List temp = getParentListMultic(parentList, parentAgency, formDTO.getCustomerId(), agencysResultDTO.getRootAgencyId()); agencysResultDTO.setParentList(temp); } @@ -468,6 +474,85 @@ public class AgencyServiceImpl implements AgencyService { return agencysResultDTO; } + @Override + public OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO formDTO) { + //todo 获取客户的所有组织 然后遍历剔除 再构建出一颗树 咋样 + //获取工作人员信息 + CustomerStaffFormDTO staffParam = new CustomerStaffFormDTO(); + staffParam.setMobile(formDTO.getMobile()); + staffParam.setCustomerId(formDTO.getCustomerId()); + Result staffInfoResult = userOpenFeignClient.getCustomerStaffInfo(staffParam); + if (!staffInfoResult.success()){ + throw new RenException(staffInfoResult.getCode(),staffInfoResult.getInternalMsg()); + } + //获取工作人员组织信息 + Result agencyByStaff = govOrgOpenFeignClient.getAgencyByStaff(staffInfoResult.getData().getUserId()); + if (!agencyByStaff.success() || agencyByStaff.getData()== null || StringUtils.isBlank(agencyByStaff.getData().getId()) ){ + throw new RenException(staffInfoResult.getCode(),staffInfoResult.getMsg()); + } + CustomerAgencyDTO staffAgencyDTO = agencyByStaff.getData(); + + + //4、如果当前客户不存在子客户则areaCode置为空 + Result> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + if (!crmRes.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + List nodes = new ArrayList<>(); + //单客户 + if (CollectionUtils.isEmpty(crmRes.getData())){ + //todo 暂不处理 有时间再说 + }else { + ScreenCustomerAgencyDTO parentAgencyDTO = null; + String subAgencyAreaCode = staffAgencyDTO.getParentAreaCode(); + List nodeList = new ArrayList<>(); + + /*ScreenCustomerAgencyDTO currentAgency = new ScreenCustomerAgencyDTO(); + currentAgency.setCustomerId(staffAgencyDTO.getCustomerId()); + currentAgency.setAgencyId(staffAgencyDTO.getId()); + currentAgency.setAgencyName(staffAgencyDTO.getOrganizationName()); + currentAgency.setLevel(staffAgencyDTO.getLevel()); + currentAgency.setAreaCode(staffAgencyDTO.getAreaCode()); + currentAgency.setParentAreaCode(staffAgencyDTO.getParentAreaCode()); + currentAgency.setPid(staffAgencyDTO.getPid()); + currentAgency.setPids(staffAgencyDTO.getPids()); + + convertOrgTreeNode(nodeList, currentAgency);*/ + //多客户 获取所有直线上级 + do { + parentAgencyDTO = screenCustomerAgencyDao.selectByAreaCode(subAgencyAreaCode); + if (parentAgencyDTO == null){ + break; + } + convertOrgTreeNode(nodeList, parentAgencyDTO); + if (parentAgencyDTO.getPid() == null || NumConstant.ZERO_STR.equals(parentAgencyDTO.getPid())){ + break; + } + subAgencyAreaCode = parentAgencyDTO.getAreaCode(); + } while (true); + //多客户 获取所有下级 + List agencyNodeDTOS = screenCustomerAgencyDao.selectAllSubAgencyList(null,staffAgencyDTO.getAreaCode()); + //孔村降级处理 + String KONG_CUN_AGENCY_ID = "1234085031077498881"; + agencyNodeDTOS.forEach(e->{ + if (e.getPids().contains(KONG_CUN_AGENCY_ID)){ + e.setLevel(OrgLevelEnum.getSubOrgLevel(e.getLevel())); + } + convertOrgTreeNode(nodeList, e); + }); + nodes = TreeUtils.buildTreeByAreaCode(nodeList); + } + //只有一个根节点的树 所以返回一个 + return nodes.get(0); + } + + private void convertOrgTreeNode(List nodeList, ScreenCustomerAgencyDTO currentAgency) { + OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class); + orgTreeNode.setOrgId(currentAgency.getAgencyId()); + orgTreeNode.setOrgName(currentAgency.getAgencyName()); + nodeList.add(orgTreeNode); + } + private List getParentListMultic(List resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { ParentListResultDTO resultDTO = new ParentListResultDTO(); resultDTO.setId(firstParent.getAgencyId()); @@ -491,20 +576,4 @@ public class AgencyServiceImpl implements AgencyService { } } } - - private String getAgencyLevelMultiC(ScreenCustomerAgencyDTO parentAgency) { - String level=StrConstant.EPMETY_STR; - if(null!=parentAgency){ - if(Constant.PROVINCE.equals(parentAgency.getLevel())){ - return Constant.CITY; - }else if(Constant.CITY.equals(parentAgency.getLevel())){ - return Constant.DISTRICT; - }else if(Constant.DISTRICT.equals(parentAgency.getLevel())){ - return Constant.STREET; - }else if(Constant.STREET.equals(parentAgency.getLevel())){ - return Constant.COMMUNITY; - } - } - return level; - } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 0d940865f0..221f2d2d91 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -433,4 +433,19 @@ AND sca.AREA_CODE = #{areaCode} limit 1 + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index b5d77983b0..7401c62038 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.commons.tools.enums.KongCunCustomerEnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java index 064d2173ea..7cea43566d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java @@ -1,13 +1,18 @@ package com.epmet.dto; +import com.epmet.commons.tools.utils.TreeAreaCodeNode; import lombok.Data; +import java.util.ArrayList; import java.util.List; @Data -public class OrgTreeNode { +public class OrgTreeNode extends TreeAreaCodeNode { + private String id; + private String pid; private String orgId; private String orgName; - private String orgType; - private List subOrgs; + private String level; + + private List children=new ArrayList<>(); }