From 90a68c364749dd98fbfcf01cbbf156cd95f95de2 Mon Sep 17 00:00:00 2001 From: mkh Date: Wed, 22 Dec 2021 16:30:22 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/用户初始化.sql | 76 ++++++ doc/sql/部门组织初始化.sql | 137 ++++++++++ .../esua/epdc/dto/CustomerAgencyDTO.java | 155 +++++++++++ .../esua/epdc/dto/CustomerDepartmentDTO.java | 101 +++++++ .../elink/esua/epdc/dto/CustomerGridDTO.java | 126 +++++++++ .../epdc/controller/SysDeptController.java | 29 ++ .../esua/epdc/dao/CustomerAgencyDao.java | 33 +++ .../esua/epdc/dao/CustomerDepartmentDao.java | 33 +++ .../elink/esua/epdc/dao/CustomerGridDao.java | 33 +++ .../esua/epdc/dao/CustomerStaffAgencyDao.java | 33 +++ .../epdc/dao/CustomerStaffDepartmentDao.java | 33 +++ .../esua/epdc/dao/CustomerStaffGridDao.java | 33 +++ .../com/elink/esua/epdc/dao/SysDeptDao.java | 13 + .../com/elink/esua/epdc/dao/SysUserDao.java | 19 ++ .../epdc/entity/CustomerAgencyEntity.java | 125 +++++++++ .../epdc/entity/CustomerDepartmentEntity.java | 71 +++++ .../esua/epdc/entity/CustomerGridEntity.java | 96 +++++++ .../entity/CustomerStaffAgencyEntity.java | 56 ++++ .../entity/CustomerStaffDepartmentEntity.java | 56 ++++ .../epdc/entity/CustomerStaffGridEntity.java | 56 ++++ .../epdc/service/impl/SysDeptServiceImpl.java | 208 ++++++++++++-- .../epdc/service/impl/SysUserServiceImpl.java | 256 ++++++++++++++++-- .../resources/mapper/CustomerAgencyDao.xml | 33 +++ .../mapper/CustomerDepartmentDao.xml | 23 ++ .../main/resources/mapper/CustomerGridDao.xml | 28 ++ .../mapper/CustomerStaffAgencyDao.xml | 20 ++ .../mapper/CustomerStaffDepartmentDao.xml | 20 ++ .../resources/mapper/CustomerStaffGridDao.xml | 20 ++ .../src/main/resources/mapper/SysDeptDao.xml | 23 ++ .../src/main/resources/mapper/SysUserDao.xml | 72 +++++ 30 files changed, 1977 insertions(+), 40 deletions(-) create mode 100644 doc/sql/用户初始化.sql create mode 100644 doc/sql/部门组织初始化.sql create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerAgencyDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerDepartmentDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerGridDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerAgencyEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerDepartmentEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerGridEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffAgencyEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffDepartmentEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffGridEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerAgencyDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml diff --git a/doc/sql/用户初始化.sql b/doc/sql/用户初始化.sql new file mode 100644 index 000000000..d506c0238 --- /dev/null +++ b/doc/sql/用户初始化.sql @@ -0,0 +1,76 @@ +/* +初始化customer_staff_agency,customer_staff_department,customer_staff_grid +*/ + + +INSERT INTO epmet_gov_org.customer_staff_grid ( ID, CUSTOMER_ID, USER_ID, GRID_ID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) SELECT +t1.id, +'bb19419e365cf97567dc0520cdcfba9e', +t1.id AS USER_ID, +t1.dept_id AS GRID_ID, +t1.del_flag, +t1.creator AS CREATED_BY, +t1.create_date AS CREATED_TIME, +t1.updater AS UPDATED_BY, +t1.update_date AS UPDATED_TIME +FROM + esua_epdc_admin.sys_user t1 + LEFT JOIN esua_epdc_admin.sys_dept t2 ON t1.dept_id = t2.id +WHERE + t2.type_key = 'grid_party'; + + +INSERT INTO epmet_gov_org.customer_staff_department ( + ID, + CUSTOMER_ID, + USER_ID, + DEPARTMENT_ID, + DEL_FLAG, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME +) SELECT +t1.id , +'bb19419e365cf97567dc0520cdcfba9e', +t1.id as USER_ID, +t1.dept_id as DEPARTMENT_ID, +t1.del_flag, +t1.creator as CREATED_BY, +t1.create_date as CREATED_TIME, +t1.updater as UPDATED_BY, +t1.update_date as UPDATED_TIME +from esua_epdc_admin.sys_user t1 +left join esua_epdc_admin.sys_dept t2 on t1.dept_id = t2.id +WHERE + t2.type_key = 'district_dept' + OR t2.type_key = 'street_dept'; + + + +INSERT INTO epmet_gov_org.customer_staff_agency ( + ID, + CUSTOMER_ID, + USER_ID, + AGENCY_ID, + DEL_FLAG, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME +) SELECT +t1.id , +'bb19419e365cf97567dc0520cdcfba9e', +t1.id as USER_ID, +t1.dept_id as AGENCY_ID, +t1.del_flag, +t1.creator as CREATED_BY, +t1.create_date as CREATED_TIME, +t1.updater as UPDATED_BY, +t1.update_date as UPDATED_TIME +from esua_epdc_admin.sys_user t1 +left join esua_epdc_admin.sys_dept t2 on t1.dept_id = t2.id +WHERE + t2.type_key = 'district_party' + OR t2.type_key = 'street_party' + OR t2.type_key = 'community_party'; \ No newline at end of file diff --git a/doc/sql/部门组织初始化.sql b/doc/sql/部门组织初始化.sql new file mode 100644 index 000000000..bbd75b2b8 --- /dev/null +++ b/doc/sql/部门组织初始化.sql @@ -0,0 +1,137 @@ +/* +初始化customer_agency,customer_department,customer_grid +*/ + + +INSERT INTO epmet_gov_org.customer_grid ( ID, CUSTOMER_ID, GRID_NAME, SYNC_FLAG, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, MANAGE_DISTRICT, TOTAL_USER, PID, PIDS ) SELECT +t1.id, +'bb19419e365cf97567dc0520cdcfba9e', +t1.NAME AS GRID_NAME, +'1', +t1.del_flag, +t1.creator AS CREATED_BY, +t1.create_date AS CREATED_TIME, +t1.updater AS UPDATED_BY, +t1.update_date AS UPDATED_TIME, +t1.NAME AS MANAGE_DISTRICT, +t2.total AS TOTAL_USER, +t1.pid, +concat( + SUBSTRING_INDEX( t1.pids, ',', 1 ), + ':', + SUBSTRING_INDEX( SUBSTRING_INDEX( t1.pids, ',', 2 ), ',',- 1 ), + ':', +SUBSTRING_INDEX( t1.pids, ',',- 1 )) pids +FROM + esua_epdc_admin.sys_dept t1 + LEFT JOIN ( SELECT count( id ) total, dept_id FROM esua_epdc_admin.sys_user GROUP BY dept_id ) t2 ON t1.id = t2.dept_id +WHERE + t1.type_key = 'grid_party' ; + +INSERT INTO epmet_gov_org.customer_agency ( + ID, + CUSTOMER_ID, + PID, + PIDS, + ALL_PARENT_NAME, + ORGANIZATION_NAME, + LEVEL, + SYNC_FLAG, + DEL_FLAG, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + TOTAL_USER +) SELECT +t1.id, +'bb19419e365cf97567dc0520cdcfba9e', +t1.pid, +CASE + t1.type_key + WHEN 'street_party' THEN + t1.pids + WHEN 'community_party' THEN + concat( + SUBSTRING_INDEX( t1.pids, ',', 1 ), + ':', + SUBSTRING_INDEX( t1.pids, ',',- 1 )) + END AS pids, +CASE + t1.type_key + WHEN 'street_party' THEN + '市北区委' + WHEN 'community_party' THEN + t5.ALL_PARENT_NAME + END AS ALL_PARENT_NAME, + t1.NAME AS ORGANIZATION_NAME, +CASE + t1.type_key + WHEN 'district_party' THEN + 'district' + WHEN 'street_party' THEN + 'street' + WHEN 'community_party' THEN + 'community' + END AS LEVEL, + '1', + t1.del_flag, + t1.creator AS CREATED_BY, + t1.create_date AS CREATED_TIME, + t1.updater AS UPDATED_BY, + t1.update_date AS UPDATED_TIME, + t2.total AS TOTAL_USER +FROM + esua_epdc_admin.sys_dept t1 + LEFT JOIN ( SELECT count( id ) total, dept_id FROM esua_epdc_admin.sys_user GROUP BY dept_id ) t2 ON t1.id = t2.dept_id + LEFT JOIN ( + SELECT + concat( '市北区委-', t4.NAME ) AS ALL_PARENT_NAME, + t3.id + FROM + esua_epdc_admin.sys_dept t3 + LEFT JOIN esua_epdc_admin.sys_dept t4 ON t3.pid = t4.id + WHERE + t3.type_key = 'community_party' + ) t5 ON t1.id = t5.id +WHERE + t1.type_key = 'district_party' + OR t1.type_key = 'street_party' + OR t1.type_key = 'community_party' ; + +INSERT INTO epmet_gov_org.customer_department ( + ID, + CUSTOMER_ID, + AGENCY_ID, + DEPARTMENT_NAME, + TOTAL_USER, + DEL_FLAG, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME +) SELECT +t1.id, +'bb19419e365cf97567dc0520cdcfba9e', +t1.pid as AGENCY_ID, +t1.name as DEPARTMENT_NAME, +t2.total AS TOTAL_USER, + t1.del_flag, + t1.creator AS CREATED_BY, + t1.create_date AS CREATED_TIME, + t1.updater AS UPDATED_BY, + t1.update_date AS UPDATED_TIME +FROM + esua_epdc_admin.sys_dept t1 + LEFT JOIN ( SELECT count( id ) total, dept_id FROM esua_epdc_admin.sys_user GROUP BY dept_id ) t2 ON t1.id = t2.dept_id +WHERE + t1.type_key = 'district_dept' or t1.type_key = 'street_dept' ; + + + + + + + + + diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerAgencyDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerAgencyDTO.java new file mode 100644 index 000000000..e02445bc9 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerAgencyDTO.java @@ -0,0 +1,155 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 机关单位信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-15 + */ +@Data +public class CustomerAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 当前组织所属的行政地区编码 + */ + private String areaCode; + + /** + * 编码 + */ + private String code; + + /** + * 当前组织是否同步到统计库和指标库,1同步。0不同步 + */ + private String syncFlag; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 区域编码字典中的【省份】名称 + */ + private String province; + + /** + * 区域编码字典中的【城市】名称 + */ + private String city; + + /** + * 区域编码字典中的【区县】名称 + */ + private String district; + + /** + * 区域编码字典中的【街道】名称0409 + */ + private String street; + + /** + * 区域编码字典中的【社区】名称0409 + */ + private String community; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701 + */ + private String parentAreaCode; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerDepartmentDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerDepartmentDTO.java new file mode 100644 index 000000000..2996aff5d --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerDepartmentDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户部门表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-16 + */ +@Data +public class CustomerDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属机关ID(customer_agency.id) + */ + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 部门所属的行政地区编码:实际就是所属组织的地区编码 + */ + private String areaCode; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerGridDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerGridDTO.java new file mode 100644 index 000000000..9ad9f6d94 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CustomerGridDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户网格表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-15 + */ +@Data +public class CustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 编码 + */ + private String code; + + /** + * 当前网格是否同步到统计库和指标库,1同步。0不同步 + */ + private String syncFlag; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java index a59d5f379..af3aa7a14 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java @@ -9,6 +9,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.AssertUtils; @@ -16,18 +17,24 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dao.CustomerAgencyDao; +import com.elink.esua.epdc.dao.CustomerDepartmentDao; +import com.elink.esua.epdc.dao.CustomerGridDao; +import com.elink.esua.epdc.dao.SysDeptDao; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO; import com.elink.esua.epdc.dto.epdc.form.KpiGridIdsFormDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; +import com.elink.esua.epdc.entity.SysDeptEntity; import com.elink.esua.epdc.service.SysDeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -46,6 +53,15 @@ public class SysDeptController { @Autowired private SysDeptService sysDeptService; + @Resource + private SysDeptDao sysDeptDao; + @Resource + private CustomerAgencyDao customerAgencyDao; + @Resource + private CustomerDepartmentDao customerDepartmentDao; + @Resource + private CustomerGridDao customerGridDao; + @GetMapping("list") @ApiOperation("列表") public Result> list() { @@ -112,6 +128,19 @@ public class SysDeptController { //效验数据 AssertUtils.isNull(id, "id"); // sysDeptService.delete(id); + + SysDeptEntity entity = sysDeptDao.select(id); + if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { + //删除customer_grid + customerGridDao.deleteById(id.toString()); + } else if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT) || entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_DEPT)) { + //customer_department + customerDepartmentDao.deleteById(id.toString()); + } else { + //同步agency + customerAgencyDao.deleteById(id.toString()); + } + sysDeptService.deleteBatchIds(Arrays.asList(new Long[]{id})); return new Result(); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java new file mode 100644 index 000000000..b789be74c --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerAgencyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关单位信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-15 + */ +@Mapper +public interface CustomerAgencyDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java new file mode 100644 index 000000000..fd4ee2ad7 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户部门表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-16 + */ +@Mapper +public interface CustomerDepartmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java new file mode 100644 index 000000000..110daaf9b --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户网格表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-15 + */ +@Mapper +public interface CustomerGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java new file mode 100644 index 000000000..2bc9680e5 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerStaffAgencyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 人员-机关单位关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-21 + */ +@Mapper +public interface CustomerStaffAgencyDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java new file mode 100644 index 000000000..45c970651 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerStaffDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 部门人员关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-21 + */ +@Mapper +public interface CustomerStaffDepartmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java new file mode 100644 index 000000000..b532becae --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerStaffGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格人员关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-21 + */ +@Mapper +public interface CustomerStaffGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java index 76511424f..991bd9616 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java @@ -16,6 +16,9 @@ import com.elink.esua.epdc.dto.epdc.form.KpiGridIdsFormDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; +import com.elink.esua.epdc.entity.CustomerAgencyEntity; +import com.elink.esua.epdc.entity.CustomerDepartmentEntity; +import com.elink.esua.epdc.entity.CustomerGridEntity; import com.elink.esua.epdc.entity.SysDeptEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -249,4 +252,14 @@ public interface SysDeptDao extends BaseDao { * @return com.elink.esua.epdc.dto.DeptInfoCodeDTO */ DeptInfoCodeDTO selectDeptInfoCode(@Param("gridId") Long gridId); + + List getParents(@Param("pidList") List pidList); + + SysDeptEntity select(Long id); + + void updateGridTotalUser(String id); + + void updateDepartmentTotalUser(String id); + + void updateAgencyTotalUser(String toString); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java index 9ec56fa5e..b3ce4de53 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java @@ -12,6 +12,9 @@ import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.SysUserAnalysisOpenIdFormDTO; import com.elink.esua.epdc.dto.SysUserDTO; import com.elink.esua.epdc.dto.SysUserOpenIdFormDTO; +import com.elink.esua.epdc.entity.CustomerStaffAgencyEntity; +import com.elink.esua.epdc.entity.CustomerStaffDepartmentEntity; +import com.elink.esua.epdc.entity.CustomerStaffGridEntity; import com.elink.esua.epdc.entity.SysUserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -151,4 +154,20 @@ public interface SysUserDao extends BaseDao { * @return com.elink.esua.epdc.commons.tools.utils.Result> */ List getGroupUserList(Map params); + + void updateGridIdById(@Param("gridId") String deptId,@Param("id") String id); + + void updateDepartmentIdById(@Param("departmentId") String deptId,@Param("id") String id); + + void updateAgencyIdById(@Param("agencyId") String deptId,@Param("id") String id); + + void deleteAgencyBatchIds(@Param("agencyIds") List agencyIds); + + void deleteDepartmentBatchIds(@Param("departmentIds") List departmentIds); + + void deleteGridBatchIds(@Param("gridIds") List gridIds); + + void updateTotalUserGridBatch(@Param("ids") List customerGridIds); + void updateTotalUserDepartmentBatch(@Param("ids") List customerDepartmentIds); + void updateTotalUserAgencyBatch(@Param("ids") List customerAgencyIds); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerAgencyEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerAgencyEntity.java new file mode 100644 index 000000000..58a15d2dd --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerAgencyEntity.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 机关单位信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.customer_agency") +public class CustomerAgencyEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 当前组织所属的行政地区编码 + */ + private String areaCode; + + /** + * 编码 + */ + private String code; + + /** + * 当前组织是否同步到统计库和指标库,1同步。0不同步 + */ + private String syncFlag; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 区域编码字典中的【省份】名称 + */ + private String province; + + /** + * 区域编码字典中的【城市】名称 + */ + private String city; + + /** + * 区域编码字典中的【区县】名称 + */ + private String district; + + /** + * 区域编码字典中的【街道】名称0409 + */ + private String street; + + /** + * 区域编码字典中的【社区】名称0409 + */ + private String community; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701 + */ + private String parentAreaCode; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerDepartmentEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerDepartmentEntity.java new file mode 100644 index 000000000..21aa0a684 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerDepartmentEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户部门表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.customer_department") +public class CustomerDepartmentEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属机关ID(customer_agency.id) + */ + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 部门所属的行政地区编码:实际就是所属组织的地区编码 + */ + private String areaCode; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerGridEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerGridEntity.java new file mode 100644 index 000000000..645b294bf --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerGridEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户网格表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.customer_grid") +public class CustomerGridEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 编码 + */ + private String code; + + /** + * 当前网格是否同步到统计库和指标库,1同步。0不同步 + */ + private String syncFlag; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffAgencyEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffAgencyEntity.java new file mode 100644 index 000000000..e3f7d8b54 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffAgencyEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 人员-机关单位关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.customer_staff_agency") +public class CustomerStaffAgencyEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 组织机构ID customer_agency.id + */ + private String agencyId; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffDepartmentEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffDepartmentEntity.java new file mode 100644 index 000000000..b1dee2dae --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffDepartmentEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 部门人员关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.customer_staff_department") +public class CustomerStaffDepartmentEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 部门ID customer_department.id + */ + private String departmentId; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffGridEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffGridEntity.java new file mode 100644 index 000000000..b965f58f9 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffGridEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格人员关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2021-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.customer_staff_grid") +public class CustomerStaffGridEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id, user.id + */ + private String userId; + + /** + * 网格ID customer_grid.id + */ + private String gridId; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index 3761cedcc..179422df5 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -29,7 +29,7 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.TreeUtils; import com.elink.esua.epdc.constant.RoleTypeKeyConstant; -import com.elink.esua.epdc.dao.SysDeptDao; +import com.elink.esua.epdc.dao.*; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.ExportTemplateInfoFormDTO; @@ -37,7 +37,7 @@ import com.elink.esua.epdc.dto.epdc.form.KpiGridIdsFormDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; -import com.elink.esua.epdc.entity.SysDeptEntity; +import com.elink.esua.epdc.entity.*; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; import com.elink.esua.epdc.rocketmq.producer.OrganizationModifyProducer; @@ -53,10 +53,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import javax.annotation.Resource; +import java.util.*; /** * 部门管理 @@ -82,6 +80,13 @@ public class SysDeptServiceImpl extends BaseServiceImpl completeDeptDtoResult = this.getCompleteDept(entity.getId().toString()); groupFeignClient.createPartyGroup(completeDeptDtoResult.getData()); } + + if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { + //同步customer_grid + CustomerGridEntity customerGridEntity = new CustomerGridEntity(); + customerGridEntity.setId(entity.getId().toString()); + customerGridEntity.setCustomerId("bb19419e365cf97567dc0520cdcfba9e"); + customerGridEntity.setPid(entity.getPid().toString()); + customerGridEntity.setPids(StringUtils.join(StringUtils.split(entity.getPids(), ","), ":")); + customerGridEntity.setSyncFlag(NumConstant.ZERO_STR); + customerGridEntity.setGridName(entity.getName()); + customerGridEntity.setManageDistrict(entity.getName()); + customerGridEntity.setTotalUser(NumConstant.ZERO); + customerGridDao.insert(customerGridEntity); + //baseDao.insertCustomerGrid(customerGridEntity); + } else if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT) || entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_DEPT)) { + //customer_department + CustomerDepartmentEntity customerDepartmentEntity = new CustomerDepartmentEntity(); + customerDepartmentEntity.setId(entity.getId().toString()); + customerDepartmentEntity.setAgencyId(entity.getPid().toString()); + customerDepartmentEntity.setCustomerId("bb19419e365cf97567dc0520cdcfba9e"); + customerDepartmentEntity.setDepartmentName(entity.getName()); + customerDepartmentEntity.setDepartmentDuty(entity.getName()); + customerDepartmentEntity.setTotalUser(NumConstant.ZERO); + customerDepartmentDao.insert(customerDepartmentEntity); + //baseDao.insertCustomerDepartment(customerDepartmentEntity); + } else { + //同步agency + CustomerAgencyEntity customerAgencyEntity = new CustomerAgencyEntity(); + customerAgencyEntity.setId(entity.getId().toString()); + customerAgencyEntity.setCustomerId("bb19419e365cf97567dc0520cdcfba9e"); + customerAgencyEntity.setPid(entity.getPid().toString()); + customerAgencyEntity.setPids(StringUtils.join(StringUtils.split(entity.getPids(), ","), ":")); + customerAgencyEntity.setSyncFlag(NumConstant.ZERO_STR); + customerAgencyEntity.setTotalUser(NumConstant.ZERO); + customerAgencyEntity.setOrganizationName(entity.getName()); + customerAgencyEntity.setAllParentName(getAllParentName(entity.getPids())); + if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_DISTRICT_PARTY)) { + customerAgencyEntity.setLevel("district"); + } else if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_PARTY)) { + customerAgencyEntity.setLevel("street"); + } else if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY)) { + customerAgencyEntity.setLevel("community"); + } + customerAgencyDao.insert(customerAgencyEntity); + //baseDao.insertCustomerAgency(customerAgencyEntity); + } + + } + + private String getAllParentName(String pids) { + List pidList = Arrays.asList(StringUtils.split(pids, ",")); + List parentName = baseDao.getParents(pidList); + return StringUtils.join(parentName, "-"); } @Override @@ -162,11 +219,121 @@ public class SysDeptServiceImpl extends BaseServiceImpl getGridAuthByUser() { // 用户拥有的所有部门权限 @@ -388,6 +557,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl deptList = baseDao.selectListDeptTree(); @@ -1049,10 +1222,10 @@ public class SysDeptServiceImpl extends BaseServiceImpl listAllDeptInfo(UserSysDeptInfoFormDTO formDTO) { Map map = new HashMap<>(); - if (formDTO.getTypeKeyList() != null && formDTO.getTypeKeyList().size() >0) { + if (formDTO.getTypeKeyList() != null && formDTO.getTypeKeyList().size() > 0) { map.put("typeKey", formDTO.getTypeKeyList().get(0)); } - if (formDTO.getDeptIdList() != null && formDTO.getDeptIdList().size() >0) { + if (formDTO.getDeptIdList() != null && formDTO.getDeptIdList().size() > 0) { map.put("deptId", formDTO.getDeptIdList()); } if (formDTO.getDeptName() != null && formDTO.getDeptName() != "") { @@ -1081,11 +1254,10 @@ public class SysDeptServiceImpl extends BaseServiceImpl page(Map params) { @@ -134,6 +150,28 @@ public class SysUserServiceImpl extends BaseServiceImpl sysUserEntities = baseDao.selectBatchIds(Arrays.asList(ids)); + List deptIds = sysUserEntities.stream().map(x -> x.getDeptId().toString()).collect(Collectors.toList()); + List sysDeptEntities = sysDeptDao.selectBatchIds(deptIds); + List agencyIds = new ArrayList<>(); + List departmentIds = new ArrayList<>(); + List gridIds = new ArrayList<>(); + List customerGridIds = new ArrayList<>(); + List customerDepartmentIds = new ArrayList<>(); + List customerAgencyIds = new ArrayList<>(); + sysDeptEntities.forEach(x -> { + if (x.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { + customerGridIds.add(x.getId().toString()); + sysUserEntities.forEach(y -> { + if (y.getDeptId().equals(x.getId())) { + gridIds.add(y.getId().toString()); + } + }); + } else if (x.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT) || x.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_DEPT)) { + customerDepartmentIds.add(x.getId().toString()); + sysUserEntities.forEach(y -> { + if (y.getDeptId().equals(x.getId())) { + departmentIds.add(y.getId().toString()); + } + }); + } else { + customerAgencyIds.add(x.getId().toString()); + sysUserEntities.forEach(y -> { + if (y.getDeptId().equals(x.getId())) { + agencyIds.add(y.getId().toString()); + } + }); + } + }); + //批量逻辑删除组织用户, 批量更新组织部门totalUser + if (CollectionUtils.isNotEmpty(agencyIds)) { + baseDao.deleteAgencyBatchIds(agencyIds); + baseDao.updateTotalUserAgencyBatch(customerAgencyIds); + } + if (CollectionUtils.isNotEmpty(departmentIds)) { + baseDao.deleteDepartmentBatchIds(departmentIds); + baseDao.updateTotalUserDepartmentBatch(customerDepartmentIds); + } + if (CollectionUtils.isNotEmpty(gridIds)) { + baseDao.deleteGridBatchIds(gridIds); + baseDao.updateTotalUserGridBatch(customerGridIds); + } } @Override @@ -272,7 +485,6 @@ public class SysUserServiceImpl extends BaseServiceImpl> getUserPhoneByListDeptId(List deptId) { - Map map = new HashMap<>(); - map.put("deptId",deptId); + Map map = new HashMap<>(); + map.put("deptId", deptId); List list = baseDao.getUserPhoneByListDeptId(map); return new Result>().ok(list); } @@ -311,12 +523,12 @@ public class SysUserServiceImpl extends BaseServiceImpl>> + * @return: com.elink.esua.epdc.commons.tools.utils.Result>> * @Author: wk * @Date: 2020/5/26 */ @@ -360,14 +572,14 @@ public class SysUserServiceImpl extends BaseServiceImpl workOpenIds = baseDao.selectListOpenIds(userList,"1"); + log.info("获取数据" + userList.get(0)); + List workOpenIds = baseDao.selectListOpenIds(userList, "1"); openIdDto.setWorkOpenIds(workOpenIds); - log.info("获取数据工作端:"+workOpenIds.size()); - List AnalysisOpenIds = baseDao.selectListOpenIds(userList,"2"); - log.info("获取数据数据端:"+AnalysisOpenIds.size()); + log.info("获取数据工作端:" + workOpenIds.size()); + List AnalysisOpenIds = baseDao.selectListOpenIds(userList, "2"); + log.info("获取数据数据端:" + AnalysisOpenIds.size()); openIdDto.setAnalyOpenIds(AnalysisOpenIds); - return new Result().ok(openIdDto); + return new Result().ok(openIdDto); } @Override @@ -375,7 +587,7 @@ public class SysUserServiceImpl extends BaseServiceImpl userIdList = Arrays.asList(userIdsArr); - params.put("userIdList",userIdList); + params.put("userIdList", userIdList); //转换成like paramsToLike(params, "username"); paramsToLike(params, "realname"); diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerAgencyDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerAgencyDao.xml new file mode 100644 index 000000000..f7347ff5f --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml new file mode 100644 index 000000000..783f39b2c --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml new file mode 100644 index 000000000..379376376 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml new file mode 100644 index 000000000..974079832 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml new file mode 100644 index 000000000..417af1203 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml new file mode 100644 index 000000000..5d72d720f --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml index 2bfe2956d..99ffc290c 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml @@ -441,4 +441,27 @@ and s.del_flag=0 and g.id=#{gridId} + + + + + + update epmet_gov_org.customer_grid set TOTAL_USER =TOTAL_USER+1 where id =#{id} + + + + update epmet_gov_org.customer_department set TOTAL_USER =TOTAL_USER+1 where id =#{id} + + + + update epmet_gov_org.customer_agency set TOTAL_USER =TOTAL_USER+1 where id =#{id} + + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml index 346175b89..2d56cd494 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml @@ -234,4 +234,76 @@ ORDER BY t1.create_date desc + + update epmet_gov_org.customer_staff_grid + set GRID_ID=#{gridId} + where id =#{id} + + + + update epmet_gov_org.customer_staff_department + set DEPARTMENT_ID=#{departmentId} + where id =#{id} + + + + update epmet_gov_org.customer_staff_agency + set AGENCY_ID=#{agencyId} + where id =#{id} + + + + update epmet_gov_org.customer_staff_agency + set DEL_FLAG='1' + where id in + + #{id} + + + + + update epmet_gov_org.customer_staff_department + set DEL_FLAG='1' + where id in + + #{id} + + + + + update epmet_gov_org.customer_staff_grid + set DEL_FLAG='1' + where id in + + #{id} + + + + + update epmet_gov_org.customer_grid + set TOTAL_USER = TOTAL_USER-1 + where id in + + #{id} + + + + + update epmet_gov_org.customer_department + set TOTAL_USER = TOTAL_USER-1 + where id in + + #{id} + + + + + update epmet_gov_org.customer_Agency + set TOTAL_USER = TOTAL_USER-1 + where id in + + #{id} + + + From 33d157fdd037a113afb0bb03e41ef3c29acbca22 Mon Sep 17 00:00:00 2001 From: mkh Date: Thu, 23 Dec 2021 10:36:25 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=94=B9=E6=88=90=E7=89=A9=E7=90=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/SysDeptController.java | 6 +++--- .../esua/epdc/dao/CustomerAgencyDao.java | 5 +++-- .../esua/epdc/dao/CustomerDepartmentDao.java | 7 ++++--- .../elink/esua/epdc/dao/CustomerGridDao.java | 7 ++++--- .../esua/epdc/dao/CustomerStaffAgencyDao.java | 5 +++-- .../epdc/dao/CustomerStaffDepartmentDao.java | 7 ++++--- .../esua/epdc/dao/CustomerStaffGridDao.java | 7 ++++--- .../epdc/service/impl/SysDeptServiceImpl.java | 12 +++++------ .../epdc/service/impl/SysUserServiceImpl.java | 12 +++++------ .../resources/mapper/CustomerAgencyDao.xml | 5 ++++- .../mapper/CustomerDepartmentDao.xml | 5 ++++- .../main/resources/mapper/CustomerGridDao.xml | 5 ++++- .../mapper/CustomerStaffAgencyDao.xml | 5 ++++- .../mapper/CustomerStaffDepartmentDao.xml | 5 ++++- .../resources/mapper/CustomerStaffGridDao.xml | 5 ++++- .../src/main/resources/mapper/SysUserDao.xml | 21 ++++++++----------- 16 files changed, 70 insertions(+), 49 deletions(-) diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java index af3aa7a14..472ead8c7 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java @@ -132,13 +132,13 @@ public class SysDeptController { SysDeptEntity entity = sysDeptDao.select(id); if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { //删除customer_grid - customerGridDao.deleteById(id.toString()); + customerGridDao.deleteGridById(id.toString()); } else if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT) || entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_DEPT)) { //customer_department - customerDepartmentDao.deleteById(id.toString()); + customerDepartmentDao.deleteDepartmentById(id.toString()); } else { //同步agency - customerAgencyDao.deleteById(id.toString()); + customerAgencyDao.deleteAgencyById(id.toString()); } sysDeptService.deleteBatchIds(Arrays.asList(new Long[]{id})); diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java index b789be74c..dc6b129bf 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerAgencyDao.java @@ -29,5 +29,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerAgencyDao extends BaseDao { - -} \ No newline at end of file + + void deleteAgencyById(String id); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java index fd4ee2ad7..171350e3b 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerDepartmentDao.java @@ -22,12 +22,13 @@ import com.elink.esua.epdc.entity.CustomerDepartmentEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户部门表 + * 客户部门表 * * @author elink elink@elink-cn.com * @since v1.0.0 2021-12-16 */ @Mapper public interface CustomerDepartmentDao extends BaseDao { - -} \ No newline at end of file + + void deleteDepartmentById(String id); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java index 110daaf9b..9d27df114 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerGridDao.java @@ -22,12 +22,13 @@ import com.elink.esua.epdc.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; /** - * 客户网格表 + * 客户网格表 * * @author elink elink@elink-cn.com * @since v1.0.0 2021-12-15 */ @Mapper public interface CustomerGridDao extends BaseDao { - -} \ No newline at end of file + + void deleteGridById(String id); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java index 2bc9680e5..370fbc7ec 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffAgencyDao.java @@ -29,5 +29,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffAgencyDao extends BaseDao { - -} \ No newline at end of file + + void deleteStaffAgencyById(String id); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java index 45c970651..515d0db5f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDepartmentDao.java @@ -22,12 +22,13 @@ import com.elink.esua.epdc.entity.CustomerStaffDepartmentEntity; import org.apache.ibatis.annotations.Mapper; /** - * 部门人员关系表 + * 部门人员关系表 * * @author elink elink@elink-cn.com * @since v1.0.0 2021-12-21 */ @Mapper public interface CustomerStaffDepartmentDao extends BaseDao { - -} \ No newline at end of file + + void deleteStaffDepartmentById(String toString); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java index b532becae..7394794e0 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffGridDao.java @@ -22,12 +22,13 @@ import com.elink.esua.epdc.entity.CustomerStaffGridEntity; import org.apache.ibatis.annotations.Mapper; /** - * 网格人员关系表 + * 网格人员关系表 * * @author elink elink@elink-cn.com * @since v1.0.0 2021-12-21 */ @Mapper public interface CustomerStaffGridDao extends BaseDao { - -} \ No newline at end of file + + void deleteStaffGridById(String id); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index 179422df5..552865474 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -239,13 +239,13 @@ public class SysDeptServiceImpl extends BaseServiceImpl + + delete from epmet_gov_org.customer_agency where id =#{id} + - \ No newline at end of file + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 783f39b2c..7999832b9 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -19,5 +19,8 @@ + + delete from epmet_gov_org.customer_department where id =#{id} + - \ No newline at end of file + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml index 379376376..422ce21eb 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerGridDao.xml @@ -24,5 +24,8 @@ + + delete from epmet_gov_org.customer_grid where id =#{id} + - \ No newline at end of file + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 974079832..4b42b2f08 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -16,5 +16,8 @@ + + delete from epmet_gov_org.customer_staff_agency where id =#{id} + - \ No newline at end of file + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 417af1203..cc065a63f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -16,5 +16,8 @@ + + delete from epmet_gov_org.customer_staff_department where id =#{id} + - \ No newline at end of file + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 5d72d720f..2f0d47527 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -16,5 +16,8 @@ + + delete from epmet_gov_org.customer_staff_grid where id =#{id} + - \ No newline at end of file + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml index 2d56cd494..3ad3f7058 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml @@ -252,32 +252,29 @@ where id =#{id} - - update epmet_gov_org.customer_staff_agency - set DEL_FLAG='1' + + delete from epmet_gov_org.customer_staff_agency where id in #{id} - + - - update epmet_gov_org.customer_staff_department - set DEL_FLAG='1' + + delete from epmet_gov_org.customer_staff_department where id in #{id} - + - - update epmet_gov_org.customer_staff_grid - set DEL_FLAG='1' + + delete from epmet_gov_org.customer_staff_grid where id in #{id} - + update epmet_gov_org.customer_grid From ae2a9d94944845c400058bc2275852c58cae3160 Mon Sep 17 00:00:00 2001 From: mkh Date: Fri, 24 Dec 2021 15:11:09 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=B5=8B=E8=AF=95nacos?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esua-epdc/epdc-admin/epdc-admin-server/pom.xml | 6 +++--- .../src/main/resources/application-test.yml | 8 ++++---- esua-epdc/epdc-auth/pom.xml | 7 ++++--- .../epdc-analysis/epdc-analysis-server/pom.xml | 6 +++--- .../epdc-api/epdc-api-server/pom.xml | 6 +++--- .../epdc-content-security-server/pom.xml | 6 +++--- .../epdc-custom/epdc-custom-server/pom.xml | 6 +++--- .../epdc-events/epdc-events-server/pom.xml | 6 +++--- .../epdc-group/epdc-group-server/pom.xml | 6 +++--- .../epdc-heart/epdc-heart-server/pom.xml | 6 +++--- .../epdc-job/epdc-job-server/pom.xml | 6 +++--- .../epdc-kpi/epdc-kpi-server/pom.xml | 6 +++--- .../epdc-message/epdc-message-server/pom.xml | 6 +++--- .../epdc-news/epdc-news-server/pom.xml | 6 +++--- .../epdc-oss/epdc-oss-server/pom.xml | 6 +++--- .../epdc-points/epdc-points-server/pom.xml | 6 +++--- .../epdc-user/epdc-user-server/pom.xml | 18 +++++++++--------- esua-epdc/epdc-module/epdc-webservice/pom.xml | 6 +++--- 18 files changed, 62 insertions(+), 61 deletions(-) diff --git a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml index f38a26d75..29e255ac1 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml @@ -197,9 +197,9 @@ true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 http://localhost:9411 diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml index 86592b908..5c78df476 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml @@ -8,9 +8,9 @@ spring: datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://118.190.232.100:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai - username: epdc - password: elink833066 + url: jdbc:mysql://rm-bp1l2b53j508j1176xo.mysql.rds.aliyuncs.com:3306/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: Abc@123456 initial-size: 10 max-active: 100 min-idle: 10 @@ -33,4 +33,4 @@ spring: stat: log-slow-sql: true slow-sql-millis: 1000 - merge-sql: false \ No newline at end of file + merge-sql: false diff --git a/esua-epdc/epdc-auth/pom.xml b/esua-epdc/epdc-auth/pom.xml index b2b72988e..7eff4e2d1 100644 --- a/esua-epdc/epdc-auth/pom.xml +++ b/esua-epdc/epdc-auth/pom.xml @@ -138,9 +138,10 @@ true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 + http://localhost:9411 diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml index 637084e87..0ac87c1cd 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml @@ -156,10 +156,10 @@ true - 47.104.224.45:8848 - 47.104.85.99 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 https://epmet-dev.elinkservice.cn/api - a746dde3-7a13-4521-b986-7369b0b7c269 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml index a8761eb29..65c61b144 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml @@ -233,9 +233,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 wx3ef8f2cd12a19fcb diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml index c483ea080..26266af0d 100644 --- a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml @@ -196,9 +196,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml index 0bcf5031b..1ca77b813 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml @@ -219,9 +219,9 @@ 394f47d4e08fc0fd629231d3f68a34dc true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 47.104.85.99:9876;114.215.125.123:9876 organizationGroup diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index 24387353c..0816a266f 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -211,9 +211,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml index bca0c64df..1accf8eb6 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml @@ -185,9 +185,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 47.104.85.99:9876;114.215.125.123:9876 organizationGroup diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml index a41345738..4342c3380 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml @@ -207,9 +207,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 http://localhost:9411 diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml b/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml index cb02caa2a..108c15c56 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml @@ -185,9 +185,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml index 8f8066abb..59cd3f2a2 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml @@ -170,9 +170,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 47.104.85.99:9876;114.215.125.123:9876 diff --git a/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml b/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml index 2fe38d599..f9387e58e 100644 --- a/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml @@ -185,9 +185,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml index 48f3cdc2c..53a326fe5 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml @@ -170,9 +170,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 47.104.85.99:9876;114.215.125.123:9876 diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml index f0fb3a28b..6cfd9dc96 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml @@ -210,9 +210,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml index 1865664b9..9be0a1170 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml @@ -168,9 +168,9 @@ elink833066 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 http://localhost:9411 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml index b242a2a9b..e870dba2c 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml @@ -179,21 +179,21 @@ epdc!redis@master1405 - + - epdc - elink833066 + root + Abc@123456 - + - epdc - elink833066 + root + Abc@123456 true - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 47.104.85.99:9876;114.215.125.123:9876 diff --git a/esua-epdc/epdc-module/epdc-webservice/pom.xml b/esua-epdc/epdc-module/epdc-webservice/pom.xml index fe0cb6cc5..c7d181b58 100644 --- a/esua-epdc/epdc-module/epdc-webservice/pom.xml +++ b/esua-epdc/epdc-module/epdc-webservice/pom.xml @@ -162,9 +162,9 @@ elink833066 false - 47.104.224.45:8848 - 47.104.85.99 - a746dde3-7a13-4521-b986-7369b0b7c269 + 115.29.142.202:8848 + 118.190.232.100 + 305e0faa-d935-4fe1-b3a0-2634da67adb3 From ecff4980430d368ce5ed5d3140863ea135352580 Mon Sep 17 00:00:00 2001 From: mkh Date: Tue, 11 Jan 2022 14:10:13 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=90=8C=E6=AD=A5user,customer=5Fstaff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elink/esua/epdc/dao/CustomerStaffDao.java | 37 ++++++ .../com/elink/esua/epdc/dao/SysDictDao.java | 1 + .../java/com/elink/esua/epdc/dao/UserDao.java | 33 ++++++ .../esua/epdc/entity/CustomerStaffEntity.java | 106 ++++++++++++++++++ .../elink/esua/epdc/entity/UserEntity.java | 56 +++++++++ .../epdc/service/impl/SysDeptServiceImpl.java | 12 +- .../epdc/service/impl/SysUserServiceImpl.java | 86 +++++++++++--- .../resources/mapper/CustomerStaffDao.xml | 36 ++++++ .../src/main/resources/mapper/SysDictDao.xml | 4 + .../src/main/resources/mapper/UserDao.xml | 20 ++++ 10 files changed, 368 insertions(+), 23 deletions(-) create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CustomerStaffDao.xml create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/UserDao.xml diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDao.java new file mode 100644 index 000000000..382378057 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CustomerStaffDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CustomerStaffEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 政府工作人员表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Mapper +public interface CustomerStaffDao extends BaseDao { + + void deleteBatchUserIds(@Param("idLists") List idLists); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java index e19c4e9b8..1292ba61b 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java @@ -28,4 +28,5 @@ public interface SysDictDao extends BaseDao { List getSubList(Map params); + SysDictEntity selectDcp(); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java new file mode 100644 index 000000000..9a31f7215 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.UserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Mapper +public interface UserDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffEntity.java new file mode 100644 index 000000000..cadcaa6f2 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CustomerStaffEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 政府工作人员表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_user.customer_staff") +public class CustomerStaffEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 关联User表的主键Id + */ + private String userId; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * fulltime专职parttime兼职 + */ + private String workType; + + /** + * 头像 + */ + private String headPhoto; + + /** + * inactive未激活,active已激活 + */ + private String activeFlag; + + /** + * 激活时间 + */ + private Date activeTime; + + /** + * 未禁用enable,已禁用disabled + */ + private String enableFlag; + + /** + * 登录密码 + */ + private String password; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java new file mode 100644 index 000000000..795953cd9 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_user.user") +public class UserEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String customerId; + + /** + * + */ + private String fromApp; + + /** + * + */ + private String fromClient; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index 552865474..d7360eea8 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -152,7 +152,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl page(Map params) { @@ -150,6 +156,27 @@ public class SysUserServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("USER_ID", dto.getId().toString()); + CustomerStaffEntity customerStaffEntity = customerStaffDao.selectOne(queryWrapper); + customerStaffEntity.setRealName(dto.getRealName()); + customerStaffEntity.setGender(dto.getGender()); + customerStaffEntity.setEmail(dto.getEmail()); + customerStaffEntity.setMobile(dto.getMobile()); + if (StringUtils.isNotEmpty(dto.getPassword())) { + customerStaffEntity.setPassword(PasswordUtils.encode(dto.getPassword())); + } + customerStaffEntity.setHeadPhoto(dto.getHeadUrl()); + customerStaffDao.updateById(customerStaffEntity); + } if (!sysUserEntity.getDeptId().equals(entity.getDeptId())) { //更新后用户的机构信息 @@ -274,54 +316,60 @@ public class SysUserServiceImpl extends BaseServiceImpl idLists = Arrays.asList(ids).stream().map(x -> x.toString()).collect(Collectors.toList()); + userDao.deleteBatchIds(idLists); + customerStaffDao.deleteBatchUserIds(idLists); + //物理删除组织用户 List sysUserEntities = baseDao.selectBatchIds(Arrays.asList(ids)); List deptIds = sysUserEntities.stream().map(x -> x.getDeptId().toString()).collect(Collectors.toList()); List sysDeptEntities = sysDeptDao.selectBatchIds(deptIds); @@ -389,7 +441,7 @@ public class SysUserServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update epmet_user.customer_staff set DEL_FLAG = '1' where USER_ID in + + #{userId} + + + + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDictDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDictDao.xml index 5dd4a6849..8dec3fa88 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDictDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDictDao.xml @@ -8,4 +8,8 @@ SELECT * FROM sys_dict WHERE pid = #{pid} and del_flag = '0' + + diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/UserDao.xml new file mode 100644 index 000000000..c60e2a98a --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/UserDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From d92e6f0227a2f63835c84db62081688b73fc263c Mon Sep 17 00:00:00 2001 From: mkh Date: Wed, 12 Jan 2022 14:16:03 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=AD=97=E5=85=B8=E8=8E=B7=E5=8F=96custome?= =?UTF-8?q?rId,=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90token=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/service/impl/SysDeptServiceImpl.java | 23 ++++++++++++------- .../epdc/service/impl/SysUserServiceImpl.java | 14 ++++++++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index d7360eea8..06f4c8815 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -86,6 +86,8 @@ public class SysDeptServiceImpl extends BaseServiceImpl completeDeptDtoResult = this.getCompleteDept(entity.getId().toString()); groupFeignClient.createPartyGroup(completeDeptDtoResult.getData()); } - + //查询字典获取customer_id + SysDictEntity sysDictEntity = sysDictDao.selectDcp(); if (entity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { //同步customer_grid CustomerGridEntity customerGridEntity = new CustomerGridEntity(); customerGridEntity.setId(entity.getId().toString()); - customerGridEntity.setCustomerId("b09527201c4409e19d1dbc5e3c3429a1"); + customerGridEntity.setCustomerId(sysDictEntity.getDictValue()); customerGridEntity.setPid(entity.getPid().toString()); customerGridEntity.setPids(StringUtils.join(StringUtils.split(entity.getPids(), ","), ":")); customerGridEntity.setSyncFlag(NumConstant.ZERO_STR); @@ -166,7 +169,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); @@ -253,6 +258,7 @@ public class SysUserServiceImpl extends BaseServiceImpl Date: Tue, 18 Jan 2022 09:19:06 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index 06f4c8815..9e9408ddd 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -236,7 +236,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl Date: Fri, 21 Jan 2022 14:17:07 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=90=8C=E6=AD=A5staff=5Forg=5Frelation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/用户初始化.sql | 100 +++++++++++++++++- doc/sql/部门组织初始化.sql | 6 +- .../esua/epdc/dao/StaffOrgRelationDao.java | 37 +++++++ .../epdc/entity/StaffOrgRelationEntity.java | 66 ++++++++++++ .../epdc/service/impl/SysUserServiceImpl.java | 42 +++++++- .../resources/mapper/StaffOrgRelationDao.xml | 28 +++++ 6 files changed, 269 insertions(+), 10 deletions(-) create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/StaffOrgRelationDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/StaffOrgRelationEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/StaffOrgRelationDao.xml diff --git a/doc/sql/用户初始化.sql b/doc/sql/用户初始化.sql index d506c0238..ebf015d73 100644 --- a/doc/sql/用户初始化.sql +++ b/doc/sql/用户初始化.sql @@ -5,7 +5,7 @@ INSERT INTO epmet_gov_org.customer_staff_grid ( ID, CUSTOMER_ID, USER_ID, GRID_ID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) SELECT t1.id, -'bb19419e365cf97567dc0520cdcfba9e', +'b09527201c4409e19d1dbc5e3c3429a1', t1.id AS USER_ID, t1.dept_id AS GRID_ID, t1.del_flag, @@ -32,7 +32,7 @@ INSERT INTO epmet_gov_org.customer_staff_department ( UPDATED_TIME ) SELECT t1.id , -'bb19419e365cf97567dc0520cdcfba9e', +'b09527201c4409e19d1dbc5e3c3429a1', t1.id as USER_ID, t1.dept_id as DEPARTMENT_ID, t1.del_flag, @@ -60,7 +60,7 @@ INSERT INTO epmet_gov_org.customer_staff_agency ( UPDATED_TIME ) SELECT t1.id , -'bb19419e365cf97567dc0520cdcfba9e', +'b09527201c4409e19d1dbc5e3c3429a1', t1.id as USER_ID, t1.dept_id as AGENCY_ID, t1.del_flag, @@ -73,4 +73,96 @@ left join esua_epdc_admin.sys_dept t2 on t1.dept_id = t2.id WHERE t2.type_key = 'district_party' OR t2.type_key = 'street_party' - OR t2.type_key = 'community_party'; \ No newline at end of file + OR t2.type_key = 'community_party'; + +INSERT INTO epmet_user.customer_staff ( ID, CUSTOMER_ID,USER_ID,REAL_NAME,GENDER,EMAIL,MOBILE,HEAD_PHOTO,PASSWORD,DEL_FLAG,REVISION,CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) SELECT +t1.id as ID, +'b09527201c4409e19d1dbc5e3c3429a1', +t1.id AS USER_ID, +t1.real_name as REAL_NAME, +t1.gender as GENDER, +t1.email as EMAIL, +t1.mobile as MOBILE, +t1.head_url as HEAD_PHOTO, +t1.password as PASSWORD, +t1.del_flag as DEL_FLAG, +'0' as REVISION, +t1.creator AS CREATED_BY, +t1.create_date AS CREATED_TIME, +t1.updater AS UPDATED_BY, +t1.update_date AS UPDATED_TIME +FROM + esua_epdc_admin.sys_user t1 +where t1.user_tag_key ='offers'; + +INSERT INTO epmet_user.USER (ID, CUSTOMER_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) SELECT +t1.id AS ID, +'b09527201c4409e19d1dbc5e3c3429a1' AS CUSTOMER_ID, +t1.del_flag AS DEL_FLAG, +'0' AS REVISION, +t1.creator AS CREATED_BY, +t1.create_date AS CREATED_TIME, +t1.updater AS UPDATED_BY, +t1.update_date AS UPDATED_TIME +FROM + esua_epdc_admin.sys_user t1 +where t1.user_tag_key ='offers'; + + +INSERT INTO epmet_gov_org.staff_org_relation ( ID, CUSTOMER_ID, PIDS, STAFF_ID, ORG_ID, ORG_TYPE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) SELECT +t1.id AS ID, +'b09527201c4409e19d1dbc5e3c3429a1' AS CUSTOMER_ID, +CASE + t2.type_key + WHEN 'district_party' THEN + t2.pids + WHEN 'street_party' THEN + t2.pids + WHEN 'community_party' THEN + concat( + SUBSTRING_INDEX( t2.pids, ',', 1 ), + ':', + SUBSTRING_INDEX( t2.pids, ',',- 1 )) + WHEN 'district_dept' THEN + t2.pids + WHEN 'street_dept' THEN + concat( + SUBSTRING_INDEX( t2.pids, ',', 1 ), + ':', + SUBSTRING_INDEX( t2.pids, ',',- 1 )) + WHEN 'grid_party' THEN + concat( + SUBSTRING_INDEX( t2.pids, ',', 1 ), + ':', + SUBSTRING_INDEX( SUBSTRING_INDEX( t2.pids, ',', 2 ), ',',- 1 ), + ':', + SUBSTRING_INDEX( t2.pids, ',',- 1 )) + END AS PIDS, + t1.id AS STAFF_ID, + t2.id AS ORG_ID, +CASE + t2.type_key + WHEN 'district_party' THEN + 'agency' + WHEN 'street_party' THEN + 'agency' + WHEN 'community_party' THEN + 'agency' + WHEN 'district_dept' THEN + 'dept' + WHEN 'street_dept' THEN + 'dept' + WHEN 'grid_party' THEN + 'grid' + END AS ORG_TYPE, + t1.del_flag AS DEL_FLAG, + '0' AS REVISION, + t1.creator AS CREATED_BY, + t1.create_date AS CREATED_TIME, + t1.updater AS UPDATED_BY, + t1.update_date AS UPDATED_TIME +FROM + esua_epdc_admin.sys_user t1 + LEFT JOIN esua_epdc_admin.sys_dept t2 ON t1.dept_id = t2.id +WHERE + t1.user_tag_key = 'offers'; \ No newline at end of file diff --git a/doc/sql/部门组织初始化.sql b/doc/sql/部门组织初始化.sql index bbd75b2b8..110564b02 100644 --- a/doc/sql/部门组织初始化.sql +++ b/doc/sql/部门组织初始化.sql @@ -5,7 +5,7 @@ INSERT INTO epmet_gov_org.customer_grid ( ID, CUSTOMER_ID, GRID_NAME, SYNC_FLAG, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, MANAGE_DISTRICT, TOTAL_USER, PID, PIDS ) SELECT t1.id, -'bb19419e365cf97567dc0520cdcfba9e', +'b09527201c4409e19d1dbc5e3c3429a1', t1.NAME AS GRID_NAME, '1', t1.del_flag, @@ -45,7 +45,7 @@ INSERT INTO epmet_gov_org.customer_agency ( TOTAL_USER ) SELECT t1.id, -'bb19419e365cf97567dc0520cdcfba9e', +'b09527201c4409e19d1dbc5e3c3429a1', t1.pid, CASE t1.type_key @@ -112,7 +112,7 @@ INSERT INTO epmet_gov_org.customer_department ( UPDATED_TIME ) SELECT t1.id, -'bb19419e365cf97567dc0520cdcfba9e', +'b09527201c4409e19d1dbc5e3c3429a1', t1.pid as AGENCY_ID, t1.name as DEPARTMENT_NAME, t2.total AS TOTAL_USER, diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/StaffOrgRelationDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/StaffOrgRelationDao.java new file mode 100644 index 000000000..bc6326729 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/StaffOrgRelationDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.StaffOrgRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 工作人员注册组织关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-01-19 + */ +@Mapper +public interface StaffOrgRelationDao extends BaseDao { + + void deleteBatchStaffIds(@Param("idLists")List idLists); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/StaffOrgRelationEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/StaffOrgRelationEntity.java new file mode 100644 index 000000000..fbe06a11a --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/StaffOrgRelationEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员注册组织关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-01-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_gov_org.staff_org_relation") +public class StaffOrgRelationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所有上级组织机构ID(以英文:隔开)部门/网格得拼上所属组织Id + */ + private String pids; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员添加入口Id(agencyId;deptId;gridId) + */ + private String orgId; + + /** + * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + */ + private String orgType; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java index ab1151dac..7abf194f4 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java @@ -86,6 +86,8 @@ public class SysUserServiceImpl extends BaseServiceImpl page(Map params) { @@ -158,6 +160,8 @@ public class SysUserServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); @@ -244,11 +265,25 @@ public class SysUserServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq("STAFF_ID",dto.getId().toString()); + StaffOrgRelationEntity staffOrgRelationEntity = staffOrgRelationDao.selectOne(wrapper); + String typeKey = deptEntity.getTypeKey(); + staffOrgRelationEntity.setPids(StringUtils.join(StringUtils.split(deptEntity.getPids(), ","), ":")); + staffOrgRelationEntity.setOrgId(deptEntity.getId().toString()); + if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(typeKey)) { + staffOrgRelationEntity.setOrgType("grid"); + } else if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(typeKey) || OrganizationTypeConstant.ORG_TYPE_STREET_DEPT.equals(typeKey)) { + staffOrgRelationEntity.setOrgType("dept"); + } else { + staffOrgRelationEntity.setOrgType("agency"); + } + staffOrgRelationDao.updateById(staffOrgRelationEntity); } if (!sysUserEntity.getDeptId().equals(entity.getDeptId())) { //更新后用户的机构信息 - SysDeptEntity deptEntity = sysDeptDao.select(entity.getDeptId()); if (sysDeptEntity.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { //原来的组织部门totol_user -1 updateGridTotalUserBefore(sysDeptEntity); @@ -411,10 +446,11 @@ public class SysUserServiceImpl extends BaseServiceImpl idLists = Arrays.asList(ids).stream().map(x -> x.toString()).collect(Collectors.toList()); userDao.deleteBatchIds(idLists); customerStaffDao.deleteBatchUserIds(idLists); + staffOrgRelationDao.deleteBatchStaffIds(idLists); //物理删除组织用户 List sysUserEntities = baseDao.selectBatchIds(Arrays.asList(ids)); List deptIds = sysUserEntities.stream().map(x -> x.getDeptId().toString()).collect(Collectors.toList()); diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/StaffOrgRelationDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/StaffOrgRelationDao.xml new file mode 100644 index 000000000..d68aeaa8a --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/StaffOrgRelationDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + update epmet_gov_org.staff_org_relation set DEL_FLAG = '1' where STAFF_ID in + + #{staffId} + + + + From fd9cce1547e52dfc06512bfe144209cd6d478a98 Mon Sep 17 00:00:00 2001 From: mkh Date: Thu, 17 Feb 2022 09:52:23 +0800 Subject: [PATCH 8/8] =?UTF-8?q?token=E6=B7=BB=E5=8A=A0customerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/elink/esua/epdc/jwt/JwtTokenUtils.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/jwt/JwtTokenUtils.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/jwt/JwtTokenUtils.java index 736be6d35..10708abd7 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/jwt/JwtTokenUtils.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/jwt/JwtTokenUtils.java @@ -18,6 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Date; +import java.util.HashMap; +import java.util.Map; /** * Jwt工具类 @@ -36,6 +38,11 @@ public class JwtTokenUtils { * 生成jwt token */ public String generateToken(String userId) { + Map map = new HashMap<>(); + map.put("userId",userId); + map.put("app","resi"); + map.put("client","wxmp"); + map.put("customerId","b09527201c4409e19d1dbc5e3c3429a1"); return Jwts.builder() .setHeaderParam("typ", "JWT") .setSubject(userId)