From c1c20ea005692f6dbba104da33371dbec590084c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 14 Jan 2021 14:12:31 +0800 Subject: [PATCH] =?UTF-8?q?dim=5Fcustomer=E5=A2=9E=E5=8A=A0=E5=88=97area?= =?UTF-8?q?=5Fcode=E3=80=81screen=5Fcustomer=5Fagency/dept/grid=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=97up=5Fto=5Fcal=E3=80=81=E6=96=B0=E5=A2=9Ecusto?= =?UTF-8?q?mer=5Frelation=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcal/CalculateCommonFormDTO.java | 12 ++++++++++++ .../com/epmet/dto/stats/DimCustomerDTO.java | 7 ++++++- .../epmet/entity/stats/DimCustomerEntity.java | 3 +++ ...ddCustomerAreaCodeAndCustomerRelationTb.sql | 18 ++++++++++++++++++ .../V0.0.7__update_agencytb_adduptocal.sql | 4 ++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index cfdc9f2ec9..f27057a9d4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * 指标计算通用入参DTO @@ -29,6 +30,17 @@ public class CalculateCommonFormDTO implements Serializable { @NotBlank(message = "客户id不能为空", groups = { CancelCalculateGroup.class }) private String customerId; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds; + public CalculateCommonFormDTO() { super(); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java index 86aff5d046..d9de52d3e7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto.stats; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -73,4 +74,8 @@ public class DimCustomerDTO implements Serializable { */ private Date updatedTime; + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java index 6641ecd2dc..ef839eca62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java @@ -43,6 +43,9 @@ public class DimCustomerEntity extends BaseEpmetEntity { */ private String customerName; + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql new file mode 100644 index 0000000000..6908d87f5e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql @@ -0,0 +1,18 @@ +-- epmet_data_statistical 库sql脚本: +alter table dim_customer add COLUMN AREA_CODE varchar(12) default '' comment '客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add)'after CUSTOMER_NAME; + +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', + `CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '当前客户类型取值: external:外部客户,internal:内部客户', + `PARENT_CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '父级客户类型取值: external:外部客户,internal:内部客户', + `STATUS` varchar(10) NOT NULL DEFAULT 'open' COMMENT 'open,closed是否启用', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识0未删除1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户关系表(01.14 add)'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql new file mode 100644 index 0000000000..17e4f2b0c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql @@ -0,0 +1,4 @@ +-- epmet_evaluation_index +alter table screen_customer_grid add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与'; +alter table screen_customer_dept add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与'; +alter table screen_customer_agency add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与'; \ No newline at end of file