+ * 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.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 客户关系表(01.14 add)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-02-03
+ */
+@Data
+public class CustomerRelationFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+}
\ No newline at end of file
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 c6fc44b140..cda0889b35 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
@@ -133,4 +133,16 @@ public interface OperCrmOpenFeignClient {
**/
@GetMapping("/oper/crm/customer/getexternalandparentcustomerid/{customerId}")
Result getExternalAndParentCustomerId(@PathVariable("customerId") String customerId);
+
+ /**
+ * 获取子客户
+ *
+ * @param customerId
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author zhy
+ * @date 2022/7/8 13:41
+ */
+ @GetMapping("/oper/crm/customerRelation/subcustomer/{customerId}")
+ Result> getSubCustomer(@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 8366657fa8..380ed077fa 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
@@ -99,4 +99,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient {
public Result getExternalAndParentCustomerId(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getExternalAndParentCustomerId", customerId);
}
+
+ @Override
+ public Result> getSubCustomer(String customerId) {
+ return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getSubCustomer", customerId);
+ }
}
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerRelationController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerRelationController.java
index 00e235b0b3..e6a4bc2f25 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerRelationController.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerRelationController.java
@@ -13,6 +13,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerRelationDTO;
import com.epmet.dto.result.CustomerRelationTreeDTO;
import com.epmet.service.CustomerRelationService;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -83,4 +84,21 @@ public class CustomerRelationController {
public Result> customerTree(@LoginUser TokenDto tokenDto) {
return new Result>().ok(customerRelationService.getCustomerTree(tokenDto));
}
+
+ /**
+ * 获取子客户
+ *
+ * @param customerId
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author zhy
+ * @date 2022/7/8 13:41
+ */
+ @GetMapping("subcustomer/{customerId}")
+ public Result> getSubCustomer(@PathVariable("customerId") String customerId) {
+ if(StringUtils.isNotBlank(customerId)){
+ List result = customerRelationService.getSubCustomer(customerId);
+ return new Result>().ok(result);
+ }
+ return new Result<>();
+ }
}
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.java
index b935ef5b08..ee8e6255ce 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.java
@@ -71,4 +71,14 @@ public interface CustomerRelationDao extends BaseDao {
*/
List selectSubCustomerByPid(@Param("customerPid") String customerPid);
+ /**
+ * 获取子客户
+ *
+ * @param customerId
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author zhy
+ * @date 2022/7/8 13:41
+ */
+ List getSubCustomer(@Param("customerId") String customerId);
+
}
\ No newline at end of file
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java
index 6dfaa6c86f..05ee703d22 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java
@@ -144,4 +144,6 @@ public interface CustomerRelationService extends BaseService getCustomerTree(TokenDto tokenDto);
+ List getSubCustomer(String customerId);
+
}
\ No newline at end of file
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java
index d9ef04903d..415a6c831a 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java
@@ -198,6 +198,11 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl getSubCustomer(String customerId) {
+ return baseDao.getSubCustomer(customerId);
+ }
+
/**
* 处理子客户
*
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml
index 9c49c97b54..525e388cf4 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml
@@ -54,4 +54,15 @@
AND cr.PARENT_CUSTOMER_ID = #{customerPid}
+
+
\ No newline at end of file