From 5d83c7c88736204c13853db45404fd9ef73d5a92 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 17 Jun 2022 15:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/IcCityManagementDTO.java | 109 ++++++++++++ .../epmet/dto/IcDangerousChemicalsDTO.java | 124 +++++++++++++ .../com/epmet/dto/IcPublicServiceDTO.java | 109 ++++++++++++ .../com/epmet/dto/IcSuperiorResourceDTO.java | 109 ++++++++++++ .../form/IcCityManagementAddEditFormDTO.java | 69 +++++++ .../dto/form/IcCityManagementListFormDTO.java | 38 ++++ .../IcDangerousChemicalsAddEditFormDTO.java | 81 +++++++++ .../form/IcDangerousChemicalsListFormDTO.java | 42 +++++ .../form/IcPublicServiceAddEditFormDTO.java | 69 +++++++ .../dto/form/IcPublicServiceListFormDTO.java | 38 ++++ .../IcSuperiorResourceAddEditFormDTO.java | 69 +++++++ .../form/IcSuperiorResourceListFormDTO.java | 38 ++++ .../result/IcCityManagementListResultDTO.java | 68 +++++++ .../IcDangerousChemicalsListResultDTO.java | 80 +++++++++ .../result/IcPublicServiceListResultDTO.java | 68 +++++++ .../IcSuperiorResourceListResultDTO.java | 68 +++++++ .../IcCityManagementController.java | 164 +++++++++++++++++ .../IcDangerousChemicalsController.java | 168 ++++++++++++++++++ .../controller/IcPublicServiceController.java | 165 +++++++++++++++++ .../IcSuperiorResourceController.java | 163 +++++++++++++++++ .../com/epmet/dao/IcCityManagementDao.java | 24 +++ .../epmet/dao/IcDangerousChemicalsDao.java | 23 +++ .../com/epmet/dao/IcPublicServiceDao.java | 23 +++ .../com/epmet/dao/IcSuperiorResourceDao.java | 23 +++ .../epmet/entity/IcCityManagementEntity.java | 79 ++++++++ .../entity/IcDangerousChemicalsEntity.java | 91 ++++++++++ .../epmet/entity/IcPublicServiceEntity.java | 79 ++++++++ .../entity/IcSuperiorResourceEntity.java | 79 ++++++++ .../epmet/excel/IcCityManagementExcel.java | 39 ++++ .../excel/IcDangerousChemicalsExcel.java | 81 +++++++++ .../com/epmet/excel/IcPublicServiceExcel.java | 39 ++++ .../epmet/excel/IcSuperiorResourceExcel.java | 37 ++++ .../service/IcCityManagementService.java | 73 ++++++++ .../service/IcDangerousChemicalsService.java | 70 ++++++++ .../epmet/service/IcPublicServiceService.java | 71 ++++++++ .../service/IcSuperiorResourceService.java | 70 ++++++++ .../impl/IcCityManagementServiceImpl.java | 160 +++++++++++++++++ .../impl/IcDangerousChemicalsServiceImpl.java | 160 +++++++++++++++++ .../impl/IcPublicServiceServiceImpl.java | 157 ++++++++++++++++ .../impl/IcSuperiorResourceServiceImpl.java | 157 ++++++++++++++++ .../resources/mapper/IcCityManagementDao.xml | 51 ++++++ .../mapper/IcDangerousChemicalsDao.xml | 52 ++++++ .../resources/mapper/IcPublicServiceDao.xml | 52 ++++++ .../mapper/IcSuperiorResourceDao.xml | 53 ++++++ 44 files changed, 3582 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcCityManagementDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcDangerousChemicalsDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPublicServiceDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcSuperiorResourceDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementAddEditFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceAddEditFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceAddEditFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceListFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcCityManagementListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcDangerousChemicalsListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPublicServiceListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcSuperiorResourceListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcCityManagementController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcSuperiorResourceController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcCityManagementEntity.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcDangerousChemicalsEntity.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcSuperiorResourceEntity.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcCityManagementExcel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPublicServiceExcel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcSuperiorResourceExcel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcCityManagementService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcSuperiorResourceService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcCityManagementDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcCityManagementDTO.java new file mode 100644 index 0000000000..7e36b065b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcCityManagementDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcCityManagementDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 场所名称 + */ + private String name; + + /** + * 场所分类【字典表ic_coverage_category_dict key:city_management】 + */ + private String category; + + /** + * 占地面积,单位平方公里 + */ + private String areaCovered; + + /** + * 容纳人数 + */ + private Integer capacity; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 删除标识 + */ + 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/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcDangerousChemicalsDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcDangerousChemicalsDTO.java new file mode 100644 index 0000000000..8afffa5726 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcDangerousChemicalsDTO.java @@ -0,0 +1,124 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcDangerousChemicalsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 企业名称 + */ + private String name; + + /** + * 企业类型【字典表ic_coverage_category_dict key:dangerous_chemicals】 + */ + private String category; + + /** + * 周边安全距离,单位公里 + */ + private String safeDistance; + + /** + * 危化品种类【字典表 ic_danger_type】 + */ + private String dangerType; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经营地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 + */ + 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/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPublicServiceDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPublicServiceDTO.java new file mode 100644 index 0000000000..64045ddd17 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPublicServiceDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcPublicServiceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 场所名称 + */ + private String name; + + /** + * 场所分类【字典表ic_coverage_category_dict key:public_service】 + */ + private String category; + + /** + * 占地面积,单位平方公里 + */ + private String areaCovered; + + /** + * 容纳人数 + */ + private Integer capacity; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 删除标识 + */ + 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/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcSuperiorResourceDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcSuperiorResourceDTO.java new file mode 100644 index 0000000000..553e4318f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcSuperiorResourceDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcSuperiorResourceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 场所名称 + */ + private String name; + + /** + * 场所分类【字典表ic_coverage_category_dict key:superior_resource】 + */ + private String category; + + /** + * 占地面积,单位平方公里 + */ + private String areaCovered; + + /** + * 容纳人数 + */ + private Integer capacity; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 删除标识 + */ + 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/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementAddEditFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementAddEditFormDTO.java new file mode 100644 index 0000000000..ab73efa810 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementAddEditFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 优势资源新增/修改 + * @Author sun + */ +@Data +public class IcCityManagementAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Del extends CustomerClientShowGroup { + } + + /** + * 场所Id + */ + @NotBlank(message = "场所Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icCityManagementId; + /** + * 场所名称 + */ + @NotBlank(message = "场所名称不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "场所名称不能超过50位", groups = AddGroup.class) + private String name; + /** + * 场所类别 + */ + @NotBlank(message = "场所类别不能为空", groups = {AddGroup.class}) + private String category; + /** + * 占地面积 + */ + private String areaCovered; + /** + * 容纳人数 + */ + private Integer capacity; + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = {AddGroup.class}) + private String longitude; + /** + * 维度 + */ + @NotBlank(message = "维度不能为空", groups = {AddGroup.class}) + private String latitude; + /** + * 地址 + */ + @NotBlank(message = "地址不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "地址不能超过50位", groups = AddGroup.class) + private String address; + + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementListFormDTO.java new file mode 100644 index 0000000000..0511b85bb6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcCityManagementListFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口入参 + * @Author sun + */ +@Data +public class IcCityManagementListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 场所名称 + */ + private String name; + /** + * 场所分类,字典表值 + */ + private String category; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icCityManagementId; + private String customerId; + private String staffId; + private String agencyId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java new file mode 100644 index 0000000000..c67cb48fb2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 优势资源新增/修改 + * @Author sun + */ +@Data +public class IcDangerousChemicalsAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Del extends CustomerClientShowGroup { + } + + /** + * 场所Id + */ + @NotBlank(message = "场所Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icDangerousChemicalsId; + /** + * 企业名称 + */ + @NotBlank(message = "企业名称不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "场所名称不能超过50位", groups = AddGroup.class) + private String name; + /** + * 企业类型值 + */ + @NotBlank(message = "企业类型不能为空", groups = {AddGroup.class}) + private String category; + /** + * 周边安全距离 + */ + private String safeDistance; + /** + * 危化品种类字典值, key值:ic_danger_type + */ + private String dangerType; + /** + * 负责人 + */ + private String principalName; + /** + * 联系电话 + */ + private String principalMobile; + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = {AddGroup.class}) + private String longitude; + /** + * 维度 + */ + @NotBlank(message = "维度不能为空", groups = {AddGroup.class}) + private String latitude; + /** + * 地址 + */ + @NotBlank(message = "地址不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "地址不能超过50位", groups = AddGroup.class) + private String address; + /** + * 备注 + */ + private String remark; + + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java new file mode 100644 index 0000000000..b0b7e589f4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口入参 + * @Author sun + */ +@Data +public class IcDangerousChemicalsListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 场所名称 + */ + private String name; + /** + * 场所分类,字典表值 + */ + private String category; + /** + * 危化品种类字典值 + */ + private String dangerType; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icDangerousChemicalsId; + private String customerId; + private String staffId; + private String agencyId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceAddEditFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceAddEditFormDTO.java new file mode 100644 index 0000000000..fb9cbf6b26 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceAddEditFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 优势资源新增/修改 + * @Author sun + */ +@Data +public class IcPublicServiceAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Del extends CustomerClientShowGroup { + } + + /** + * 场所Id + */ + @NotBlank(message = "场所Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icPublicServiceId; + /** + * 场所名称 + */ + @NotBlank(message = "场所名称不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "场所名称不能超过50位", groups = AddGroup.class) + private String name; + /** + * 场所类别 + */ + @NotBlank(message = "场所类别不能为空", groups = {AddGroup.class}) + private String category; + /** + * 占地面积 + */ + private String areaCovered; + /** + * 容纳人数 + */ + private Integer capacity; + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = {AddGroup.class}) + private String longitude; + /** + * 维度 + */ + @NotBlank(message = "维度不能为空", groups = {AddGroup.class}) + private String latitude; + /** + * 地址 + */ + @NotBlank(message = "地址不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "地址不能超过50位", groups = AddGroup.class) + private String address; + + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceListFormDTO.java new file mode 100644 index 0000000000..ca5b8aefda --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceListFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口入参 + * @Author sun + */ +@Data +public class IcPublicServiceListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 场所名称 + */ + private String name; + /** + * 场所分类,字典表值 + */ + private String category; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icPublicServiceId; + private String customerId; + private String staffId; + private String agencyId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceAddEditFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceAddEditFormDTO.java new file mode 100644 index 0000000000..d28569a0a1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceAddEditFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 优势资源新增/修改 + * @Author sun + */ +@Data +public class IcSuperiorResourceAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Del extends CustomerClientShowGroup { + } + + /** + * 场所Id + */ + @NotBlank(message = "场所Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icSuperiorResourceId; + /** + * 场所名称 + */ + @NotBlank(message = "场所名称不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "场所名称不能超过50位", groups = AddGroup.class) + private String name; + /** + * 场所类别 + */ + @NotBlank(message = "场所类别不能为空", groups = {AddGroup.class}) + private String category; + /** + * 占地面积 + */ + private String areaCovered; + /** + * 容纳人数 + */ + private Integer capacity; + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = {AddGroup.class}) + private String longitude; + /** + * 维度 + */ + @NotBlank(message = "维度不能为空", groups = {AddGroup.class}) + private String latitude; + /** + * 地址 + */ + @NotBlank(message = "地址不能为空", groups = {AddGroup.class}) + @Length(max = 50, message = "地址不能超过50位", groups = AddGroup.class) + private String address; + + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceListFormDTO.java new file mode 100644 index 0000000000..026ece3d56 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcSuperiorResourceListFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口入参 + * @Author sun + */ +@Data +public class IcSuperiorResourceListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 场所名称 + */ + private String name; + /** + * 场所分类,字典表值 + */ + private String category; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icSuperiorResourceId; + private String customerId; + private String staffId; + private String agencyId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcCityManagementListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcCityManagementListResultDTO.java new file mode 100644 index 0000000000..6c40cb030c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcCityManagementListResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口返参 + * @Author sun + */ +@Data +public class IcCityManagementListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 场所Id + */ + private String icCityManagementId; + /** + * 组织Id + */ + private String agencyId; + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + /** + * 场所名称 + */ + private String name; + /** + * 场所类别值 + */ + private String category; + /** + * 场所类别名 + */ + private String categoryName; + /** + * 占地面积值 + */ + private String areaCovered; + /** + * 占地面积名 + */ + private String areaCoveredName; + /** + * 容纳人数值 + */ + private String capacity; + /** + * 容纳人数名 + */ + private String capacityName; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcDangerousChemicalsListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcDangerousChemicalsListResultDTO.java new file mode 100644 index 0000000000..bf00d9205e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcDangerousChemicalsListResultDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口返参 + * @Author sun + */ +@Data +public class IcDangerousChemicalsListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 企业Id + */ + private String icDangerousChemicalsId; + /** + * 组织Id + */ + private String agencyId; + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + /** + * 企业名称 + */ + private String name; + /** + * 企业类型值 + */ + private String category; + /** + * 企业类型名 + */ + private String categoryName; + /** + * 周边安全距离 + */ + private String safeDistance; + /** + * 周边安全距离名 + */ + private String safeDistanceName; + /** + * 危化品种类值 + */ + private String dangerType; + /** + * 危化品种类名 + */ + private String dangerTypeName; + /** + * 负责人 + */ + private String principalName; + /** + * 联系电话 + */ + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPublicServiceListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPublicServiceListResultDTO.java new file mode 100644 index 0000000000..859b36faca --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPublicServiceListResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口返参 + * @Author sun + */ +@Data +public class IcPublicServiceListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 场所Id + */ + private String icPublicServiceId; + /** + * 组织Id + */ + private String agencyId; + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + /** + * 场所名称 + */ + private String name; + /** + * 场所类别值 + */ + private String category; + /** + * 场所类别名 + */ + private String categoryName; + /** + * 占地面积值 + */ + private String areaCovered; + /** + * 占地面积名 + */ + private String areaCoveredName; + /** + * 容纳人数值 + */ + private String capacity; + /** + * 容纳人数名 + */ + private String capacityName; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcSuperiorResourceListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcSuperiorResourceListResultDTO.java new file mode 100644 index 0000000000..28f5c6202f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcSuperiorResourceListResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【优势资源】列表--接口返参 + * @Author sun + */ +@Data +public class IcSuperiorResourceListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 场所Id + */ + private String icSuperiorResourceId; + /** + * 组织Id + */ + private String agencyId; + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + /** + * 场所名称 + */ + private String name; + /** + * 场所类别值 + */ + private String category; + /** + * 场所类别名 + */ + private String categoryName; + /** + * 占地面积值 + */ + private String areaCovered; + /** + * 占地面积名 + */ + private String areaCoveredName; + /** + * 容纳人数值 + */ + private String capacity; + /** + * 容纳人数名 + */ + private String capacityName; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcCityManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcCityManagementController.java new file mode 100644 index 0000000000..76e111baa2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcCityManagementController.java @@ -0,0 +1,164 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcCityManagementDTO; +import com.epmet.dto.form.IcCityManagementAddEditFormDTO; +import com.epmet.dto.form.IcCityManagementListFormDTO; +import com.epmet.dto.result.IcCityManagementListResultDTO; +import com.epmet.excel.IcCityManagementExcel; +import com.epmet.service.IcCityManagementService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.util.Date; +import java.util.List; + + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@RestController +@RequestMapping("icCityManagement") +@Slf4j +public class IcCityManagementController { + + @Autowired + private IcCityManagementService icCityManagementService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcCityManagementListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icCityManagementService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcCityManagementDTO data = icCityManagementService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcCityManagementAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icCityManagementService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcCityManagementAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icCityManagementService.update(formDTO); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcCityManagementAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcCityManagementAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icCityManagementService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcCityManagementListFormDTO formDTO) { + return new Result().ok(icCityManagementService.detail(formDTO)); + } + + @RequestMapping(value = "download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("优势资源管理导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/superior_resource_template.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcCityManagementListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "优势资源管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcCityManagementExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icCityManagementService.list(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcCityManagementExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java new file mode 100644 index 0000000000..84289ab8a5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java @@ -0,0 +1,168 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcDangerousChemicalsDTO; +import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; +import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; +import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.excel.IcDangerousChemicalsExcel; +import com.epmet.excel.IcDangerousChemicalsExcel; +import com.epmet.service.IcDangerousChemicalsService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@RestController +@RequestMapping("icDangerousChemicals") +@Slf4j +public class IcDangerousChemicalsController { + + @Autowired + private IcDangerousChemicalsService icDangerousChemicalsService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icDangerousChemicalsService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcDangerousChemicalsDTO data = icDangerousChemicalsService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icDangerousChemicalsService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icDangerousChemicalsService.update(formDTO); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcDangerousChemicalsAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icDangerousChemicalsService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcDangerousChemicalsListFormDTO formDTO) { + return new Result().ok(icDangerousChemicalsService.detail(formDTO)); + } + + @RequestMapping(value = "download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("优势资源管理导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/superior_resource_template.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "优势资源管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcDangerousChemicalsExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icDangerousChemicalsService.list(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcDangerousChemicalsExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java new file mode 100644 index 0000000000..3071f4d97e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java @@ -0,0 +1,165 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcPublicServiceDTO; +import com.epmet.dto.form.IcPublicServiceAddEditFormDTO; +import com.epmet.dto.form.IcPublicServiceListFormDTO; +import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO; +import com.epmet.dto.result.IcPublicServiceListResultDTO; +import com.epmet.excel.IcPublicServiceExcel; +import com.epmet.service.IcPublicServiceService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.util.Date; +import java.util.List; + + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@RestController +@RequestMapping("icPublicService") +@Slf4j +public class IcPublicServiceController { + + @Autowired + private IcPublicServiceService icPublicServiceService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icPublicServiceService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPublicServiceDTO data = icPublicServiceService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icPublicServiceService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icPublicServiceService.update(formDTO); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcSuperiorResourceAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icPublicServiceService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcPublicServiceListFormDTO formDTO) { + return new Result().ok(icPublicServiceService.detail(formDTO)); + } + + @RequestMapping(value = "download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("优势资源管理导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/public_service_template.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "优势资源管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPublicServiceExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icPublicServiceService.list(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcPublicServiceExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcSuperiorResourceController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcSuperiorResourceController.java new file mode 100644 index 0000000000..c9aec6b4d0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcSuperiorResourceController.java @@ -0,0 +1,163 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcSuperiorResourceDTO; +import com.epmet.dto.form.IcSuperiorResourceListFormDTO; +import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO; +import com.epmet.dto.result.IcSuperiorResourceListResultDTO; +import com.epmet.excel.IcSuperiorResourceExcel; +import com.epmet.service.IcSuperiorResourceService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.util.Date; +import java.util.List; + + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@RestController +@RequestMapping("icSuperiorResource") +@Slf4j +public class IcSuperiorResourceController { + + @Autowired + private IcSuperiorResourceService icSuperiorResourceService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcSuperiorResourceListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icSuperiorResourceService.list(formDTO)); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + IcSuperiorResourceDTO data = icSuperiorResourceService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcSuperiorResourceAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icSuperiorResourceService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcSuperiorResourceAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icSuperiorResourceService.update(formDTO); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcSuperiorResourceAddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcSuperiorResourceAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icSuperiorResourceService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcSuperiorResourceListFormDTO formDTO) { + return new Result().ok(icSuperiorResourceService.detail(formDTO)); + } + + @RequestMapping(value = "download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("优势资源管理导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/superior_resource_template.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcSuperiorResourceListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "优势资源管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcSuperiorResourceExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icSuperiorResourceService.list(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcSuperiorResourceExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java new file mode 100644 index 0000000000..ba554957d5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java @@ -0,0 +1,24 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcCityManagementListFormDTO; +import com.epmet.dto.result.IcCityManagementListResultDTO; +import com.epmet.entity.IcCityManagementEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Mapper +public interface IcCityManagementDao extends BaseDao { + + List selectCityManagementList(IcCityManagementListFormDTO formDTO); + + void del(IcCityManagementEntity entity); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java new file mode 100644 index 0000000000..03c1c90c62 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; +import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.entity.IcDangerousChemicalsEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Mapper +public interface IcDangerousChemicalsDao extends BaseDao { + + List selectDangerousChemicalsList(IcDangerousChemicalsListFormDTO formDTO); + + void del(IcDangerousChemicalsEntity entity); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java new file mode 100644 index 0000000000..e1a168ae30 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcPublicServiceListFormDTO; +import com.epmet.dto.result.IcPublicServiceListResultDTO; +import com.epmet.entity.IcPublicServiceEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Mapper +public interface IcPublicServiceDao extends BaseDao { + + List selectPublicServiceList(IcPublicServiceListFormDTO formDTO); + + void del(IcPublicServiceEntity entity); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java new file mode 100644 index 0000000000..1ac3c972f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcSuperiorResourceListFormDTO; +import com.epmet.dto.result.IcSuperiorResourceListResultDTO; +import com.epmet.entity.IcSuperiorResourceEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Mapper +public interface IcSuperiorResourceDao extends BaseDao { + + List selectSuperiorResourceList(IcSuperiorResourceListFormDTO formDTO); + + void del(IcSuperiorResourceEntity entity); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcCityManagementEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcCityManagementEntity.java new file mode 100644 index 0000000000..8a90c40380 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcCityManagementEntity.java @@ -0,0 +1,79 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_city_management") +public class IcCityManagementEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 场所名称 + */ + private String name; + + /** + * 场所分类【字典表ic_coverage_category_dict key:city_management】 + */ + private String category; + + /** + * 占地面积,单位平方公里 + */ + private String areaCovered; + + /** + * 容纳人数 + */ + private Integer capacity; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcDangerousChemicalsEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcDangerousChemicalsEntity.java new file mode 100644 index 0000000000..e4e9e35252 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcDangerousChemicalsEntity.java @@ -0,0 +1,91 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_dangerous_chemicals") +public class IcDangerousChemicalsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 企业名称 + */ + private String name; + + /** + * 企业类型【字典表ic_coverage_category_dict key:dangerous_chemicals】 + */ + private String category; + + /** + * 周边安全距离,单位公里 + */ + private String safeDistance; + + /** + * 危化品种类【字典表 ic_danger_type】 + */ + private String dangerType; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经营地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java new file mode 100644 index 0000000000..5c0e35ec89 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java @@ -0,0 +1,79 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_public_service") +public class IcPublicServiceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 场所名称 + */ + private String name; + + /** + * 场所分类【字典表ic_coverage_category_dict key:public_service】 + */ + private String category; + + /** + * 占地面积,单位平方公里 + */ + private String areaCovered; + + /** + * 容纳人数 + */ + private Integer capacity; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcSuperiorResourceEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcSuperiorResourceEntity.java new file mode 100644 index 0000000000..193a8a5283 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcSuperiorResourceEntity.java @@ -0,0 +1,79 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_superior_resource") +public class IcSuperiorResourceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 场所名称 + */ + private String name; + + /** + * 场所分类【字典表ic_coverage_category_dict key:superior_resource】 + */ + private String category; + + /** + * 占地面积,单位平方公里 + */ + private String areaCovered; + + /** + * 容纳人数 + */ + private Integer capacity; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcCityManagementExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcCityManagementExcel.java new file mode 100644 index 0000000000..aa616ce854 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcCityManagementExcel.java @@ -0,0 +1,39 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.util.Date; + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcCityManagementExcel { + + @ExcelProperty(value = "场所名称") + @ColumnWidth(25) + private String name; + + @ExcelProperty(value = "场所类别") + @ColumnWidth(20) + private String categoryName; + + @ExcelProperty(value = "占地面积") + @ColumnWidth(25) + private String areaCoveredName; + + @ExcelProperty(value = "容纳人数") + @ColumnWidth(20) + private Integer capacityName; + + @ExcelProperty(value = "地址") + @ColumnWidth(25) + private String address; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java new file mode 100644 index 0000000000..9a4c6ad7aa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java @@ -0,0 +1,81 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcDangerousChemicalsExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "所属组织机构Id") + private String agencyId; + + @Excel(name = "agencyId的所有上级,包含自己") + private String agencyIdPath; + + @Excel(name = "来源【新增:add 导入:import 】") + private String sourceType; + + @Excel(name = "企业名称") + private String name; + + @Excel(name = "企业类型【字典表ic_coverage_category_dict key:dangerous_chemicals】") + private String category; + + @Excel(name = "周边安全距离,单位公里") + private String safeDistance; + + @Excel(name = "危化品种类【字典表 ic_danger_type】") + private Integer dangerType; + + @Excel(name = "负责人姓名") + private String principalName; + + @Excel(name = "负责人电话") + private String principalMobile; + + @Excel(name = "经营地址") + private String address; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPublicServiceExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPublicServiceExcel.java new file mode 100644 index 0000000000..34edee1026 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPublicServiceExcel.java @@ -0,0 +1,39 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.util.Date; + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcPublicServiceExcel { + + @ExcelProperty(value = "场所名称") + @ColumnWidth(25) + private String name; + + @ExcelProperty(value = "场所类别") + @ColumnWidth(20) + private String categoryName; + + @ExcelProperty(value = "占地面积") + @ColumnWidth(25) + private String areaCoveredName; + + @ExcelProperty(value = "容纳人数") + @ColumnWidth(20) + private Integer capacityName; + + @ExcelProperty(value = "地址") + @ColumnWidth(25) + private String address; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcSuperiorResourceExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcSuperiorResourceExcel.java new file mode 100644 index 0000000000..b62792ec1c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcSuperiorResourceExcel.java @@ -0,0 +1,37 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Data +public class IcSuperiorResourceExcel { + + @ExcelProperty(value = "场所名称") + @ColumnWidth(25) + private String name; + + @ExcelProperty(value = "场所类别") + @ColumnWidth(20) + private String categoryName; + + @ExcelProperty(value = "占地面积") + @ColumnWidth(25) + private String areaCoveredName; + + @ExcelProperty(value = "容纳人数") + @ColumnWidth(20) + private Integer capacityName; + + @ExcelProperty(value = "地址") + @ColumnWidth(25) + private String address; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcCityManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcCityManagementService.java new file mode 100644 index 0000000000..cd8eb0ab00 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcCityManagementService.java @@ -0,0 +1,73 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcCityManagementDTO; +import com.epmet.dto.form.IcCityManagementAddEditFormDTO; +import com.epmet.dto.form.IcCityManagementListFormDTO; +import com.epmet.dto.result.IcCityManagementListResultDTO; +import com.epmet.entity.IcCityManagementEntity; + +import java.util.List; +import java.util.Map; + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +public interface IcCityManagementService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-06-16 + */ + PageData list(IcCityManagementListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcCityManagementDTO + * @author generator + * @date 2022-06-16 + */ + IcCityManagementDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void save(IcCityManagementAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void update(IcCityManagementAddEditFormDTO dto); + + /** + * 批量删除 + * + * @return void + * @author generator + * @date 2022-06-16 + */ + void delete(IcCityManagementAddEditFormDTO formDTO); + + IcCityManagementListResultDTO detail(IcCityManagementListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java new file mode 100644 index 0000000000..321437f1f6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java @@ -0,0 +1,70 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcDangerousChemicalsDTO; +import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; +import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; +import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.entity.IcDangerousChemicalsEntity; + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +public interface IcDangerousChemicalsService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-06-16 + */ + PageData list(IcDangerousChemicalsListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcDangerousChemicalsDTO + * @author generator + * @date 2022-06-16 + */ + IcDangerousChemicalsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void save(IcDangerousChemicalsAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void update(IcDangerousChemicalsAddEditFormDTO dto); + + /** + * 批量删除 + * + * @return void + * @author generator + * @date 2022-06-16 + */ + void delete(IcDangerousChemicalsAddEditFormDTO formDTO); + + IcDangerousChemicalsListResultDTO detail(IcDangerousChemicalsListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java new file mode 100644 index 0000000000..062337b6d3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java @@ -0,0 +1,71 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPublicServiceDTO; +import com.epmet.dto.form.IcPublicServiceAddEditFormDTO; +import com.epmet.dto.form.IcPublicServiceListFormDTO; +import com.epmet.dto.result.IcPublicServiceListResultDTO; +import com.epmet.entity.IcPublicServiceEntity; + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +public interface IcPublicServiceService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-06-16 + */ + PageData list(IcPublicServiceListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcPublicServiceDTO + * @author generator + * @date 2022-06-16 + */ + IcPublicServiceDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void save(IcPublicServiceAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void update(IcPublicServiceAddEditFormDTO dto); + + /** + * 批量删除 + * + * @return void + * @author generator + * @date 2022-06-16 + */ + void delete(IcPublicServiceAddEditFormDTO dto); + + IcPublicServiceListResultDTO detail(IcPublicServiceListFormDTO formDTO); + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcSuperiorResourceService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcSuperiorResourceService.java new file mode 100644 index 0000000000..23eff34421 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcSuperiorResourceService.java @@ -0,0 +1,70 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcSuperiorResourceDTO; +import com.epmet.dto.form.IcSuperiorResourceListFormDTO; +import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO; +import com.epmet.dto.result.IcSuperiorResourceListResultDTO; +import com.epmet.entity.IcSuperiorResourceEntity; + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +public interface IcSuperiorResourceService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-06-16 + */ + PageData list(IcSuperiorResourceListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcSuperiorResourceDTO + * @author generator + * @date 2022-06-16 + */ + IcSuperiorResourceDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void save(IcSuperiorResourceAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-16 + */ + void update(IcSuperiorResourceAddEditFormDTO dto); + + /** + * 批量删除 + * + * @return void + * @author generator + * @date 2022-06-16 + */ + void delete(IcSuperiorResourceAddEditFormDTO formDTO); + + IcSuperiorResourceListResultDTO detail(IcSuperiorResourceListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java new file mode 100644 index 0000000000..5a8c4d2800 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java @@ -0,0 +1,160 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcCityManagementDao; +import com.epmet.dto.IcCityManagementDTO; +import com.epmet.dto.form.IcCityManagementAddEditFormDTO; +import com.epmet.dto.form.IcCityManagementListFormDTO; +import com.epmet.dto.result.IcCityManagementListResultDTO; +import com.epmet.entity.IcCityManagementEntity; +import com.epmet.entity.IcCityManagementEntity; +import com.epmet.service.IcCityManagementService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 城市管理图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Service +public class IcCityManagementServiceImpl extends BaseServiceImpl implements IcCityManagementService { + + + @Override + public PageData list(IcCityManagementListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectCityManagementList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcCityManagementListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcCityManagementDTO get(String id) { + IcCityManagementEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcCityManagementDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcCityManagementAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcCityManagementEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcCityManagementEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的场所"); + } + //3.新增服务组织数据 + IcCityManagementEntity entity = ConvertUtils.sourceToTarget(formDTO, IcCityManagementEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcCityManagementAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcCityManagementEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcCityManagementEntity::getId, formDTO.getIcCityManagementId()); + tWrapper.eq(IcCityManagementEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcCityManagementEntity entity = ConvertUtils.sourceToTarget(formDTO, IcCityManagementEntity.class); + entity.setId(formDTO.getIcCityManagementId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcCityManagementAddEditFormDTO formDTO) { + IcCityManagementEntity entity = new IcCityManagementEntity(); + entity.setId(formDTO.getIcCityManagementId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcCityManagementListResultDTO detail(IcCityManagementListFormDTO formDTO) { + IcCityManagementListResultDTO resultDTO = new IcCityManagementListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectCityManagementList(formDTO); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcCityManagementListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java new file mode 100644 index 0000000000..62a4c240e5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java @@ -0,0 +1,160 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcDangerousChemicalsDao; +import com.epmet.dto.IcDangerousChemicalsDTO; +import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; +import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; +import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.entity.IcDangerousChemicalsEntity; +import com.epmet.entity.IcDangerousChemicalsEntity; +import com.epmet.service.IcDangerousChemicalsService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 重点危化品企业 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Service +public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl implements IcDangerousChemicalsService { + + + @Override + public PageData list(IcDangerousChemicalsListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectDangerousChemicalsList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcDangerousChemicalsListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcDangerousChemicalsDTO get(String id) { + IcDangerousChemicalsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcDangerousChemicalsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcDangerousChemicalsAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcDangerousChemicalsEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的场所"); + } + //3.新增服务组织数据 + IcDangerousChemicalsEntity entity = ConvertUtils.sourceToTarget(formDTO, IcDangerousChemicalsEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcDangerousChemicalsAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcDangerousChemicalsEntity::getId, formDTO.getIcDangerousChemicalsId()); + tWrapper.eq(IcDangerousChemicalsEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcDangerousChemicalsEntity entity = ConvertUtils.sourceToTarget(formDTO, IcDangerousChemicalsEntity.class); + entity.setId(formDTO.getIcDangerousChemicalsId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcDangerousChemicalsAddEditFormDTO formDTO) { + IcDangerousChemicalsEntity entity = new IcDangerousChemicalsEntity(); + entity.setId(formDTO.getIcDangerousChemicalsId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcDangerousChemicalsListResultDTO detail(IcDangerousChemicalsListFormDTO formDTO) { + IcDangerousChemicalsListResultDTO resultDTO = new IcDangerousChemicalsListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectDangerousChemicalsList(formDTO); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcDangerousChemicalsListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java new file mode 100644 index 0000000000..e26a033a01 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java @@ -0,0 +1,157 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcPublicServiceDao; +import com.epmet.dto.IcPublicServiceDTO; +import com.epmet.dto.form.IcPublicServiceAddEditFormDTO; +import com.epmet.dto.form.IcPublicServiceListFormDTO; +import com.epmet.dto.result.IcPublicServiceListResultDTO; +import com.epmet.entity.IcPublicServiceEntity; +import com.epmet.service.IcPublicServiceService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; + +/** + * 公共服务图层 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Service +public class IcPublicServiceServiceImpl extends BaseServiceImpl implements IcPublicServiceService { + + + @Override + public PageData list(IcPublicServiceListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectPublicServiceList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcPublicServiceListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPublicServiceDTO get(String id) { + IcPublicServiceEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPublicServiceDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPublicServiceAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcPublicServiceEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcPublicServiceEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的场所"); + } + //3.新增服务组织数据 + IcPublicServiceEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPublicServiceEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPublicServiceAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcPublicServiceEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcPublicServiceEntity::getId, formDTO.getIcPublicServiceId()); + tWrapper.eq(IcPublicServiceEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcPublicServiceEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPublicServiceEntity.class); + entity.setId(formDTO.getIcPublicServiceId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcPublicServiceAddEditFormDTO formDTO) { + IcPublicServiceEntity entity = new IcPublicServiceEntity(); + entity.setId(formDTO.getIcPublicServiceId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcPublicServiceListResultDTO detail(IcPublicServiceListFormDTO formDTO) { + IcPublicServiceListResultDTO resultDTO = new IcPublicServiceListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectPublicServiceList(formDTO); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcPublicServiceListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java new file mode 100644 index 0000000000..27e940c730 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java @@ -0,0 +1,157 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcSuperiorResourceDao; +import com.epmet.dto.IcSuperiorResourceDTO; +import com.epmet.dto.form.IcSuperiorResourceListFormDTO; +import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO; +import com.epmet.dto.result.IcSuperiorResourceListResultDTO; +import com.epmet.entity.IcSuperiorResourceEntity; +import com.epmet.service.IcSuperiorResourceService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; + +/** + * 优势资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-16 + */ +@Service +public class IcSuperiorResourceServiceImpl extends BaseServiceImpl implements IcSuperiorResourceService { + + + @Override + public PageData list(IcSuperiorResourceListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectSuperiorResourceList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcSuperiorResourceListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcSuperiorResourceDTO get(String id) { + IcSuperiorResourceEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcSuperiorResourceDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcSuperiorResourceAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcSuperiorResourceEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcSuperiorResourceEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的场所"); + } + //3.新增服务组织数据 + IcSuperiorResourceEntity entity = ConvertUtils.sourceToTarget(formDTO, IcSuperiorResourceEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcSuperiorResourceAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcSuperiorResourceEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcSuperiorResourceEntity::getId, formDTO.getIcSuperiorResourceId()); + tWrapper.eq(IcSuperiorResourceEntity::getName, formDTO.getName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcSuperiorResourceEntity entity = ConvertUtils.sourceToTarget(formDTO, IcSuperiorResourceEntity.class); + entity.setId(formDTO.getIcSuperiorResourceId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcSuperiorResourceAddEditFormDTO formDTO) { + IcSuperiorResourceEntity entity = new IcSuperiorResourceEntity(); + entity.setId(formDTO.getIcSuperiorResourceId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcSuperiorResourceListResultDTO detail(IcSuperiorResourceListFormDTO formDTO) { + IcSuperiorResourceListResultDTO resultDTO = new IcSuperiorResourceListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectSuperiorResourceList(formDTO); + + //封装类别数据 + if (!CollectionUtils.isEmpty(list)) { + /*Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + for (IcSuperiorResourceListResultDTO v : list) { + if (StringUtils.isNotBlank(v.getCategory())) { + v.setCategoryName(statusMap.get(v.getCategory())); + } + }*/ + } + + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml new file mode 100644 index 0000000000..5d7e5dfdbc --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml @@ -0,0 +1,51 @@ + + + + + + + + + UPDATE ic_city_management + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml new file mode 100644 index 0000000000..c9d2242132 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml @@ -0,0 +1,52 @@ + + + + + + + + + UPDATE ic_dangerous_chemicals + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml new file mode 100644 index 0000000000..91ea0d7cce --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml @@ -0,0 +1,52 @@ + + + + + + + + + UPDATE ic_public_service + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml new file mode 100644 index 0000000000..9edfe1c756 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + UPDATE ic_superior_resource + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + + + \ No newline at end of file