From 4ac78d99dcf95a06e8471a36d983003e6d643e47 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Feb 2021 14:46:04 +0800 Subject: [PATCH] =?UTF-8?q?customer=5Frelation=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=94=BE=E5=88=B0crm=E6=9C=8D=E5=8A=A1=20=E6=96=B0=E5=A2=9Epid?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java | 2 +- .../main/java/com/epmet/dao/crm/CustomerRelationDao.java | 2 +- .../java/com/epmet/entity/crm/CustomerRelationEntity.java | 5 +++++ .../com/epmet/service/crm/CustomerRelationService.java | 2 +- .../service/crm/impl/CustomerRelationServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateServiceImpl.java | 4 ++-- .../V0.0.6__alter_dimcustomer_add_areaCode_col.sql | 3 +++ .../src/main/resources/mapper/crm/CustomerRelationDao.xml | 2 +- .../src/main/java/com/epmet/dto/CustomerRelationDTO.java | 8 +++++++- .../java/com/epmet/entity/CustomerRelationEntity.java | 5 +++++ .../db/migration/V0.0.7__create_customer_relation.sql} | 6 +----- 11 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql rename epmet-module/{data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql => oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.7__create_customer_relation.sql} (77%) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java index 95d7189f6d..0e9f0c961e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java @@ -6,7 +6,7 @@ import java.io.Serializable; import java.util.List; /** - * 描述一下 + * 查询当前客户的area_code信息、以及下一级客户列表 * * @author yinzuomei@elink-cn.com * @date 2021/1/14 16:17 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java index 8876498774..d79e843076 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java @@ -37,7 +37,7 @@ public interface CustomerRelationDao extends BaseDao { /** * @param customerIds * @author yinzuomei - * @description 查询当前客户的area_code信息、以及子客户列表 + * @description 查询当前客户的area_code信息、以及下一级客户列表 * @Date 2021/1/21 11:27 **/ List selectCustomerSubInfo(@Param("list") List customerIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java index 786cbe96f5..9de6f223d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java @@ -45,6 +45,11 @@ public class CustomerRelationEntity extends BaseEpmetEntity { */ private String parentCustomerId; + /** + * 当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0 + */ + private String pids; + /** * 当前客户类型取值: external:外部客户,internal:内部客户 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java index 6b7cec2291..25e3272436 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java @@ -37,7 +37,7 @@ public interface CustomerRelationService extends BaseService * @param customerIds * @author yinzuomei - * @description 查询每个客户的area_code以及子客户列表 + * @description 查询每个客户的area_code、以及下一级客户列表 * @Date 2021/1/14 16:22 **/ Map getCustomerInfoMap(List customerIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java index 7b6b5ea570..9b6c4ab7f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java @@ -47,7 +47,7 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl * @author yinzuomei - * @description 查询每个客户的area_code以及子客户列表 + * @description 查询每个客户的area_code、以及下一级客户列表 * @Date 2021/1/14 16:22 **/ @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 761cc75ff4..82142afec4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -76,7 +76,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { customerIds.add(formDTO.getCustomerId()); } - //查询客户编码、子客户信息 add01.14 + //查询客户编码、以及下一级客户列表 add01.14 Map customerInfoMap=this.getCustomerInfoMap(customerIds); Boolean flag = false; @@ -196,7 +196,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { /** * @param customerIds * @author yinzuomei - * @description 查询当前客户的area_code信息、以及子客户列表 + * @description 查询当前客户的area_code信息、以及下一级客户列表 * @Date 2021/1/21 11:28 **/ private Map getCustomerInfoMap(List customerIds) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql new file mode 100644 index 0000000000..e4ab88b03d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql @@ -0,0 +1,3 @@ +-- 一、epmet_data_statistical 库sql脚本: +-- 1、客户维度表新增 area_code列 +alter table dim_customer add COLUMN AREA_CODE varchar(12) default '' comment '客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add)'after CUSTOMER_NAME; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml index a942ca5995..b6d60ae9a4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml @@ -10,7 +10,7 @@ - +