From 3b34cfb6ff38d1d618a507de49bf7e340d2c308b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 19 Apr 2020 18:02:47 +0800 Subject: [PATCH] =?UTF-8?q?customer=5Fgrid=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/CustomerGridDTO.java | 12 +++++++++++- .../java/com/epmet/entity/CustomerGridEntity.java | 12 +++++++++--- .../main/resources/db/migration/epmet_gov_org.sql | 8 +++++--- .../src/main/resources/mapper/CustomerGridDao.xml | 2 ++ .../epmet/service/impl/GridLatestServiceImpl.java | 1 + .../src/main/resources/db/migration/epmet_user.sql | 4 +++- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java index 8905df8cf0..a3c62138e1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -103,4 +104,13 @@ public class CustomerGridDTO implements Serializable { */ private Integer totalUser; + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java index 0c6b381ff3..26d0cd84af 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 客户网格表 * @@ -73,4 +70,13 @@ public class CustomerGridEntity extends BaseEpmetEntity { */ private Integer totalUser; + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql index 17c0b21678..c53d7724f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql @@ -94,13 +94,15 @@ drop table IF EXISTS pdman_db_version; -- ----------------------------------------------------------------------- -- ----------------------------------------------------------------------- -ALTER TABLE customer_grid MODIFY COLUMN CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID'; +alter table customer_grid MODIFY column PID VARCHAR(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)'; +alter table customer_grid MODIFY column PIDS VARCHAR(1024) NOT NULL COMMENT '所有上级组织ID'; +ALTER TABLE customer_grid MODIFY COLUMN CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID'; ALTER TABLE customer_grid MODIFY COLUMN LONGITUDE VARCHAR(32) DEFAULT NULL COMMENT '中心位置经度'; ALTER TABLE customer_grid MODIFY COLUMN LATITUDE VARCHAR(32) DEFAULT NULL COMMENT '中心位置纬度'; ALTER TABLE customer_grid MODIFY COLUMN AREA_CODE VARCHAR(32) DEFAULT NULL COMMENT '所属地区码(所属组织地区码)'; alter table customer_grid drop column GRID_CODE; -alter table customer_grid drop column PID; -alter table customer_grid drop column PIDS; alter table customer_grid drop column SORT; + +alter table customer_grid add column ORG_ID varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)'; alter table customer_grid add column MANAGE_DISTRICT varchar(255) DEFAULT "" NOT NULL COMMENT '管辖区域'; alter table customer_grid add column TOTAL_USER INT(11) DEFAULT 0 NOT NULL COMMENT '当前网格总人数'; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index f5e057f2f1..7c35a3e1c5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -8,6 +8,8 @@ gr.id, gr.customer_id, gr.grid_name, + gr.pid, + gr.pids, gr.longitude, gr.latitude, gr.area_code diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java index 5800b457ab..345c06e670 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java @@ -122,6 +122,7 @@ public class GridLatestServiceImpl extends BaseServiceImpl