From c548c5b4defc63a15094b870e6d0ab24e5388b72 Mon Sep 17 00:00:00 2001
From: zhangyongzhangyong <2012005003@qq.coom>
Date: Mon, 22 Mar 2021 15:45:26 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=8A002=E3=80=81=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=88=86=E7=B1=BB=E5=AD=97=E5=85=B8=E6=9F=A5=E8=AF=A2=E3=80=8B?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../project/dto/CustomerCategoryDTO.java | 43 +++++++++++++++
.../result/ProjectCategoryDictResultDTO.java | 41 ++++++++++++++
.../data-report/data-report-server/pom.xml | 6 +++
.../controller/project/ProjectController.java | 14 +++++
.../service/project/ProjectService.java | 10 ++++
.../project/impl/ProjectServiceImpl.java | 54 +++++++++++++++++--
.../gov-issue/gov-issue-client/pom.xml | 8 ++-
.../epmet/feign/GovIssueOpenFeignClient.java | 16 ++++--
.../GovIssueOpenFeignClientFallBack.java | 10 ++--
.../gov-issue/gov-issue-server/pom.xml | 8 ++-
.../IssueProjectCategoryDictController.java | 19 ++++++-
.../dao/IssueProjectCategoryDictDao.java | 16 +++++-
.../IssueProjectCategoryDictService.java | 16 +++++-
.../IssueProjectCategoryDictServiceImpl.java | 7 ++-
.../mapper/IssueProjectCategoryDictDao.xml | 19 ++++++-
.../epmet/feign/OperCrmOpenFeignClient.java | 11 ++++
.../OperCrmOpenFeignClientFallback.java | 5 ++
.../epmet/controller/CustomerController.java | 17 ++++++
.../main/java/com/epmet/dao/CustomerDao.java | 11 +++-
.../com/epmet/service/CustomerService.java | 10 ++++
.../service/impl/CustomerServiceImpl.java | 4 ++
.../src/main/resources/mapper/CustomerDao.xml | 10 ++++
22 files changed, 336 insertions(+), 19 deletions(-)
create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java
create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java
new file mode 100644
index 0000000000..d351ae7346
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.project.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class CustomerCategoryDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 父id
+ * pid = 0 查询一级分类
+ * pid != 0 查询二级分类
+ */
+ private String pid;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java
new file mode 100644
index 0000000000..ca534db2a9
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java
@@ -0,0 +1,41 @@
+package com.epmet.project.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author zhangyong
+ * @Description 002、项目分类字典查询
+ **/
+@Data
+public class ProjectCategoryDictResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 8529179932504931368L;
+
+ /**
+ * 一级分类编码
+ */
+ private String categoryCode;
+
+ /**
+ * 一级分类名称
+ */
+ private String categoryName;
+
+ /**
+ * 二级分类列表
+ */
+ private List children;
+
+ /**
+ * 主键
+ **/
+ private String id;
+
+ /**
+ * 上级分类ID 顶级此列存储0
+ **/
+ private String pid;
+}
diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml
index 8cb39e2c6b..4480ac88e7 100644
--- a/epmet-module/data-report/data-report-server/pom.xml
+++ b/epmet-module/data-report/data-report-server/pom.xml
@@ -94,6 +94,12 @@
2.0.0
compile
+
+ com.epmet
+ gov-issue-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
index ed31aef27a..2bb49d5c25 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
@@ -129,4 +129,18 @@ public class ProjectController {
public Result> myNextAgency(@LoginUser TokenDto tokenDto){
return new Result>().ok(projectService.getMyNextAgency(tokenDto));
}
+
+ /**
+ * 002、项目分类字典查询
+ * 查询当前客户的父客户下,项目分类字典
+ *
+ * @param tokenDto
+ * @return com.epmet.commons.tools.utils.Result>
+ * @Author zhangyong
+ * @Date 10:41 2021-03-22
+ **/
+ @PostMapping("categorydict")
+ public Result> categoryDict(@LoginUser TokenDto tokenDto) {
+ return new Result>().ok(projectService.getCategoryDict(tokenDto));
+ }
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
index 18246addc6..bb2ffedd9c 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
@@ -70,4 +70,14 @@ public interface ProjectService {
* @date 2020.10.19 16:38
**/
List getMyNextAgency(TokenDto tokenDto);
+
+ /**
+ * 002、项目分类字典查询
+ *
+ * @param tokenDto
+ * @return java.util.List
+ * @Author zhangyong
+ * @Date 14:26 2021-03-22
+ **/
+ List getCategoryDict(TokenDto tokenDto);
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
index f095fb0666..4da82573c9 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
@@ -3,6 +3,7 @@ package com.epmet.datareport.service.project.impl;
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.ServiceConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@@ -18,20 +19,21 @@ import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.SubAgencyFormDTO;
import com.epmet.dto.result.*;
import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO;
-import com.epmet.feign.EpmetUserOpenFeignClient;
-import com.epmet.feign.GovOrgOpenFeignClient;
-import com.epmet.feign.GovProjectOpenFeignClient;
+import com.epmet.feign.*;
import com.epmet.project.constant.ProjectConstant;
+import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
-import com.epmet.project.dto.result.ProjectDetailResultDTO;
import com.epmet.project.dto.result.*;
+import com.epmet.project.dto.result.ProjectDetailResultDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -50,7 +52,7 @@ import java.util.List;
@Slf4j
@Service
public class ProjectServiceImpl implements ProjectService {
-
+ private Logger logger = LogManager.getLogger(getClass());
@Autowired
private ProjectDao projectDao;
@Autowired
@@ -64,6 +66,11 @@ public class ProjectServiceImpl implements ProjectService {
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
+ @Autowired
+ private GovIssueOpenFeignClient govIssueOpenFeignClient;
+ @Autowired
+ private OperCrmOpenFeignClient operCrmOpenFeignClient;
+
/**
* @Author sun
* @Description 数据-项目-获取汇总数据
@@ -350,4 +357,41 @@ public class ProjectServiceImpl implements ProjectService {
return result;
}
+ @Override
+ public List getCategoryDict(TokenDto tokenDto) {
+ List result = new ArrayList<>();
+ Result parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(tokenDto.getCustomerId());
+ if (!parentCustomerId.success() && null == parentCustomerId.getData()) {
+ logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER,
+ JSON.toJSONString(tokenDto.getCustomerId())));
+ return result;
+ }
+ CustomerCategoryDTO argDto = new CustomerCategoryDTO();
+ argDto.setCustomerId(parentCustomerId.getData());
+ argDto.setPid(NumConstant.ZERO_STR);
+ // 获取客户一级分类
+ Result> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto);
+ if (!parentCategoryDict.success()) {
+ logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER,
+ JSON.toJSONString(tokenDto.getCustomerId())));
+ } else {
+ result = parentCategoryDict.getData();
+ // 获取客户二级分类
+ argDto.setPid(NumConstant.TWO_STR);
+ Result> childrenCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto);
+ for (ProjectCategoryDictResultDTO p : result) {
+ List children = new ArrayList<>();
+ for (ProjectCategoryDictResultDTO c : childrenCategoryDict.getData()) {
+ if (p.getId().equals(c.getPid())) {
+ ProjectCategoryDictResultDTO dto = new ProjectCategoryDictResultDTO();
+ dto.setCategoryCode(c.getCategoryCode());
+ dto.setCategoryName(c.getCategoryName());
+ children.add(dto);
+ }
+ }
+ p.setChildren(children);
+ }
+ }
+ return result;
+ }
}
diff --git a/epmet-module/gov-issue/gov-issue-client/pom.xml b/epmet-module/gov-issue/gov-issue-client/pom.xml
index f77ec89656..9d07717da1 100644
--- a/epmet-module/gov-issue/gov-issue-client/pom.xml
+++ b/epmet-module/gov-issue/gov-issue-client/pom.xml
@@ -29,5 +29,11 @@
2.0.0
compile
+
+ com.epmet
+ data-report-client
+ 2.0.0
+ compile
+
-
\ No newline at end of file
+
diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
index 38bc581f8c..277239669d 100644
--- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
+++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
@@ -2,13 +2,12 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
-import com.epmet.dto.IssueApplicationDTO;
-import com.epmet.dto.IssueDTO;
-import com.epmet.dto.IssueSuggestionDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack;
+import com.epmet.project.dto.CustomerCategoryDTO;
+import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.resi.group.dto.group.form.AllIssueFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO;
@@ -272,4 +271,15 @@ public interface GovIssueOpenFeignClient {
@PostMapping("/gov/issue/issue/detail")
Result queryIssueDetail(@RequestBody IssueDetailFormDTO formDTO);
+
+ /**
+ * 获取客户 分类字典 信息
+ *
+ * @param dto
+ * @return com.epmet.commons.tools.utils.Result>
+ * @Author zhangyong
+ * @Date 14:10 2021-03-22
+ **/
+ @PostMapping(value = "/gov/issue/issueprojectcategorydict/getcustomercategorydict")
+ Result> getCustomerCategoryDict(@RequestBody CustomerCategoryDTO dto);
}
diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
index 0046975f18..a304db1fa7 100644
--- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
+++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
@@ -3,13 +3,12 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
-import com.epmet.dto.IssueApplicationDTO;
-import com.epmet.dto.IssueDTO;
-import com.epmet.dto.IssueSuggestionDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.GovIssueOpenFeignClient;
+import com.epmet.project.dto.CustomerCategoryDTO;
+import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.resi.group.dto.group.form.AllIssueFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO;
@@ -237,4 +236,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result queryIssueDetail(IssueDetailFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "detail", formDTO);
}
+
+ @Override
+ public Result> getCustomerCategoryDict(CustomerCategoryDTO customerCategoryDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCustomerCategoryDict", customerCategoryDTO);
+ }
}
diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml
index 68e7b17d5b..673a33aeb9 100644
--- a/epmet-module/gov-issue/gov-issue-server/pom.xml
+++ b/epmet-module/gov-issue/gov-issue-server/pom.xml
@@ -96,6 +96,12 @@
2.0.0
compile
+
+ com.epmet
+ data-report-client
+ 2.0.0
+ compile
+
@@ -270,4 +276,4 @@
-
\ No newline at end of file
+
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
index b0d5a7fd1f..cbd7c63190 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
@@ -34,6 +34,8 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.excel.IssueProjectCategoryDictExcel;
+import com.epmet.project.dto.CustomerCategoryDTO;
+import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.service.IssueProjectCategoryDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -166,4 +168,19 @@ public class IssueProjectCategoryDictController {
return new Result().ok(issueProjectCategoryDictService.delCategory(formDTO));
}
-}
\ No newline at end of file
+ /**
+ * 获取客户 分类字典 信息
+ *
+ * @param dto
+ * pid = 0 查询一级分类
+ * pid != 0 查询二级分类
+ * @return com.epmet.commons.tools.utils.Result>
+ * @Author zhangyong
+ * @Date 14:10 2021-03-22
+ **/
+ @PostMapping("getcustomercategorydict")
+ public Result> getCustomerCategoryDict(@RequestBody CustomerCategoryDTO dto){
+ return new Result>().ok(issueProjectCategoryDictService.listCategoryDict(dto.getCustomerId(),
+ dto.getPid()));
+ }
+}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
index 770c10cb99..1524bc1fc0 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
@@ -22,6 +22,7 @@ import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.IssueProjectCategoryDictListFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
+import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -73,4 +74,17 @@ public interface IssueProjectCategoryDictDao extends BaseDao
+ * @Author zhangyong
+ * @Date 14:10 2021-03-22
+ **/
+ List selectListCategoryDict(@Param("customerId") String customerId, @Param("pid") String pid);
+}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
index 9de4150e08..24e824ffff 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
@@ -26,6 +26,7 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
+import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import java.util.List;
import java.util.Map;
@@ -142,4 +143,17 @@ public interface IssueProjectCategoryDictService extends BaseService
+ * @Author zhangyong
+ * @Date 14:10 2021-03-22
+ **/
+ List listCategoryDict(String customerId, String pid);
+}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
index c77651b103..c154a5f7e2 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
@@ -38,6 +38,7 @@ import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.dto.result.ProjectIssueDTOResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.entity.IssueProjectTagDictEntity;
+import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.redis.IssueProjectCategoryDictRedis;
import com.epmet.service.IssueProjectCategoryDictService;
import com.epmet.service.IssueProjectTagDictService;
@@ -221,4 +222,8 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl listCategoryDict(String customerId, String pid) {
+ return baseDao.selectListCategoryDict(customerId, pid);
+ }
+}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
index 096d54422a..5054069566 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
@@ -96,4 +96,21 @@
LIMIT 1
-
\ No newline at end of file
+
+
+ SELECT
+ CATEGORY_CODE categoryCode,
+ CATEGORY_NAME categoryName,
+ PID,
+ ID
+ FROM issue_project_category_dict d
+ WHERE d.CUSTOMER_ID = #{customerId}
+ AND d.DEL_FLAG ='0' AND d.IS_DISABLE = 'enable'
+
+ AND d.PID = '0'
+
+
+ AND d.PID != '0'
+
+
+
diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
index 0f4313dfad..04508ac6df 100644
--- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
+++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
@@ -122,4 +122,15 @@ public interface OperCrmOpenFeignClient {
**/
@GetMapping("/oper/crm/customer/getallsubcustomerids/{customerId}")
Result> getAllSubCustomerIds(@PathVariable("customerId") String customerId);
+
+ /**
+ * 获取外部客户,的父级 客户id
+ *
+ * @param customerId
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 14:57 2021-03-22
+ **/
+ @GetMapping("/oper/crm/customer/getexternalandparentcustomerid/{customerId}")
+ Result getExternalAndParentCustomerId(@PathVariable("customerId") String customerId);
}
diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
index 5de09ce167..b718517d4b 100644
--- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
+++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
@@ -95,4 +95,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient {
public Result> getAllSubCustomerIds(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllSubCustomerIds", customerId);
}
+
+ @Override
+ public Result getExternalAndParentCustomerId(String customerId) {
+ return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getExternalAndParentCustomerId", customerId);
+ }
}
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
index c5330a9abd..30fe309079 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
@@ -376,4 +376,21 @@ public class CustomerController {
}
return new Result<>();
}
+
+ /**
+ * 获取外部客户,的父级 客户id
+ *
+ * @param customerId
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 14:57 2021-03-22
+ **/
+ @GetMapping("getexternalandparentcustomerid/{customerId}")
+ public Result getExternalAndParentCustomerId(@PathVariable("customerId") String customerId){
+ if(StringUtils.isNotBlank(customerId)){
+ String resultDTO = customerService.getExternalAndParentCustomerId(customerId);
+ return new Result().ok(resultDTO);
+ }
+ return new Result<>();
+ }
}
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
index b7aed8f55a..02ae9d9890 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
@@ -48,7 +48,7 @@ public interface CustomerDao extends BaseDao {
* @param customerIdList
* @Author yinzuomei
* @Description 根据客户id查询客户信息
- * @Date 2020/4/24 9:21
+ * @Date 2020/4/24 9:21
**/
List selectListByIds(@Param("customerIdList") List customerIdList);
@@ -98,4 +98,13 @@ public interface CustomerDao extends BaseDao {
*/
List selectAllCustomerList(@Param("customerName") String customerName);
+ /**
+ * 获取外部客户,的父级 客户id
+ *
+ * @param customerId
+ * @return java.lang.String
+ * @Author zhangyong
+ * @Date 14:57 2021-03-22
+ **/
+ String getExternalAndParentCustomerId(@Param("customerId") String customerId);
}
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
index 82e872e511..f1efa2d087 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
@@ -226,4 +226,14 @@ public interface CustomerService extends BaseService {
* @Date 2021/2/3 12:52
**/
CustomerRelationInfoResultDTO queryCustomerInfoByCustomerId(String customerId);
+
+ /**
+ * 获取外部客户,的父级 客户id
+ *
+ * @param customerId
+ * @return java.lang.String
+ * @Author zhangyong
+ * @Date 14:57 2021-03-22
+ **/
+ String getExternalAndParentCustomerId(String customerId);
}
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
index 1fadbd8443..c2677c0504 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
@@ -785,4 +785,8 @@ public class CustomerServiceImpl extends BaseServiceImpl
+
+
+ SELECT
+ CR.PARENT_CUSTOMER_ID AS rootCustomerId
+ FROM customer_relation cr
+ WHERE cr.DEL_FLAG = '0'
+ AND cr.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
+ AND cr.PARENT_CUSTOMER_ID != '0'
+ AND cr.CUSTOMER_TYPE = 'external'
+