Browse Source

customer_relation 脚本放到crm服务 新增pids

dev
yinzuomei 5 years ago
parent
commit
4ac78d99dc
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java
  3. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java
  6. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  7. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml
  9. 8
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerRelationDTO.java
  10. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerRelationEntity.java
  11. 6
      epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.7__create_customer_relation.sql

2
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

2
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<CustomerRelationEntity> {
/**
* @param customerIds
* @author yinzuomei
* @description 查询当前客户的area_code信息以及客户列表
* @description 查询当前客户的area_code信息以及下一级客户列表
* @Date 2021/1/21 11:27
**/
List<CustomerSubInfoDTO> selectCustomerSubInfo(@Param("list") List<String> customerIds);

5
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:内部客户
*/

2
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<CustomerRelationEnt
* @return java.util.Map<java.lang.String,com.epmet.dto.indexcal.CustomerSubInfoDTO>
* @param customerIds
* @author yinzuomei
* @description 查询每个客户的area_code以及子客户列表
* @description 查询每个客户的area_code以及下一级客户列表
* @Date 2021/1/14 16:22
**/
Map<String, CustomerSubInfoDTO> getCustomerInfoMap(List<String> customerIds);

2
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<CustomerRelatio
* @param customerIds
* @return java.util.Map<java.lang.String, com.epmet.dto.indexcal.CustomerSubInfoDTO>
* @author yinzuomei
* @description 查询每个客户的area_code以及子客户列表
* @description 查询每个客户的area_code以及下一级客户列表
* @Date 2021/1/14 16:22
**/
@Override

4
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<String, CustomerSubInfoDTO> 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<String, CustomerSubInfoDTO> getCustomerInfoMap(List<String> customerIds) {

3
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;

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml

@ -10,7 +10,7 @@
<result column="subCustomerId"/>
</collection>
</resultMap>
<!-- 查询当前客户的area_code信息、以及客户列表 -->
<!-- 查询当前客户的area_code信息、以及下一级客户列表 -->
<select id="selectCustomerSubInfo" parameterType="map" resultMap="CustomerSubInfoDTOResMap">
SELECT
CR.PARENT_CUSTOMER_ID AS customerId,

8
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerRelationDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -48,6 +49,11 @@ public class CustomerRelationDTO implements Serializable {
*/
private String parentCustomerId;
/**
* 当前客户的所有父级客户id,以英文冒号隔开如果是顶级客户此列=0
*/
private String pids;
/**
* 当前客户类型取值 external:外部客户internal:内部客户
*/

5
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerRelationEntity.java

@ -45,6 +45,11 @@ public class CustomerRelationEntity extends BaseEpmetEntity {
*/
private String parentCustomerId;
/**
* 当前客户的所有父级客户id,以英文冒号隔开如果是顶级客户此列=0
*/
private String pids;
/**
* 当前客户类型取值 external:外部客户internal:内部客户
*/

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql → epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.7__create_customer_relation.sql

@ -1,12 +1,8 @@
-- 一、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;
-- 二、epmet_oper_crm库sql脚本: oper_crm库新增客户关系表
-- 2、新增客户关系表
CREATE TABLE `customer_relation` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`PARENT_CUSTOMER_ID` varchar(64) NOT NULL COMMENT '父级客户id;如果是顶级客户,此列=0',
`PIDS` varchar(255) NOT NULL COMMENT '当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0',
`CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '当前客户类型取值: external:外部客户,internal:内部客户',
`PARENT_CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0',
`STATUS` varchar(10) NOT NULL DEFAULT 'open' COMMENT 'open,closed是否启用',
Loading…
Cancel
Save