44 changed files with 3582 additions and 0 deletions
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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<PageData<IcCityManagementListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcCityManagementListFormDTO formDTO) { |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
return new Result<PageData<IcCityManagementListResultDTO>>().ok(icCityManagementService.list(formDTO)); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcCityManagementDTO> get(@PathVariable("id") String id){ |
||||
|
IcCityManagementDTO data = icCityManagementService.get(id); |
||||
|
return new Result<IcCityManagementDTO>().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<IcCityManagementListResultDTO> detail(@RequestBody IcCityManagementListFormDTO formDTO) { |
||||
|
return new Result<IcCityManagementListResultDTO>().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<IcCityManagementListResultDTO> data = null; |
||||
|
List<IcCityManagementExcel> 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<Object> 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(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -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<PageData<IcDangerousChemicalsListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsListFormDTO formDTO) { |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
return new Result<PageData<IcDangerousChemicalsListResultDTO>>().ok(icDangerousChemicalsService.list(formDTO)); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcDangerousChemicalsDTO> get(@PathVariable("id") String id){ |
||||
|
IcDangerousChemicalsDTO data = icDangerousChemicalsService.get(id); |
||||
|
return new Result<IcDangerousChemicalsDTO>().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<IcDangerousChemicalsListResultDTO> detail(@RequestBody IcDangerousChemicalsListFormDTO formDTO) { |
||||
|
return new Result<IcDangerousChemicalsListResultDTO>().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<IcDangerousChemicalsListResultDTO> data = null; |
||||
|
List<IcDangerousChemicalsExcel> 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<Object> 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(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -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<PageData<IcPublicServiceListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceListFormDTO formDTO) { |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
return new Result<PageData<IcPublicServiceListResultDTO>>().ok(icPublicServiceService.list(formDTO)); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcPublicServiceDTO> get(@PathVariable("id") String id){ |
||||
|
IcPublicServiceDTO data = icPublicServiceService.get(id); |
||||
|
return new Result<IcPublicServiceDTO>().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<IcPublicServiceListResultDTO> detail(@RequestBody IcPublicServiceListFormDTO formDTO) { |
||||
|
return new Result<IcPublicServiceListResultDTO>().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<IcPublicServiceListResultDTO> data = null; |
||||
|
List<IcPublicServiceExcel> 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<Object> 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(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -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<PageData<IcSuperiorResourceListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcSuperiorResourceListFormDTO formDTO) { |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
return new Result<PageData<IcSuperiorResourceListResultDTO>>().ok(icSuperiorResourceService.list(formDTO)); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<IcSuperiorResourceDTO> get(@PathVariable("id") String id) { |
||||
|
IcSuperiorResourceDTO data = icSuperiorResourceService.get(id); |
||||
|
return new Result<IcSuperiorResourceDTO>().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<IcSuperiorResourceListResultDTO> detail(@RequestBody IcSuperiorResourceListFormDTO formDTO) { |
||||
|
return new Result<IcSuperiorResourceListResultDTO>().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<IcSuperiorResourceListResultDTO> data = null; |
||||
|
List<IcSuperiorResourceExcel> 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<Object> 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(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -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<IcCityManagementEntity> { |
||||
|
|
||||
|
List<IcCityManagementListResultDTO> selectCityManagementList(IcCityManagementListFormDTO formDTO); |
||||
|
|
||||
|
void del(IcCityManagementEntity entity); |
||||
|
|
||||
|
} |
@ -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<IcDangerousChemicalsEntity> { |
||||
|
|
||||
|
List<IcDangerousChemicalsListResultDTO> selectDangerousChemicalsList(IcDangerousChemicalsListFormDTO formDTO); |
||||
|
|
||||
|
void del(IcDangerousChemicalsEntity entity); |
||||
|
} |
@ -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<IcPublicServiceEntity> { |
||||
|
|
||||
|
List<IcPublicServiceListResultDTO> selectPublicServiceList(IcPublicServiceListFormDTO formDTO); |
||||
|
|
||||
|
void del(IcPublicServiceEntity entity); |
||||
|
} |
@ -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<IcSuperiorResourceEntity> { |
||||
|
|
||||
|
List<IcSuperiorResourceListResultDTO> selectSuperiorResourceList(IcSuperiorResourceListFormDTO formDTO); |
||||
|
|
||||
|
void del(IcSuperiorResourceEntity entity); |
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
|
||||
|
} |
@ -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<IcCityManagementEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<IcCityManagementDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-16 |
||||
|
*/ |
||||
|
PageData<IcCityManagementListResultDTO> 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); |
||||
|
|
||||
|
} |
@ -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<IcDangerousChemicalsEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<IcDangerousChemicalsDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-16 |
||||
|
*/ |
||||
|
PageData<IcDangerousChemicalsListResultDTO> 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); |
||||
|
|
||||
|
} |
@ -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<IcPublicServiceEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<IcPublicServiceDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-16 |
||||
|
*/ |
||||
|
PageData<IcPublicServiceListResultDTO> 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); |
||||
|
|
||||
|
|
||||
|
} |
@ -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<IcSuperiorResourceEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<IcSuperiorResourceDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-16 |
||||
|
*/ |
||||
|
PageData<IcSuperiorResourceListResultDTO> 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); |
||||
|
|
||||
|
} |
@ -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<IcCityManagementDao, IcCityManagementEntity> implements IcCityManagementService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcCityManagementListResultDTO> 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<IcCityManagementListResultDTO> list = baseDao.selectCityManagementList(formDTO); |
||||
|
PageInfo<IcCityManagementListResultDTO> pageInfo = new PageInfo<>(list); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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<IcCityManagementEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcCityManagementEntity> 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<IcCityManagementEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcCityManagementEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.eq(IcCityManagementEntity::getName, formDTO.getName()); |
||||
|
List<IcCityManagementEntity> 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<IcCityManagementEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcCityManagementEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.ne(IcCityManagementEntity::getId, formDTO.getIcCityManagementId()); |
||||
|
tWrapper.eq(IcCityManagementEntity::getName, formDTO.getName()); |
||||
|
List<IcCityManagementEntity> 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<IcCityManagementListResultDTO> list = baseDao.selectCityManagementList(formDTO); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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<IcDangerousChemicalsDao, IcDangerousChemicalsEntity> implements IcDangerousChemicalsService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcDangerousChemicalsListResultDTO> 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<IcDangerousChemicalsListResultDTO> list = baseDao.selectDangerousChemicalsList(formDTO); |
||||
|
PageInfo<IcDangerousChemicalsListResultDTO> pageInfo = new PageInfo<>(list); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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<IcDangerousChemicalsEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcDangerousChemicalsEntity> 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<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.eq(IcDangerousChemicalsEntity::getName, formDTO.getName()); |
||||
|
List<IcDangerousChemicalsEntity> 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<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.ne(IcDangerousChemicalsEntity::getId, formDTO.getIcDangerousChemicalsId()); |
||||
|
tWrapper.eq(IcDangerousChemicalsEntity::getName, formDTO.getName()); |
||||
|
List<IcDangerousChemicalsEntity> 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<IcDangerousChemicalsListResultDTO> list = baseDao.selectDangerousChemicalsList(formDTO); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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<IcPublicServiceDao, IcPublicServiceEntity> implements IcPublicServiceService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcPublicServiceListResultDTO> 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<IcPublicServiceListResultDTO> list = baseDao.selectPublicServiceList(formDTO); |
||||
|
PageInfo<IcPublicServiceListResultDTO> pageInfo = new PageInfo<>(list); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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<IcPublicServiceEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcPublicServiceEntity> 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<IcPublicServiceEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcPublicServiceEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.eq(IcPublicServiceEntity::getName, formDTO.getName()); |
||||
|
List<IcPublicServiceEntity> 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<IcPublicServiceEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcPublicServiceEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.ne(IcPublicServiceEntity::getId, formDTO.getIcPublicServiceId()); |
||||
|
tWrapper.eq(IcPublicServiceEntity::getName, formDTO.getName()); |
||||
|
List<IcPublicServiceEntity> 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<IcPublicServiceListResultDTO> list = baseDao.selectPublicServiceList(formDTO); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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<IcSuperiorResourceDao, IcSuperiorResourceEntity> implements IcSuperiorResourceService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcSuperiorResourceListResultDTO> 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<IcSuperiorResourceListResultDTO> list = baseDao.selectSuperiorResourceList(formDTO); |
||||
|
PageInfo<IcSuperiorResourceListResultDTO> pageInfo = new PageInfo<>(list); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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<IcSuperiorResourceEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcSuperiorResourceEntity> 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<IcSuperiorResourceEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcSuperiorResourceEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.eq(IcSuperiorResourceEntity::getName, formDTO.getName()); |
||||
|
List<IcSuperiorResourceEntity> 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<IcSuperiorResourceEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcSuperiorResourceEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.ne(IcSuperiorResourceEntity::getId, formDTO.getIcSuperiorResourceId()); |
||||
|
tWrapper.eq(IcSuperiorResourceEntity::getName, formDTO.getName()); |
||||
|
List<IcSuperiorResourceEntity> 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<IcSuperiorResourceListResultDTO> list = baseDao.selectSuperiorResourceList(formDTO); |
||||
|
|
||||
|
//封装类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
/*Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); |
||||
|
Map<String, String> 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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcCityManagementDao"> |
||||
|
|
||||
|
<select id="selectCityManagementList" resultType="com.epmet.dto.result.IcCityManagementListResultDTO"> |
||||
|
SELECT |
||||
|
id icCityManagementId, |
||||
|
agency_id agencyId, |
||||
|
source_type sourceType, |
||||
|
`name` name, |
||||
|
category category, |
||||
|
area_covered areaCovered, |
||||
|
CONCAT(area_covered,'平方公里') areaCoveredName, |
||||
|
capacity capacity, |
||||
|
CONCAT(capacity,'人') capacityName, |
||||
|
address address, |
||||
|
longitude longitude, |
||||
|
latitude latitude |
||||
|
FROM |
||||
|
ic_city_management |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="icCityManagementId != null and icCityManagementId != '' "> |
||||
|
AND id = #{icCityManagementId} |
||||
|
</if> |
||||
|
<if test="customerId != null and customerId != '' "> |
||||
|
AND customer_id = #{customerId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%') |
||||
|
</if> |
||||
|
<if test="name != null and name != '' "> |
||||
|
AND name LIKE CONCAT('%', #{name}, '%') |
||||
|
</if> |
||||
|
<if test="category != null and category != '' "> |
||||
|
AND category = #{category} |
||||
|
</if> |
||||
|
ORDER BY created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
<delete id="del"> |
||||
|
UPDATE ic_city_management |
||||
|
SET del_flag = '1', |
||||
|
updated_by = #{updatedBy}, |
||||
|
updated_time = NOW() |
||||
|
WHERE |
||||
|
id = #{id} |
||||
|
AND del_flag = '0' |
||||
|
</delete> |
||||
|
</mapper> |
@ -0,0 +1,52 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcDangerousChemicalsDao"> |
||||
|
|
||||
|
<select id="selectDangerousChemicalsList" resultType="com.epmet.dto.result.IcDangerousChemicalsListResultDTO"> |
||||
|
SELECT |
||||
|
id icDangerousChemicalsId, |
||||
|
agency_id agencyId, |
||||
|
source_type sourceType, |
||||
|
`name` name, |
||||
|
category category, |
||||
|
area_covered areaCovered, |
||||
|
CONCAT(area_covered,'平方公里') areaCoveredName, |
||||
|
capacity capacity, |
||||
|
CONCAT(capacity,'人') capacityName, |
||||
|
address address, |
||||
|
longitude longitude, |
||||
|
latitude latitude |
||||
|
FROM |
||||
|
ic_dangerous_chemicals |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="icDangerousChemicalsId != null and icDangerousChemicalsId != '' "> |
||||
|
AND id = #{icDangerousChemicalsId} |
||||
|
</if> |
||||
|
<if test="customerId != null and customerId != '' "> |
||||
|
AND customer_id = #{customerId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%') |
||||
|
</if> |
||||
|
<if test="name != null and name != '' "> |
||||
|
AND name LIKE CONCAT('%', #{name}, '%') |
||||
|
</if> |
||||
|
<if test="category != null and category != '' "> |
||||
|
AND category = #{category} |
||||
|
</if> |
||||
|
ORDER BY created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
<delete id="del"> |
||||
|
UPDATE ic_dangerous_chemicals |
||||
|
SET del_flag = '1', |
||||
|
updated_by = #{updatedBy}, |
||||
|
updated_time = NOW() |
||||
|
WHERE |
||||
|
id = #{id} |
||||
|
AND del_flag = '0' |
||||
|
</delete> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,52 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcPublicServiceDao"> |
||||
|
|
||||
|
<select id="selectPublicServiceList" resultType="com.epmet.dto.result.IcPublicServiceListResultDTO"> |
||||
|
SELECT |
||||
|
id icPublicServiceId, |
||||
|
agency_id agencyId, |
||||
|
source_type sourceType, |
||||
|
`name` name, |
||||
|
category category, |
||||
|
area_covered areaCovered, |
||||
|
CONCAT(area_covered,'平方公里') areaCoveredName, |
||||
|
capacity capacity, |
||||
|
CONCAT(capacity,'人') capacityName, |
||||
|
address address, |
||||
|
longitude longitude, |
||||
|
latitude latitude |
||||
|
FROM |
||||
|
ic_public_service |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="icPublicServiceId != null and icPublicServiceId != '' "> |
||||
|
AND id = #{icPublicServiceId} |
||||
|
</if> |
||||
|
<if test="customerId != null and customerId != '' "> |
||||
|
AND customer_id = #{customerId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%') |
||||
|
</if> |
||||
|
<if test="name != null and name != '' "> |
||||
|
AND name LIKE CONCAT('%', #{name}, '%') |
||||
|
</if> |
||||
|
<if test="category != null and category != '' "> |
||||
|
AND category = #{category} |
||||
|
</if> |
||||
|
ORDER BY created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
<delete id="del"> |
||||
|
UPDATE ic_public_service |
||||
|
SET del_flag = '1', |
||||
|
updated_by = #{updatedBy}, |
||||
|
updated_time = NOW() |
||||
|
WHERE |
||||
|
id = #{id} |
||||
|
AND del_flag = '0' |
||||
|
</delete> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,53 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcSuperiorResourceDao"> |
||||
|
|
||||
|
<select id="selectSuperiorResourceList" resultType="com.epmet.dto.result.IcSuperiorResourceListResultDTO"> |
||||
|
SELECT |
||||
|
id icSuperiorResourceId, |
||||
|
agency_id agencyId, |
||||
|
source_type sourceType, |
||||
|
`name` name, |
||||
|
category category, |
||||
|
area_covered areaCovered, |
||||
|
CONCAT(area_covered,'平方公里') areaCoveredName, |
||||
|
capacity capacity, |
||||
|
CONCAT(capacity,'人') capacityName, |
||||
|
address address, |
||||
|
longitude longitude, |
||||
|
latitude latitude |
||||
|
FROM |
||||
|
ic_superior_resource |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="icSuperiorResourceId != null and icSuperiorResourceId != '' "> |
||||
|
AND id = #{icSuperiorResourceId} |
||||
|
</if> |
||||
|
<if test="customerId != null and customerId != '' "> |
||||
|
AND customer_id = #{customerId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%') |
||||
|
</if> |
||||
|
<if test="name != null and name != '' "> |
||||
|
AND name LIKE CONCAT('%', #{name}, '%') |
||||
|
</if> |
||||
|
<if test="category != null and category != '' "> |
||||
|
AND category = #{category} |
||||
|
</if> |
||||
|
ORDER BY created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
<delete id="del"> |
||||
|
UPDATE ic_superior_resource |
||||
|
SET del_flag = '1', |
||||
|
updated_by = #{updatedBy}, |
||||
|
updated_time = NOW() |
||||
|
WHERE |
||||
|
id = #{id} |
||||
|
AND del_flag = '0' |
||||
|
</delete> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue