From 195c3d05d63630e945f314ff04c0cec3952d9fb2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 18 Jul 2022 17:24:49 +0800 Subject: [PATCH 01/76] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/HeartAttachmentDTO.java | 116 +++++++++++++++++ .../com/epmet/dto/IcPolicyCategoryDTO.java | 74 +++++++++++ .../main/java/com/epmet/dto/IcPolicyDTO.java | 94 ++++++++++++++ .../java/com/epmet/dto/IcPolicyRuleDTO.java | 74 +++++++++++ .../com/epmet/dto/IcPolicyRuleDetailDTO.java | 119 ++++++++++++++++++ .../com/epmet/dto/IcServiceFeedbackV2DTO.java | 99 +++++++++++++++ .../com/epmet/dto/IcServiceRecordV2DTO.java | 112 +++++++++++++++++ .../com/epmet/dto/IcServiceScopeV2DTO.java | 89 +++++++++++++ .../controller/HeartAttachmentController.java | 70 +++++++++++ .../IcPolicyCategoryController.java | 73 +++++++++++ .../epmet/controller/IcPolicyController.java | 70 +++++++++++ .../controller/IcPolicyRuleController.java | 70 +++++++++++ .../IcPolicyRuleDetailController.java | 74 +++++++++++ .../IcServiceFeedbackV2Controller.java | 70 +++++++++++ .../IcServiceRecordV2Controller.java | 74 +++++++++++ .../IcServiceScopeV2Controller.java | 70 +++++++++++ .../com/epmet/dao/HeartAttachmentDao.java | 16 +++ .../com/epmet/dao/IcPolicyCategoryDao.java | 16 +++ .../main/java/com/epmet/dao/IcPolicyDao.java | 16 +++ .../java/com/epmet/dao/IcPolicyRuleDao.java | 16 +++ .../com/epmet/dao/IcPolicyRuleDetailDao.java | 16 +++ .../com/epmet/dao/IcServiceFeedbackV2Dao.java | 16 +++ .../com/epmet/dao/IcServiceRecordV2Dao.java | 16 +++ .../com/epmet/dao/IcServiceScopeV2Dao.java | 16 +++ .../epmet/entity/HeartAttachmentEntity.java | 82 ++++++++++++ .../epmet/entity/IcPolicyCategoryEntity.java | 44 +++++++ .../java/com/epmet/entity/IcPolicyEntity.java | 64 ++++++++++ .../entity/IcPolicyRuleDetailEntity.java | 89 +++++++++++++ .../com/epmet/entity/IcPolicyRuleEntity.java | 44 +++++++ .../entity/IcServiceFeedbackV2Entity.java | 69 ++++++++++ .../epmet/entity/IcServiceRecordV2Entity.java | 82 ++++++++++++ .../epmet/entity/IcServiceScopeV2Entity.java | 59 +++++++++ .../epmet/service/HeartAttachmentService.java | 78 ++++++++++++ .../service/IcPolicyCategoryService.java | 78 ++++++++++++ .../service/IcPolicyRuleDetailService.java | 78 ++++++++++++ .../epmet/service/IcPolicyRuleService.java | 78 ++++++++++++ .../com/epmet/service/IcPolicyService.java | 78 ++++++++++++ .../service/IcServiceFeedbackV2Service.java | 78 ++++++++++++ .../service/IcServiceRecordV2Service.java | 78 ++++++++++++ .../service/IcServiceScopeV2Service.java | 78 ++++++++++++ .../impl/HeartAttachmentServiceImpl.java | 84 +++++++++++++ .../impl/IcPolicyCategoryServiceImpl.java | 84 +++++++++++++ .../impl/IcPolicyRuleDetailServiceImpl.java | 83 ++++++++++++ .../service/impl/IcPolicyRuleServiceImpl.java | 84 +++++++++++++ .../service/impl/IcPolicyServiceImpl.java | 84 +++++++++++++ .../impl/IcServiceFeedbackV2ServiceImpl.java | 84 +++++++++++++ .../impl/IcServiceRecordV2ServiceImpl.java | 84 +++++++++++++ .../impl/IcServiceScopeV2ServiceImpl.java | 82 ++++++++++++ .../resources/mapper/HeartAttachmentDao.xml | 28 +++++ .../resources/mapper/IcPolicyCategoryDao.xml | 21 ++++ .../src/main/resources/mapper/IcPolicyDao.xml | 25 ++++ .../main/resources/mapper/IcPolicyRuleDao.xml | 21 ++++ .../mapper/IcPolicyRuleDetailDao.xml | 30 +++++ .../mapper/IcServiceFeedbackV2Dao.xml | 26 ++++ .../resources/mapper/IcServiceRecordV2Dao.xml | 28 +++++ .../resources/mapper/IcServiceScopeV2Dao.xml | 24 ++++ 56 files changed, 3505 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyCategoryDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/HeartAttachmentController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceScopeV2Controller.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeV2Dao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyCategoryEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartAttachmentService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyCategoryService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleDetailService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeV2Service.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeV2ServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeV2Dao.xml diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java new file mode 100644 index 0000000000..6c87b6d3d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * heart库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Data +public class HeartAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务id + */ + private String businessId; + + /** + * 政策:ic_policy;服务:ic_service_record_v2 + */ + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyCategoryDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyCategoryDTO.java new file mode 100644 index 0000000000..7afb8aee58 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyCategoryDTO.java @@ -0,0 +1,74 @@ +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-07-18 + */ +@Data +public class IcPolicyCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 政策id + */ + private String icPolicyId; + + /** + * 分类编码 + */ + private String categoryCode; + + /** + * 分类全路径,包含CATEGORY_CODE,英文逗号隔开 + */ + private String codePath; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java new file mode 100644 index 0000000000..dfd47f23bc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -0,0 +1,94 @@ +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-07-18 + */ +@Data +public class IcPolicyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 政策创建人,所属组织id + */ + private String orgId; + + /** + * AGENCY_ID的全路径,含agency_id + */ + private String orgIdPath; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 生效起止日期 + */ + private Date startDate; + + /** + * 截止日期 + */ + private Date endDate; + + /** + * 政策标题 + */ + private String title; + + /** + * 政策内容 + */ + private String content; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java new file mode 100644 index 0000000000..be1c02628d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java @@ -0,0 +1,74 @@ +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-07-18 + */ +@Data +public class IcPolicyRuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 政策id + */ + private String icPolicyId; + + /** + * 规则名称 + */ + private String ruleName; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java new file mode 100644 index 0000000000..8a87279bcf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java @@ -0,0 +1,119 @@ +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-07-18 + */ +@Data +public class IcPolicyRuleDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 政策id + */ + private String icPolicyId; + + /** + * 规则id + */ + private String ruleId; + + /** + * 规则描述文字,例如:基础信息性别等于女 + */ + private String ruleDesc; + + /** + * resi:人员信息,house:房屋信息,stat:统计信息 + */ + private String groupType; + + /** + * 与上一条的关系;and、or + */ + private String lastLogicalRel; + + /** + * 分组id;人员信息有值; + */ + private String itemGroupId; + + /** + * 组件id;人员信息有值; + */ + private String itemId; + + /** + * 查询类型:等于、不等于....;来源于字典表sql_query_type + */ + private String queryType; + + /** + * 表名;人员信息有值; + */ + private String colTable; + + /** + * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 + */ + private String colKey; + + /** + * 参数值 + */ + private String colVal; + + /** + * 排序字段;同一group_type升序 + */ + private Integer sort; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java new file mode 100644 index 0000000000..6cb0bf7b7a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java @@ -0,0 +1,99 @@ +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-07-18 + */ +@Data +public class IcServiceFeedbackV2DTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * + */ + private String customerId; + + /** + * 服务ID + */ + private String serviceId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private Integer delFlag; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java new file mode 100644 index 0000000000..d86138657e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java @@ -0,0 +1,112 @@ +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-07-18 + */ +@Data +public class IcServiceRecordV2DTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * + */ + private String customerId; + + /** + * 服务组织类型 +社区自组织:community_org, +志愿者:ic_user_volunteer, +联建单位:party_unit + */ + private String serviceOrgType; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成;cancel:取消 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 政策依据ID + */ + private String policyId; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java new file mode 100644 index 0000000000..aa69855de6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java @@ -0,0 +1,89 @@ +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-07-18 + */ +@Data +public class IcServiceScopeV2DTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * + */ + private String customerId; + + /** + * 服务记录的ID + */ + private String serviceRecordId; + + /** + * agency单位;grid网格;neighborhood小区 + */ + private String objectType; + + /** + * 选中的组织的ID + */ + private String objectId; + + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; + + /** + * + */ + private String objectName; + + /** + * 备注 + */ + private String remark; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/HeartAttachmentController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/HeartAttachmentController.java new file mode 100644 index 0000000000..61a0d14a87 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/HeartAttachmentController.java @@ -0,0 +1,70 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.HeartAttachmentDTO; +import com.epmet.service.HeartAttachmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * heart库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("heartAttachment") +public class HeartAttachmentController { + + @Autowired + private HeartAttachmentService heartAttachmentService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = heartAttachmentService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + HeartAttachmentDTO data = heartAttachmentService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody HeartAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + heartAttachmentService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody HeartAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + heartAttachmentService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + heartAttachmentService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java new file mode 100644 index 0000000000..37a78aed67 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java @@ -0,0 +1,73 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +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.IcPolicyCategoryDTO; +import com.epmet.service.IcPolicyCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 政策匹配资源类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icPolicyCategory") +public class IcPolicyCategoryController { + + @Autowired + private IcPolicyCategoryService icPolicyCategoryService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPolicyCategoryService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPolicyCategoryDTO data = icPolicyCategoryService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPolicyCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPolicyCategoryService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPolicyCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPolicyCategoryService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPolicyCategoryService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java new file mode 100644 index 0000000000..c675263718 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -0,0 +1,70 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcPolicyDTO; +import com.epmet.service.IcPolicyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 政策表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icPolicy") +public class IcPolicyController { + + @Autowired + private IcPolicyService icPolicyService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPolicyService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPolicyDTO data = icPolicyService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPolicyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPolicyService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPolicyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPolicyService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPolicyService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java new file mode 100644 index 0000000000..a2706981e7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java @@ -0,0 +1,70 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcPolicyRuleDTO; +import com.epmet.service.IcPolicyRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 政策匹配规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icPolicyRule") +public class IcPolicyRuleController { + + @Autowired + private IcPolicyRuleService icPolicyRuleService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPolicyRuleService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPolicyRuleDTO data = icPolicyRuleService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPolicyRuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPolicyRuleService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPolicyRuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPolicyRuleService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPolicyRuleService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java new file mode 100644 index 0000000000..03d738dfc4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java @@ -0,0 +1,74 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +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.IcPolicyRuleDetailDTO; +import com.epmet.excel.IcPolicyRuleDetailExcel; +import com.epmet.service.IcPolicyRuleDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 政策匹配规则明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icPolicyRuleDetail") +public class IcPolicyRuleDetailController { + + @Autowired + private IcPolicyRuleDetailService icPolicyRuleDetailService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPolicyRuleDetailService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPolicyRuleDetailDTO data = icPolicyRuleDetailService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPolicyRuleDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPolicyRuleDetailService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPolicyRuleDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPolicyRuleDetailService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPolicyRuleDetailService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java new file mode 100644 index 0000000000..1ecb5fec9d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java @@ -0,0 +1,70 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.service.IcServiceFeedbackV2Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icServiceFeedbackV2") +public class IcServiceFeedbackV2Controller { + + @Autowired + private IcServiceFeedbackV2Service icServiceFeedbackV2Service; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceFeedbackV2Service.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceFeedbackV2DTO data = icServiceFeedbackV2Service.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceFeedbackV2DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceFeedbackV2Service.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceFeedbackV2DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceFeedbackV2Service.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceFeedbackV2Service.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java new file mode 100644 index 0000000000..afd64fa595 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -0,0 +1,74 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +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.IcServiceRecordV2DTO; +import com.epmet.excel.IcServiceRecordV2Excel; +import com.epmet.service.IcServiceRecordV2Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icServiceRecordV2") +public class IcServiceRecordV2Controller { + + @Autowired + private IcServiceRecordV2Service icServiceRecordV2Service; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceRecordV2Service.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceRecordV2DTO data = icServiceRecordV2Service.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceRecordV2DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceRecordV2Service.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceRecordV2DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceRecordV2Service.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceRecordV2Service.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceScopeV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceScopeV2Controller.java new file mode 100644 index 0000000000..c87bedbac7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceScopeV2Controller.java @@ -0,0 +1,70 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcServiceScopeV2DTO; +import com.epmet.service.IcServiceScopeV2Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 服务范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@RestController +@RequestMapping("icServiceScopeV2") +public class IcServiceScopeV2Controller { + + @Autowired + private IcServiceScopeV2Service icServiceScopeV2Service; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceScopeV2Service.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceScopeV2DTO data = icServiceScopeV2Service.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceScopeV2DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceScopeV2Service.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceScopeV2DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceScopeV2Service.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceScopeV2Service.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java new file mode 100644 index 0000000000..e42ae13d94 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.HeartAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * heart库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface HeartAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java new file mode 100644 index 0000000000..5a48211281 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPolicyCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政策匹配资源类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcPolicyCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java new file mode 100644 index 0000000000..58dd84bf8d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPolicyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政策表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcPolicyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java new file mode 100644 index 0000000000..c69ad22f47 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPolicyRuleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政策匹配规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcPolicyRuleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java new file mode 100644 index 0000000000..c776a5a386 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPolicyRuleDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政策匹配规则明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcPolicyRuleDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java new file mode 100644 index 0000000000..a3d4eb7831 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcServiceFeedbackV2Entity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcServiceFeedbackV2Dao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java new file mode 100644 index 0000000000..340747b8a0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcServiceRecordV2Entity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcServiceRecordV2Dao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeV2Dao.java new file mode 100644 index 0000000000..6c849fe429 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeV2Dao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcServiceScopeV2Entity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 服务范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Mapper +public interface IcServiceScopeV2Dao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java new file mode 100644 index 0000000000..f0eb7f7fd5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java @@ -0,0 +1,82 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * heart库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("heart_attachment") +public class HeartAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务id + */ + private String businessId; + + /** + * 政策:ic_policy;服务:ic_service_record_v2 + */ + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyCategoryEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyCategoryEntity.java new file mode 100644 index 0000000000..811dced0c8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyCategoryEntity.java @@ -0,0 +1,44 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_policy_category") +public class IcPolicyCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 政策id + */ + private String icPolicyId; + + /** + * 分类编码 + */ + private String categoryCode; + + /** + * 分类全路径,包含CATEGORY_CODE,英文逗号隔开 + */ + private String codePath; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyEntity.java new file mode 100644 index 0000000000..c32bbdc4c9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyEntity.java @@ -0,0 +1,64 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_policy") +public class IcPolicyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 政策创建人,所属组织id + */ + private String orgId; + + /** + * AGENCY_ID的全路径,含agency_id + */ + private String orgIdPath; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 生效起止日期 + */ + private Date startDate; + + /** + * 截止日期 + */ + private Date endDate; + + /** + * 政策标题 + */ + private String title; + + /** + * 政策内容 + */ + private String content; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java new file mode 100644 index 0000000000..57d8f91ab1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java @@ -0,0 +1,89 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_policy_rule_detail") +public class IcPolicyRuleDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 政策id + */ + private String icPolicyId; + + /** + * 规则id + */ + private String ruleId; + + /** + * 规则描述文字,例如:基础信息性别等于女 + */ + private String ruleDesc; + + /** + * resi:人员信息,house:房屋信息,stat:统计信息 + */ + private String groupType; + + /** + * 与上一条的关系;and、or + */ + private String lastLogicalRel; + + /** + * 分组id;人员信息有值; + */ + private String itemGroupId; + + /** + * 组件id;人员信息有值; + */ + private String itemId; + + /** + * 查询类型:等于、不等于....;来源于字典表sql_query_type + */ + private String queryType; + + /** + * 表名;人员信息有值; + */ + private String colTable; + + /** + * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 + */ + private String colKey; + + /** + * 参数值 + */ + private String colVal; + + /** + * 排序字段;同一group_type升序 + */ + private Integer sort; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleEntity.java new file mode 100644 index 0000000000..e5536bbb8c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleEntity.java @@ -0,0 +1,44 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_policy_rule") +public class IcPolicyRuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 政策id + */ + private String icPolicyId; + + /** + * 规则名称 + */ + private String ruleName; + + /** + * 排序字段 + */ + private Integer sort; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java new file mode 100644 index 0000000000..2772d22a27 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java @@ -0,0 +1,69 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_feedback_v2") +public class IcServiceFeedbackV2Entity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String customerId; + + /** + * 服务ID + */ + private String serviceId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java new file mode 100644 index 0000000000..e18eda964e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java @@ -0,0 +1,82 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_record_v2") +public class IcServiceRecordV2Entity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String customerId; + + /** + * 服务组织类型 +社区自组织:community_org, +志愿者:ic_user_volunteer, +联建单位:party_unit + */ + private String serviceOrgType; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成;cancel:取消 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 政策依据ID + */ + private String policyId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java new file mode 100644 index 0000000000..cbf0dd1392 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java @@ -0,0 +1,59 @@ +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-07-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_scope_v2") +public class IcServiceScopeV2Entity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String customerId; + + /** + * 服务记录的ID + */ + private String serviceRecordId; + + /** + * agency单位;grid网格;neighborhood小区 + */ + private String objectType; + + /** + * 选中的组织的ID + */ + private String objectId; + + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; + + /** + * + */ + private String objectName; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartAttachmentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartAttachmentService.java new file mode 100644 index 0000000000..9049c4e730 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.HeartAttachmentDTO; +import com.epmet.entity.HeartAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * heart库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface HeartAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HeartAttachmentDTO + * @author generator + * @date 2022-07-18 + */ + HeartAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(HeartAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(HeartAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyCategoryService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyCategoryService.java new file mode 100644 index 0000000000..cb61b3200c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyCategoryService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPolicyCategoryDTO; +import com.epmet.entity.IcPolicyCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 政策匹配资源类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcPolicyCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPolicyCategoryDTO + * @author generator + * @date 2022-07-18 + */ + IcPolicyCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcPolicyCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcPolicyCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleDetailService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleDetailService.java new file mode 100644 index 0000000000..6abc53986c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleDetailService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPolicyRuleDetailDTO; +import com.epmet.entity.IcPolicyRuleDetailEntity; + +import java.util.List; +import java.util.Map; + +/** + * 政策匹配规则明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcPolicyRuleDetailService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPolicyRuleDetailDTO + * @author generator + * @date 2022-07-18 + */ + IcPolicyRuleDetailDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcPolicyRuleDetailDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcPolicyRuleDetailDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleService.java new file mode 100644 index 0000000000..923bd7f60e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyRuleService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPolicyRuleDTO; +import com.epmet.entity.IcPolicyRuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 政策匹配规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcPolicyRuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPolicyRuleDTO + * @author generator + * @date 2022-07-18 + */ + IcPolicyRuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcPolicyRuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcPolicyRuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java new file mode 100644 index 0000000000..6f8eacf71a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPolicyDTO; +import com.epmet.entity.IcPolicyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 政策表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcPolicyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPolicyDTO + * @author generator + * @date 2022-07-18 + */ + IcPolicyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcPolicyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcPolicyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java new file mode 100644 index 0000000000..e1b949bc33 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.entity.IcServiceFeedbackV2Entity; + +import java.util.List; +import java.util.Map; + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcServiceFeedbackV2Service extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceFeedbackV2DTO + * @author generator + * @date 2022-07-18 + */ + IcServiceFeedbackV2DTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcServiceFeedbackV2DTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcServiceFeedbackV2DTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java new file mode 100644 index 0000000000..c2065d0107 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.entity.IcServiceRecordV2Entity; + +import java.util.List; +import java.util.Map; + +/** + * 服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcServiceRecordV2Service extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceRecordV2DTO + * @author generator + * @date 2022-07-18 + */ + IcServiceRecordV2DTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcServiceRecordV2DTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcServiceRecordV2DTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeV2Service.java new file mode 100644 index 0000000000..cee7d60ff2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeV2Service.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceScopeV2DTO; +import com.epmet.entity.IcServiceScopeV2Entity; + +import java.util.List; +import java.util.Map; + +/** + * 服务范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +public interface IcServiceScopeV2Service extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceScopeV2DTO + * @author generator + * @date 2022-07-18 + */ + IcServiceScopeV2DTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void save(IcServiceScopeV2DTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-18 + */ + void update(IcServiceScopeV2DTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java new file mode 100644 index 0000000000..e0b5567047 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.HeartAttachmentDao; +import com.epmet.dto.HeartAttachmentDTO; +import com.epmet.entity.HeartAttachmentEntity; +import com.epmet.redis.HeartAttachmentRedis; +import com.epmet.service.HeartAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * heart库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class HeartAttachmentServiceImpl extends BaseServiceImpl implements HeartAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HeartAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HeartAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HeartAttachmentDTO get(String id) { + HeartAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HeartAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HeartAttachmentDTO dto) { + HeartAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, HeartAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HeartAttachmentDTO dto) { + HeartAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, HeartAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java new file mode 100644 index 0000000000..b2e3788b5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcPolicyCategoryDao; +import com.epmet.dto.IcPolicyCategoryDTO; +import com.epmet.entity.IcPolicyCategoryEntity; +import com.epmet.redis.IcPolicyCategoryRedis; +import com.epmet.service.IcPolicyCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 政策匹配资源类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcPolicyCategoryServiceImpl extends BaseServiceImpl implements IcPolicyCategoryService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPolicyCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPolicyCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPolicyCategoryDTO get(String id) { + IcPolicyCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPolicyCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPolicyCategoryDTO dto) { + IcPolicyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPolicyCategoryDTO dto) { + IcPolicyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java new file mode 100644 index 0000000000..aac4097267 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcPolicyRuleDetailDao; +import com.epmet.dto.IcPolicyRuleDetailDTO; +import com.epmet.entity.IcPolicyRuleDetailEntity; +import com.epmet.redis.IcPolicyRuleDetailRedis; +import com.epmet.service.IcPolicyRuleDetailService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 政策匹配规则明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcPolicyRuleDetailServiceImpl extends BaseServiceImpl implements IcPolicyRuleDetailService { + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPolicyRuleDetailDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPolicyRuleDetailDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPolicyRuleDetailDTO get(String id) { + IcPolicyRuleDetailEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPolicyRuleDetailDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPolicyRuleDetailDTO dto) { + IcPolicyRuleDetailEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyRuleDetailEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPolicyRuleDetailDTO dto) { + IcPolicyRuleDetailEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyRuleDetailEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java new file mode 100644 index 0000000000..512f75b43b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcPolicyRuleDao; +import com.epmet.dto.IcPolicyRuleDTO; +import com.epmet.entity.IcPolicyRuleEntity; +import com.epmet.redis.IcPolicyRuleRedis; +import com.epmet.service.IcPolicyRuleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 政策匹配规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcPolicyRuleServiceImpl extends BaseServiceImpl implements IcPolicyRuleService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPolicyRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPolicyRuleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPolicyRuleDTO get(String id) { + IcPolicyRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPolicyRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPolicyRuleDTO dto) { + IcPolicyRuleEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyRuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPolicyRuleDTO dto) { + IcPolicyRuleEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyRuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java new file mode 100644 index 0000000000..28b27edf25 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcPolicyDao; +import com.epmet.dto.IcPolicyDTO; +import com.epmet.entity.IcPolicyEntity; +import com.epmet.redis.IcPolicyRedis; +import com.epmet.service.IcPolicyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 政策表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPolicyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPolicyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPolicyDTO get(String id) { + IcPolicyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPolicyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPolicyDTO dto) { + IcPolicyEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPolicyDTO dto) { + IcPolicyEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java new file mode 100644 index 0000000000..f9451f6bfa --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcServiceFeedbackV2Dao; +import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.entity.IcServiceFeedbackV2Entity; +import com.epmet.redis.IcServiceFeedbackV2Redis; +import com.epmet.service.IcServiceFeedbackV2Service; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl implements IcServiceFeedbackV2Service { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceFeedbackV2DTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceFeedbackV2DTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcServiceFeedbackV2DTO get(String id) { + IcServiceFeedbackV2Entity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceFeedbackV2DTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceFeedbackV2DTO dto) { + IcServiceFeedbackV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceFeedbackV2Entity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceFeedbackV2DTO dto) { + IcServiceFeedbackV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceFeedbackV2Entity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java new file mode 100644 index 0000000000..f934bfe090 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcServiceRecordV2Dao; +import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.entity.IcServiceRecordV2Entity; +import com.epmet.redis.IcServiceRecordV2Redis; +import com.epmet.service.IcServiceRecordV2Service; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl implements IcServiceRecordV2Service { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceRecordV2DTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceRecordV2DTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcServiceRecordV2DTO get(String id) { + IcServiceRecordV2Entity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceRecordV2DTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceRecordV2DTO dto) { + IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceRecordV2Entity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceRecordV2DTO dto) { + IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceRecordV2Entity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeV2ServiceImpl.java new file mode 100644 index 0000000000..8909c3b234 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeV2ServiceImpl.java @@ -0,0 +1,82 @@ +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcServiceScopeV2Dao; +import com.epmet.dto.IcServiceScopeV2DTO; +import com.epmet.entity.IcServiceScopeV2Entity; +import com.epmet.service.IcServiceScopeV2Service; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 服务范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Service +public class IcServiceScopeV2ServiceImpl extends BaseServiceImpl implements IcServiceScopeV2Service { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceScopeV2DTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceScopeV2DTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcServiceScopeV2DTO get(String id) { + IcServiceScopeV2Entity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceScopeV2DTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceScopeV2DTO dto) { + IcServiceScopeV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceScopeV2Entity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceScopeV2DTO dto) { + IcServiceScopeV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceScopeV2Entity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml new file mode 100644 index 0000000000..6a4f001f8e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml new file mode 100644 index 0000000000..58145c7134 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml new file mode 100644 index 0000000000..9be6fc19d2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml new file mode 100644 index 0000000000..9c83835fdf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml new file mode 100644 index 0000000000..df78f56e7e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml new file mode 100644 index 0000000000..82d136814b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml new file mode 100644 index 0000000000..38033e4e4a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeV2Dao.xml new file mode 100644 index 0000000000..9692853a65 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeV2Dao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 222d4969d8277400f76a12afb61fb526edec83e9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 18 Jul 2022 17:27:19 +0800 Subject: [PATCH 02/76] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IcServiceRecordV2Controller.java | 4 ---- .../com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index afd64fa595..dc1ea6ce52 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -2,7 +2,6 @@ package com.epmet.controller; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -10,13 +9,10 @@ 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.IcServiceRecordV2DTO; -import com.epmet.excel.IcServiceRecordV2Excel; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.util.List; import java.util.Map; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java index f934bfe090..c6c151f325 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcServiceRecordV2Dao; import com.epmet.dto.IcServiceRecordV2DTO; import com.epmet.entity.IcServiceRecordV2Entity; -import com.epmet.redis.IcServiceRecordV2Redis; import com.epmet.service.IcServiceRecordV2Service; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; From 77fe9e670a62cb8a16455ca11b0c90827b11e3b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 18 Jul 2022 17:31:03 +0800 Subject: [PATCH 03/76] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88?= =?UTF-8?q?=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IcPolicyRuleDetailController.java | 4 ---- .../com/epmet/service/impl/HeartAttachmentServiceImpl.java | 4 +--- .../com/epmet/service/impl/IcPolicyCategoryServiceImpl.java | 4 +--- .../com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java | 4 +--- .../java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java | 4 +--- .../main/java/com/epmet/service/impl/IcPolicyServiceImpl.java | 4 +--- .../epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java | 4 +--- 7 files changed, 6 insertions(+), 22 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java index 03d738dfc4..a0221221a5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java @@ -2,7 +2,6 @@ package com.epmet.controller; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -10,13 +9,10 @@ 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.IcPolicyRuleDetailDTO; -import com.epmet.excel.IcPolicyRuleDetailExcel; import com.epmet.service.IcPolicyRuleDetailService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.util.List; import java.util.Map; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java index e0b5567047..5691a02847 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartAttachmentServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.HeartAttachmentDao; import com.epmet.dto.HeartAttachmentDTO; import com.epmet.entity.HeartAttachmentEntity; -import com.epmet.redis.HeartAttachmentRedis; import com.epmet.service.HeartAttachmentService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java index b2e3788b5b..be2bc4c568 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyCategoryServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcPolicyCategoryDao; import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.entity.IcPolicyCategoryEntity; -import com.epmet.redis.IcPolicyCategoryRedis; import com.epmet.service.IcPolicyCategoryService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java index aac4097267..f18c902037 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleDetailServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcPolicyRuleDetailDao; import com.epmet.dto.IcPolicyRuleDetailDTO; import com.epmet.entity.IcPolicyRuleDetailEntity; -import com.epmet.redis.IcPolicyRuleDetailRedis; import com.epmet.service.IcPolicyRuleDetailService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java index 512f75b43b..b0a18734a4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyRuleServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcPolicyRuleDao; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.entity.IcPolicyRuleEntity; -import com.epmet.redis.IcPolicyRuleRedis; import com.epmet.service.IcPolicyRuleService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 28b27edf25..25bff0ed12 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcPolicyDao; import com.epmet.dto.IcPolicyDTO; import com.epmet.entity.IcPolicyEntity; -import com.epmet.redis.IcPolicyRedis; import com.epmet.service.IcPolicyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java index f9451f6bfa..a4f8904b18 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java @@ -3,16 +3,14 @@ package com.epmet.service.impl; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcServiceFeedbackV2Dao; import com.epmet.dto.IcServiceFeedbackV2DTO; import com.epmet.entity.IcServiceFeedbackV2Entity; -import com.epmet.redis.IcServiceFeedbackV2Redis; import com.epmet.service.IcServiceFeedbackV2Service; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; From 7956163b626c832e6a3516af9612e1a8b8b46900 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 18 Jul 2022 17:34:44 +0800 Subject: [PATCH 04/76] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java | 5 +++-- .../java/com/epmet/entity/IcServiceFeedbackV2Entity.java | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java index 6cb0bf7b7a..54e7469c7c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -29,7 +30,7 @@ public class IcServiceFeedbackV2DTO implements Serializable { /** * 服务ID */ - private String serviceId; + private String serviceRecordId; /** * 服务目标 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java index 2772d22a27..ea194676e9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackV2Entity.java @@ -1,13 +1,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 服务记录反馈表 * @@ -29,7 +26,7 @@ public class IcServiceFeedbackV2Entity extends BaseEpmetEntity { /** * 服务ID */ - private String serviceId; + private String serviceRecordId; /** * 服务目标 From c4dd7d899cef164eebd52ab2d76af9756b565464 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 09:12:24 +0800 Subject: [PATCH 05/76] =?UTF-8?q?=E5=88=86=E7=BB=84=E5=92=8Citem=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9Epolicy=5Fflag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.31__policy_flag.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql new file mode 100644 index 0000000000..ffbc722586 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql @@ -0,0 +1,18 @@ +alter table ic_form_item_group add COLUMN POLICY_FLAG VARCHAR(1) DEFAULT '0' + COMMENT '政策人员信息组件;1:展示;0:不展示;默认0' AFTER DISPLAY; + + +alter table ic_form_item add COLUMN POLICY_FLAG VARCHAR(1) DEFAULT '0' + COMMENT '政策人员信息组件;1:展示;0:不展示;默认0' AFTER MULTI_SELECT; + +update ic_form_item_group set POLICY_FLAG='1' +where DEL_FLAG='0' + and LABEL not like '%需求信息%'; + +update ic_form_item i set i.POLICY_FLAG='1' +where i.DEL_FLAG='0' + and i.DYNAMIC='1' + and i.COLUMN_NAME is not null + and i.COLUMN_NAME !='' +and i.ITEM_TYPE not in('cascader') +and label not in ('分割线'); \ No newline at end of file From e11fd14ee653473635743fad076cff6427fb234b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 10:42:00 +0800 Subject: [PATCH 06/76] =?UTF-8?q?=E6=94=BF=E7=AD=96=E6=8B=9B=E4=BA=BA?= =?UTF-8?q?=EF=BC=8C=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/IcFormItemGroupLisFormDTO.java | 6 +++ .../epmet/dto/form/IcFormItemQueryDTO.java | 27 ++++++++++ .../epmet/dto/result/FormItemBaseResult.java | 7 +++ .../controller/IcFormItemController.java | 13 +++++ .../java/com/epmet/dao/IcFormItemDao.java | 1 + .../epmet/entity/IcFormItemGroupEntity.java | 4 ++ .../com/epmet/service/IcFormItemService.java | 1 + .../impl/IcFormItemGroupServiceImpl.java | 4 +- .../service/impl/IcFormItemServiceImpl.java | 4 ++ .../main/resources/mapper/IcFormItemDao.xml | 51 ++++++++++++++++++- 10 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemQueryDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemGroupLisFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemGroupLisFormDTO.java index 49624a71d1..15b26e7f7d 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemGroupLisFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemGroupLisFormDTO.java @@ -81,4 +81,10 @@ public class IcFormItemGroupLisFormDTO extends PageFormDTO { * 1展示,0不展示,默认1 */ private Boolean display; + + /** + * 1:政策招人 + * 0:居民信息导出 + */ + private String policyFlag; } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemQueryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemQueryDTO.java new file mode 100644 index 0000000000..bdb67e2d52 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormItemQueryDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 查询分组下的组件;前端再政策招人那个界面,传入分组id,policyFlag查询 + * @Author yzm + * @Date 2022/7/19 9:24 + */ +@Data +public class IcFormItemQueryDTO implements Serializable { + public interface AddUserInternalGroup { + } + + @NotBlank(message = "客户Id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + private String groupId; + /** + * 政策人员信息组件;1:展示;0:不展示;默认0 + */ + private String policyFlag; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemBaseResult.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemBaseResult.java index c8707fcbc1..fb8d1412a7 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemBaseResult.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemBaseResult.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Description 基础表单项 @@ -59,6 +60,12 @@ public class FormItemBaseResult implements Serializable { * 是否支持添加(即多对一,eg:需求列表) */ private boolean supportAdd; + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + private String customerId; + private List options; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java index 0d6070e7f6..9d1c814eb6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java @@ -20,6 +20,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.EditIFormItemFormDTO; +import com.epmet.dto.form.IcFormItemQueryDTO; import com.epmet.dto.result.ColumnTableNameResultDTO; import com.epmet.dto.result.FormItemBaseResult; import com.epmet.dto.result.ResiCategoryItemResultDTO; @@ -99,4 +100,16 @@ public class IcFormItemController { List list = icFormItemService.getItemListByGroupId(customerId,groupId); return new Result().ok(list); } + + /** + * 根据分组id 获取分组下的item + * @return + */ + @PostMapping("getItemListV2") + public Result> getItemListByGroupId(@RequestHeader String customerId, @RequestBody IcFormItemQueryDTO formDto){ + formDto.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDto,IcFormItemQueryDTO.AddUserInternalGroup.class); + List list = icFormItemService.getItemListByGroupIdV2(customerId,formDto.getGroupId(),formDto.getPolicyFlag()); + return new Result().ok(list); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java index fda1c91afc..9737ddb90f 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java @@ -96,4 +96,5 @@ public interface IcFormItemDao extends BaseDao { * @return */ List getItemListByGroupId(@Param("customerId") String customerId, @Param("groupId") String groupId); + List getItemListByGroupIdV2(@Param("customerId") String customerId, @Param("groupId") String groupId,@Param("policyFlag")String policyFlag); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java index 29e5cec078..af11e9b05c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java @@ -75,4 +75,8 @@ public class IcFormItemGroupEntity extends BaseEpmetEntity { */ private Boolean display; + /** + * 政策人员信息组件;1:展示;0:不展示;默认0 + */ + private String policyFlag; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java index b60e178ea2..435e703e33 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -91,4 +91,5 @@ public interface IcFormItemService extends BaseService { * @return */ List getItemListByGroupId(String customerId, String groupId); + List getItemListByGroupIdV2(String customerId, String groupId,String policyFlag); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java index 7eee10c186..0241c9e9ba 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.dto.IcFormItemGroupDTO; import com.epmet.dto.form.IcFormItemGroupLisFormDTO; import com.epmet.entity.IcFormItemGroupEntity; import com.epmet.service.IcFormItemGroupService; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,7 +46,8 @@ public class IcFormItemGroupServiceImpl extends BaseServiceImpl list(IcFormItemGroupLisFormDTO params) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcFormItemGroupEntity::getCustomerId, params.getCustomerId()) - .orderByAsc(IcFormItemGroupEntity::getSort); + .eq(StringUtils.isNotBlank(params.getPolicyFlag()), IcFormItemGroupEntity::getPolicyFlag, params.getPolicyFlag()) + .orderByAsc(IcFormItemGroupEntity::getSort); List entityList = baseDao.selectList(wrapper); return ConvertUtils.sourceToTarget(entityList, IcFormItemGroupDTO.class); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index 06c8c1ed14..c3b2e35991 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -269,6 +269,10 @@ public class IcFormItemServiceImpl extends BaseServiceImpl getItemListByGroupIdV2(String customerId, String groupId,String policyFlag) { + return baseDao.getItemListByGroupIdV2(customerId,groupId,policyFlag); + } private String queryType(String itemType) { /*switch (itemType) { diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 20974d2afa..689a90a30a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -257,9 +257,58 @@ CONCAT(ifi.COLUMN_NAME, if(ifi.COLUMN_NUM = 0, '', ifi.COLUMN_NUM)) columnName FROM ic_form_item ifi - LEFT JOIN ic_form_item_group ifig ON ifi.ITEM_GROUP_ID = ifig.ID + LEFT JOIN ic_form_item_group ifig ON ifi.ITEM_GROUP_ID = ifig.ID WHERE ITEM_GROUP_ID = #{groupId} and ifi.CUSTOMER_ID = #{customerId} + and ifi.del_flag='0' + AND LENGTH(ifi.COLUMN_NAME)>0 + ORDER BY ifi.SORT + + + + + + + + + + + + + + + + + + + + + From ebae47dd8f0074aa38e48e5cd1c41d6b87cd6a6f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 12:27:29 +0800 Subject: [PATCH 07/76] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E3=80=81=E7=BB=9F=E8=AE=A1=E4=BF=A1=E6=81=AF=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/policy/IcPolicyItemResultDTO.java | 79 +++++++++++++++++++ .../IcPolicyCategoryController.java | 73 ----------------- .../epmet/controller/IcPolicyController.java | 59 +++----------- .../controller/IcPolicyRuleController.java | 70 ---------------- .../IcPolicyRuleDetailController.java | 70 ---------------- .../main/java/com/epmet/dao/IcPolicyDao.java | 13 ++- .../com/epmet/service/IcPolicyService.java | 67 ++-------------- .../service/impl/IcPolicyServiceImpl.java | 78 +++++------------- .../src/main/resources/mapper/IcPolicyDao.xml | 22 +++++- 9 files changed, 151 insertions(+), 380 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/policy/IcPolicyItemResultDTO.java delete mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java delete mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java delete mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/policy/IcPolicyItemResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/policy/IcPolicyItemResultDTO.java new file mode 100644 index 0000000000..ee75325f26 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/policy/IcPolicyItemResultDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-19 + */ +@Data +public class IcPolicyItemResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * + */ + private String customerId; + + /** + * house:房屋信息,stat:统计信息 + */ + private String groupType; + + /** + * 选项名;例如:房屋类型,房屋状态,人均收入 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 房屋信息存储列名;统计信息定义好key放在这里 + */ + private String colKey; + + /** + * + */ + private String itemType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 备注 + */ + private String remark; + + /** + * 值来源;需要接口获取:remote。 + */ + private String optionSourceType; + + /** + * 动态url; + */ + private String optionSourceUrl; + + /** + * 动态url的入参;存储json串 + */ + private String optionSourceParam; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java deleted file mode 100644 index 37a78aed67..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyCategoryController.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.epmet.controller; - -import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ExcelUtils; -import com.epmet.commons.tools.utils.Result; -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.IcPolicyCategoryDTO; -import com.epmet.service.IcPolicyCategoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; - - -/** - * 政策匹配资源类型 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-07-18 - */ -@RestController -@RequestMapping("icPolicyCategory") -public class IcPolicyCategoryController { - - @Autowired - private IcPolicyCategoryService icPolicyCategoryService; - - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icPolicyCategoryService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - IcPolicyCategoryDTO data = icPolicyCategoryService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcPolicyCategoryDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icPolicyCategoryService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcPolicyCategoryDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icPolicyCategoryService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icPolicyCategoryService.delete(ids); - return new Result(); - } - -} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index c675263718..1cebba0484 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,19 +1,12 @@ package com.epmet.controller; -import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; -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.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.IcPolicyDTO; +import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Map; +import java.util.List; /** @@ -23,48 +16,22 @@ import java.util.Map; * @since v1.0.0 2022-07-18 */ @RestController -@RequestMapping("icPolicy") +@RequestMapping("policy") public class IcPolicyController { @Autowired private IcPolicyService icPolicyService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icPolicyService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - IcPolicyDTO data = icPolicyService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcPolicyDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icPolicyService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcPolicyDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icPolicyService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icPolicyService.delete(ids); - return new Result(); + /** + * 房屋信息、统计信息查询有哪些可选项 + * @param customerId + * @param groupType + * @return + */ + @PostMapping("item-list/{groupType}") + public Result> itemList(@RequestHeader("customerId") String customerId, @PathVariable("groupType") String groupType) { + List list = icPolicyService.itemList(customerId, groupType); + return new Result>().ok(list); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java deleted file mode 100644 index a2706981e7..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.epmet.controller; - -import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; -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.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.IcPolicyRuleDTO; -import com.epmet.service.IcPolicyRuleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Map; - - -/** - * 政策匹配规则 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-07-18 - */ -@RestController -@RequestMapping("icPolicyRule") -public class IcPolicyRuleController { - - @Autowired - private IcPolicyRuleService icPolicyRuleService; - - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icPolicyRuleService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - IcPolicyRuleDTO data = icPolicyRuleService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcPolicyRuleDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icPolicyRuleService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcPolicyRuleDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icPolicyRuleService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icPolicyRuleService.delete(ids); - return new Result(); - } - -} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java deleted file mode 100644 index a0221221a5..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyRuleDetailController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.epmet.controller; - -import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; -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.IcPolicyRuleDetailDTO; -import com.epmet.service.IcPolicyRuleDetailService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Map; - - -/** - * 政策匹配规则明细 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-07-18 - */ -@RestController -@RequestMapping("icPolicyRuleDetail") -public class IcPolicyRuleDetailController { - - @Autowired - private IcPolicyRuleDetailService icPolicyRuleDetailService; - - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icPolicyRuleDetailService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - IcPolicyRuleDetailDTO data = icPolicyRuleDetailService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcPolicyRuleDetailDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icPolicyRuleDetailService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcPolicyRuleDetailDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icPolicyRuleDetailService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icPolicyRuleDetailService.delete(ids); - return new Result(); - } - -} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java index 58dd84bf8d..2da10a4941 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java @@ -1,8 +1,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.entity.IcPolicyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 政策表 @@ -12,5 +16,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyDao extends BaseDao { - + + /** + * 房屋信息、统计信息查询有哪些可选项 + * @param customerId + * @param groupType + * @return + */ + List selectItemList(@Param("customerId") String customerId, @Param("groupType") String groupType); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 6f8eacf71a..86a984760f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -1,12 +1,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.IcPolicyDTO; +import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; -import java.util.Map; /** * 政策表 @@ -15,64 +13,11 @@ import java.util.Map; * @since v1.0.0 2022-07-18 */ public interface IcPolicyService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2022-07-18 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2022-07-18 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return IcPolicyDTO - * @author generator - * @date 2022-07-18 - */ - IcPolicyDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-07-18 - */ - void save(IcPolicyDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-07-18 - */ - void update(IcPolicyDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-07-18 + * 房屋信息、统计信息查询有哪些可选项 + * @param customerId + * @param groupType + * @return */ - void delete(String[] ids); + List itemList(String customerId, String groupType); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 25bff0ed12..90162b4231 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -1,22 +1,17 @@ package com.epmet.service.impl; -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.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.Constant; import com.epmet.dao.IcPolicyDao; -import com.epmet.dto.IcPolicyDTO; +import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.entity.IcPolicyEntity; import com.epmet.service.IcPolicyService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; -import java.util.Map; /** * 政策表 @@ -27,56 +22,23 @@ import java.util.Map; @Service public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService { - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcPolicyDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, IcPolicyDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } + /** + * 房屋信息、统计信息查询有哪些可选项 + * + * @param customerId + * @param groupType + * @return + */ @Override - public IcPolicyDTO get(String id) { - IcPolicyEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, IcPolicyDTO.class); + public List itemList(String customerId, String groupType) { + if(StringUtils.isBlank(groupType)){ + return new ArrayList<>(); + } + List resultList=baseDao.selectItemList(customerId,groupType); + if(CollectionUtils.isEmpty(resultList)){ + return baseDao.selectItemList(Constant.DEFAULT_CUSTOMER,groupType); + } + return resultList; } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcPolicyDTO dto) { - IcPolicyEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(IcPolicyDTO dto) { - IcPolicyEntity entity = ConvertUtils.sourceToTarget(dto, IcPolicyEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index 9be6fc19d2..f02037127c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -21,5 +21,25 @@ - + \ No newline at end of file From 45f49766cbbcb2387b031cfb327a11e14300cb82 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 19 Jul 2022 13:45:18 +0800 Subject: [PATCH 08/76] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E5=86=85=E5=AE=B6=E5=BA=AD=E6=88=90=E5=91=98=E6=9C=88=E6=94=B6?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.36__house_add_avgysr.sql | 1 + .../gov-org-server/src/main/resources/mapper/IcHouseDao.xml | 1 + 2 files changed, 2 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql new file mode 100644 index 0000000000..73b95459ce --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql @@ -0,0 +1 @@ +alter table ic_house add column AVG_RSR decimal(10, 4) comment '人均月收入' after RESI_NUMBER; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index f770ddfa8e..ac7c0fc342 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -25,6 +25,7 @@ + From e7f9b111bc1f7c23936ca9e76762545a3e7d464c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 15:05:25 +0800 Subject: [PATCH 09/76] commityixia --- .../commons/tools/constant/Constant.java | 16 ++ .../dto/form/policy/IcPolicyFormDTO.java | 99 +++++++++++ .../form/policy/IcPolicyRuleDetailDTO.java | 60 +++++++ .../dto/form/policy/IcPolicyRuleFormDTO.java | 37 ++++ .../epmet/controller/IcPolicyController.java | 36 ++++ .../entity/IcPolicyRuleDetailEntity.java | 5 +- .../com/epmet/service/IcPolicyService.java | 15 ++ .../service/impl/IcPolicyServiceImpl.java | 158 +++++++++++++++++- 8 files changed, 416 insertions(+), 10 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 77875d5415..95cc929784 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -174,4 +174,20 @@ public interface Constant { String OPITON_SOURCE_REMOTE = "remote"; String OPITON_SOURCE_LOCAL = "local"; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + String AUDITING="auditing"; + String AUTO_PASSED="auto_passed"; + String REVIEW="review"; + String BLOCK="block"; + String REJECTED="rejected"; + String APPROVED="approved"; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java new file mode 100644 index 0000000000..c605e8b062 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java @@ -0,0 +1,99 @@ +package com.epmet.dto.form.policy; + +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dto.IcPolicyCategoryDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 13:09 + */ + +@Data +public class IcPolicyFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateUserInternalGroup { + } + @NotBlank(message = "政策id不能为空",groups = UpdateUserInternalGroup.class) + private String policyId; + /** + * 政策创建人,所属组织id + */ + @NotBlank(message = "orgId不能为空",groups = UpdateUserInternalGroup.class) + private String orgId; + + /** + * AGENCY_ID的全路径,含agency_id + */ + @NotBlank(message = "orgIdPath不能为空",groups = UpdateUserInternalGroup.class) + private String orgIdPath; + + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + private String staffId; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + @NotBlank(message = "政策级别不能为空", groups = AddUserShowGroup.class) + private String policyLevel; + + /** + * 生效起止日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + @NotNull(message = "政策开始日期不能为空", groups = AddUserShowGroup.class) + private Date startDate; + + /** + * 截止日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + @NotNull(message = "政策截止日期不能为空", groups = AddUserShowGroup.class) + private Date endDate; + + /** + * 政策标题 + */ + @NotBlank(message = "政策标题不能为空", groups = AddUserShowGroup.class) + @Length(max = 100, groups = AddUserShowGroup.class, message = "政策标题最多输入100字") + private String title; + + /** + * 政策内容 + */ + @NotBlank(message = "政策内容不能为空", groups = AddUserShowGroup.class) + @Length(max = 2000, groups = AddUserShowGroup.class, message = "政策内容最多输入2000字") + private String content; + + private List categoryList; + + // @Valid + private List attachmentList; + + @Valid + @NotEmpty(message = "政策细则不能为空",groups =AddUserShowGroup.class ) + private List ruleList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java new file mode 100644 index 0000000000..b88ac693c6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.form.policy; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 13:32 + */ +@Data +public class IcPolicyRuleDetailDTO { + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 规则描述文字,例如:基础信息性别等于女 + */ + private String ruleDesc; + + /** + * 与上一条的关系;and、or + */ + private String lastLogicalRel; + + /** + * 分组id;人员信息有值; + */ + private String itemGroupId; + + /** + * 表名;人员信息有值;房屋信息也有值 + */ + private String itemId; + + /** + * 查询类型:等于、不等于....;来源于字典表sql_query_type + */ + @NotBlank(message = "查询类型不能为空", groups = AddUserShowGroup.class) + private String queryType; + + /** + * 表名;人员信息有值; + */ + private String colTable; + + /** + * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 + */ + @NotBlank(message = "条件不能为空", groups = AddUserShowGroup.class) + private String colKey; + + /** + * 参数值 + */ + @NotBlank(message = "参数值不能为空", groups = AddUserShowGroup.class) + private String colVal; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java new file mode 100644 index 0000000000..99ed14eb4e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form.policy; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 13:31 + */ +@Data +public class IcPolicyRuleFormDTO implements Serializable { + + /** + * 细则名称 + */ + @NotBlank(message = "细则名称不能为空", groups = IcPolicyFormDTO.AddUserShowGroup.class) + private String ruleName; + /** + * 人员信息 + */ + // @Valid + // @NotEmpty + private List resiRuleList; + /** + * 房屋信息 + */ + private List houseRuleList; + /** + * 统计信息 + */ + private List statRuleList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 1cebba0484..8b17d4d6ed 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,7 +1,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,4 +38,36 @@ public class IcPolicyController { return new Result>().ok(list); } + /** + * 政策管理-新增/修改 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class); + icPolicyService.addPolicy(formDTO); + return new Result(); + } + + /** + * 编辑政策 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class,IcPolicyFormDTO.UpdateUserInternalGroup.class); + icPolicyService.updatePolicy(formDTO); + return new Result(); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java index 57d8f91ab1..ee959255b0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java @@ -1,13 +1,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 政策匹配规则明细 * @@ -67,7 +64,7 @@ public class IcPolicyRuleDetailEntity extends BaseEpmetEntity { private String queryType; /** - * 表名;人员信息有值; + * 表名;人员信息有值;房屋信息也有值 */ private String colTable; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 86a984760f..b464facd1a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; @@ -15,9 +16,23 @@ import java.util.List; public interface IcPolicyService extends BaseService { /** * 房屋信息、统计信息查询有哪些可选项 + * * @param customerId * @param groupType * @return */ List itemList(String customerId, String groupType); + + /** + * 政策管理-新增/修改 + * + * @param formDTO + */ + void addPolicy(IcPolicyFormDTO formDTO); + + /** + * 修改政策 + * @param formDTO + */ + void updatePolicy(IcPolicyFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 90162b4231..183a1d4cad 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -2,13 +2,26 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; -import com.epmet.dao.IcPolicyDao; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +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.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.*; +import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.entity.IcPolicyEntity; +import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; +import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; +import com.epmet.entity.*; import com.epmet.service.IcPolicyService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -22,6 +35,15 @@ import java.util.List; @Service public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService { + @Autowired + private IcPolicyCategoryDao icPolicyCategoryDao; + @Autowired + private IcPolicyRuleDao icPolicyRuleDao; + @Autowired + private HeartAttachmentDao heartAttachmentDao; + @Autowired + private IcPolicyRuleDetailDao icPolicyRuleDetailDao; + /** * 房屋信息、统计信息查询有哪些可选项 @@ -32,13 +54,137 @@ public class IcPolicyServiceImpl extends BaseServiceImpl itemList(String customerId, String groupType) { - if(StringUtils.isBlank(groupType)){ + if (StringUtils.isBlank(groupType)) { return new ArrayList<>(); } - List resultList=baseDao.selectItemList(customerId,groupType); - if(CollectionUtils.isEmpty(resultList)){ - return baseDao.selectItemList(Constant.DEFAULT_CUSTOMER,groupType); + List resultList = baseDao.selectItemList(customerId, groupType); + if (CollectionUtils.isEmpty(resultList)) { + return baseDao.selectItemList(Constant.DEFAULT_CUSTOMER, groupType); } return resultList; } + + /** + * 政策管理-新增/修改 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void addPolicy(IcPolicyFormDTO formDTO) { + // 校验参数 + checkAddFormDTO(formDTO); + // 设置所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); + } + IcPolicyEntity icPolicyEntity = ConvertUtils.sourceToTarget(formDTO, IcPolicyEntity.class); + icPolicyEntity.setOrgId(staffInfo.getAgencyId()); + icPolicyEntity.setOrgIdPath(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId()) : staffInfo.getAgencyId()); + // 插入政策主表 + baseDao.insert(icPolicyEntity); + // 插入细则 + int ruleSort = 1; + for (IcPolicyRuleFormDTO rule : formDTO.getRuleList()) { + IcPolicyRuleEntity ruleEntity = new IcPolicyRuleEntity(); + ruleEntity.setCustomerId(formDTO.getCustomerId()); + ruleEntity.setIcPolicyId(icPolicyEntity.getId()); + ruleEntity.setRuleName(rule.getRuleName()); + ruleEntity.setSort(ruleSort); + icPolicyRuleDao.insert(ruleEntity); + if (CollectionUtils.isNotEmpty(rule.getResiRuleList())) { + int resiRuleSort = 1; + for (IcPolicyRuleDetailDTO ruleDetailDTO : rule.getResiRuleList()) { + IcPolicyRuleDetailEntity icPolicyRuleDetailEntity = ConvertUtils.sourceToTarget(ruleDetailDTO, IcPolicyRuleDetailEntity.class); + icPolicyRuleDetailEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyRuleDetailEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyRuleDetailEntity.setRuleId(ruleEntity.getId()); + icPolicyRuleDetailEntity.setSort(resiRuleSort); + icPolicyRuleDetailEntity.setGroupType("resi"); + icPolicyRuleDetailDao.insert(icPolicyRuleDetailEntity); + resiRuleSort++; + } + } + if (CollectionUtils.isNotEmpty(rule.getHouseRuleList())) { + int houseRuleSort = 1; + for (IcPolicyRuleDetailDTO ruleDetailDTO : rule.getHouseRuleList()) { + IcPolicyRuleDetailEntity icPolicyRuleDetailEntity = ConvertUtils.sourceToTarget(ruleDetailDTO, IcPolicyRuleDetailEntity.class); + icPolicyRuleDetailEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyRuleDetailEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyRuleDetailEntity.setRuleId(ruleEntity.getId()); + icPolicyRuleDetailEntity.setSort(houseRuleSort); + icPolicyRuleDetailEntity.setGroupType("house"); + icPolicyRuleDetailDao.insert(icPolicyRuleDetailEntity); + houseRuleSort++; + } + } + if (CollectionUtils.isNotEmpty(rule.getStatRuleList())) { + int statRuleSort = 1; + for (IcPolicyRuleDetailDTO ruleDetailDTO : rule.getStatRuleList()) { + IcPolicyRuleDetailEntity icPolicyRuleDetailEntity = ConvertUtils.sourceToTarget(ruleDetailDTO, IcPolicyRuleDetailEntity.class); + icPolicyRuleDetailEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyRuleDetailEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyRuleDetailEntity.setRuleId(ruleEntity.getId()); + icPolicyRuleDetailEntity.setSort(statRuleSort); + icPolicyRuleDetailEntity.setGroupType("stat"); + icPolicyRuleDetailDao.insert(icPolicyRuleDetailEntity); + statRuleSort++; + } + } + } + // 插入分类 + if (CollectionUtils.isNotEmpty(formDTO.getCategoryList())) { + for (IcPolicyCategoryDTO categoryDTO : formDTO.getCategoryList()) { + IcPolicyCategoryEntity icPolicyCategoryEntity = new IcPolicyCategoryEntity(); + icPolicyCategoryEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyCategoryEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyCategoryEntity.setCategoryCode(categoryDTO.getCategoryCode()); + icPolicyCategoryEntity.setCodePath(categoryDTO.getCodePath()); + icPolicyCategoryDao.insert(icPolicyCategoryEntity); + } + } + // 插入附件 + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())) { + int sort = 1; + for (FileCommonDTO fileCommonDTO : formDTO.getAttachmentList()) { + HeartAttachmentEntity heartAttachment = new HeartAttachmentEntity(); + heartAttachment.setCustomerId(formDTO.getCustomerId()); + heartAttachment.setBusinessId(icPolicyEntity.getId()); + heartAttachment.setAttachTo("ic_policy"); + heartAttachment.setAttachmentName(fileCommonDTO.getName()); + heartAttachment.setAttachmentFormat(fileCommonDTO.getFormat()); + heartAttachment.setAttachmentType(fileCommonDTO.getType()); + heartAttachment.setAttachmentUrl(fileCommonDTO.getUrl()); + heartAttachment.setSort(sort); + heartAttachment.setStatus(Constant.AUTO_PASSED); + heartAttachment.setDuration(fileCommonDTO.getDuration()); + heartAttachmentDao.insert(heartAttachment); + sort++; + } + } + } + + + private void checkAddFormDTO(IcPolicyFormDTO formDTO) { + List ruleList = formDTO.getRuleList(); + for (IcPolicyRuleFormDTO rule : ruleList) { + if (CollectionUtils.isEmpty(rule.getResiRuleList()) + && CollectionUtils.isEmpty(rule.getHouseRuleList()) + && CollectionUtils.isEmpty(rule.getStatRuleList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息、房屋信息、统计信息任意选择一项填写", "请填写细则明细"); + } + } + // 政策文件最多3个先不限制了吧,前端控制下 + } + + /** + * 修改政策 + * + * @param formDTO + */ + @Override + public void updatePolicy(IcPolicyFormDTO formDTO) { + // todo + } } \ No newline at end of file From 05baa8c94f8aa8dc70ddb040df752a21784379cb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 19 Jul 2022 15:09:23 +0800 Subject: [PATCH 10/76] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 12 ++++ .../dto/form/ServiceRecordV2ListFormDTO.java | 55 ++++++++++++++++ .../result/ServiceRecordV2ListResultDTO.java | 66 +++++++++++++++++++ .../IcCommunitySelfOrganizationConstant.java | 4 ++ .../IcServiceRecordV2Controller.java | 17 +++++ .../dao/IcCommunitySelfOrganizationDao.java | 3 + .../com/epmet/dao/IcServiceRecordV2Dao.java | 14 +++- .../com/epmet/redis/IcPartyUnitRedis.java | 33 ++++++++++ .../service/IcServiceRecordV2Service.java | 9 +++ .../impl/IcServiceRecordV2ServiceImpl.java | 40 +++++++++++ .../mapper/IcCommunitySelfOrganizationDao.xml | 7 ++ .../resources/mapper/IcServiceRecordV2Dao.xml | 58 ++++++++++------ 12 files changed, 297 insertions(+), 21 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 579f8ee9cf..97dfa853b7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -817,4 +817,16 @@ public class RedisKeys { } return rootPrefix.concat("datasync:").concat(bizType); } + + /** + * Desc: 服务组织名称 + * @param customerId + * @param serviceOrgType + * @param serviceOrgId + * @author zxc + * @date 2022/7/19 14:08 + */ + public static String getServiceOrgNameKey(String customerId,String serviceOrgType,String serviceOrgId){ + return rootPrefix.concat("serviceOrgName:").concat(serviceOrgType).concat(":").concat(customerId).concat(":").concat(serviceOrgId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java new file mode 100644 index 0000000000..675bd575b4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/19 10:10 + * @DESC + */ +@Data +public class ServiceRecordV2ListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 88592831607216246L; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 起始服务时间yyyy-MM-dd + */ + private String serviceTimeStart; + + /** + * 终止服务时间yyyy-MM-dd + */ + private String serviceTimeEnd; + + /** + * in_service服务中;completed:已完成;cancel:取消 + */ + private String serviceStatus; + + /** + * 满意度 0:不满意,1:基本满意,2:非常满意 + */ + private String satisfaction; + private String customerId; + private String userId; + + /** + * 当前工作人员所属组织ID + */ + private String orgId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java new file mode 100644 index 0000000000..d4c591a469 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/19 10:16 + * @DESC + */ +@Data +public class ServiceRecordV2ListResultDTO implements Serializable { + + private static final long serialVersionUID = -7486208970876756573L; + + /** + * 服务ID + */ + private String serviceRecordId; + + /** + * 政策ID + */ + private String policyId; + + /** + * 服务组织类别 + */ + private String serviceOrgType; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名字 + */ + private String serviceOrgName; + + /** + * 服务名字 + */ + private String serviceName; + + /** + * 起始服务时间yyyy-MM-dd + */ + private String serviceTimeStart; + + /** + * 终止服务时间yyyy-MM-dd + */ + private String serviceTimeEnd; + + /** + * 服务状态 + */ + private String serviceStatus; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java index ffd87124bf..a94b3304b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java @@ -8,4 +8,8 @@ package com.epmet.constant; public interface IcCommunitySelfOrganizationConstant { String ORG_TYPE_AGENCY = "agency"; + + String SERVICE_ORG_TYPE_COMMUNITY_ORG = "community_org"; + String SERVICE_ORG_TYPE_IC_USER_VOLUNTEEr = "ic_user_volunteer"; + String SERVICE_ORG_TYPE_PARTY_UNIT = "party_unit"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index dc1ea6ce52..aa8b978b4c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -9,6 +11,7 @@ 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.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -67,4 +70,18 @@ public class IcServiceRecordV2Controller { return new Result(); } + /** + * Desc:【服务管理】列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/7/19 10:24 + */ + @PostMapping("list") + public Result serviceRecordV2List(@LoginUser TokenDto tokenDto, @RequestBody ServiceRecordV2ListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index 3ba576777b..e97091463e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -75,4 +75,7 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao queryCoordinateList(CategorySelfOrgFormDTO formDTO); List selectByIds(@Param("communityOrgIds") List communityOrgIds); + + String getCommunityOrgName(@Param("id") String id); + String getPartyUnitName(@Param("id") String id); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java index 340747b8a0..55ae94e6aa 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java @@ -1,9 +1,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ServiceRecordV2ListFormDTO; +import com.epmet.dto.result.ServiceRecordV2ListResultDTO; import com.epmet.entity.IcServiceRecordV2Entity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 服务记录表 * @@ -12,5 +16,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcServiceRecordV2Dao extends BaseDao { - + + /** + * Desc:【服务管理】列表 + * @param formDTO + * @author zxc + * @date 2022/7/19 10:24 + */ + List serviceRecordV2List(ServiceRecordV2ListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java index 83113e7903..8ce4a285ce 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java @@ -17,7 +17,14 @@ package com.epmet.redis; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IcCommunitySelfOrganizationConstant; +import com.epmet.dao.IcCommunitySelfOrganizationDao; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,6 +38,10 @@ import org.springframework.stereotype.Component; public class IcPartyUnitRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private IcCommunitySelfOrganizationDao communitySelfOrganizationDao; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; public void delete(Object[] ids) { @@ -44,4 +55,26 @@ public class IcPartyUnitRedis { return null; } + public String getServiceOrgName(String customerId,String serviceOrgType,String serviceOrgId){ + String serviceOrgNameKey = RedisKeys.getServiceOrgNameKey(customerId, serviceOrgType, serviceOrgId); + Object o = redisUtils.get(serviceOrgNameKey); + if (null != o){ + return o.toString(); + } + String name = ""; + if (serviceOrgType.equals(IcCommunitySelfOrganizationConstant.SERVICE_ORG_TYPE_COMMUNITY_ORG)){ + name = communitySelfOrganizationDao.getCommunityOrgName(serviceOrgId); + }else if (serviceOrgType.equals(IcCommunitySelfOrganizationConstant.SERVICE_ORG_TYPE_PARTY_UNIT)){ + name = communitySelfOrganizationDao.getPartyUnitName(serviceOrgId); + }else if (serviceOrgType.equals(IcCommunitySelfOrganizationConstant.SERVICE_ORG_TYPE_IC_USER_VOLUNTEEr)){ + Result icResiUserDTO = userOpenFeignClient.getIcResiUserDTO(serviceOrgId); + if (!icResiUserDTO.success()){ + throw new EpmetException("getIcResiUserDTO method is failure"); + } + name = icResiUserDTO.getData().getName(); + } + redisUtils.set(serviceOrgNameKey,name,RedisUtils.DEFAULT_EXPIRE); + return name; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index c2065d0107..f10012c762 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.entity.IcServiceRecordV2Entity; import java.util.List; @@ -75,4 +76,12 @@ public interface IcServiceRecordV2Service extends BaseService implements IcServiceRecordV2Service { + @Autowired + private IcPartyUnitRedis partyUnitRedis; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -79,4 +94,29 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl result = new PageData<>(new ArrayList<>(), NumConstant.ZERO_L); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息+"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.serviceRecordV2List(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + if (CollectionUtils.isNotEmpty(result.getList())){ + result.getList().forEach(r -> { + r.setServiceOrgName(partyUnitRedis.getServiceOrgName(formDTO.getCustomerId(), r.getServiceOrgType(),r.getServiceOrgId())); + }); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml index fd457a3628..872caf9999 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -196,4 +196,11 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 38033e4e4a..7c8a86b911 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -3,26 +3,44 @@ - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file From f4aea85b12dafe3a1b9d87a6ba0ac849f3a82eab Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 19 Jul 2022 15:25:10 +0800 Subject: [PATCH 11/76] =?UTF-8?q?dto=E5=92=8Centity=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/HeartAttachmentDTO.java | 8 ++++---- .../main/java/com/epmet/entity/HeartAttachmentEntity.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java index 6c87b6d3d6..ff807d1da3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java @@ -40,22 +40,22 @@ public class HeartAttachmentDTO implements Serializable { /** * 附件名 */ - private String attachmentName; + private String name; /** * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) */ - private String attachmentFormat; + private String format; /** * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) */ - private String attachmentType; + private String type; /** * 附件地址 */ - private String attachmentUrl; + private String url; /** * 排序字段 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java index f0eb7f7fd5..c96dc8d6cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java @@ -36,22 +36,22 @@ public class HeartAttachmentEntity extends BaseEpmetEntity { /** * 附件名 */ - private String attachmentName; + private String name; /** * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) */ - private String attachmentFormat; + private String format; /** * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) */ - private String attachmentType; + private String type; /** * 附件地址 */ - private String attachmentUrl; + private String url; /** * 排序字段 From 084fb6ed6ec43ebb488a762ed451d2e1c65c5dd5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 15:31:24 +0800 Subject: [PATCH 12/76] commityixia --- .../epmet/controller/IcPolicyController.java | 4 +- .../com/epmet/dao/HeartAttachmentDao.java | 3 +- .../com/epmet/dao/IcPolicyCategoryDao.java | 3 +- .../java/com/epmet/dao/IcPolicyRuleDao.java | 3 +- .../com/epmet/dao/IcPolicyRuleDetailDao.java | 3 +- .../com/epmet/service/IcPolicyService.java | 8 +--- .../service/impl/IcPolicyServiceImpl.java | 39 ++++++++++--------- .../resources/mapper/HeartAttachmentDao.xml | 4 +- .../resources/mapper/IcPolicyCategoryDao.xml | 4 +- .../main/resources/mapper/IcPolicyRuleDao.xml | 4 +- .../mapper/IcPolicyRuleDetailDao.xml | 3 ++ 11 files changed, 44 insertions(+), 34 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 8b17d4d6ed..49e144a4e5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -50,7 +50,7 @@ public class IcPolicyController { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class); - icPolicyService.addPolicy(formDTO); + icPolicyService.addOrUpdatePolicy(formDTO); return new Result(); } @@ -65,7 +65,7 @@ public class IcPolicyController { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class,IcPolicyFormDTO.UpdateUserInternalGroup.class); - icPolicyService.updatePolicy(formDTO); + icPolicyService.addOrUpdatePolicy(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java index e42ae13d94..6dba23af2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface HeartAttachmentDao extends BaseDao { - + + int deleteByBusinessId(String businessId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java index 5a48211281..e81d230a1b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyCategoryDao extends BaseDao { - + + int deleteByIcPolicyId(String icPolicyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java index c69ad22f47..adb211432f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyRuleDao extends BaseDao { - + + int deleteByIcPolicyId(String policyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java index c776a5a386..41147f9eae 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyRuleDetailDao extends BaseDao { - + + int deleteByRuleId(String ruleId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index b464facd1a..6f12cfbb66 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -28,11 +28,5 @@ public interface IcPolicyService extends BaseService { * * @param formDTO */ - void addPolicy(IcPolicyFormDTO formDTO); - - /** - * 修改政策 - * @param formDTO - */ - void updatePolicy(IcPolicyFormDTO formDTO); + void addOrUpdatePolicy(IcPolicyFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 183a1d4cad..78b1a5eec7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -71,7 +71,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl - + + delete from heart_attachment where BUSINESS_ID=#{businessId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml index 58145c7134..b862cc8112 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml @@ -17,5 +17,7 @@ - + + delete from ic_policy_category where IC_POLICY_ID=#{icPolicyId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml index 9c83835fdf..777da08654 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml @@ -17,5 +17,7 @@ - + + delete from ic_policy_rule where IC_POLICY_ID=#{policyId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml index df78f56e7e..82a78d96f5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml @@ -26,5 +26,8 @@ + + delete from ic_policy_rule_detail where RULE_ID=#{ruleId} + \ No newline at end of file From 7c4a16df19db0ec8238843193de78446169d3a5b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 15:40:36 +0800 Subject: [PATCH 13/76] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcServiceFeedbackV2AddFormDTO.java | 96 +++++++++++++++++++ .../IcServiceFeedbackV2Controller.java | 12 ++- .../service/IcServiceFeedbackV2Service.java | 3 +- .../impl/IcServiceFeedbackV2ServiceImpl.java | 62 +++++++++++- 4 files changed, 165 insertions(+), 8 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java new file mode 100644 index 0000000000..9a82fc9872 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Data +public class IcServiceFeedbackV2AddFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 服务ID + */ + @NotBlank(message = "服务Id不能为空", groups = {UpdateGroup.class}) + private String serviceRecordId; + /** + * 服务目标 + */ + private String serviceGoal; + /** + * 服务效果 + */ + private String serviceEffect; + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + /** + * 服务状态[服务状态,cancel:取消,closed:已关闭,underway:进行中] + */ + private String serviceStatus; + /** + * 地址 + */ + private String address; + /** + * 地址经度 + */ + private String longitude; + /** + * 地址纬度 + */ + private String latitude; + /** + * 地址纬度 + */ + private List fileList; + + private String customerId; + private String userId; + + @Data + public static class FileDTO { + + /** + * 文件名 + */ + private String name; + /** + * url地址 + */ + private String url; + /** + * 文件类型(图片 - image、 视频 - video、 语音 - voice、 文档 - doc) + */ + private String type; + /** + * 后缀名 + */ + private String format; + /** + * 文件大小 kb + */ + private Integer size; + /** + * 语音或视频文件时长,单位秒 + */ + private Integer duration; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java index 1ecb5fec9d..01cc032b9b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -9,6 +11,7 @@ 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.IcServiceFeedbackV2DTO; +import com.epmet.dto.form.IcServiceFeedbackV2AddFormDTO; import com.epmet.service.IcServiceFeedbackV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -43,10 +46,11 @@ public class IcServiceFeedbackV2Controller { @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody IcServiceFeedbackV2DTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icServiceFeedbackV2Service.save(dto); + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceFeedbackV2AddFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceFeedbackV2Service.save(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java index e1b949bc33..d9a40725bd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.dto.form.IcServiceFeedbackV2AddFormDTO; import com.epmet.entity.IcServiceFeedbackV2Entity; import java.util.List; @@ -54,7 +55,7 @@ public interface IcServiceFeedbackV2Service extends BaseService implements IcServiceFeedbackV2Service { + @Autowired + private IcServiceRecordV2Service icServiceRecordV2Service; + @Autowired + private HeartAttachmentService heartAttachmentService; + @Override public PageData page(Map params) { @@ -60,9 +79,46 @@ public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增服务反馈记录失败,未查询到服务记录"); + } + + //2.校验是否已存在服务反馈 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceFeedbackV2Entity::getServiceRecordId, formDTO.getServiceRecordId()); + List feedbackList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(feedbackList)) { + log.error(String.format("新增服务反馈记录失败,当前服务记录已存在反馈记录,服务记录Id->%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增服务反馈记录失败,当前服务记录已存在反馈记录"); + } + + //3.更新服务记录表数据状态 + recordV2Entity.setServiceStatus(formDTO.getServiceStatus()); + icServiceRecordV2Service.updateById(recordV2Entity); + + //4.新增服务反馈记录 + IcServiceFeedbackV2Entity feedback = ConvertUtils.sourceToTarget(formDTO, IcServiceFeedbackV2Entity.class); + feedback.setCustomerId(formDTO.getCustomerId()); + feedback.setServiceRecordId(formDTO.getServiceRecordId()); + baseDao.insert(feedback); + List AttachmentList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(formDTO.getFileList())) { + int sort = 0; + for (IcServiceFeedbackV2AddFormDTO.FileDTO file : formDTO.getFileList()) { + HeartAttachmentEntity attachment = ConvertUtils.sourceToTarget(file, HeartAttachmentEntity.class); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setBusinessId(feedback.getId()); + attachment.setAttachTo("ic_service_record_v2"); + attachment.setSort(sort++); + attachment.setStatus("auto_passed"); + AttachmentList.add(attachment); + } + heartAttachmentService.insertBatch(AttachmentList); + } } @Override From 72b4dc5898aa643c87697548c263a186435021b5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 15:56:01 +0800 Subject: [PATCH 14/76] commityixia --- .../main/java/com/epmet/dto/IcPolicyDTO.java | 50 +++---------------- .../dto/form/policy/IcPolicyPageFormDTO.java | 39 +++++++++++++++ .../epmet/controller/IcPolicyController.java | 19 +++++++ .../main/java/com/epmet/dao/IcPolicyDao.java | 4 ++ .../com/epmet/service/IcPolicyService.java | 10 ++++ .../service/impl/IcPolicyServiceImpl.java | 24 +++++++++ .../src/main/resources/mapper/IcPolicyDao.xml | 29 +++++++++++ 7 files changed, 131 insertions(+), 44 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index dfd47f23bc..2037ce05c7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -16,26 +18,13 @@ public class IcPolicyDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 主键 - */ - private String id; - - /** - * 客户id - */ - private String customerId; + private String policyId; /** * 政策创建人,所属组织id */ private String orgId; - /** - * AGENCY_ID的全路径,含agency_id - */ - private String orgIdPath; - /** * 政策级别,0市级;1区级;2街道级 */ @@ -44,11 +33,13 @@ public class IcPolicyDTO implements Serializable { /** * 生效起止日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date startDate; /** * 截止日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date endDate; /** @@ -61,34 +52,5 @@ public class IcPolicyDTO implements Serializable { */ private String content; - /** - * 删除标识 0.未删除 1.已删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java new file mode 100644 index 0000000000..c1b3591b7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form.policy; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 15:36 + */ +@Data +public class IcPolicyPageFormDTO extends PageFormDTO implements Serializable { + /** + * 客户id + */ + private String customerId; + private String staffId; + + /** + * 政策标题 + */ + private String title; + + /** + * 政策内容 + */ + private String content; + + /** + * 是否过期;1:已过期;0:未过期 + */ + private String expiredFlag; + + private String agencyId; + +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 49e144a4e5..5211d232c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,11 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -69,5 +73,20 @@ public class IcPolicyController { return new Result(); } + /** + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("list") + public Result> policyList(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class,PageFormDTO.AddUserShowGroup.class); + PageData page = icPolicyService.policyList(formDTO); + return new Result>().ok(page); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java index 2da10a4941..d2e34e23f4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java @@ -1,7 +1,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -24,4 +26,6 @@ public interface IcPolicyDao extends BaseDao { * @return */ List selectItemList(@Param("customerId") String customerId, @Param("groupType") String groupType); + + List policyList(IcPolicyPageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 6f12cfbb66..63e0d0636b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -1,8 +1,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; @@ -29,4 +32,11 @@ public interface IcPolicyService extends BaseService { * @param formDTO */ void addOrUpdatePolicy(IcPolicyFormDTO formDTO); + + /** + * 列表查询 + * @param formDTO + * @return + */ + PageData policyList(IcPolicyPageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 78b1a5eec7..93d04fe879 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -7,16 +7,21 @@ import com.epmet.commons.tools.dto.form.FileCommonDTO; 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.*; import com.epmet.dto.IcPolicyCategoryDTO; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; import com.epmet.entity.*; import com.epmet.service.IcPolicyService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -190,4 +195,23 @@ public class IcPolicyServiceImpl extends BaseServiceImpl policyList(IcPolicyPageFormDTO formDTO) { + // 设置所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.policyList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index f02037127c..6727f2cb81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -42,4 +42,33 @@ and i.GROUP_TYPE = #{groupType} order by i.SORT asc + + \ No newline at end of file From 37f8ed1b591a04a9998bfa09a146d2f1cef112f6 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 16:36:59 +0800 Subject: [PATCH 15/76] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E3=80=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcServiceRecordV2AddEditFormDTO.java | 91 +++++++++++++++++++ .../IcServiceRecordV2Controller.java | 15 +-- .../service/IcServiceRecordV2Service.java | 5 +- .../impl/IcServiceRecordServiceImpl.java | 2 +- .../impl/IcServiceRecordV2ServiceImpl.java | 80 +++++++++++++++- 5 files changed, 178 insertions(+), 15 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java new file mode 100644 index 0000000000..615e9b7a20 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java @@ -0,0 +1,91 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Data +public class IcServiceRecordV2AddEditFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务Id + */ + @NotBlank(message = "服务Id不能为空", groups = {UpdateGroup.class}) + private String serviceRecordId; + /** + * 服务名称 + */ + @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) + private String serviceName; + /** + * 服务组织类型 社区自组织:community_org, 志愿者:ic_user_volunteer, 联建单位:party_unit + */ + @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) + private String serviceOrgType; + /** + * 服务组织Id + */ + @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) + private String serviceOrgId; + /** + * 服务范围集合 + */ + private List objList; + /** + * 政策依据Id + */ + private Integer policyId; + /** + * 经办人姓名 + */ + private String principalName; + /** + * 联系方式 + */ + private String principalContact; + /** + * 起始服务时间 + */ + @NotNull(message = "起始服务时间不能为空", groups = {AddGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd") + private String serviceTimeStart; + /** + * 终止服务时间 + */ + @NotNull(message = "终止服务时间不能为空", groups = {AddGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd") + private String serviceTimeEnd; + /** + * 备注信息 + */ + private String remark; + /** + * 反馈记录数据 + */ + private IcServiceFeedbackV2AddFormDTO feedback; + + private String customerId; + private String userId; + + @Data + public static class ObjList { + private String objectType; + private String objectId; + private String objectName; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index aa8b978b4c..538bee258d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -7,10 +7,10 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; @@ -46,16 +46,17 @@ public class IcServiceRecordV2Controller { @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody IcServiceRecordV2DTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icServiceRecordV2Service.save(dto); + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceRecordV2AddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceRecordV2Service.save(formDTO); return new Result(); } @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody IcServiceRecordV2DTO dto){ + public Result update(@RequestBody IcServiceRecordV2AddEditFormDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); icServiceRecordV2Service.update(dto); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index f10012c762..a88b4f1a13 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.entity.IcServiceRecordV2Entity; @@ -55,7 +56,7 @@ public interface IcServiceRecordV2Service extends BaseService implements IcServiceRecordV2Service { @Autowired private IcPartyUnitRedis partyUnitRedis; + @Autowired + private IcServiceScopeV2Service icServiceScopeV2Service; + @Autowired + private IcServiceRecordServiceImpl icServiceRecordServiceImpl; + @Autowired + private IcServiceFeedbackV2Service icServiceFeedbackV2Service; + @Autowired + private HeartAttachmentService heartAttachmentService; + @Override public PageData page(Map params) { @@ -75,15 +93,67 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeList = new ArrayList<>(); + formDTO.getObjList().stream().forEach(s -> { + String[] scopeObjectIdPathAndName = icServiceRecordServiceImpl.getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); + IcServiceScopeV2Entity scope = new IcServiceScopeV2Entity(); + scope.setCustomerId(formDTO.getCustomerId()); + scope.setServiceRecordId(entity.getId()); + scope.setObjectType(s.getObjectType()); + scope.setObjectId(s.getObjectId()); + scope.setObjectIdPath(scopeObjectIdPathAndName[0]); + scope.setObjectName(scopeObjectIdPathAndName[1]); + scopeList.add(scope); + }); + + //4.新增服务反馈数据feedback + if(null != formDTO.getFeedback()){ + IcServiceFeedbackV2Entity feedback = ConvertUtils.sourceToTarget(formDTO.getFeedback(), IcServiceFeedbackV2Entity.class); + feedback.setCustomerId(formDTO.getCustomerId()); + feedback.setServiceRecordId(entity.getId()); + icServiceFeedbackV2Service.insert(feedback); + // 反馈附件列表 + if (CollectionUtils.isNotEmpty(formDTO.getFeedback().getFileList())) { + List attachmentList = new ArrayList<>(); + int[] sort = {0}; + formDTO.getFeedback().getFileList().forEach(f->{ + HeartAttachmentEntity attachment = ConvertUtils.sourceToTarget(f, HeartAttachmentEntity.class); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setBusinessId(feedback.getId()); + attachment.setAttachTo("ic_service_record_v2"); + attachment.setSort(sort[0]); + attachment.setStatus("auto_passed"); + sort[0]++; + attachmentList.add(attachment); + }); + heartAttachmentService.insertBatch(attachmentList); + } + } + } @Override @Transactional(rollbackFor = Exception.class) - public void update(IcServiceRecordV2DTO dto) { - IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceRecordV2Entity.class); + public void update(IcServiceRecordV2AddEditFormDTO formDTO) { + //1.校验数据是否存在 + if (null == baseDao.selectById(formDTO.getServiceRecordId())) { + log.error(String.format("修改服务记录失败,未查询到服务记录,服务记录Id->%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "修改服务记录失败,未查询到服务记录"); + } + IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceRecordV2Entity.class); + entity.setId(formDTO.getServiceRecordId()); updateById(entity); } From bbfe442096b9b4e5ea1335fa6b7bb7d8d6209a9b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 16:43:18 +0800 Subject: [PATCH 16/76] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcServiceRecordV2Controller.java | 9 +++++++++ .../com/epmet/service/IcServiceRecordV2Service.java | 2 ++ .../service/impl/IcServiceRecordV2ServiceImpl.java | 12 ++++++++++++ 3 files changed, 23 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index 538bee258d..92a3966962 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -63,6 +63,15 @@ public class IcServiceRecordV2Controller { return new Result(); } + @NoRepeatSubmit + @PostMapping("cancel") + public Result cancel(@RequestBody IcServiceRecordV2AddEditFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceRecordV2Service.cancel(dto); + return new Result(); + } + @PostMapping("delete") public Result delete(@RequestBody String[] ids){ //效验数据 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index a88b4f1a13..6d7860ea1c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -85,4 +85,6 @@ public interface IcServiceRecordV2Service extends BaseService%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消服务记录失败,未查询到服务记录"); + } + entity.setServiceStatus("cancel"); + baseDao.updateById(entity); + } + @Override @Transactional(rollbackFor = Exception.class) public void delete(String[] ids) { From 63b31e8618c57aeb43dfac5a11f9cd81d9202ed2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 16:44:17 +0800 Subject: [PATCH 17/76] 140 --- .../commons/tools/enums/DictTypeEnum.java | 1 + .../main/java/com/epmet/dto/IcPolicyDTO.java | 12 +++ .../java/com/epmet/dto/IcPolicyRuleDTO.java | 10 ++- .../dto/form/policy/IcPolicyRuleFormDTO.java | 5 ++ .../epmet/controller/IcPolicyController.java | 28 ++++++- .../com/epmet/service/IcPolicyService.java | 5 ++ .../service/impl/IcPolicyServiceImpl.java | 81 ++++++++++++++++++- 7 files changed, 139 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index f552db723a..e900f79875 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -27,6 +27,7 @@ public enum DictTypeEnum { IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), IC_SERVICE_TYPE("ic_service_type","服务类别",20), IC_DANGER_TYPE("ic_danger_type","危化品种类",24), + POLICY_LEVEL("policy_level","政策级别",25), ; private final String code; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index 2037ce05c7..e3822ddf27 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -1,10 +1,13 @@ package com.epmet.dto; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -30,6 +33,11 @@ public class IcPolicyDTO implements Serializable { */ private String policyLevel; + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevelName; + /** * 生效起止日期 */ @@ -52,5 +60,9 @@ public class IcPolicyDTO implements Serializable { */ private String content; + //以下三个详情接口返回 + private List categoryList; + private List attachmentList; + private List ruleList; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java index be1c02628d..112474a76f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,31 +46,37 @@ public class IcPolicyRuleDTO implements Serializable { /** * 删除标记 0:未删除,1:已删除 */ + @JsonIgnore private String delFlag; /** * 乐观锁 */ + @JsonIgnore private Integer revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** * 创建时间 */ + @JsonIgnore private Date createdTime; /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java index 99ed14eb4e..e35df132dd 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java @@ -33,5 +33,10 @@ public class IcPolicyRuleFormDTO implements Serializable { * 统计信息 */ private List statRuleList; + + /** + * ruleId + */ + private String id; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 5211d232c2..44432ab0ee 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.service.IcPolicyService; @@ -74,7 +75,7 @@ public class IcPolicyController { } /** - * + * 政策列表 * @param tokenDto * @param formDTO * @return @@ -88,5 +89,30 @@ public class IcPolicyController { return new Result>().ok(page); } + /** + * 细则列表 + * @param customerId + * @param policyId + * @return + */ + @PostMapping("rulelist/{policyId}") + public Result> ruleList(@RequestHeader("customerId") String customerId,@PathVariable("policyId") String policyId) { + return new Result>().ok(icPolicyService.ruleList(customerId,policyId)); + } + + /** + * 删除政策 + * @param policyId + * @return + */ + @PostMapping("delete/{policyId}") + public Result deletePolicy(@PathVariable("policyId") String policyId) { + icPolicyService.deleteById(policyId); + return new Result<>(); + } + @PostMapping("detail/{policyId}") + public Result policyDetail(@LoginUser TokenDto tokenDto,@PathVariable("policyId") String policyId) { + return new Result().ok(icPolicyService.policyDetail(tokenDto.getCustomerId(),policyId)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 63e0d0636b..60564097ec 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; @@ -39,4 +40,8 @@ public interface IcPolicyService extends BaseService { * @return */ PageData policyList(IcPolicyPageFormDTO formDTO); + + List ruleList(String customerId,String policyId); + + IcPolicyDTO policyDetail(String customerId,String policyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 93d04fe879..64648b3358 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -1,35 +1,43 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; 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.commons.tools.utils.Result; import com.epmet.dao.*; import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPolicyService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 政策表 @@ -48,7 +56,8 @@ public class IcPolicyServiceImpl extends BaseServiceImpl list = baseDao.policyList(formDTO); + if (CollectionUtils.isNotEmpty(list)) { + for (IcPolicyDTO icPolicyDTO : list) { + // 查询字典表 + Result> levelRes = adminOpenFeignClient.dictMap(DictTypeEnum.POLICY_LEVEL.getCode()); + Map levelMap = levelRes.success() && MapUtils.isNotEmpty(levelRes.getData()) ? levelRes.getData() : new HashMap<>(); + icPolicyDTO.setPolicyLevelName(MapUtils.isNotEmpty(levelMap) && levelMap.containsKey(icPolicyDTO.getPolicyLevel()) ? levelMap.get(icPolicyDTO.getPolicyLevel()) : StrConstant.EPMETY_STR); + } + } PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } + + @Override + public List ruleList(String customerId, String policyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPolicyRuleEntity::getCustomerId, customerId) + .eq(IcPolicyRuleEntity::getIcPolicyId, policyId) + .orderByAsc(IcPolicyRuleEntity::getSort); + List list = icPolicyRuleDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, IcPolicyRuleDTO.class); + } + + @Override + public IcPolicyDTO policyDetail(String customerId, String policyId) { + IcPolicyEntity policyEntity = baseDao.selectById(policyId); + IcPolicyDTO icPolicyDTO = ConvertUtils.sourceToTarget(policyEntity, IcPolicyDTO.class); + if (null != icPolicyDTO) { + icPolicyDTO.setPolicyId(policyId); + + LambdaQueryWrapper attWrapper = new LambdaQueryWrapper<>(); + attWrapper.eq(HeartAttachmentEntity::getBusinessId, policyId) + .orderByAsc(HeartAttachmentEntity::getSort); + List attList = heartAttachmentDao.selectList(attWrapper); + icPolicyDTO.setAttachmentList(CollectionUtils.isNotEmpty(attList) ? ConvertUtils.sourceToTarget(attList, FileCommonDTO.class) : new ArrayList<>()); + + LambdaQueryWrapper cateWrapper = new LambdaQueryWrapper<>(); + cateWrapper.eq(IcPolicyCategoryEntity::getIcPolicyId, policyId); + List cateList = icPolicyCategoryDao.selectList(cateWrapper); + icPolicyDTO.setCategoryList(CollectionUtils.isNotEmpty(cateList) ? ConvertUtils.sourceToTarget(cateList, IcPolicyCategoryDTO.class) : new ArrayList<>()); + + List ruleDTOList = ruleList(customerId, policyId); + List ruleList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(ruleDTOList)) { + ruleList = ConvertUtils.sourceToTarget(ruleDTOList, IcPolicyRuleFormDTO.class); + for (IcPolicyRuleFormDTO rule : ruleList) { + LambdaQueryWrapper ruleDetailWrapper = new LambdaQueryWrapper<>(); + ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + .eq(IcPolicyRuleDetailEntity::getGroupType, "resi") + .orderByAsc(IcPolicyRuleDetailEntity::getSort); + List resiList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List resiRuleList = CollectionUtils.isNotEmpty(resiList) ? ConvertUtils.sourceToTarget(resiList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); + rule.setResiRuleList(resiRuleList); + + ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + .eq(IcPolicyRuleDetailEntity::getGroupType, "house") + .orderByAsc(IcPolicyRuleDetailEntity::getSort); + List houseList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List houseRuleList = CollectionUtils.isNotEmpty(houseList) ? ConvertUtils.sourceToTarget(houseList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); + rule.setHouseRuleList(houseRuleList); + + ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + .eq(IcPolicyRuleDetailEntity::getGroupType, "stat") + .orderByAsc(IcPolicyRuleDetailEntity::getSort); + List statList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List statRuleList = CollectionUtils.isNotEmpty(statList) ? ConvertUtils.sourceToTarget(statList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); + ; + rule.setStatRuleList(statRuleList); + } + } + icPolicyDTO.setRuleList(ruleList); + } + return icPolicyDTO; + } } \ No newline at end of file From e3e2c148cf591ab0864b69d2fc9a187b4a820402 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 17:05:39 +0800 Subject: [PATCH 18/76] =?UTF-8?q?=E5=9B=BD=E4=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcPolicyDTO.java | 5 +++++ .../src/main/resources/mapper/IcPolicyDao.xml | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index e3822ddf27..8c7fc33767 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -60,6 +60,11 @@ public class IcPolicyDTO implements Serializable { */ private String content; + /** + * 是否过期;1:已过期;0:未过期 + */ + private String expiredFlag; + //以下三个详情接口返回 private List categoryList; private List attachmentList; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index 6727f2cb81..9ab37dc06a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -51,7 +51,12 @@ ip.START_DATE, ip.END_DATE, ip.TITLE, - ip.CONTENT + ip.CONTENT, + ( + case when ip.END_DATE < now() then '1' + when ip.END_DATE >= now() then '0' + end + )as expiredFlag FROM ic_policy ip WHERE @@ -64,11 +69,12 @@ and ip.CONTENT like concat('%',#{content},'%') - + and ip.END_DATE < now() - + and ip.END_DATE >= now() - + order by ip.CREATED_TIME desc + \ No newline at end of file From 60cf5478e37654b75a339d4f125d2fc740f9f709 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 19 Jul 2022 17:30:19 +0800 Subject: [PATCH 19/76] detail --- .../com/epmet/dto/IcServiceFeedbackV2DTO.java | 3 + .../form/ServiceRecordV2DetailFormDTO.java | 24 +++++++ .../ServiceRecordV2DetailResultDTO.java | 71 +++++++++++++++++++ .../IcServiceRecordV2Controller.java | 14 ++++ .../com/epmet/dao/IcServiceFeedbackV2Dao.java | 6 +- .../java/com/epmet/dao/IcServiceScopeDao.java | 3 + .../service/IcServiceRecordV2Service.java | 10 +++ .../impl/IcServiceRecordV2ServiceImpl.java | 38 +++++++++- .../mapper/IcServiceFeedbackV2Dao.xml | 37 ++++++++++ .../resources/mapper/IcServiceScopeDao.xml | 11 +++ 10 files changed, 213 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java index 54e7469c7c..b0a39730f3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java @@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -97,4 +98,6 @@ public class IcServiceFeedbackV2DTO implements Serializable { */ private Integer delFlag; + private List fileList; + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java new file mode 100644 index 0000000000..7b783d0628 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/19 16:34 + * @DESC + */ +@Data +public class ServiceRecordV2DetailFormDTO implements Serializable { + + private static final long serialVersionUID = 476430342315532314L; + + public interface ServiceRecordV2DetailForm{} + + @NotBlank(message = "serviceRecordId不能为空",groups = ServiceRecordV2DetailForm.class) + private String serviceRecordId; + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java new file mode 100644 index 0000000000..7043ddfc0a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.dto.IcServiceScopeV2DTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/7/19 16:34 + * @DESC + */ +@Data +public class ServiceRecordV2DetailResultDTO implements Serializable { + + private static final long serialVersionUID = 3385425608362604836L; + + private String serviceRecordId; + + private String serviceName; + + /** + * 服务组织类型 + 社区自组织:community_org, + 志愿者:ic_user_volunteer, + 联建单位:party_unit + */ + private String serviceOrgType; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成;cancel:取消 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + private List gridIdList; + + private IcServiceFeedbackV2DTO feedback; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index 92a3966962..8698c3d08c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -7,11 +7,14 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; 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.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2DetailFormDTO; import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; +import com.epmet.dto.result.ServiceRecordV2DetailResultDTO; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -94,4 +97,15 @@ public class IcServiceRecordV2Controller { return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); } + /** + * Desc: 详情 + * @param formDTO + * @author zxc + * @date 2022/7/19 16:37 + */ + @PostMapping("detail") + public Result serviceRecordV2Detail(@RequestBody ServiceRecordV2DetailFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ServiceRecordV2DetailFormDTO.ServiceRecordV2DetailForm.class); + return new Result().ok(icServiceRecordV2Service.serviceRecordV2Detail(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java index a3d4eb7831..43a90f357d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java @@ -1,8 +1,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcServiceFeedbackV2DTO; import com.epmet.entity.IcServiceFeedbackV2Entity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 服务记录反馈表 @@ -12,5 +14,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcServiceFeedbackV2Dao extends BaseDao { - + + IcServiceFeedbackV2DTO getFeedbackV2(@Param("serviceRecordId") String serviceRecordId); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java index c2fc96cfd9..6b4123134c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java @@ -1,6 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcServiceScopeV2DTO; import com.epmet.dto.result.IcServiceScopeDTO; import com.epmet.entity.IcServiceScopeEntity; import org.apache.ibatis.annotations.Mapper; @@ -20,4 +21,6 @@ public interface IcServiceScopeDao extends BaseDao { int update(@Param("serviceId") String serviceId, @Param("userId") String userId); List selectList(String serviceRecordId); + + List selectListV2(@Param("serviceRecordId") String serviceRecordId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index 6d7860ea1c..4682517a00 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -3,8 +3,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2DetailFormDTO; import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; +import com.epmet.dto.result.ServiceRecordV2DetailResultDTO; import com.epmet.entity.IcServiceRecordV2Entity; import java.util.List; @@ -86,5 +88,13 @@ public interface IcServiceRecordV2Service extends BaseService page(Map params) { @@ -201,4 +212,25 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeV2DTOS = serviceScopeDao.selectListV2(formDTO.getServiceRecordId()); + result.setGridIdList(scopeV2DTOS); + IcServiceFeedbackV2DTO feedbackV2 = serviceFeedbackV2Dao.getFeedbackV2(formDTO.getServiceRecordId()); + result.setFeedback(feedbackV2); + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml index 82d136814b..5443852817 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml @@ -22,5 +22,42 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml index 026d8c6ac4..0cb231d71c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml @@ -39,4 +39,15 @@ s.DEL_FLAG = '0' AND s.SERVICE_RECORD_ID = #{serviceRecordId} + \ No newline at end of file From fda99cf1ecb1df3daa025799ac6743fef0bf237e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 17:35:50 +0800 Subject: [PATCH 20/76] =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcServiceFeedbackV2ServiceImpl.java | 4 ++++ .../impl/IcServiceRecordV2ServiceImpl.java | 19 +++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java index 70525915ac..d1bdf326cc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java @@ -86,6 +86,10 @@ public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl%s", formDTO.getServiceRecordId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增服务反馈记录失败,未查询到服务记录"); } + if (!"in_service".equals(recordV2Entity.getServiceStatus())) { + String msg = "服务状态不是进行中的,不允许反馈"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } //2.校验是否已存在服务反馈 LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java index 9071a364bc..f817137bde 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -105,17 +106,12 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeList = new ArrayList<>(); formDTO.getObjList().stream().forEach(s -> { String[] scopeObjectIdPathAndName = icServiceRecordServiceImpl.getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); @@ -129,8 +125,9 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl Date: Tue, 19 Jul 2022 17:40:26 +0800 Subject: [PATCH 21/76] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java | 4 ++-- .../com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java index 7043ddfc0a..536e292c70 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java @@ -48,12 +48,12 @@ public class ServiceRecordV2DetailResultDTO implements Serializable { /** * 服务时间 */ - private Date serviceTimeStart; + private String serviceTimeStart; /** * 服务截止时间 */ - private Date serviceTimeEnd; + private String serviceTimeEnd; /** * in_service服务中;completed:已完成;cancel:取消 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java index f817137bde..bf5997a1b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -12,6 +12,7 @@ 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.commons.tools.utils.DateUtils; import com.epmet.dao.IcServiceFeedbackV2Dao; import com.epmet.dao.IcServiceRecordV2Dao; import com.epmet.dao.IcServiceScopeDao; @@ -224,6 +225,8 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeV2DTOS = serviceScopeDao.selectListV2(formDTO.getServiceRecordId()); result.setGridIdList(scopeV2DTOS); From dfafac2facdfea3f0ccde5e06a2e81004312b21a Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 19 Jul 2022 17:52:15 +0800 Subject: [PATCH 22/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BDdemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ResisByPolicyRulesFormDTO.java | 69 +++++++++++++++++ .../epmetuser/result/ResiInfoResultDTO.java | 21 ++++++ .../feign/DataAggregatorOpenFeignClient.java | 8 ++ ...DataAggregatorOpenFeignClientFallback.java | 6 ++ .../controller/IcUserController.java | 31 ++++++++ .../dao/epmetuser/IcResiUserDao.java | 12 +++ .../epmet/dataaggre/service/ResiService.java | 24 ++++++ .../service/epmetuser/EpmetUserService.java | 3 + .../epmetuser/impl/EpmetUserServiceImpl.java | 5 +- .../service/govorg/GovOrgService.java | 5 ++ .../govorg/impl/GovOrgServiceImpl.java | 35 +++++++++ .../service/impl/ResiServiceImpl.java | 74 +++++++++++++++++++ .../mapper/epmetuser/IcResiUserDao.xml | 24 ++++++ .../resi/HeartResisByPolicyRulesFormDTO.java | 69 +++++++++++++++++ .../epmet-heart/epmet-heart-server/pom.xml | 5 ++ .../epmet/controller/IcPolicyController.java | 10 +++ .../com/epmet/service/IcPolicyService.java | 2 + .../service/impl/IcPolicyServiceImpl.java | 32 ++++++++ 18 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java new file mode 100644 index 0000000000..d47d8fdde1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Comparator; +import java.util.Map; +import java.util.Set; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ResisByPolicyRulesFormDTO { + + private Integer pageNo = 1; + private Integer pageSize = 20; + + /** + * 规则map + */ + private Map> rules; + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class PolicyRule implements Comparator { + private String customerId; + /** + * resi:人员信息,house:房屋信息,stat:统计信息 + */ + private String groupType; + + /** + * 与上一条的关系;and、or + */ + private String lastLogicalRel; + + /** + * 查询类型:等于、不等于....;来源于字典表sql_query_type + */ + private String queryType; + + /** + * 表名;人员信息有值; + */ + private String colTable; + + /** + * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 + */ + private String colKey; + + /** + * 参数值 + */ + private String colVal; + + /** + * 排序字段;同一group_type升序 + */ + private Integer sort; + + @Override + public int compare(Integer o1, Integer o2) { + return o1.compareTo(o2); + } + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java new file mode 100644 index 0000000000..04793b3a71 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ResiInfoResultDTO { + + private String name; + private String mobile; + private String idCard; + /** + * 小区全名,包含小区前面的属性,比如网格等 + */ + private String neighborhoodFullName; + private Integer age; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java index a164b0c020..d29b42173e 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.feign.impl.DataAggregatorOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -21,4 +22,11 @@ public interface DataAggregatorOpenFeignClient { @PostMapping(value = "data/aggregator/org/export-send-msg") Result exportGridLiveRes(@RequestBody GridLivelyFormDTO form); + /** + * 政策人员预览 + * @param input + * @return + */ + @PostMapping("data/aggregator/icuser/listByPolicyRules") + Result listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java index ea2bfebddf..b50b31441f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; @@ -16,4 +17,9 @@ public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpen public Result exportGridLiveRes(GridLivelyFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "pcworkRecordListExportSendMsg",form); } + + @Override + public Result listByPolicyRules(ResisByPolicyRulesFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "listByPolicyRules", input); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 15c0473ba0..715fbc7501 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -6,8 +6,11 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; +import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -15,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; +import java.util.Map; +import java.util.Set; @RestController @RequestMapping("icuser") @@ -23,6 +28,8 @@ public class IcUserController { @Autowired private EpmetUserService epmetUserService; + @Autowired + private ResiService icResiService; /** * 【人员类别分析】-各类别人数 @@ -38,5 +45,29 @@ public class IcUserController { return new Result>().ok(epmetUserService.queryIcUserCategoryData(formDTO)); } + /** + * 政策人员预览 + * @param input + * @return + */ + @PostMapping("listByPolicyRules") + public Result listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + + Map> rules = input.getRules(); + Set resiRule = rules.get("resi"); + Set houseRule = rules.get("house"); + Set houseStat = rules.get("stat"); + + if (CollectionUtils.isEmpty(resiRule) + && CollectionUtils.isEmpty(houseRule) + && CollectionUtils.isEmpty(houseStat)) { + return new Result(); + } + + icResiService.listByPolicyRules(pageNo, pageSize, resiRule, houseRule, houseStat); + return new Result(); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java index 78e7b7d4b7..82d13c9094 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -18,7 +18,9 @@ package com.epmet.dataaggre.dao.epmetuser; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.IcResiInfoResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiInfoResultDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO; import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity; import com.epmet.dto.IcResiUserDTO; @@ -26,6 +28,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * 用户基础信息 @@ -59,4 +62,13 @@ public interface IcResiUserDao extends BaseDao { @Param("queryPids") String queryPids, @Param("categoryKey") String categoryKey, @Param("search") String search); + + /** + * 政策查找居民 + * @param houseIds + * @return + */ + List listByPolicyRules(@Param("customerId") String customerId, + @Param("resiRules") Set resiRules, + @Param("houseIds") List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java new file mode 100644 index 0000000000..286f299186 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -0,0 +1,24 @@ +package com.epmet.dataaggre.service; + +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiInfoResultDTO; + +import java.util.List; +import java.util.Set; + +/** + * 居民的service + */ +public interface ResiService { + + /** + * 政策人员预览 + * @param pageNo + * @param pageSize + * @param resiRule + * @param houseRule + */ + List listByPolicyRules(Integer pageNo, Integer pageSize, Set resiRule, + Set houseRule, + Set houseStat); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index dec1415a20..834ffd051e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -13,6 +13,7 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.UserBaseInfoDTO; import java.util.List; +import java.util.Set; /** * @Author zxc @@ -199,4 +200,6 @@ public interface EpmetUserService { * @return */ List staffSelectList(List staffIds); + + List listByPolicyRules(String customerId, Set resiRule, List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index e0a3760bed..ef4ad9c699 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -844,5 +844,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { return customerStaffDao.staffSelectList(staffIds); } - + @Override + public List listByPolicyRules(String customerId, Set resiRule, List houseIds) { + return icResiUserDao.listByPolicyRules(customerId, resiRule, houseIds); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 140b909a71..746be2acd2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.govorg; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; @@ -10,9 +11,11 @@ import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.entity.govorg.IcHouseEntity; import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Set; /** * @Author zxc @@ -212,4 +215,6 @@ public interface GovOrgService { * @return */ CustomerAgencyEntity getRootAgencyByCustomerId(String customerId); + + List listHousesByRules(Set houseRule, Set houseStat, Integer pageNo, Integer pageSize); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 0c2533a7c9..076191a1f1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dingtalk.api.request.OapiRobotSendRequest; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.Constant; @@ -26,10 +27,12 @@ import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.*; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO; @@ -38,6 +41,7 @@ import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.entity.govorg.IcHouseEntity; import com.epmet.dataaggre.excel.GridLivelyDetailExcel; import com.epmet.dataaggre.excel.GridLivelyExcel; import com.epmet.dataaggre.service.commonservice.AreaCodeService; @@ -48,6 +52,7 @@ import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.opercrm.CustomerRelation; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.feign.OssFeignClient; +import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.fileupload.FileItem; @@ -107,6 +112,8 @@ public class GovOrgServiceImpl implements GovOrgService { private RedisUtils redisUtils; @Autowired private ExecutorService executorService; + @Autowired + private IcHouseDao houseDao; /** * @param staffId @@ -1079,4 +1086,32 @@ public class GovOrgServiceImpl implements GovOrgService { query.eq(CustomerAgencyEntity::getPid, "0"); // 跟组织的pid为"0" return customerAgencyDao.selectOne(query); } + + @Override + public List listHousesByRules(Set houseRule, Set statRule, Integer pageNo, Integer pageSize) { + if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { + return new ArrayList<>(); + } + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + + QueryWrapper query = new QueryWrapper<>(); + query.eq("CUSTOMER_ID", customerId); + + // 房屋属性 + if (CollectionUtils.isNotEmpty(houseRule)) { + for (ResisByPolicyRulesFormDTO.PolicyRule rule : houseRule) { + query.eq(rule.getColKey(), rule.getColVal()); + } + } + + // 房屋的统计属性 + if (CollectionUtils.isNotEmpty(statRule)) { + for (ResisByPolicyRulesFormDTO.PolicyRule rule : statRule) { + query.eq(rule.getColKey(), rule.getColVal()); + } + } + + PageHelper.startPage(pageNo, pageSize); + return houseDao.selectList(query); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java new file mode 100644 index 0000000000..716fff932e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -0,0 +1,74 @@ +package com.epmet.dataaggre.service.impl; + +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiInfoResultDTO; +import com.epmet.dataaggre.entity.govorg.IcHouseEntity; +import com.epmet.dataaggre.service.ResiService; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Service +public class ResiServiceImpl implements ResiService { + + @Autowired + private EpmetUserService epmetUserService; + + @Autowired + private GovOrgService govOrgService; + + @Override + public List listByPolicyRules(Integer pageNo, Integer pageSize, + Set resiRule, + Set houseRule, + Set houseStat) { + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + + // 结果集 + List resultResis = new ArrayList<>(); + + int housePageNo = 0; + do { + // houseIds 为null,说明用户没有指定house和统计的规则,则不应该使用这两项来查询,sql中不应该有这方面的条件 + List houseIds = null; + + // 拿到房屋id列表,去查询居民列表 + if (CollectionUtils.isNotEmpty(houseRule) || CollectionUtils.isNotEmpty(houseStat)) { + List houseEntities = govOrgService.listHousesByRules(houseRule, houseStat, housePageNo, 50); + houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList()); + } + + if (houseIds != null && houseIds.size() == 0) { + // 用户使用了房屋和统计相关的条件,但是没查到房屋,我看就没有走下去了的必要了吧.. + break; + } + + // 查询居民 + List resis = epmetUserService.listByPolicyRules(customerId, resiRule, houseIds); + resultResis.addAll(resis); + + // 满了20个,或者查不到居民和房屋了(数据空了),则跳出 + // 没有用house的条件,没有循环的必要,查一次居民信息即可,跳出 + if (resultResis.size() >= pageSize || houseIds == null ) { + break; + } + + housePageNo ++; + } while (true); + + // 够了20个,那就截取前20个,否则直接返回 + if (resultResis.size() > 20) { + return resultResis.subList(0, 20); + } + return resultResis; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index c5f04ae7bd..1017c1f37a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -69,4 +69,28 @@ and resi.STATUS='0' + + + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java new file mode 100644 index 0000000000..5dbf1cfba1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.form.resi; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Comparator; +import java.util.Map; +import java.util.Set; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class HeartResisByPolicyRulesFormDTO { + + private Integer pageNo = 1; + private Integer pageSize = 20; + + /** + * 规则map + */ + private Set rules; + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class PolicyRule implements Comparator { + private String customerId; + /** + * resi:人员信息,house:房屋信息,stat:统计信息 + */ + private String groupType; + + /** + * 与上一条的关系;and、or + */ + private String lastLogicalRel; + + /** + * 查询类型:等于、不等于....;来源于字典表sql_query_type + */ + private String queryType; + + /** + * 表名;人员信息有值; + */ + private String colTable; + + /** + * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 + */ + private String colKey; + + /** + * 参数值 + */ + private String colVal; + + /** + * 排序字段;同一group_type升序 + */ + private Integer sort; + + @Override + public int compare(Integer o1, Integer o2) { + return o1.compareTo(o2); + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 5d1c230a1c..f90e54c36b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -12,6 +12,11 @@ jar + + com.epmet + data-aggregator-client + 2.0.0 + com.epmet epmet-heart-client diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 1cebba0484..f9eda02bdc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.resi.HeartResisByPolicyRulesFormDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,4 +36,12 @@ public class IcPolicyController { return new Result>().ok(list); } + @PostMapping("resiuserlist") + public Result listResiUserByPolicyRules(@RequestBody HeartResisByPolicyRulesFormDTO input) { + //todo + String ruleId = "a"; + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + icPolicyService.listResiUserByPolicyRules(customerId, ruleId, 1, 20); + return null; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 86a984760f..ccc0f06a39 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -20,4 +20,6 @@ public interface IcPolicyService extends BaseService { * @return */ List itemList(String customerId, String groupType); + + void listResiUserByPolicyRules(String customerId, String ruleId, Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 90162b4231..6da00f89eb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -1,17 +1,27 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcPolicyDao; +import com.epmet.dao.IcPolicyRuleDetailDao; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.entity.IcPolicyEntity; +import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.service.IcPolicyService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * 政策表 @@ -22,6 +32,11 @@ import java.util.List; @Service public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService { + @Autowired + private IcPolicyRuleDetailDao policyRuleDetailDao; + + @Autowired + private DataAggregatorOpenFeignClient dataAggregatorOpenFeignClient; /** * 房屋信息、统计信息查询有哪些可选项 @@ -41,4 +56,21 @@ public class IcPolicyServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper(); + query.eq(IcPolicyRuleDetailEntity::getCustomerId, customerId); + query.eq(IcPolicyRuleDetailEntity::getRuleId, ruleId); + + List rules = policyRuleDetailDao.selectList(query); + + // 将查询出的数据转化成aggre服务能接受的格式 + Map> rulesMap = rules.stream().map((r) -> new ResisByPolicyRulesFormDTO.PolicyRule( + customerId, r.getGroupType(), r.getLastLogicalRel(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal(), r.getSort()) + ).collect(Collectors.groupingBy(ResisByPolicyRulesFormDTO.PolicyRule::getGroupType, Collectors.toSet())); + + ResisByPolicyRulesFormDTO aggForm = new ResisByPolicyRulesFormDTO(pageNo, pageSize, rulesMap); + Result result = dataAggregatorOpenFeignClient.listByPolicyRules(aggForm); + } } \ No newline at end of file From ee9a262d38e99b8cb287a5977c26898555df1969 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 09:09:39 +0800 Subject: [PATCH 23/76] =?UTF-8?q?=E6=94=BF=E7=AD=96=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.21__policy_dict.sql | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.21__policy_dict.sql diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.21__policy_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.21__policy_dict.sql new file mode 100644 index 0000000000..22a626d92a --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.21__policy_dict.sql @@ -0,0 +1,34 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES ('1549241609500921857', 'house_purpose', '房屋用途', '', 31, 0, 0, '1', '2022-07-19 11:55:58', '1', '2022-07-19 11:55:58'); + +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES ('1549241262669729794', 'house_type', '房屋类型', '楼房、平房、别墅', 30, 0, 0, '1', '2022-07-19 11:54:35', '1', '2022-07-19 11:54:35'); + +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES ('1548958559042969601', 'policy_level', '政策级别', '政策级别;与服务项目的政策级别一致', 29, 0, 0, '1', '2022-07-18 17:11:13', '1', '2022-07-19 11:10:42'); + +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +VALUES ('1548956290117443586', 'sql_query_type', 'sql查询条件', '目前应用于政策找人规则查询条件', 28, 0, 0, '1', '2022-07-18 17:02:12', '1', '2022-07-19 11:10:36'); + + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956434175008770', 1548956290117443586, '等于', '=', '0', '等于', 1, 0, 0, '1', '2022-07-18 17:02:47', '1', '2022-07-18 17:02:47'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956518434381826', 1548956290117443586, '不等于', '!=', '0', '不等于', 2, 0, 0, '1', '2022-07-18 17:03:07', '1', '2022-07-18 17:03:07'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956603855577089', 1548956290117443586, '大于', '>', '0', '大于', 3, 0, 0, '1', '2022-07-18 17:03:27', '1', '2022-07-18 17:03:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956681525698561', 1548956290117443586, '大于等于', '>=', '0', '大于等于', 4, 0, 0, '1', '2022-07-18 17:03:46', '1', '2022-07-18 17:03:46'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956755412557826', 1548956290117443586, '小于', '<', '0', '小于', 5, 0, 0, '1', '2022-07-18 17:04:03', '1', '2022-07-18 17:04:03'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956830482210818', 1548956290117443586, '小于等于', '<=', '0', '<=', 6, 0, 0, '1', '2022-07-18 17:04:21', '1', '2022-07-18 17:04:21'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548956956554600450', 1548956290117443586, '包含', 'like', '0', '包含', 7, 0, 0, '1', '2022-07-18 17:04:51', '1', '2022-07-18 17:04:51'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548957038305779714', 1548956290117443586, '不包含', 'not like', '0', '不包含', 8, 0, 0, '1', '2022-07-18 17:05:11', '1', '2022-07-18 17:05:11'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548958784704913410', 1548958559042969601, '市级', '0', '0', '市级;政策级别ic_policy.POLICY_LEVEL', 1, 0, 0, '1', '2022-07-18 17:12:07', '1', '2022-07-18 17:12:07'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548958823573528578', 1548958559042969601, '区级', '1', '0', '区级;政策级别ic_policy.POLICY_LEVEL', 2, 0, 0, '1', '2022-07-18 17:12:16', '1', '2022-07-18 17:12:16'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1548958887222091777', 1548958559042969601, '街道级', '2', '0', '街道级;政策级别ic_policy.POLICY_LEVEL', 3, 0, 0, '1', '2022-07-18 17:12:32', '1', '2022-07-18 17:12:32'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241348443246594', 1549241262669729794, '楼房', '1', '0', '房屋类型ic_house.houseType', 1, 0, 0, '1', '2022-07-19 11:54:56', '1', '2022-07-19 11:54:56'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241378726121473', 1549241262669729794, '平房', '2', '0', '房屋类型ic_house.houseType', 2, 0, 0, '1', '2022-07-19 11:55:03', '1', '2022-07-19 11:55:03'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241467490177025', 1549241262669729794, '别墅', '3', '0', '房屋类型ic_house.houseType', 3, 0, 0, '1', '2022-07-19 11:55:24', '1', '2022-07-19 11:55:24'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241664320475137', 1549241609500921857, '住宅', '1', '0', '房屋用途ic_house.purpose', 1, 0, 0, '1', '2022-07-19 11:56:11', '1', '2022-07-19 11:56:11'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241693034680321', 1549241609500921857, '商业', '2', '0', '房屋用途ic_house.purpose', 2, 0, 0, '1', '2022-07-19 11:56:18', '1', '2022-07-19 11:56:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241720020832257', 1549241609500921857, '办公', '3', '0', '房屋用途ic_house.purpose', 3, 0, 0, '1', '2022-07-19 11:56:24', '1', '2022-07-19 11:56:24'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241750299512833', 1549241609500921857, '工业', '4', '0', '房屋用途ic_house.purpose', 4, 0, 0, '1', '2022-07-19 11:56:31', '1', '2022-07-19 11:56:31'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241808101216257', 1549241609500921857, '仓储', '5', '0', '房屋用途ic_house.purpose', 5, 0, 0, '1', '2022-07-19 11:56:45', '1', '2022-07-19 11:56:45'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241873729490946', 1549241609500921857, '商住混用', '6', '0', '房屋用途ic_house.purpose', 6, 0, 0, '1', '2022-07-19 11:57:01', '1', '2022-07-19 11:57:01'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1549241913411801089', 1549241609500921857, '其他', '7', '0', '房屋用途ic_house.purpose', 7, 0, 0, '1', '2022-07-19 11:57:10', '1', '2022-07-19 11:57:10'); From 5af4be43ed9de0d4c12a55bd2f748455241c1ad2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 09:23:14 +0800 Subject: [PATCH 24/76] =?UTF-8?q?=E5=87=BA=E7=94=9F=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E4=B8=8D=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=8D=95=E7=8B=AC=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B9=B4=E9=BE=84=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V0.0.31__policy_flag.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql index ffbc722586..435565604f 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql @@ -14,5 +14,6 @@ where i.DEL_FLAG='0' and i.DYNAMIC='1' and i.COLUMN_NAME is not null and i.COLUMN_NAME !='' + and i.LABEL !='出生日期' and i.ITEM_TYPE not in('cascader') and label not in ('分割线'); \ No newline at end of file From b775693ead52d90c48bb4f6b1d951953ea05aedd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 10:03:28 +0800 Subject: [PATCH 25/76] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.31__resi_export.sql | 6 ++++++ .../{V0.0.31__policy_flag.sql => V0.0.32__policy_flag.sql} | 0 .../src/main/resources/mapper/IcFormItemDao.xml | 1 + 3 files changed, 7 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__resi_export.sql rename epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/{V0.0.31__policy_flag.sql => V0.0.32__policy_flag.sql} (100%) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__resi_export.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__resi_export.sql new file mode 100644 index 0000000000..bb7b0964f7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__resi_export.sql @@ -0,0 +1,6 @@ +alter table ic_form_item add COLUMN EXPORT_FLAG tinyint(1) DEFAULT '0' + COMMENT '是否用于自定义导出显示,1展示。0不展示' AFTER DATA_ANALYSE; + +update ic_form_item set EXPORT_FLAG='1' +where DEL_FLAG='0' + and LENGTH(COLUMN_NAME)>0; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql similarity index 100% rename from epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.31__policy_flag.sql rename to epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 689a90a30a..b0906de8d1 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -262,6 +262,7 @@ ITEM_GROUP_ID = #{groupId} and ifi.CUSTOMER_ID = #{customerId} and ifi.del_flag='0' AND LENGTH(ifi.COLUMN_NAME)>0 + AND ifi.EXPORT_FLAG='1' ORDER BY ifi.SORT From 61ccd3d3b11bb66ea5f3cf4e078a79afd709403c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 10:05:21 +0800 Subject: [PATCH 26/76] POLICY_FLAG --- .../main/resources/db/migration/V0.0.32__policy_flag.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql index 435565604f..59bb1f75d5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql @@ -11,9 +11,7 @@ where DEL_FLAG='0' update ic_form_item i set i.POLICY_FLAG='1' where i.DEL_FLAG='0' - and i.DYNAMIC='1' and i.COLUMN_NAME is not null - and i.COLUMN_NAME !='' - and i.LABEL !='出生日期' -and i.ITEM_TYPE not in('cascader') -and label not in ('分割线'); \ No newline at end of file + and i.COLUMN_NAME !='' + and i.ITEM_TYPE not in('cascader') + and i.label not in ('分割线','出生日期'); \ No newline at end of file From 97537270cdfc939044bf4e9245c13a1890bd09e9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 20 Jul 2022 10:09:14 +0800 Subject: [PATCH 27/76] =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=8F=98=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=20=E6=9B=B4=E6=96=B0=20=E6=88=BF=E5=B1=8B=E5=86=85?= =?UTF-8?q?=E7=9A=84=E4=BA=BA=E5=9D=87=E6=94=B6=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/IcHouseDao.java | 4 +++- .../java/com/epmet/service/impl/IcHouseServiceImpl.java | 8 +++++++- .../src/main/resources/mapper/IcHouseDao.xml | 4 +++- .../src/main/java/com/epmet/dao/IcResiUserDao.java | 2 +- .../epmet/service/impl/IcResiUserDataSyncServiceImpl.java | 4 ++-- .../src/main/resources/mapper/IcResiUserDao.xml | 6 +++++- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index 35abf9d798..ac4eba65fd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -9,6 +9,7 @@ import com.epmet.entity.IcHouseEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; import java.util.Set; @@ -178,9 +179,10 @@ public interface IcHouseDao extends BaseDao { * * @param houseId, * @param resiNumber + * @param avgYsrD * @return */ - int updateIcHouseResiNumber(String houseId, Integer resiNumber); + int updateIcHouseResiNumber(String houseId, Integer resiNumber, BigDecimal avgYsrD); /** * @return com.epmet.entity.IcHouseEntity diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 98e340221c..8b584871e7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -43,6 +43,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -301,10 +302,15 @@ public class IcHouseServiceImpl extends BaseServiceImpl { Object houseId = o.get("houseId"); Object resiNumber = o.get("resiNumber"); + Object avgYsr = o.get("avgYsr"); if (houseId == null || resiNumber == null) { return; } - int i = baseDao.updateIcHouseResiNumber(houseId.toString(), Integer.valueOf(resiNumber.toString())); + BigDecimal avgYsrD = null; + if (avgYsr != null){ + avgYsrD = new BigDecimal(avgYsr.toString()); + } + int i = baseDao.updateIcHouseResiNumber(houseId.toString(), Integer.valueOf(resiNumber.toString()), avgYsrD); effects.getAndAdd(i); }); log.debug("updateIcHouseResiNumber effectRow:{}", effects.intValue()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index ac7c0fc342..8756c9ea8d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -526,7 +526,9 @@ - UPDATE ic_house SET RESI_NUMBER = #{resiNumber}, UPDATED_TIME = NOW() where ID = #{houseId} and RESI_NUMBER != #{resiNumber} and DEL_FLAG = '0' + UPDATE ic_house + SET RESI_NUMBER = #{resiNumber}, AVG_YSR = #{avgYsrD}, UPDATED_TIME = NOW() + where ID = #{houseId} and RESI_NUMBER != #{resiNumber} and DEL_FLAG = '0' From 5c16125deac200101f9ae33ba2bac6aa7966faf3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 20 Jul 2022 13:40:50 +0800 Subject: [PATCH 31/76] =?UTF-8?q?=E6=97=A0=E7=94=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java | 5 ----- .../main/java/com/epmet/entity/IcServiceScopeV2Entity.java | 5 ----- 2 files changed, 10 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java index aa69855de6..f5bc086fae 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceScopeV2DTO.java @@ -51,11 +51,6 @@ public class IcServiceScopeV2DTO implements Serializable { */ private String objectName; - /** - * 备注 - */ - private String remark; - /** * 乐观锁 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java index cbf0dd1392..491aadda15 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeV2Entity.java @@ -51,9 +51,4 @@ public class IcServiceScopeV2Entity extends BaseEpmetEntity { */ private String objectName; - /** - * 备注 - */ - private String remark; - } From 8f814417f3d529fcb9d9da0029af9f85c4ae39de Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 13:51:56 +0800 Subject: [PATCH 32/76] xionzeng --- .../form/policy/IcPolicyRuleDetailDTO.java | 17 ++++++++++++---- .../dto/form/policy/IcPolicyRuleFormDTO.java | 5 ++++- .../service/impl/IcPolicyServiceImpl.java | 20 +++++++------------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java index b88ac693c6..8bbbe1ef5e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java @@ -12,7 +12,13 @@ import javax.validation.constraints.NotBlank; */ @Data public class IcPolicyRuleDetailDTO { - public interface AddUserShowGroup extends CustomerClientShowGroup { + public interface ResiRulerShowGroup extends CustomerClientShowGroup { + } + + public interface HouseRulerShowGroup extends CustomerClientShowGroup { + } + + public interface StatRulerShowGroup extends CustomerClientShowGroup { } /** * 规则描述文字,例如:基础信息性别等于女 @@ -27,34 +33,37 @@ public class IcPolicyRuleDetailDTO { /** * 分组id;人员信息有值; */ + @NotBlank(message = "itemGroupId不能为空", groups = ResiRulerShowGroup.class) private String itemGroupId; /** * 表名;人员信息有值;房屋信息也有值 */ + @NotBlank(message = "itemId不能为空", groups = ResiRulerShowGroup.class) private String itemId; /** * 查询类型:等于、不等于....;来源于字典表sql_query_type */ - @NotBlank(message = "查询类型不能为空", groups = AddUserShowGroup.class) + @NotBlank(message = "查询类型不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class}) private String queryType; /** * 表名;人员信息有值; */ + @NotBlank(message = "colTable不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class}) private String colTable; /** * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 */ - @NotBlank(message = "条件不能为空", groups = AddUserShowGroup.class) + @NotBlank(message = "条件不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class}) private String colKey; /** * 参数值 */ - @NotBlank(message = "参数值不能为空", groups = AddUserShowGroup.class) + @NotBlank(message = "参数值不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class}) private String colVal; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java index e35df132dd..df8d8689fa 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form.policy; import lombok.Data; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.List; @@ -22,16 +23,18 @@ public class IcPolicyRuleFormDTO implements Serializable { /** * 人员信息 */ - // @Valid + @Valid // @NotEmpty private List resiRuleList; /** * 房屋信息 */ + @Valid private List houseRuleList; /** * 统计信息 */ + @Valid private List statRuleList; /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index b77a8a31ab..5fe69341dc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -3,11 +3,6 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.IcPolicyDao; -import com.epmet.dao.IcPolicyRuleDetailDao; -import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; -import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; @@ -18,12 +13,13 @@ 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.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.*; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.entity.IcPolicyEntity; -import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; @@ -41,13 +37,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; -import java.util.Map; /** * 政策表 @@ -137,6 +128,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl Date: Wed, 20 Jul 2022 14:10:03 +0800 Subject: [PATCH 33/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ResisByPolicyRulesFormDTO.java | 88 +++++++++--------- .../result/ResiByPolicyInfoResultDTO.java | 26 ++++++ .../feign/DataAggregatorOpenFeignClient.java | 5 +- .../controller/IcUserController.java | 30 +++++-- .../dao/epmetuser/IcResiUserDao.java | 16 +++- .../dao/govorg/IcNeighborhoodDao.java | 13 +++ .../epmet/dataaggre/service/ResiService.java | 11 ++- .../service/epmetuser/EpmetUserService.java | 4 +- .../epmetuser/impl/EpmetUserServiceImpl.java | 7 +- .../service/govorg/GovOrgService.java | 8 +- .../govorg/impl/GovOrgServiceImpl.java | 59 ++++++++++-- .../service/impl/ResiServiceImpl.java | 90 ++++++++++++++----- .../mapper/epmetuser/IcResiUserDao.xml | 45 +++++++++- .../mapper/govorg/IcNeighborhoodDao.xml | 15 ++++ .../resi/HeartResisByPolicyRulesFormDTO.java | 86 +++++++++--------- .../form/resi/ResisByPolicyRulesFormDTO.java | 62 +++++++++++++ .../resi/ResiByPolicyInfoResultDTO.java} | 4 +- .../epmet/controller/IcPolicyController.java | 8 +- .../com/epmet/service/IcPolicyService.java | 4 +- .../service/impl/IcPolicyServiceImpl.java | 72 ++++++++++++--- .../migration/V0.0.36__house_add_avgysr.sql | 2 +- 21 files changed, 498 insertions(+), 157 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcNeighborhoodDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcNeighborhoodDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java rename epmet-module/{data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java => epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java} (81%) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java index d47d8fdde1..cfcedbed03 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Comparator; +import java.util.List; import java.util.Map; import java.util.Set; @@ -12,58 +13,63 @@ import java.util.Set; @NoArgsConstructor @AllArgsConstructor public class ResisByPolicyRulesFormDTO { + private String ruleId; + private String orgId; + private String orgType; + private String neighborHoodId; + private String buildingId; + private String unitId; + private String houseId; + private String name; + private String mobile; + private String idCard; + private RuleList ruleList = new RuleList(); + private Integer pageNo; + private Integer pageSize; - private Integer pageNo = 1; - private Integer pageSize = 20; - - /** - * 规则map - */ - private Map> rules; + @Data + public static class RuleList { + private String ruleName; + private List resiRule; + private List houseRule; + private List statRule; + } @Data @NoArgsConstructor @AllArgsConstructor - public static class PolicyRule implements Comparator { - private String customerId; - /** - * resi:人员信息,house:房屋信息,stat:统计信息 - */ - private String groupType; - - /** - * 与上一条的关系;and、or - */ + public static class ResiRule { + private String ruleDesc; private String lastLogicalRel; - - /** - * 查询类型:等于、不等于....;来源于字典表sql_query_type - */ + private String itemGroupId; + private String itemId; private String queryType; - - /** - * 表名;人员信息有值; - */ private String colTable; - - /** - * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 - */ private String colKey; - - /** - * 参数值 - */ private String colVal; + } - /** - * 排序字段;同一group_type升序 - */ - private Integer sort; + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class HouseRule { + private String colTable; + private String colKey; + private String colVal; + private String ruleDesc; + private String lastLogicalRel; + private String queryType; + } - @Override - public int compare(Integer o1, Integer o2) { - return o1.compareTo(o2); - } + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class StatRule { + private String colKey; + private String colVal; + private String lastLogicalRel; + private String ruleDesc; + private String queryType; + private String colTable; } } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java new file mode 100644 index 0000000000..e739baca1d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ResiByPolicyInfoResultDTO { + + private String icResiUserId; + private String name; + private String mobile; + private String idCard; + /** + * 小区全名,包含小区前面的属性,比如网格等 + */ + private String gridId; + private String neighborhoodId; + private String neighborHoodName; + private Integer age; + private Date birthday; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java index d29b42173e..9bda005a8b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java @@ -4,12 +4,15 @@ package com.epmet.dataaggre.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.feign.impl.DataAggregatorOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; + @FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = DataAggregatorOpenFeignClientFallbackFactory.class) // @FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory= DataAggregatorOpenFeignClientFallbackFactory.class,url = "localhost:8114") public interface DataAggregatorOpenFeignClient { @@ -28,5 +31,5 @@ public interface DataAggregatorOpenFeignClient { * @return */ @PostMapping("data/aggregator/icuser/listByPolicyRules") - Result listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); + Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 715fbc7501..8e68a00431 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import org.apache.commons.collections4.CollectionUtils; @@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; @@ -51,23 +53,33 @@ public class IcUserController { * @return */ @PostMapping("listByPolicyRules") - public Result listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + public Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); - Map> rules = input.getRules(); - Set resiRule = rules.get("resi"); - Set houseRule = rules.get("house"); - Set houseStat = rules.get("stat"); + List resiRule = input.getRuleList().getResiRule(); + List houseRule = input.getRuleList().getHouseRule(); + List statRule = input.getRuleList().getStatRule(); + String orgId = input.getOrgId(); + String orgType = input.getOrgType(); + String neighborHoodId = input.getNeighborHoodId(); + String buildingId = input.getBuildingId(); + String unitId = input.getUnitId(); + String houseId = input.getHouseId(); + String idCard = input.getIdCard(); + String name = input.getName(); + + // 全都为空,则返回空 if (CollectionUtils.isEmpty(resiRule) && CollectionUtils.isEmpty(houseRule) - && CollectionUtils.isEmpty(houseStat)) { - return new Result(); + && CollectionUtils.isEmpty(statRule)) { + return new Result().ok(new ArrayList<>()); } - icResiService.listByPolicyRules(pageNo, pageSize, resiRule, houseRule, houseStat); - return new Result(); + List resis = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); + return new Result>().ok(resis); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java index 82d13c9094..dfbf64daaa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -20,7 +20,7 @@ package com.epmet.dataaggre.dao.epmetuser; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.IcResiInfoResultDTO; -import com.epmet.dataaggre.dto.epmetuser.result.ResiInfoResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO; import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity; import com.epmet.dto.IcResiUserDTO; @@ -68,7 +68,15 @@ public interface IcResiUserDao extends BaseDao { * @param houseIds * @return */ - List listByPolicyRules(@Param("customerId") String customerId, - @Param("resiRules") Set resiRules, - @Param("houseIds") List houseIds); + List listByPolicyRules(@Param("customerId") String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType, + @Param("neighborHoodId") String neighborHoodId, + @Param("buildingId") String buildingId, + @Param("unitId") String unitId, + @Param("houseId") String houseId, + @Param("idCard") String idCard, + @Param("name") String name, + @Param("resiRules") List resiRule, + @Param("houseIds") List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcNeighborhoodDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcNeighborhoodDao.java new file mode 100644 index 0000000000..51a309e135 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcNeighborhoodDao.java @@ -0,0 +1,13 @@ +package com.epmet.dataaggre.dao.govorg; + +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; +import com.epmet.dto.IcNeighborHoodDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface IcNeighborhoodDao { + List neighborhoodsByIds(@Param("neighborhoodIds") List neighborhoodIds); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java index 286f299186..b15f39e5fc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -1,7 +1,7 @@ package com.epmet.dataaggre.service; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; -import com.epmet.dataaggre.dto.epmetuser.result.ResiInfoResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import java.util.List; import java.util.Set; @@ -18,7 +18,10 @@ public interface ResiService { * @param resiRule * @param houseRule */ - List listByPolicyRules(Integer pageNo, Integer pageSize, Set resiRule, - Set houseRule, - Set houseStat); + List listByPolicyRules( + String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + List resiRule, + List houseRule, + List statRule); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 834ffd051e..5a095d6e2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -201,5 +201,7 @@ public interface EpmetUserService { */ List staffSelectList(List staffIds); - List listByPolicyRules(String customerId, Set resiRule, List houseIds); + List listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + List resiRule, List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index ef4ad9c699..2166db1e3d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -845,7 +845,10 @@ public class EpmetUserServiceImpl implements EpmetUserService { } @Override - public List listByPolicyRules(String customerId, Set resiRule, List houseIds) { - return icResiUserDao.listByPolicyRules(customerId, resiRule, houseIds); + public List listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + List resiRule, List houseIds) { + + return icResiUserDao.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 746be2acd2..237a0cf6f2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -12,6 +12,8 @@ import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.IcHouseEntity; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.result.NeighborHoodListResultDTO; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -216,5 +218,9 @@ public interface GovOrgService { */ CustomerAgencyEntity getRootAgencyByCustomerId(String customerId); - List listHousesByRules(Set houseRule, Set houseStat, Integer pageNo, Integer pageSize); + List listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, + String unitId, String houseId, List houseRule, + List statRule, Integer pageNo, Integer pageSize); + + List neighborhoodsByIds(List neighborhoodIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 076191a1f1..945cb2ab59 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -50,6 +50,7 @@ import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.opercrm.CustomerRelation; +import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.feign.OssFeignClient; import com.github.pagehelper.PageHelper; @@ -114,6 +115,8 @@ public class GovOrgServiceImpl implements GovOrgService { private ExecutorService executorService; @Autowired private IcHouseDao houseDao; + @Autowired + private IcNeighborhoodDao neighborhoodDao; /** * @param staffId @@ -1087,26 +1090,67 @@ public class GovOrgServiceImpl implements GovOrgService { return customerAgencyDao.selectOne(query); } + public String getOrgIdPath(String orgId, String orgType) { + if ("agency".equals(orgType)) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + if (agencyInfo != null) { + String pids = agencyInfo.getPids(); + String id = agencyInfo.getId(); + if (StringUtils.isBlank(pids)) { + return id; + } else { + return pids.concat(":").concat(id); + } + } + } else { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); + return gridInfo.getPids().concat(":").concat(gridInfo.getId()); + } + return null; + } + @Override - public List listHousesByRules(Set houseRule, Set statRule, Integer pageNo, Integer pageSize) { + public List listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, + String unitId, String houseId, List houseRule, + List statRule, Integer pageNo, Integer pageSize) { + if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { return new ArrayList<>(); } - String customerId = EpmetRequestHolder.getLoginUserCustomerId(); QueryWrapper query = new QueryWrapper<>(); - query.eq("CUSTOMER_ID", customerId); + + if (StringUtils.isNotBlank(orgId) && StringUtils.isNotBlank(orgType)) { + String orgIdPath = getOrgIdPath(orgId, orgType); + query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath); + } + + if (StringUtils.isNotBlank(customerId)) { + query.eq("CUSTOMER_ID", customerId); + } + if (StringUtils.isNotBlank(neighborHoodId)) { + query.eq("NEIGHBOR_HOOD_ID", neighborHoodId); + } + if (StringUtils.isNotBlank(buildingId)) { + query.eq("BUILDING_ID", buildingId); + } + if (StringUtils.isNotBlank(unitId)) { + query.eq("BUILDING_UNIT_ID", unitId); + } + if (StringUtils.isNotBlank(houseId)) { + query.eq("ID", houseId); + } // 房屋属性 if (CollectionUtils.isNotEmpty(houseRule)) { - for (ResisByPolicyRulesFormDTO.PolicyRule rule : houseRule) { + for (ResisByPolicyRulesFormDTO.HouseRule rule : houseRule) { query.eq(rule.getColKey(), rule.getColVal()); } } // 房屋的统计属性 if (CollectionUtils.isNotEmpty(statRule)) { - for (ResisByPolicyRulesFormDTO.PolicyRule rule : statRule) { + for (ResisByPolicyRulesFormDTO.StatRule rule : statRule) { query.eq(rule.getColKey(), rule.getColVal()); } } @@ -1114,4 +1158,9 @@ public class GovOrgServiceImpl implements GovOrgService { PageHelper.startPage(pageNo, pageSize); return houseDao.selectList(query); } + + @Override + public List neighborhoodsByIds(List neighborhoodIds) { + return neighborhoodDao.neighborhoodsByIds(neighborhoodIds); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 716fff932e..1e81a3c520 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -1,19 +1,21 @@ package com.epmet.dataaggre.service.impl; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; -import com.epmet.dataaggre.dto.epmetuser.result.ResiInfoResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.entity.govorg.IcHouseEntity; import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; +import com.epmet.dto.IcNeighborHoodDTO; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; +import java.time.*; +import java.util.*; import java.util.stream.Collectors; @Service @@ -26,38 +28,45 @@ public class ResiServiceImpl implements ResiService { private GovOrgService govOrgService; @Override - public List listByPolicyRules(Integer pageNo, Integer pageSize, - Set resiRule, - Set houseRule, - Set houseStat) { + public List listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + List resiRule, + List houseRule, + List statRule) { String customerId = EpmetRequestHolder.getLoginUserCustomerId(); // 结果集 - List resultResis = new ArrayList<>(); + List resultResis = new ArrayList<>(); + // 1.用户没配置house和stat规则,直接按照居民规则查询 + if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { + return epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, null); + } + + // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民 int housePageNo = 0; do { - // houseIds 为null,说明用户没有指定house和统计的规则,则不应该使用这两项来查询,sql中不应该有这方面的条件 - List houseIds = null; - // 拿到房屋id列表,去查询居民列表 - if (CollectionUtils.isNotEmpty(houseRule) || CollectionUtils.isNotEmpty(houseStat)) { - List houseEntities = govOrgService.listHousesByRules(houseRule, houseStat, housePageNo, 50); - houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList()); - } + List houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, houseRule, statRule, housePageNo, 50); + List houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList()); - if (houseIds != null && houseIds.size() == 0) { + if (houseIds.size() == 0) { // 用户使用了房屋和统计相关的条件,但是没查到房屋,我看就没有走下去了的必要了吧.. break; } // 查询居民 - List resis = epmetUserService.listByPolicyRules(customerId, resiRule, houseIds); + List resis = epmetUserService.listByPolicyRules( + customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); + resultResis.addAll(resis); // 满了20个,或者查不到居民和房屋了(数据空了),则跳出 // 没有用house的条件,没有循环的必要,查一次居民信息即可,跳出 - if (resultResis.size() >= pageSize || houseIds == null ) { + if (resultResis.size() >= pageSize) { break; } @@ -66,9 +75,50 @@ public class ResiServiceImpl implements ResiService { // 够了20个,那就截取前20个,否则直接返回 if (resultResis.size() > 20) { - return resultResis.subList(0, 20); + resultResis = resultResis.subList(0, 20); } + + // 补充额外信息 + fillResisExtraInfoForPolicy(resultResis); return resultResis; } + /** + * 补充额外信息 + * @param resultResis + */ + private void fillResisExtraInfoForPolicy(List resultResis) { + List gridIds = new ArrayList<>(); + List neighborhoodIds = new ArrayList<>(); + resultResis.stream().forEach((r) -> { + gridIds.add(r.getGridId()); + neighborhoodIds.add(r.getNeighborhoodId()); + }); + + // 统一收集网格和小区信息 + Map gridIdAndName = govOrgService.gridListByIds(gridIds) + .stream() + .collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, GridsInfoListResultDTO::getName)); + + Map neighborhoodIdAndName = govOrgService.neighborhoodsByIds(neighborhoodIds) + .stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName)); + + resultResis.stream().forEach((r) -> { + // 小区名称 + r.setNeighborHoodName(gridIdAndName.get(r.getGridId()).concat("-").concat(neighborhoodIdAndName.get(r.getNeighborhoodId()))); + + // 出生日期 & 年龄 + if (r.getBirthday() != null) { + Integer age = null; + try { + LocalDate birthdayLocalDate = LocalDateTime.ofInstant(r.getBirthday().toInstant(), ZoneId.systemDefault()).toLocalDate(); + age = Period.between(birthdayLocalDate, LocalDate.now()).getYears(); + } catch (DateTimeException e) { + throw new EpmetException("居民生日计算错误"); + } + r.setAge(age); + } + }); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index 1017c1f37a..2a0f410795 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -70,20 +70,59 @@ - + select `ID` as icResiUserId, + `GRID_ID`, + `NAME`, + `MOBILE`, + `ID_CARD`, + `VILLAGE_ID` as neighborhoodId, + `BIRTHDAY` from ic_resi_user inner join #{rule.colTable} + ic_resi_user.CUSTOMER_ID=#{customerId} + + + + + and ic_resi_user.AGENCY_ID=#{orgId} + + + and ic_resi_user.GRID_ID=#{orgId} + + + + + + and ic_resi_user.VILLAGE_ID=#{neighborHoodId} + + + and ic_resi_user.BUILD_ID=#{buildingId} + + + and ic_resi_user.UNIT_ID=#{unitId} + + + and ic_resi_user.HOME_ID=#{houseId} + + + and ic_resi_user.ID_CARD like CONCAT('%'#{idCard}, '%') + + + and ic_resi_user.NAME like CONCAT('%'#{name}, '%') + + + ${rule.lastLogicalRel} ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} - + and HOME_ID in diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcNeighborhoodDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcNeighborhoodDao.xml new file mode 100644 index 0000000000..93a43bbb01 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcNeighborhoodDao.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java index 5dbf1cfba1..d195372b96 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Comparator; +import java.util.List; import java.util.Map; import java.util.Set; @@ -12,58 +13,57 @@ import java.util.Set; @NoArgsConstructor @AllArgsConstructor public class HeartResisByPolicyRulesFormDTO { - - private Integer pageNo = 1; - private Integer pageSize = 20; - - /** - * 规则map - */ - private Set rules; + private String ruleId; + private String orgId; + private String orgType; + private String neighborHoodId; + private String buildingId; + private String unitId; + private String houseId; + private String name; + private String mobile; + private String idCard; + private RuleList ruleList; + private Integer pageNo; + private Integer pageSize; @Data - @NoArgsConstructor - @AllArgsConstructor - public static class PolicyRule implements Comparator { - private String customerId; - /** - * resi:人员信息,house:房屋信息,stat:统计信息 - */ - private String groupType; + public static class RuleList { + private String ruleName; + private List resiRule; + private List houseRule; + private List statRule; + } - /** - * 与上一条的关系;and、or - */ + @Data + public static class ResiRule { + private String ruleDesc; private String lastLogicalRel; - - /** - * 查询类型:等于、不等于....;来源于字典表sql_query_type - */ + private String itemGroupId; + private String itemId; private String queryType; - - /** - * 表名;人员信息有值; - */ private String colTable; - - /** - * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 - */ private String colKey; - - /** - * 参数值 - */ private String colVal; + } - /** - * 排序字段;同一group_type升序 - */ - private Integer sort; + @Data + public static class HouseRule { + private String colTable; + private String colKey; + private String colVal; + private String ruleDesc; + private String lastLogicalRel; + private String queryType; + } - @Override - public int compare(Integer o1, Integer o2) { - return o1.compareTo(o2); - } + @Data + public static class StatRule { + private String colKey; + private String colVal; + private String lastLogicalRel; + private String ruleDesc; + private String queryType; + private String colTable; } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java new file mode 100644 index 0000000000..2f9fd654a4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import java.util.List; + +@Data +public class ResisByPolicyRulesFormDTO { + private String ruleId; + private String orgId; + private String orgType; + private String neighborHoodId; + private String buildingId; + private String unitId; + private String houseId; + private String name; + private String mobile; + private String idCard; + private RuleList ruleList; + private Integer pageNo; + private Integer pageSize; + + @Data + public static class RuleList { + private String ruleName; + private List resiRule; + private List houseRule; + private List statRule; + } + + @Data + public static class ResiRule { + private String ruleDesc; + private String lastLogicalRel; + private String itemGroupId; + private String itemId; + private String queryType; + private String colTable; + private String colKey; + private String colVal; + } + + @Data + public static class HouseRule { + private String colTable; + private String colKey; + private String colVal; + private String ruleDesc; + private String lastLogicalRel; + private String queryType; + } + + @Data + public static class StatRule { + private String colKey; + private String colVal; + private String lastLogicalRel; + private String ruleDesc; + private String queryType; + private String colTable; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java similarity index 81% rename from epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java index 04793b3a71..313f70560b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dataaggre.dto.epmetuser.result; +package com.epmet.dto.result.resi; import lombok.AllArgsConstructor; import lombok.Data; @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor -public class ResiInfoResultDTO { +public class ResiByPolicyInfoResultDTO { private String name; private String mobile; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index aa6a390038..cc444aa24e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -13,6 +13,7 @@ import com.epmet.dto.form.resi.HeartResisByPolicyRulesFormDTO; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; +import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,11 +47,8 @@ public class IcPolicyController { } @PostMapping("resiuserlist") - public Result listResiUserByPolicyRules(@RequestBody HeartResisByPolicyRulesFormDTO input) { - //todo - String ruleId = "a"; - String customerId = EpmetRequestHolder.getLoginUserCustomerId(); - icPolicyService.listResiUserByPolicyRules(customerId, ruleId, 1, 20); + public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + icPolicyService.listResiUserByPolicyRules(input); return null; } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 0c3534e2bb..b0f0fe2636 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -7,6 +7,8 @@ import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; +import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; +import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; @@ -45,5 +47,5 @@ public interface IcPolicyService extends BaseService { IcPolicyDTO policyDetail(String customerId,String policyId); - void listResiUserByPolicyRules(String customerId, String ruleId, Integer pageNo, Integer pageSize); + List listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index b77a8a31ab..1d17e462aa 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -3,6 +3,9 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcPolicyDao; import com.epmet.dao.IcPolicyRuleDetailDao; @@ -17,11 +20,11 @@ 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.commons.tools.utils.Result; import com.epmet.dao.*; import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.IcPolicyEntity; import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.dto.IcPolicyRuleDTO; @@ -47,7 +50,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import java.util.Map; /** * 政策表 @@ -56,7 +58,7 @@ import java.util.Map; * @since v1.0.0 2022-07-18 */ @Service -public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService { +public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService, ResultDataResolver { @Autowired private IcPolicyRuleDetailDao policyRuleDetailDao; @@ -310,19 +312,61 @@ public class IcPolicyServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper(); - query.eq(IcPolicyRuleDetailEntity::getCustomerId, customerId); - query.eq(IcPolicyRuleDetailEntity::getRuleId, ruleId); + public List listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) { + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + String ruleId = input.getRuleId(); + + ResisByPolicyRulesFormDTO aggForm = ConvertUtils.sourceToTarget(input, ResisByPolicyRulesFormDTO.class); + + // 穿了规则id,按照规则id来,忽略规则list + if (StringUtils.isNotBlank(ruleId)) { + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(IcPolicyRuleDetailEntity::getCustomerId, customerId); + query.eq(IcPolicyRuleDetailEntity::getRuleId, ruleId); + List rules = policyRuleDetailDao.selectList(query); + + // 将查询出的数据转化成aggre服务能接受的格式 + Map> ruleMap = rules.stream().collect(Collectors.groupingBy(IcPolicyRuleDetailEntity::getGroupType, Collectors.toList())); + + // resi规则 + List originResiRules = ruleMap.get("resi"); + if (CollectionUtils.isNotEmpty(originResiRules)) { + List resiRules = originResiRules + .stream() + .map((r) -> new ResisByPolicyRulesFormDTO.ResiRule(r.getRuleDesc(), r.getLastLogicalRel(), r.getItemGroupId(), + r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal())) + .collect(Collectors.toList()); - List rules = policyRuleDetailDao.selectList(query); + aggForm.getRuleList().setResiRule(resiRules); + } + + // house规则 + List originHouseRules = ruleMap.get("house"); + if (CollectionUtils.isNotEmpty(originHouseRules)) { + List houseRules = originHouseRules + .stream() + .map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(), + r.getRuleDesc(), r.getLastLogicalRel(), r.getQueryType())) + .collect(Collectors.toList()); + aggForm.getRuleList().setHouseRule(houseRules); + } - // 将查询出的数据转化成aggre服务能接受的格式 - Map> rulesMap = rules.stream().map((r) -> new ResisByPolicyRulesFormDTO.PolicyRule( - customerId, r.getGroupType(), r.getLastLogicalRel(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal(), r.getSort()) - ).collect(Collectors.groupingBy(ResisByPolicyRulesFormDTO.PolicyRule::getGroupType, Collectors.toSet())); + // stat规则 + List originStatRules = ruleMap.get("stat"); + if (CollectionUtils.isNotEmpty(originStatRules)) { + List statRules = originStatRules + .stream() + .map((r) -> new ResisByPolicyRulesFormDTO.StatRule(r.getColKey(), r.getColVal(), r.getLastLogicalRel(), + r.getRuleDesc(), r.getQueryType(), r.getColTable())) + .collect(Collectors.toList()); + + aggForm.getRuleList().setStatRule(statRules); + } + } - ResisByPolicyRulesFormDTO aggForm = new ResisByPolicyRulesFormDTO(pageNo, pageSize, rulesMap); - Result result = dataAggregatorOpenFeignClient.listByPolicyRules(aggForm); + List resis = getResultDataOrReturnNull(dataAggregatorOpenFeignClient.listByPolicyRules(aggForm), ServiceConstant.DATA_AGGREGATOR_SERVER); + return resis.stream() + .map((r) -> new ResiByPolicyInfoResultDTO(r.getName(), r.getMobile(), r.getIdCard(), r.getNeighborhoodFullName(), r.getAge())) + .collect(Collectors.toList()); } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql index 73b95459ce..b088ca5656 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.36__house_add_avgysr.sql @@ -1 +1 @@ -alter table ic_house add column AVG_RSR decimal(10, 4) comment '人均月收入' after RESI_NUMBER; \ No newline at end of file +alter table ic_house add column AVG_YSR decimal(10,4) comment '家庭平均月收入' default -1 after RESI_NUMBER; \ No newline at end of file From 2e2364742663c3b36a560a00659ff77bf8479dfe Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 20 Jul 2022 14:35:08 +0800 Subject: [PATCH 34/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/IcPolicyController.java | 38 +++++++++++++++++++ .../service/impl/IcPolicyServiceImpl.java | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index cc444aa24e..a383b5ffd9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -15,6 +15,7 @@ import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.service.IcPolicyService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -48,9 +49,46 @@ public class IcPolicyController { @PostMapping("resiuserlist") public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + // 调整错位的逻辑符号位置 + //adjustMalpositionLogicalOperatorPosition(input); icPolicyService.listResiUserByPolicyRules(input); return null; } + + /** + * 调整错位的逻辑运算符 + * @param input + */ + //private void adjustMalpositionLogicalOperatorPosition(ResisByPolicyRulesFormDTO input) { + // List resiRule = input.getRuleList().getResiRule(); + // List houseRule = input.getRuleList().getHouseRule(); + // List statRule = input.getRuleList().getStatRule(); + // + // if (CollectionUtils.isNotEmpty(resiRule)) { + // for (int i = 1; i < resiRule.size() - 1; i++) { + // ResisByPolicyRulesFormDTO.ResiRule current = resiRule.get(i); + // ResisByPolicyRulesFormDTO.ResiRule last = resiRule.get(i - 1); + // current.setLastLogicalRel(last.getLastLogicalRel()); + // } + // } + // + // if (CollectionUtils.isNotEmpty(houseRule)) { + // for (int i = 1; i < houseRule.size() - 1; i++) { + // ResisByPolicyRulesFormDTO.HouseRule current = houseRule.get(i); + // ResisByPolicyRulesFormDTO.HouseRule last = houseRule.get(i - 1); + // current.setLastLogicalRel(last.getLastLogicalRel()); + // } + // } + // + // if (CollectionUtils.isNotEmpty(statRule)) { + // for (int i = 1; i < statRule.size() - 1; i++) { + // ResisByPolicyRulesFormDTO.StatRule current = statRule.get(i); + // ResisByPolicyRulesFormDTO.StatRule last = statRule.get(i - 1); + // current.setLastLogicalRel(last.getLastLogicalRel()); + // } + // } + //} + /** * 政策管理-新增/修改 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index f46a0b0af8..ed96978438 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -369,7 +369,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl resis = getResultDataOrReturnNull(dataAggregatorOpenFeignClient.listByPolicyRules(aggForm), ServiceConstant.DATA_AGGREGATOR_SERVER); return resis.stream() - .map((r) -> new ResiByPolicyInfoResultDTO(r.getName(), r.getMobile(), r.getIdCard(), r.getNeighborhoodFullName(), r.getAge())) + .map((r) -> new ResiByPolicyInfoResultDTO(r.getName(), r.getMobile(), r.getIdCard(), r.getNeighborHoodName(), r.getAge())) .collect(Collectors.toList()); } } \ No newline at end of file From 608b181774a1759d16cfe005e02f8cb5cb1a2c20 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 14:38:09 +0800 Subject: [PATCH 35/76] nextLogicalRel --- .../com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java | 5 +++-- .../java/com/epmet/entity/IcPolicyRuleDetailEntity.java | 5 +++-- .../java/com/epmet/service/impl/IcPolicyServiceImpl.java | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java index 8bbbe1ef5e..79be9a25ff 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java @@ -26,9 +26,10 @@ public class IcPolicyRuleDetailDTO { private String ruleDesc; /** - * 与上一条的关系;and、or + * 与下一条的关系;and、or + * 如果没有条件的话,此列为空 */ - private String lastLogicalRel; + private String nextLogicalRel; /** * 分组id;人员信息有值; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java index ee959255b0..7516f2aca6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java @@ -44,9 +44,10 @@ public class IcPolicyRuleDetailEntity extends BaseEpmetEntity { private String groupType; /** - * 与上一条的关系;and、or + * 与下一条的关系;and、or + * 如果没有条件的话,此列为空 */ - private String lastLogicalRel; + private String nextLogicalRel; /** * 分组id;人员信息有值; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index f46a0b0af8..09d7977b6a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -336,7 +336,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl resiRules = originResiRules .stream() - .map((r) -> new ResisByPolicyRulesFormDTO.ResiRule(r.getRuleDesc(), r.getLastLogicalRel(), r.getItemGroupId(), + .map((r) -> new ResisByPolicyRulesFormDTO.ResiRule(r.getRuleDesc(), r.getNextLogicalRel(), r.getItemGroupId(), r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal())) .collect(Collectors.toList()); @@ -349,7 +349,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl houseRules = originHouseRules .stream() .map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(), - r.getRuleDesc(), r.getLastLogicalRel(), r.getQueryType())) + r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType())) .collect(Collectors.toList()); aggForm.getRuleList().setHouseRule(houseRules); } @@ -359,7 +359,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl statRules = originStatRules .stream() - .map((r) -> new ResisByPolicyRulesFormDTO.StatRule(r.getColKey(), r.getColVal(), r.getLastLogicalRel(), + .map((r) -> new ResisByPolicyRulesFormDTO.StatRule(r.getColKey(), r.getColVal(), r.getNextLogicalRel(), r.getRuleDesc(), r.getQueryType(), r.getColTable())) .collect(Collectors.toList()); From cc2649b85d7ad1f142f55e4e32e970c1452990d9 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 20 Jul 2022 14:39:08 +0800 Subject: [PATCH 36/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/epmetuser/IcResiUserDao.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index 2a0f410795..651c9c806f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -114,14 +114,6 @@ and ic_resi_user.NAME like CONCAT('%'#{name}, '%') - - - - - ${rule.lastLogicalRel} ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} - - - and HOME_ID in @@ -129,6 +121,13 @@ #{houseId} + + + and + + ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.lastLogicalRel} + + From 31b7f23d8abf77a8ae6d1f1770db560561c4ffe6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 15:05:04 +0800 Subject: [PATCH 37/76] =?UTF-8?q?=E5=8E=BB=E6=8E=89orgIdPath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcPolicyDTO.java | 4 ++++ .../com/epmet/dto/form/policy/IcPolicyFormDTO.java | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index 8c7fc33767..947f2faa09 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -28,6 +28,10 @@ public class IcPolicyDTO implements Serializable { */ private String orgId; + /** + * AGENCY_ID的全路径,含agency_id + */ + private String orgIdPath; /** * 政策级别,0市级;1区级;2街道级 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java index c605e8b062..3ebd110fad 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java @@ -39,11 +39,11 @@ public class IcPolicyFormDTO implements Serializable { @NotBlank(message = "orgId不能为空",groups = UpdateUserInternalGroup.class) private String orgId; - /** - * AGENCY_ID的全路径,含agency_id - */ - @NotBlank(message = "orgIdPath不能为空",groups = UpdateUserInternalGroup.class) - private String orgIdPath; + // /** + // * AGENCY_ID的全路径,含agency_id + // */ + // @NotBlank(message = "orgIdPath不能为空",groups = UpdateUserInternalGroup.class) + // private String orgIdPath; /** From 7bad0e5692ec1fc82d6048e4b73b9d530d1c51ad Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 20 Jul 2022 15:21:34 +0800 Subject: [PATCH 38/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/page/PageData.java | 2 ++ .../epmetuser/form/ResisByPolicyRulesFormDTO.java | 6 +++--- .../feign/DataAggregatorOpenFeignClient.java | 3 ++- .../impl/DataAggregatorOpenFeignClientFallback.java | 4 +++- .../epmet/dataaggre/controller/IcUserController.java | 7 ++++--- .../com/epmet/dataaggre/service/ResiService.java | 4 +++- .../dataaggre/service/impl/ResiServiceImpl.java | 10 +++++++--- .../resources/mapper/epmetuser/IcResiUserDao.xml | 2 +- .../java/com/epmet/dto/IcPolicyRuleDetailDTO.java | 2 +- .../form/resi/HeartResisByPolicyRulesFormDTO.java | 6 +++--- .../dto/form/resi/ResisByPolicyRulesFormDTO.java | 6 +++--- .../dto/result/resi/ResiByPolicyInfoResultDTO.java | 8 +++++++- .../com/epmet/controller/IcPolicyController.java | 5 +++-- .../main/java/com/epmet/service/IcPolicyService.java | 2 +- .../com/epmet/service/impl/IcPolicyServiceImpl.java | 12 ++++++++---- 15 files changed, 51 insertions(+), 28 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java index 380d5ec0e5..55a331c4e2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.page; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; @@ -20,6 +21,7 @@ import java.util.List; * @since 1.0.0 */ @Data +@NoArgsConstructor public class PageData implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java index cfcedbed03..ea4bd8cb0a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java @@ -40,7 +40,7 @@ public class ResisByPolicyRulesFormDTO { @AllArgsConstructor public static class ResiRule { private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String itemGroupId; private String itemId; private String queryType; @@ -57,7 +57,7 @@ public class ResisByPolicyRulesFormDTO { private String colKey; private String colVal; private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String queryType; } @@ -67,7 +67,7 @@ public class ResisByPolicyRulesFormDTO { public static class StatRule { private String colKey; private String colVal; - private String lastLogicalRel; + private String nextLogicalRel; private String ruleDesc; private String queryType; private String colTable; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java index 9bda005a8b..f979ead709 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; @@ -31,5 +32,5 @@ public interface DataAggregatorOpenFeignClient { * @return */ @PostMapping("data/aggregator/icuser/listByPolicyRules") - Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); + Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java index b50b31441f..2cec07e6b3 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java @@ -1,9 +1,11 @@ package com.epmet.dataaggre.feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; @@ -19,7 +21,7 @@ public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpen } @Override - public Result listByPolicyRules(ResisByPolicyRulesFormDTO input) { + public Result> listByPolicyRules(ResisByPolicyRulesFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "listByPolicyRules", input); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 8e68a00431..32f41b81e4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -53,7 +54,7 @@ public class IcUserController { * @return */ @PostMapping("listByPolicyRules") - public Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { + public Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); @@ -77,9 +78,9 @@ public class IcUserController { return new Result().ok(new ArrayList<>()); } - List resis = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, + PageData page = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); - return new Result>().ok(resis); + return new Result>().ok(page); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java index b15f39e5fc..ee9feb43c4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -1,7 +1,9 @@ package com.epmet.dataaggre.service; +import com.epmet.commons.tools.page.PageData; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; +import com.github.pagehelper.PageInfo; import java.util.List; import java.util.Set; @@ -18,7 +20,7 @@ public interface ResiService { * @param resiRule * @param houseRule */ - List listByPolicyRules( + PageData listByPolicyRules( String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 1e81a3c520..178f70ead8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.dataaggre.service.impl; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; @@ -10,6 +11,7 @@ import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dto.IcNeighborHoodDTO; +import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -28,7 +30,7 @@ public class ResiServiceImpl implements ResiService { private GovOrgService govOrgService; @Override - public List listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + public PageData listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, List houseRule, @@ -40,8 +42,9 @@ public class ResiServiceImpl implements ResiService { // 1.用户没配置house和stat规则,直接按照居民规则查询 if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { - return epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + List resis = epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, pageNo, pageSize, resiRule, null); + return new PageData<>(resis, new PageInfo(resis).getTotal()); } // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民 @@ -80,7 +83,8 @@ public class ResiServiceImpl implements ResiService { // 补充额外信息 fillResisExtraInfoForPolicy(resultResis); - return resultResis; + // todo + return new PageData<>(resultResis, 100); } /** diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index 651c9c806f..f5939ad993 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -125,7 +125,7 @@ and - ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.lastLogicalRel} + ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.nextLogicalRel} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java index 8a87279bcf..10e875d312 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDetailDTO.java @@ -49,7 +49,7 @@ public class IcPolicyRuleDetailDTO implements Serializable { /** * 与上一条的关系;and、or */ - private String lastLogicalRel; + private String nextLogicalRel; /** * 分组id;人员信息有值; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java index d195372b96..11ff13ac65 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java @@ -38,7 +38,7 @@ public class HeartResisByPolicyRulesFormDTO { @Data public static class ResiRule { private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String itemGroupId; private String itemId; private String queryType; @@ -53,7 +53,7 @@ public class HeartResisByPolicyRulesFormDTO { private String colKey; private String colVal; private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String queryType; } @@ -61,7 +61,7 @@ public class HeartResisByPolicyRulesFormDTO { public static class StatRule { private String colKey; private String colVal; - private String lastLogicalRel; + private String nextLogicalRel; private String ruleDesc; private String queryType; private String colTable; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java index 2f9fd654a4..4437c9de35 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java @@ -31,7 +31,7 @@ public class ResisByPolicyRulesFormDTO { @Data public static class ResiRule { private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String itemGroupId; private String itemId; private String queryType; @@ -46,7 +46,7 @@ public class ResisByPolicyRulesFormDTO { private String colKey; private String colVal; private String ruleDesc; - private String lastLogicalRel; + private String nextLogicalRel; private String queryType; } @@ -54,7 +54,7 @@ public class ResisByPolicyRulesFormDTO { public static class StatRule { private String colKey; private String colVal; - private String lastLogicalRel; + private String nextLogicalRel; private String ruleDesc; private String queryType; private String colTable; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java index 313f70560b..2faa7c9b82 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiByPolicyInfoResultDTO.java @@ -4,18 +4,24 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Date; + @Data @NoArgsConstructor @AllArgsConstructor public class ResiByPolicyInfoResultDTO { + private String icResiUserId; private String name; private String mobile; private String idCard; /** * 小区全名,包含小区前面的属性,比如网格等 */ - private String neighborhoodFullName; + private String gridId; + private String neighborhoodId; + private String neighborHoodName; private Integer age; + private Date birthday; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index a383b5ffd9..d8536ce6c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -14,6 +14,7 @@ import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; +import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.service.IcPolicyService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -51,8 +52,8 @@ public class IcPolicyController { public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { // 调整错位的逻辑符号位置 //adjustMalpositionLogicalOperatorPosition(input); - icPolicyService.listResiUserByPolicyRules(input); - return null; + PageData page = icPolicyService.listResiUserByPolicyRules(input); + return new Result().ok(page); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index b0f0fe2636..1b18091b4a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -47,5 +47,5 @@ public interface IcPolicyService extends BaseService { IcPolicyDTO policyDetail(String customerId,String policyId); - List listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); + PageData listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 2c05ac4565..3f959d9f2d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -315,7 +315,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) { + public PageData listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) { String customerId = EpmetRequestHolder.getLoginUserCustomerId(); String ruleId = input.getRuleId(); @@ -367,9 +367,13 @@ public class IcPolicyServiceImpl extends BaseServiceImpl resis = getResultDataOrReturnNull(dataAggregatorOpenFeignClient.listByPolicyRules(aggForm), ServiceConstant.DATA_AGGREGATOR_SERVER); - return resis.stream() - .map((r) -> new ResiByPolicyInfoResultDTO(r.getName(), r.getMobile(), r.getIdCard(), r.getNeighborHoodName(), r.getAge())) + // 调用aggre服务查询结果 + Result> result = dataAggregatorOpenFeignClient.listByPolicyRules(aggForm); + List list = result.getData().getList().stream() + .map((r) -> new ResiByPolicyInfoResultDTO(r.getIcResiUserId() ,r.getName(), r.getMobile(), r.getIdCard(), r.getGridId() + ,r.getNeighborhoodId(), r.getNeighborHoodName(), r.getAge(), r.getBirthday())) .collect(Collectors.toList()); + + return new PageData(list, result.getData().getTotal()); } } \ No newline at end of file From 85fcaefbc30cc9a55e8047e79441c67012def8be Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 15:22:57 +0800 Subject: [PATCH 39/76] update --- .../service/impl/IcPolicyServiceImpl.java | 24 ++++++++----------- .../main/resources/mapper/IcPolicyRuleDao.xml | 2 +- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 2c05ac4565..0745a52db3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -4,22 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.feign.ResultDataResolver; -import com.epmet.commons.tools.utils.EpmetRequestHolder; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.IcPolicyDao; -import com.epmet.dao.IcPolicyRuleDetailDao; -import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; -import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; 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.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.*; @@ -28,14 +23,12 @@ import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; -import com.epmet.entity.IcPolicyEntity; -import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; +import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPolicyService; @@ -48,7 +41,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -116,13 +112,13 @@ public class IcPolicyServiceImpl extends BaseServiceImpl - delete from ic_policy_rule where IC_POLICY_ID=#{policyId} + delete from ic_policy_rule where IC_POLICY_ID = #{policyId} \ No newline at end of file From 13eb83e678b13488b18f9342736fdc93bf5543f2 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 20 Jul 2022 15:24:04 +0800 Subject: [PATCH 40/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcPolicyServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 3f959d9f2d..22dbcb1c4d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -326,6 +326,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper(); query.eq(IcPolicyRuleDetailEntity::getCustomerId, customerId); query.eq(IcPolicyRuleDetailEntity::getRuleId, ruleId); + query.orderByAsc(IcPolicyRuleDetailEntity::getSort); List rules = policyRuleDetailDao.selectList(query); // 将查询出的数据转化成aggre服务能接受的格式 From 6648d840736728981f443526d3eaa06ca5b63f7a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 20 Jul 2022 15:58:41 +0800 Subject: [PATCH 41/76] detail --- .../epmet/service/impl/IcPolicyServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index b4e99c7588..c8f3edeae9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; -import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; @@ -281,6 +280,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl ruleDetailWrapper = new LambdaQueryWrapper<>(); ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) .eq(IcPolicyRuleDetailEntity::getGroupType, "resi") @@ -289,19 +289,22 @@ public class IcPolicyServiceImpl extends BaseServiceImpl resiRuleList = CollectionUtils.isNotEmpty(resiList) ? ConvertUtils.sourceToTarget(resiList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); rule.setResiRuleList(resiRuleList); - ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + //房屋信息 + LambdaQueryWrapper houseDetailWrapper = new LambdaQueryWrapper<>(); + houseDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) .eq(IcPolicyRuleDetailEntity::getGroupType, "house") .orderByAsc(IcPolicyRuleDetailEntity::getSort); - List houseList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List houseList = icPolicyRuleDetailDao.selectList(houseDetailWrapper); List houseRuleList = CollectionUtils.isNotEmpty(houseList) ? ConvertUtils.sourceToTarget(houseList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); rule.setHouseRuleList(houseRuleList); - ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + //统计信息 + LambdaQueryWrapper statDetailWrapper = new LambdaQueryWrapper<>(); + statDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) .eq(IcPolicyRuleDetailEntity::getGroupType, "stat") .orderByAsc(IcPolicyRuleDetailEntity::getSort); - List statList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List statList = icPolicyRuleDetailDao.selectList(statDetailWrapper); List statRuleList = CollectionUtils.isNotEmpty(statList) ? ConvertUtils.sourceToTarget(statList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); - ; rule.setStatRuleList(statRuleList); } } From 41b65f9d34ab3147d4960151c3181ecfeadb8345 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 20 Jul 2022 16:15:10 +0800 Subject: [PATCH 42/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A2=84=E8=A7=88=E5=88=97=E8=A1=A8=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=BA=94=E8=AF=A5=E5=B7=AE=E4=B8=8D=E5=A4=9A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/epmetuser/IcResiUserDao.java | 17 ++++++++ .../service/epmetuser/EpmetUserService.java | 4 ++ .../epmetuser/impl/EpmetUserServiceImpl.java | 5 +++ .../service/impl/ResiServiceImpl.java | 33 +++++++++------- .../mapper/epmetuser/IcResiUserDao.xml | 39 ++++++++++++------- 5 files changed, 72 insertions(+), 26 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java index dfbf64daaa..5dd78f714c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -79,4 +79,21 @@ public interface IcResiUserDao extends BaseDao { @Param("name") String name, @Param("resiRules") List resiRule, @Param("houseIds") List houseIds); + + /** + * 政策查找居民 + * @param houseIds + * @return + */ + Integer getTotalByPolicyRules(@Param("customerId") String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType, + @Param("neighborHoodId") String neighborHoodId, + @Param("buildingId") String buildingId, + @Param("unitId") String unitId, + @Param("houseId") String houseId, + @Param("idCard") String idCard, + @Param("name") String name, + @Param("resiRules") List resiRule, + @Param("houseIds") List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 5a095d6e2f..ca91cd86e7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -204,4 +204,8 @@ public interface EpmetUserService { List listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, List resiRule, List houseIds); + + Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, + List resiRule, List houseIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 2166db1e3d..267af969ea 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -851,4 +851,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { return icResiUserDao.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); } + + @Override + public Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List resiRule, List houseIds) { + return icResiUserDao.getTotalByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 178f70ead8..09097b559c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -48,7 +48,8 @@ public class ResiServiceImpl implements ResiService { } // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民 - int housePageNo = 0; + int housePageNo = 1; + int total = 0; do { // 拿到房屋id列表,去查询居民列表 List houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, @@ -60,19 +61,22 @@ public class ResiServiceImpl implements ResiService { break; } - // 查询居民 - List resis = epmetUserService.listByPolicyRules( - customerId, orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); - - resultResis.addAll(resis); + // 查询居民,满了20个,不再查询数据,只查询数量 + if (resultResis.size() < pageSize) { + List resis = epmetUserService.listByPolicyRules( + customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); - // 满了20个,或者查不到居民和房屋了(数据空了),则跳出 - // 没有用house的条件,没有循环的必要,查一次居民信息即可,跳出 - if (resultResis.size() >= pageSize) { - break; + resultResis.addAll(resis); } + // 查询数量 + Integer count = epmetUserService.getTotalByPolicyRules( + customerId, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, resiRule, houseIds); + + total += count; + housePageNo ++; } while (true); @@ -83,8 +87,7 @@ public class ResiServiceImpl implements ResiService { // 补充额外信息 fillResisExtraInfoForPolicy(resultResis); - // todo - return new PageData<>(resultResis, 100); + return new PageData<>(resultResis, total); } /** @@ -92,6 +95,10 @@ public class ResiServiceImpl implements ResiService { * @param resultResis */ private void fillResisExtraInfoForPolicy(List resultResis) { + if (CollectionUtils.isEmpty(resultResis)) { + return; + } + List gridIds = new ArrayList<>(); List neighborhoodIds = new ArrayList<>(); resultResis.stream().forEach((r) -> { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index f5939ad993..f0c98c7732 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -69,19 +69,7 @@ and resi.STATUS='0' - - + select `ID` as icResiUserId, + `GRID_ID`, + `NAME`, + `MOBILE`, + `ID_CARD`, + `VILLAGE_ID` as neighborhoodId, + `BIRTHDAY` + from ic_resi_user + + inner join #{rule.colTable} + + + + + From f1eb322a40a9155a1f6ba545596e758987d0a1c0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 21 Jul 2022 09:03:12 +0800 Subject: [PATCH 43/76] guoqi --- .../src/main/resources/mapper/IcPolicyDao.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index 9ab37dc06a..0bf133236c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -53,8 +53,8 @@ ip.TITLE, ip.CONTENT, ( - case when ip.END_DATE < now() then '1' - when ip.END_DATE >= now() then '0' + case when ip.END_DATE < DATE_FORMAT(now(),'%Y-%m-%d') then '1' + when ip.END_DATE >= DATE_FORMAT(now(),'%Y-%m-%d') then '0' end )as expiredFlag FROM @@ -70,10 +70,10 @@ and ip.CONTENT like concat('%',#{content},'%') - and ip.END_DATE < now() + and ip.END_DATE < DATE_FORMAT(now(),'%Y-%m-%d') - and ip.END_DATE >= now() + and ip.END_DATE >= DATE_FORMAT(now(),'%Y-%m-%d') order by ip.CREATED_TIME desc From 50d02c096615b2c5b4c6731e15a414fbad70afe3 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 21 Jul 2022 09:25:29 +0800 Subject: [PATCH 44/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=AF=BC=E5=87=BA=EF=BC=8C=E5=81=9A=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E5=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ResisByPolicyRulesFormDTO.java | 6 +- .../data-aggregator-server/pom.xml | 5 ++ .../controller/IcUserController.java | 20 ++++++ .../dataaggre/excel/ResisByPolicyExcel.java | 21 +++++++ .../epmet/dataaggre/service/ResiService.java | 23 +++++++ .../service/impl/ResiServiceImpl.java | 62 ++++++++++++++++++- .../form/resi/ResisByPolicyRulesFormDTO.java | 15 ++++- .../feign/EpmetHeartOpenFeignClient.java | 8 +++ .../EpmetHeartOpenFeignClientFallback.java | 5 ++ .../epmet/controller/IcPolicyController.java | 55 ++++++++++++++++ .../com/epmet/service/IcPolicyService.java | 10 +++ .../service/impl/IcPolicyServiceImpl.java | 22 ++++--- 12 files changed, 238 insertions(+), 14 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/ResisByPolicyExcel.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java index ea4bd8cb0a..e89f1131cf 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java @@ -24,10 +24,12 @@ public class ResisByPolicyRulesFormDTO { private String mobile; private String idCard; private RuleList ruleList = new RuleList(); - private Integer pageNo; - private Integer pageSize; + private Integer pageNo = 1; + private Integer pageSize = 20; @Data + @NoArgsConstructor + @AllArgsConstructor public static class RuleList { private String ruleName; private List resiRule; diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 4cc34ba06f..efa4bca631 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -13,6 +13,11 @@ data-aggregator-server + + com.epmet + epmet-heart-client + 2.0.0 + com.epmet epmet-commons-tools diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 32f41b81e4..23b6e5f4ec 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -2,6 +2,8 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.annotation.LoginUser; +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.Result; @@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -83,4 +87,20 @@ public class IcUserController { return new Result>().ok(page); } + /** + * 导出政策查找到的居民 + * @param input + */ + @PostMapping("exportByPolicy") + public void exportResisByPolicy(@RequestBody ResisByPolicyRulesFormDTO input, HttpServletResponse response) { + try { + icResiService.exportResisByPolicy( + input.getOrgId(), input.getOrgType(), input.getNeighborHoodId(), input.getBuildingId(), input.getUnitId(), + input.getHouseId(), input.getIdCard(), input.getName(), input.getPageNo(), input.getPageSize(), + input.getRuleId(), input.getRuleList().getResiRule(), input.getRuleList().getHouseRule(), input.getRuleList().getStatRule(), response); + } catch (IOException e) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "导出Excel文件失败", "导出Excel文件失败"); + } + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/ResisByPolicyExcel.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/ResisByPolicyExcel.java new file mode 100644 index 0000000000..e5cb9b5022 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/ResisByPolicyExcel.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class ResisByPolicyExcel { + @ExcelProperty("姓名") + private String name; + @ExcelProperty("手机号") + private String mobile; + @ExcelProperty("身份证号") + private String idCard; + /** + * 小区全名,包含小区前面的属性,比如网格等 + */ + @ExcelProperty("小区名") + private String neighborHoodName; + @ExcelProperty("年龄") + private Integer age; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java index ee9feb43c4..f160f4a8f3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -5,6 +5,8 @@ import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.github.pagehelper.PageInfo; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Set; @@ -26,4 +28,25 @@ public interface ResiService { List resiRule, List houseRule, List statRule); + + /** + * 政策找居民导出 + * @param orgId + * @param orgType + * @param neighborHoodId + * @param buildingId + * @param unitId + * @param houseId + * @param idCard + * @param name + * @param pageNo + * @param pageSize + * @param ruleId + */ + void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + String ruleId, List resiRule, + List houseRule, + List statRule, + HttpServletResponse response) throws IOException; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 09097b559c..b0de4560f1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -1,27 +1,43 @@ package com.epmet.dataaggre.service.impl; +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.support.ExcelTypeEnum; +import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.entity.govorg.IcHouseEntity; +import com.epmet.dataaggre.excel.ResisByPolicyExcel; import com.epmet.dataaggre.service.ResiService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.feign.EpmetHeartOpenFeignClient; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.time.*; import java.util.*; import java.util.stream.Collectors; @Service -public class ResiServiceImpl implements ResiService { +public class ResiServiceImpl implements ResiService, ResultDataResolver { @Autowired private EpmetUserService epmetUserService; @@ -29,6 +45,9 @@ public class ResiServiceImpl implements ResiService { @Autowired private GovOrgService govOrgService; + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; + @Override public PageData listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, @@ -132,4 +151,45 @@ public class ResiServiceImpl implements ResiService { }); } + @Override + public void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, + String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + String ruleId, List resiRule, + List houseRule, + List statRule, + HttpServletResponse response) throws IOException { + + if (StringUtils.isNotBlank(ruleId)) { + // 从heart取,覆盖形参 + com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO.RuleList ruleList = getResultDataOrThrowsException( + heartOpenFeignClient.listPolicyRules4QueryAndExport(ruleId), + ServiceConstant.EPMET_HEART_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + null, null); + + resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRule(), ResisByPolicyRulesFormDTO.ResiRule.class); + houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRule(), ResisByPolicyRulesFormDTO.HouseRule.class); + statRule = ConvertUtils.sourceToTarget(ruleList.getStatRule(), ResisByPolicyRulesFormDTO.StatRule.class); + } + + ServletOutputStream ostream = response.getOutputStream(); + ExcelWriterSheetBuilder sheetBuilder = EasyExcel.write(ostream, ResisByPolicyExcel.class).sheet("居民列表"); + + // 循环填充数据 + do { + PageData resis = this.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); + List list = resis.getList(); + List excelDatas = ConvertUtils.sourceToTarget(list, ResisByPolicyExcel.class); + if (CollectionUtils.isEmpty(excelDatas)) { + break; + } + //sheetBuilder.write(excelDatas); + } while (true); + + + + System.out.println(666); + + } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java index 4437c9de35..9522159e12 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java @@ -1,10 +1,14 @@ package com.epmet.dto.form.resi; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import java.util.List; @Data +@NoArgsConstructor +@AllArgsConstructor public class ResisByPolicyRulesFormDTO { private String ruleId; private String orgId; @@ -16,19 +20,22 @@ public class ResisByPolicyRulesFormDTO { private String name; private String mobile; private String idCard; - private RuleList ruleList; + private RuleList ruleList = new RuleList(); private Integer pageNo; private Integer pageSize; @Data + @NoArgsConstructor + @AllArgsConstructor public static class RuleList { - private String ruleName; private List resiRule; private List houseRule; private List statRule; } @Data + @NoArgsConstructor + @AllArgsConstructor public static class ResiRule { private String ruleDesc; private String nextLogicalRel; @@ -41,6 +48,8 @@ public class ResisByPolicyRulesFormDTO { } @Data + @NoArgsConstructor + @AllArgsConstructor public static class HouseRule { private String colTable; private String colKey; @@ -51,6 +60,8 @@ public class ResisByPolicyRulesFormDTO { } @Data + @NoArgsConstructor + @AllArgsConstructor public static class StatRule { private String colKey; private String colVal; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index f3c8430b3e..9939b88455 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -14,6 +14,7 @@ import com.epmet.dto.form.demand.DemandRecId; import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; @@ -158,4 +159,11 @@ public interface EpmetHeartOpenFeignClient { @PostMapping("/heart/resi/volunteer/addVolunteer") Result addVolunteer(@RequestBody ResiVolunteerAuthenticateFormDTO formDTO); + + /** + * 为预览和导出提供规则列表查询 + * @return + */ + @PostMapping("/heart/policy/rules4ResiListAndExport/{ruleId}") + Result listPolicyRules4QueryAndExport(@PathVariable("ruleId") String ruleId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 10670de1ab..815bfab92c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -16,6 +16,7 @@ import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO; import com.epmet.dto.form.demand.ServiceItemSelectFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; @@ -161,4 +162,8 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "addVolunteer", formDTO); } + @Override + public Result listPolicyRules4QueryAndExport(String ruleId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "listPolicyRules4QueryAndExport", ruleId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index d8536ce6c2..ad21eb16e4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.dto.form.PageFormDTO; @@ -15,12 +16,15 @@ import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; +import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.service.IcPolicyService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** @@ -48,6 +52,11 @@ public class IcPolicyController { return new Result>().ok(list); } + /** + * 政策找人,居民列表 + * @param input + * @return + */ @PostMapping("resiuserlist") public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { // 调整错位的逻辑符号位置 @@ -162,4 +171,50 @@ public class IcPolicyController { public Result policyDetail(@LoginUser TokenDto tokenDto,@PathVariable("policyId") String policyId) { return new Result().ok(icPolicyService.policyDetail(tokenDto.getCustomerId(),policyId)); } + + /** + * 为预览和导出提供规则列表查询 + * @return + */ + @PostMapping("rules4ResiListAndExport/{ruleId}") + public Result listPolicyRules4QueryAndExport(@PathVariable("ruleId") String ruleId) { + Map> ruleMap = icPolicyService.listPolicyRules4QueryAndExport(EpmetRequestHolder.getLoginUserCustomerId(), ruleId); + ResisByPolicyRulesFormDTO.RuleList data = new ResisByPolicyRulesFormDTO.RuleList(); + // resi规则 + List originResiRules = ruleMap.get("resi"); + if (CollectionUtils.isNotEmpty(originResiRules)) { + List resiRules = originResiRules + .stream() + .map((r) -> new ResisByPolicyRulesFormDTO.ResiRule(r.getRuleDesc(), r.getNextLogicalRel(), r.getItemGroupId(), + r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal())) + .collect(Collectors.toList()); + + data.setResiRule(resiRules); + } + + // house规则 + List originHouseRules = ruleMap.get("house"); + if (CollectionUtils.isNotEmpty(originHouseRules)) { + List houseRules = originHouseRules + .stream() + .map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(), + r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType())) + .collect(Collectors.toList()); + data.setHouseRule(houseRules); + } + + // stat规则 + List originStatRules = ruleMap.get("stat"); + if (CollectionUtils.isNotEmpty(originStatRules)) { + List statRules = originStatRules + .stream() + .map((r) -> new ResisByPolicyRulesFormDTO.StatRule(r.getColKey(), r.getColVal(), r.getNextLogicalRel(), + r.getRuleDesc(), r.getQueryType(), r.getColTable())) + .collect(Collectors.toList()); + + data.setStatRule(statRules); + } + + return new Result().ok(data); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 1b18091b4a..e9e71b24af 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -10,8 +10,10 @@ import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.IcPolicyEntity; +import com.epmet.entity.IcPolicyRuleDetailEntity; import java.util.List; +import java.util.Map; /** * 政策表 @@ -48,4 +50,12 @@ public interface IcPolicyService extends BaseService { IcPolicyDTO policyDetail(String customerId,String policyId); PageData listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); + + /** + * 政策规则查询 + * @param customerId + * @param ruleId + * @return + */ + Map> listPolicyRules4QueryAndExport(String customerId, String ruleId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index c8f3edeae9..2fc323a951 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -322,15 +322,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper(); - query.eq(IcPolicyRuleDetailEntity::getCustomerId, customerId); - query.eq(IcPolicyRuleDetailEntity::getRuleId, ruleId); - query.orderByAsc(IcPolicyRuleDetailEntity::getSort); - List rules = policyRuleDetailDao.selectList(query); - - // 将查询出的数据转化成aggre服务能接受的格式 - Map> ruleMap = rules.stream().collect(Collectors.groupingBy(IcPolicyRuleDetailEntity::getGroupType, Collectors.toList())); - + Map> ruleMap = listPolicyRules4QueryAndExport(customerId, ruleId); // resi规则 List originResiRules = ruleMap.get("resi"); if (CollectionUtils.isNotEmpty(originResiRules)) { @@ -376,4 +368,16 @@ public class IcPolicyServiceImpl extends BaseServiceImpl(list, result.getData().getTotal()); } + + public Map> listPolicyRules4QueryAndExport(String customerId, String ruleId) { + ResisByPolicyRulesFormDTO form = new ResisByPolicyRulesFormDTO(); + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(IcPolicyRuleDetailEntity::getCustomerId, customerId); + query.eq(IcPolicyRuleDetailEntity::getRuleId, ruleId); + query.orderByAsc(IcPolicyRuleDetailEntity::getSort); + List rules = policyRuleDetailDao.selectList(query); + + // 将查询出的数据转化成aggre服务能接受的格式 + return rules.stream().collect(Collectors.groupingBy(IcPolicyRuleDetailEntity::getGroupType, Collectors.toList())); + } } \ No newline at end of file From c59cdc216376e07b74fc3224be0a6d8ce3a637bd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 21 Jul 2022 09:26:29 +0800 Subject: [PATCH 45/76] list --- .../dto/form/policy/IcPolicyPageFormDTO.java | 2 -- .../src/main/java/com/epmet/dao/IcPolicyDao.java | 7 +++++-- .../epmet/service/impl/IcPolicyServiceImpl.java | 3 +-- .../src/main/resources/mapper/IcPolicyDao.xml | 15 +++++++++------ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java index c1b3591b7c..0db60d639a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java @@ -33,7 +33,5 @@ public class IcPolicyPageFormDTO extends PageFormDTO implements Serializable { */ private String expiredFlag; - private String agencyId; - } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java index d2e34e23f4..7738a3f38e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java @@ -3,7 +3,6 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -27,5 +26,9 @@ public interface IcPolicyDao extends BaseDao { */ List selectItemList(@Param("customerId") String customerId, @Param("groupType") String groupType); - List policyList(IcPolicyPageFormDTO formDTO); + List policyList(@Param("customerId")String customerId, + @Param("agencyId")String agencyId, + @Param("title")String title, + @Param("content")String content, + @Param("expiredFlag")String expiredFlag); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index c8f3edeae9..951cd33f76 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -232,9 +232,8 @@ public class IcPolicyServiceImpl extends BaseServiceImpl list = baseDao.policyList(formDTO); + List list = baseDao.policyList(formDTO.getCustomerId(),staffInfo.getAgencyId(),formDTO.getTitle(),formDTO.getContent(),formDTO.getExpiredFlag()); if (CollectionUtils.isNotEmpty(list)) { for (IcPolicyDTO icPolicyDTO : list) { // 查询字典表 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index 0bf133236c..57fdfd27cd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -43,7 +43,7 @@ order by i.SORT asc - SELECT ip.id AS POLICY_ID, ip.ORG_ID, @@ -69,11 +69,14 @@ and ip.CONTENT like concat('%',#{content},'%') - - and ip.END_DATE < DATE_FORMAT(now(),'%Y-%m-%d') - - - and ip.END_DATE >= DATE_FORMAT(now(),'%Y-%m-%d') + + and 1=1 + + and ip.END_DATE < DATE_FORMAT(now(),'%Y-%m-%d') + + + and ip.END_DATE >= DATE_FORMAT(now(),'%Y-%m-%d') + order by ip.CREATED_TIME desc From 645b0a3101ffa0c8fdeb6bb6f5978190f3c1b055 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 21 Jul 2022 09:53:53 +0800 Subject: [PATCH 46/76] =?UTF-8?q?=E6=94=BF=E7=AD=96=E4=BE=9D=E6=8D=AE?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/policy/IcPolicyPageFormDTO.java | 1 + .../com/epmet/controller/IcPolicyController.java | 16 ++++++++++++++-- .../java/com/epmet/service/IcPolicyService.java | 8 ++++++++ .../epmet/service/impl/IcPolicyServiceImpl.java | 10 ++++++++++ .../resources/mapper/IcServiceRecordV2Dao.xml | 2 +- 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java index 0db60d639a..01cf09cfbf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java @@ -32,6 +32,7 @@ public class IcPolicyPageFormDTO extends PageFormDTO implements Serializable { * 是否过期;1:已过期;0:未过期 */ private String expiredFlag; + private String agencyId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index ad21eb16e4..7b604b4ba8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -10,7 +10,6 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.dto.form.resi.HeartResisByPolicyRulesFormDTO; import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; @@ -18,7 +17,6 @@ import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.service.IcPolicyService; -import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -145,6 +143,20 @@ public class IcPolicyController { return new Result>().ok(page); } + /** + * Desc: 政策列表下拉选 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/7/21 09:48 + */ + @PostMapping("policyListSelect") + public Result> policyListSelect(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icPolicyService.policyListSelect(formDTO)); + } + /** * 细则列表 * @param customerId diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index e9e71b24af..a392aced64 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -45,6 +45,14 @@ public interface IcPolicyService extends BaseService { */ PageData policyList(IcPolicyPageFormDTO formDTO); + /** + * Desc: 政策列表下拉选 + * @param formDTO + * @author zxc + * @date 2022/7/21 09:48 + */ + List policyListSelect(IcPolicyPageFormDTO formDTO); + List ruleList(String customerId,String policyId); IcPolicyDTO policyDetail(String customerId,String policyId); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 31b7ccb20e..65824d663b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -246,6 +246,16 @@ public class IcPolicyServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + @Override + public List policyListSelect(IcPolicyPageFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + return baseDao.policyList(formDTO.getCustomerId(), formDTO.getAgencyId(), null,null,null); + } + @Override public List ruleList(String customerId, String policyId) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 7c8a86b911..1eae34fe2e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -16,7 +16,7 @@ sr.SERVICE_STATUS, IFNULL(sf.SERVICE_PEOPLE_NUMBER,0) AS servicePeopleNumber FROM ic_service_record_v2 sr - INNER JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0 + left JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0 INNER JOIN ic_service_scope_v2 ss ON ss.SERVICE_RECORD_ID = sr.ID AND ss.DEL_FLAG = '0' WHERE sr.DEL_FLAG = '0' AND ss.OBJECT_ID_PATH LIKE concat('%',#{orgId},'%') From 433b8c9194ba40cd43161c1f5cd6fda82b906c69 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 21 Jul 2022 10:01:01 +0800 Subject: [PATCH 47/76] =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcPolicyController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 7b604b4ba8..31003e4e31 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,11 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyDTO; @@ -17,6 +16,7 @@ import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.IcPolicyRuleDetailEntity; import com.epmet.service.IcPolicyService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; From bca00f802799728f7e917a465999673808e638b3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 21 Jul 2022 10:11:46 +0800 Subject: [PATCH 48/76] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcPolicyController.java | 6 ++---- .../src/main/java/com/epmet/service/IcPolicyService.java | 2 +- .../java/com/epmet/service/impl/IcPolicyServiceImpl.java | 7 +++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 31003e4e31..f27d291844 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -151,10 +151,8 @@ public class IcPolicyController { * @date 2022/7/21 09:48 */ @PostMapping("policyListSelect") - public Result> policyListSelect(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyPageFormDTO formDTO){ - formDTO.setCustomerId(tokenDto.getCustomerId()); - formDTO.setStaffId(tokenDto.getUserId()); - return new Result>().ok(icPolicyService.policyListSelect(formDTO)); + public Result> policyListSelect(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icPolicyService.policyListSelect(tokenDto.getUserId(),tokenDto.getCustomerId())); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index a392aced64..d57a6ca886 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -51,7 +51,7 @@ public interface IcPolicyService extends BaseService { * @author zxc * @date 2022/7/21 09:48 */ - List policyListSelect(IcPolicyPageFormDTO formDTO); + List policyListSelect(String userId,String customerId); List ruleList(String customerId,String policyId); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 65824d663b..77900d2519 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -247,13 +247,12 @@ public class IcPolicyServiceImpl extends BaseServiceImpl policyListSelect(IcPolicyPageFormDTO formDTO) { - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + public List policyListSelect(String userId,String customerId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); } - formDTO.setAgencyId(staffInfo.getAgencyId()); - return baseDao.policyList(formDTO.getCustomerId(), formDTO.getAgencyId(), null,null,null); + return baseDao.policyList(customerId, staffInfo.getAgencyId(), null,null,null); } @Override From 6462848d98cff2a2f2945064a54a16f2aa24400c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 21 Jul 2022 10:15:23 +0800 Subject: [PATCH 49/76] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcServiceRecordV2Dao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 1eae34fe2e..15696d8d2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -6,7 +6,7 @@ From 108568d51e1fdd551be8f2ebfa69a23b6115958c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 21 Jul 2022 17:19:14 +0800 Subject: [PATCH 62/76] policy --- .../db/migration/V0.0.24__ic_policy.sql | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql new file mode 100644 index 0000000000..86d1472abb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql @@ -0,0 +1,102 @@ +CREATE TABLE `ic_policy` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `ORG_ID` varchar(64) NOT NULL COMMENT '政策创建人,所属组织id', + `ORG_ID_PATH` varchar(255) NOT NULL COMMENT 'AGENCY_ID的全路径,含agency_id', + `POLICY_LEVEL` varchar(1) NOT NULL COMMENT '政策级别,0市级;1区级;2街道级', + `START_DATE` date NOT NULL COMMENT '生效起止日期', + `END_DATE` date NOT NULL COMMENT '截止日期', + `TITLE` varchar(128) NOT NULL COMMENT '政策标题', + `CONTENT` varchar(2048) NOT NULL COMMENT '政策内容', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='政策表'; + + +CREATE TABLE `ic_policy_category` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_POLICY_ID` varchar(64) NOT NULL COMMENT '政策id', + `CATEGORY_CODE` varchar(64) NOT NULL COMMENT '分类编码', + `CODE_PATH` varchar(128) NOT NULL COMMENT '分类全路径,包含CATEGORY_CODE,英文逗号隔开', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='政策匹配资源类型'; + +CREATE TABLE `ic_policy_rule` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_POLICY_ID` varchar(64) NOT NULL COMMENT '政策id', + `RULE_NAME` varchar(128) NOT NULL COMMENT '规则名称', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='政策匹配规则'; + + +CREATE TABLE `ic_policy_rule_detail` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_POLICY_ID` varchar(64) NOT NULL COMMENT '政策id', + `RULE_ID` varchar(32) NOT NULL COMMENT '规则id', + `RULE_DESC` varchar(512) DEFAULT NULL COMMENT '规则描述文字,例如:基础信息性别等于女', + `GROUP_TYPE` varchar(10) NOT NULL COMMENT 'resi:人员信息,house:房屋信息,stat:统计信息', + `NEXT_LOGICAL_REL` varchar(4) DEFAULT NULL COMMENT '与下一条的关系;and、or', + `ITEM_GROUP_ID` varchar(64) DEFAULT NULL COMMENT '分组id;人员信息有值;', + `ITEM_ID` varchar(64) DEFAULT NULL COMMENT '组件id;人员信息有值;', + `COL_TABLE` varchar(64) DEFAULT NULL COMMENT '表名;人员信息有值;房屋信息也有值', + `QUERY_TYPE` varchar(32) NOT NULL COMMENT '查询类型:等于、不等于....;来源于字典表sql_query_type', + `COL_KEY` varchar(32) NOT NULL COMMENT '人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧', + `COL_VAL` varchar(512) NOT NULL COMMENT '参数值', + `SORT` int(1) NOT NULL COMMENT '排序字段;同一group_type升序', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `ITEM_GROUP_NAME` varchar(64) DEFAULT NULL COMMENT '用于前端展示:基础信息、教育信息、房屋类型.....', + `ITEM_LABEL` varchar(64) DEFAULT NULL COMMENT '用于前端展示:姓名、手机号、......', + `QUERY_TYPE_NAME` varchar(64) DEFAULT NULL COMMENT '用于前端展示:等于、不等于、大于、小于....', + `COL_VAL_LABEL` varchar(64) DEFAULT NULL COMMENT '用于前端展示:参数值显示值eg:男女', + `NEXT_LOGICAL_REL_NAME` varchar(32) DEFAULT NULL COMMENT '用于前端展示:逻辑:并且、或者', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='政策匹配规则明细'; + + +CREATE TABLE `ic_policy_item` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `GROUP_TYPE` varchar(10) NOT NULL COMMENT 'house:房屋信息,stat:统计信息', + `LABEL` varchar(255) NOT NULL COMMENT '选项名;例如:房屋类型,房屋状态,人均收入', + `COL_KEY` varchar(64) NOT NULL COMMENT '房屋信息存储列名;统计信息定义好key放在这里', + `ITEM_TYPE` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) DEFAULT NULL COMMENT '表名', + `SORT` int(11) NOT NULL COMMENT '排序', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `OPTION_SOURCE_TYPE` varchar(10) DEFAULT NULL COMMENT '值来源;需要接口获取:remote。', + `OPTION_SOURCE_URL` varchar(128) DEFAULT NULL COMMENT '动态url;', + `OPTION_SOURCE_PARAM` varchar(255) DEFAULT NULL COMMENT '动态url的入参;存储json串', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='政策找人规则组件表'; \ No newline at end of file From 9532f7db7ad8a2b68a1c632f4295adf3062dd6f3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 21 Jul 2022 17:24:38 +0800 Subject: [PATCH 63/76] =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.25__ic_service_v2.sql | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.25__ic_service_v2.sql diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.25__ic_service_v2.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.25__ic_service_v2.sql new file mode 100644 index 0000000000..c52f2abc0d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.25__ic_service_v2.sql @@ -0,0 +1,81 @@ +CREATE TABLE `ic_service_record_v2` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `POLICY_ID` varchar(64) NOT NULL COMMENT '政策依据ID', + `SERVICE_NAME` varchar(32) NOT NULL COMMENT '服务名称', + `SERVICE_ORG_TYPE` varchar(64) NOT NULL COMMENT '服务组织类型\n社区自组织:community_org,\n志愿者:ic_user_volunteer,\n联建单位:party_unit', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `PRINCIPAL_NAME` varchar(32) DEFAULT NULL COMMENT '经办人姓名', + `PRINCIPAL_CONTACT` varchar(64) DEFAULT NULL COMMENT '联系方式', + `SERVICE_TIME_START` datetime NOT NULL COMMENT '服务时间', + `SERVICE_TIME_END` datetime NOT NULL COMMENT '服务截止时间', + `SERVICE_STATUS` varchar(32) NOT NULL COMMENT 'in_service服务中;completed:已完成;cancel:取消', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务记录表'; + +CREATE TABLE `ic_service_feedback_v2` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_RECORD_ID` varchar(64) NOT NULL COMMENT '服务ID', + `SERVICE_GOAL` varchar(2000) DEFAULT NULL COMMENT '服务目标', + `SERVICE_EFFECT` varchar(2000) DEFAULT NULL COMMENT '服务效果', + `SERVICE_PEOPLE_NUMBER` int(10) DEFAULT NULL COMMENT '服务人数', + `SATISFACTION` varchar(30) DEFAULT NULL COMMENT '满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect', + `LONGITUDE` varchar(255) DEFAULT NULL COMMENT '地址经度', + `LATITUDE` varchar(255) DEFAULT NULL COMMENT '地址纬度', + `ADDRESS` varchar(64) DEFAULT NULL COMMENT '地址', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务记录反馈表'; + + +CREATE TABLE `ic_service_scope_v2` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_RECORD_ID` varchar(64) NOT NULL COMMENT '服务记录的ID', + `OBJECT_TYPE` varchar(32) NOT NULL COMMENT 'agency单位;grid网格;neighborhood小区', + `OBJECT_ID` varchar(64) NOT NULL COMMENT '选中的组织的ID', + `OBJECT_ID_PATH` varchar(255) NOT NULL COMMENT '发布范围的组织ID【包含组织、网格、小区本身的全路径】', + `OBJECT_NAME` varchar(32) DEFAULT NULL, + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务范围表'; + +CREATE TABLE `heart_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `BUSINESS_ID` varchar(64) NOT NULL COMMENT '业务id', + `ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '政策:ic_policy;服务:ic_service_record_v2', + `NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='heart库附件表'; \ No newline at end of file From 3d221b45d6e026be6c0b5c3f17d744426ae4a51f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 21 Jul 2022 19:53:04 +0800 Subject: [PATCH 64/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E9=B1=BC=E7=83=82=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dao/govorg/IcHouseDao.java | 24 +++++++++ .../service/govorg/GovOrgService.java | 2 +- .../govorg/impl/GovOrgServiceImpl.java | 39 +-------------- .../service/impl/ResiServiceImpl.java | 50 ++++++++++++++++++- .../mapper/epmetuser/IcResiUserDao.xml | 14 +++--- .../resources/mapper/govorg/IcHouseDao.xml | 35 +++++++++++++ 6 files changed, 117 insertions(+), 47 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcHouseDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcHouseDao.java index 5df9a571dc..568e74e5cb 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcHouseDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcHouseDao.java @@ -1,8 +1,12 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.entity.govorg.IcHouseEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 房屋信息 @@ -12,4 +16,24 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcHouseDao extends BaseDao { + /** + * 为政策-预览居民,提供房屋id列表查询 + * @param orgIdPath + * @param customerId + * @param neighborHoodId + * @param buildingId + * @param unitId + * @param houseId + * @param houseRule + * @param statRule + * @return + */ + List listHouseIds4PolicyResis(@Param("orgIdPath") String orgIdPath, + @Param("customerId") String customerId, + @Param("neighborHoodId") String neighborHoodId, + @Param("buildingId") String buildingId, + @Param("unitId") String unitId, + @Param("houseId") String houseId, + @Param("houseRule") List houseRule, + @Param("statRule") List statRule); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index c3908fad04..ee502bd493 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -218,7 +218,7 @@ public interface GovOrgService { */ CustomerAgencyEntity getRootAgencyByCustomerId(String customerId); - List listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, + List listHouseIdsByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, List houseRule, List statRule, Integer pageNo, Integer pageSize); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index a57f014463..e869553be3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -1110,7 +1110,7 @@ public class GovOrgServiceImpl implements GovOrgService { } @Override - public List listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, + public List listHouseIdsByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, List houseRule, List statRule, Integer pageNo, Integer pageSize) { @@ -1118,47 +1118,12 @@ public class GovOrgServiceImpl implements GovOrgService { return new ArrayList<>(); } - QueryWrapper query = new QueryWrapper<>(); - - // 如果参数里面选了,就用参数选择的来查询,没有选择的话,就查询当前工作人员所属组织的本级及下级 if (StringUtils.isNotBlank(orgId) && StringUtils.isNotBlank(orgType)) { orgIdPath = getOrgIdPath(orgId, orgType); } - query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath); - - if (StringUtils.isNotBlank(customerId)) { - query.eq("CUSTOMER_ID", customerId); - } - if (StringUtils.isNotBlank(neighborHoodId)) { - query.eq("NEIGHBOR_HOOD_ID", neighborHoodId); - } - if (StringUtils.isNotBlank(buildingId)) { - query.eq("BUILDING_ID", buildingId); - } - if (StringUtils.isNotBlank(unitId)) { - query.eq("BUILDING_UNIT_ID", unitId); - } - if (StringUtils.isNotBlank(houseId)) { - query.eq("ID", houseId); - } - - // 房屋属性 - if (CollectionUtils.isNotEmpty(houseRule)) { - for (ResisByPolicyRulesFormDTO.HouseRule rule : houseRule) { - query.eq(rule.getColKey(), rule.getColVal()); - } - } - - // 房屋的统计属性 - if (CollectionUtils.isNotEmpty(statRule)) { - for (ResisByPolicyRulesFormDTO.StatRule rule : statRule) { - query.eq(rule.getColKey(), rule.getColVal()); - } - } - PageHelper.startPage(pageNo, pageSize); - return houseDao.selectList(query); + return houseDao.listHouseIds4PolicyResis(orgIdPath, customerId, neighborHoodId, buildingId, unitId, houseId, houseRule, statRule); } @Override diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 428d87ed3e..32cc0cbfa1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -31,11 +31,15 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.time.*; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalUnit; import java.util.*; import java.util.stream.Collectors; @@ -65,6 +69,9 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { String client = EpmetRequestHolder.getLoginUserClient(); String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + // 对特殊规则进行转换。 + specificRuleConvert(resiRule); + // 查询当前组织及下级id路径 LoginUserDetailsResultDTO userDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(new LoginUserDetailsFormDTO(app, client, userId)), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); @@ -87,9 +94,8 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { int total = 0; do { // 拿到房屋id列表,去查询居民列表 - List houseEntities = govOrgService.listHousesByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, + List houseIds = govOrgService.listHouseIdsByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, houseRule, statRule, housePageNo, 50); - List houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList()); if (houseIds.size() == 0) { // 用户使用了房屋和统计相关的条件,但是没查到房屋,我看就没有走下去了的必要了吧.. @@ -125,6 +131,46 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { return new PageData<>(resultResis, total); } + /** + * 为特定的规则进行转换 + * @param resiRule + */ + private void specificRuleConvert(List resiRule) { + // 使用年龄计算出生日期 + resiRule.stream().forEach((r) -> { + if ("BIRTHDAY".equals(r.getColKey())) { + LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS); + r.setQueryType(revertQueryType(r.getQueryType())); + r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + } + }); + } + + /** + * 翻转逻辑操作符 + * @param oldRel + * @return + */ + private String revertQueryType(String oldRel) { + if (">".equals(oldRel)) { + return "<"; + } + + if (">=".equals(oldRel)) { + return "<="; + } + + if ("<".equals(oldRel)) { + return ">"; + } + + if ("<=".equals(oldRel)) { + return ">="; + } + + return ""; + } + /** * 补充额外信息 * @param resultResis diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index ffb7246583..703bcc2bfa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -124,13 +124,13 @@ + select ic_house.ID + from ic_house + + DEL_FLAG = '0' + and ic_house.CUSTOMER_ID = #{customerId} + and ic_house.ORG_ID_PATH like CONCAT(#{orgIdPath}, '%') + + and ic_house.NEIGHBOR_HOOD_ID = #{neighborHoodId} + + + and ic_house.BUILDING_ID = #{buildingId} + + + and ic_house.BUILDING_UNIT_ID = #{unitId} + + + and ic_house.ID = #{houseId} + + + and + + ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.nextLogicalRel} + + + + + and + + ${rule.colTable}.${rule.colKey} ${rule.queryType} #{rule.colVal} ${rule.nextLogicalRel} + + + + From d3a1a2d7c4c2706d2ae3b3aeaa35014f4540b53b Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 21 Jul 2022 20:00:47 +0800 Subject: [PATCH 65/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E6=B8=85=E7=90=86=E4=B8=80=E4=BA=9B=E7=A0=B4=E7=83=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/HeartResisByPolicyRulesFormDTO.java | 77 ------------------- .../epmet/controller/IcPolicyController.java | 47 ----------- .../com/epmet/service/IcPolicyService.java | 2 - .../service/impl/IcPolicyServiceImpl.java | 56 -------------- 4 files changed, 182 deletions(-) delete mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java deleted file mode 100644 index b02273a16c..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.epmet.dto.form.resi; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class HeartResisByPolicyRulesFormDTO { - private String ruleId; - private String orgId; - private String orgType; - private String neighborHoodId; - private String buildingId; - private String unitId; - private String houseId; - private String name; - private String mobile; - private String idCard; - private RuleList ruleList; - private Integer pageNo; - private Integer pageSize; - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class RuleList { - private String ruleName; - private List resiRuleList; - private List houseRuleList; - private List statRuleList; - } - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class ResiRule { - private String ruleDesc; - private String nextLogicalRel; - private String itemGroupId; - private String itemId; - private String queryType; - private String colTable; - private String colKey; - private String colVal; - } - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class HouseRule { - private String colTable; - private String colKey; - private String colVal; - private String ruleDesc; - private String nextLogicalRel; - private String queryType; - } - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class StatRule { - private String colKey; - private String colVal; - private String nextLogicalRel; - private String ruleDesc; - private String queryType; - private String colTable; - } -} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 7b73ce9894..53cd8815b5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -50,53 +50,6 @@ public class IcPolicyController { return new Result>().ok(list); } - /** - * 政策找人,居民列表 - * @param input - * @return - */ - @Deprecated - @PostMapping("resiuserlist") - public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) { - // 调整错位的逻辑符号位置 - //adjustMalpositionLogicalOperatorPosition(input); - PageData page = icPolicyService.listResiUserByPolicyRules(input); - return new Result().ok(page); - } - - /** - * 调整错位的逻辑运算符 - * @param input - */ - //private void adjustMalpositionLogicalOperatorPosition(ResisByPolicyRulesFormDTO input) { - // List resiRule = input.getRuleList().getResiRule(); - // List houseRule = input.getRuleList().getHouseRule(); - // List statRule = input.getRuleList().getStatRule(); - // - // if (CollectionUtils.isNotEmpty(resiRule)) { - // for (int i = 1; i < resiRule.size() - 1; i++) { - // ResisByPolicyRulesFormDTO.ResiRule current = resiRule.get(i); - // ResisByPolicyRulesFormDTO.ResiRule last = resiRule.get(i - 1); - // current.setLastLogicalRel(last.getLastLogicalRel()); - // } - // } - // - // if (CollectionUtils.isNotEmpty(houseRule)) { - // for (int i = 1; i < houseRule.size() - 1; i++) { - // ResisByPolicyRulesFormDTO.HouseRule current = houseRule.get(i); - // ResisByPolicyRulesFormDTO.HouseRule last = houseRule.get(i - 1); - // current.setLastLogicalRel(last.getLastLogicalRel()); - // } - // } - // - // if (CollectionUtils.isNotEmpty(statRule)) { - // for (int i = 1; i < statRule.size() - 1; i++) { - // ResisByPolicyRulesFormDTO.StatRule current = statRule.get(i); - // ResisByPolicyRulesFormDTO.StatRule last = statRule.get(i - 1); - // current.setLastLogicalRel(last.getLastLogicalRel()); - // } - // } - //} /** * 政策管理-新增/修改 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index d57a6ca886..e13fb4722f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -57,8 +57,6 @@ public interface IcPolicyService extends BaseService { IcPolicyDTO policyDetail(String customerId,String policyId); - PageData listResiUserByPolicyRules(ResisByPolicyRulesFormDTO input); - /** * 政策规则查询 * @param customerId diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 30d6b265ef..194b9561b2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -321,62 +321,6 @@ public class IcPolicyServiceImpl extends BaseServiceImpl listResiUserByPolicyRules(com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO input) { - String customerId = EpmetRequestHolder.getLoginUserCustomerId(); - String ruleId = input.getRuleId(); - - ResisByPolicyRulesFormDTO aggForm = ConvertUtils.sourceToTarget(input, ResisByPolicyRulesFormDTO.class); - - // 穿了规则id,按照规则id来,忽略规则list - if (StringUtils.isNotBlank(ruleId)) { - Map> ruleMap = listPolicyRules4QueryAndExport(customerId, ruleId); - // resi规则 - List originResiRules = ruleMap.get("resi"); - if (CollectionUtils.isNotEmpty(originResiRules)) { - List resiRules = originResiRules - .stream() - .map((r) -> new ResisByPolicyRulesFormDTO.ResiRule(r.getRuleDesc(), r.getNextLogicalRel(), r.getItemGroupId(), - r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal())) - .collect(Collectors.toList()); - - aggForm.getRuleList().setResiRuleList(resiRules); - } - - // house规则 - List originHouseRules = ruleMap.get("house"); - if (CollectionUtils.isNotEmpty(originHouseRules)) { - List houseRules = originHouseRules - .stream() - .map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(), - r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType())) - .collect(Collectors.toList()); - aggForm.getRuleList().setHouseRuleList(houseRules); - } - - // stat规则 - List originStatRules = ruleMap.get("stat"); - if (CollectionUtils.isNotEmpty(originStatRules)) { - List statRules = originStatRules - .stream() - .map((r) -> new ResisByPolicyRulesFormDTO.StatRule(r.getColKey(), r.getColVal(), r.getNextLogicalRel(), - r.getRuleDesc(), r.getQueryType(), r.getColTable())) - .collect(Collectors.toList()); - - aggForm.getRuleList().setStatRuleList(statRules); - } - } - - // 调用aggre服务查询结果 - Result> result = dataAggregatorOpenFeignClient.listByPolicyRules(aggForm); - List list = result.getData().getList().stream() - .map((r) -> new ResiByPolicyInfoResultDTO(r.getIcResiUserId() ,r.getName(), r.getMobile(), r.getIdCard(), r.getGridId() - ,r.getNeighborhoodId(), r.getNeighborHoodName(), r.getAge(), r.getBirthday())) - .collect(Collectors.toList()); - - return new PageData(list, result.getData().getTotal()); - } - public Map> listPolicyRules4QueryAndExport(String customerId, String ruleId) { ResisByPolicyRulesFormDTO form = new ResisByPolicyRulesFormDTO(); LambdaQueryWrapper query = new LambdaQueryWrapper(); From 3954edae0b059d3474ebb88d43a48c38790dd4a0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 22 Jul 2022 09:29:00 +0800 Subject: [PATCH 66/76] =?UTF-8?q?ic=5Fpolicy=5Fitem=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.24__ic_policy.sql | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql index 86d1472abb..ebf16c860c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql @@ -99,4 +99,14 @@ CREATE TABLE `ic_policy_item` ( `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='政策找人规则组件表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='政策找人规则组件表'; + + + +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', 'house', '房屋类型', 'HOUSE_TYPE', 'select', 'ic_house', 1, '从字典表获取', 'remote', '/sys/dict/data/dictlist', '{\"dictType\":\"house_type\"}', '0', 0, 'APP_USER', '2022-07-19 10:01:39', 'APP_USER', '2022-07-19 10:01:42'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', 'house', '房屋用途', 'PURPOSE', 'select', 'ic_house', 2, '从字典表获取', 'remote', '/sys/dict/data/dictlist', '{\"dictType\":\"house_purpose\"}', '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', 'house', '房屋状态', 'RENT_FLAG', 'select', 'ic_house', 3, '从字典表获取', 'remote', '/sys/dict/data/dictlist', '{\"dictType\":\"house_status\"}', '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', 'house', '创建时间', 'CREATED_TIME', 'date', 'ic_house', 4, '日期格式', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', 'house', '备注', 'REMARK', 'input', 'ic_house', 5, '文本域', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', 'stat', '人均收入', 'AVG_YSR', 'inputNum', '', 1, '只能输入数字,可以是小数', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', 'stat', '家庭人数', 'RESI_NUMBER', 'inputNum', '', 2, '只能输入数字', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); From f138207a7a6bf7c124ba85b7b6ecf215a9ea341d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 22 Jul 2022 15:49:24 +0800 Subject: [PATCH 67/76] bugfix --- .../main/resources/db/migration/V0.0.33__policy_flagbugfix.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql new file mode 100644 index 0000000000..ea437f22b7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql @@ -0,0 +1,3 @@ +update ic_form_item i set i.UPDATED_TIME=NOW(),i.POLICY_FLAG='0' +where i.DEL_FLAG='0' + and i.DYNAMIC='0'; \ No newline at end of file From 77d203048cb352efb3d85c56a397e6a2fbeef3ad Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 22 Jul 2022 16:07:06 +0800 Subject: [PATCH 68/76] =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java index 3ebd110fad..c96aa65540 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java @@ -83,7 +83,7 @@ public class IcPolicyFormDTO implements Serializable { /** * 政策内容 */ - @NotBlank(message = "政策内容不能为空", groups = AddUserShowGroup.class) + // @NotBlank(message = "政策内容不能为空", groups = AddUserShowGroup.class) @Length(max = 2000, groups = AddUserShowGroup.class, message = "政策内容最多输入2000字") private String content; From a640cd0c3b52054dd7a6eb95508737ddb44f7044 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 25 Jul 2022 10:28:22 +0800 Subject: [PATCH 69/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ResiByPolicyInfoResultDTO.java | 20 ++++++++ .../controller/IcUserController.java | 6 +-- .../epmet/dataaggre/service/ResiService.java | 4 +- .../service/impl/ResiServiceImpl.java | 48 ++++++++++++------- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java index e739baca1d..da425762d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java @@ -1,5 +1,8 @@ package com.epmet.dataaggre.dto.epmetuser.result; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -11,16 +14,33 @@ import java.util.Date; @AllArgsConstructor public class ResiByPolicyInfoResultDTO { + @ExcelIgnore private String icResiUserId; + + @ExcelProperty(value = "姓名") + @ColumnWidth(10) private String name; + + @ExcelProperty("手机号") + @ColumnWidth(20) private String mobile; + + @ExcelProperty("身份证号") + @ColumnWidth(30) private String idCard; /** * 小区全名,包含小区前面的属性,比如网格等 */ + @ExcelIgnore private String gridId; + @ExcelIgnore private String neighborhoodId; + @ExcelProperty("小区名称") + @ColumnWidth(30) private String neighborHoodName; + @ExcelProperty("年龄") + @ColumnWidth(10) private Integer age; + @ExcelIgnore private Date birthday; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 1216c2b193..63d686260c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -114,13 +114,13 @@ public class IcUserController implements ResultDataResolver { * 导出政策查找到的居民 * @param input */ - @PostMapping("exportByPolicy") + @PostMapping("exportByPolicyRules") public void exportResisByPolicy(@RequestBody ResisByPolicyRulesFormDTO input, HttpServletResponse response) { try { icResiService.exportResisByPolicy( input.getOrgId(), input.getOrgType(), input.getNeighborHoodId(), input.getBuildingId(), input.getUnitId(), - input.getHouseId(), input.getIdCard(), input.getName(), input.getPageNo(), input.getPageSize(), - input.getRuleId(), input.getRuleList().getResiRuleList(), input.getRuleList().getHouseRuleList(), input.getRuleList().getStatRuleList(), response); + input.getHouseId(), input.getIdCard(), input.getName(), input.getRuleId(), input.getRuleList().getResiRuleList(), + input.getRuleList().getHouseRuleList(), input.getRuleList().getStatRuleList(), response); } catch (IOException e) { throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "导出Excel文件失败", "导出Excel文件失败"); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java index f160f4a8f3..a77e94ceb7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -39,12 +39,10 @@ public interface ResiService { * @param houseId * @param idCard * @param name - * @param pageNo - * @param pageSize * @param ruleId */ void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, - String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + String houseId, String idCard, String name, String ruleId, List resiRule, List houseRule, List statRule, diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 32cc0cbfa1..9c613b2c56 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -12,6 +13,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; @@ -215,7 +217,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { @Override public void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, - String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + String houseId, String idCard, String name, String ruleId, List resiRule, List houseRule, List statRule, @@ -234,24 +236,34 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class); } - ServletOutputStream ostream = response.getOutputStream(); - ExcelWriterSheetBuilder sheetBuilder = EasyExcel.write(ostream, ResisByPolicyExcel.class).sheet("居民列表"); - - // 循环填充数据 - do { - PageData resis = this.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); - List list = resis.getList(); - List excelDatas = ConvertUtils.sourceToTarget(list, ResisByPolicyExcel.class); - if (CollectionUtils.isEmpty(excelDatas)) { - break; - } - //sheetBuilder.write(excelDatas); - } while (true); - - + // 模板导出 + ExcelWriter writer = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("政策人员预览信息导出.xlsx", response)) + //.withTemplate(inputStream) + .build(); + + WriteSheet writeSheet = EasyExcel.writerSheet("政策人员列表") + .head(ResiByPolicyInfoResultDTO.class) + .build(); + + Integer pageSize = 500; + Integer pageNo = 1; + + try { + do { + PageData resis = this.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); + List list = resis.getList(); + List excelDatas = ConvertUtils.sourceToTarget(list, ResisByPolicyExcel.class); + if (CollectionUtils.isEmpty(excelDatas)) { + break; + } - System.out.println(666); + writer.write(resis.getList(), writeSheet); + pageNo++; + } while (true); + } finally { + writer.finish(); + } } } From 57eaea76885a5d0554fdac70bf88c03f2cdaa5a4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 25 Jul 2022 17:41:40 +0800 Subject: [PATCH 70/76] =?UTF-8?q?=E6=96=B0=E5=A2=9EserviceCategoryKey?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=8F=91=E8=B5=B7=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java | 5 ++++- .../com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java | 3 +++ .../java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java | 6 ++++++ .../com/epmet/controller/IcServiceRecordV2Controller.java | 1 + .../main/java/com/epmet/entity/IcServiceRecordV2Entity.java | 2 ++ .../db/migration/V0.0.26__add_service_v2_category.sql | 1 + .../src/main/resources/mapper/IcServiceRecordV2Dao.xml | 1 + 7 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java index d86138657e..be41f030b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -109,4 +110,6 @@ public class IcServiceRecordV2DTO implements Serializable { */ private String policyId; + private String serviceCategoryKey; + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java index fff02eb997..0de6bc737f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java @@ -37,6 +37,9 @@ public class IcServiceRecordV2AddEditFormDTO implements Serializable { */ @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) private String serviceOrgType; + + @NotBlank(message = "serviceCategoryKey不能为空", groups = {AddGroup.class}) + private String serviceCategoryKey; /** * 服务组织Id */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java index 675bd575b4..a9eea1aa2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -15,11 +16,16 @@ public class ServiceRecordV2ListFormDTO extends PageFormDTO implements Serializa private static final long serialVersionUID = 88592831607216246L; + public interface ServiceRecordV2ListForm{} + /** * 服务名称 */ private String serviceName; + @NotBlank(message = "serviceCategoryKey不能为空",groups = ServiceRecordV2ListForm.class) + private String serviceCategoryKey; + /** * 服务组织ID */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index f451fafc81..9449689fc2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -92,6 +92,7 @@ public class IcServiceRecordV2Controller { */ @PostMapping("list") public Result serviceRecordV2List(@LoginUser TokenDto tokenDto, @RequestBody ServiceRecordV2ListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceRecordV2ListFormDTO.ServiceRecordV2ListForm.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java index e18eda964e..7f32333f2e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java @@ -79,4 +79,6 @@ public class IcServiceRecordV2Entity extends BaseEpmetEntity { */ private String policyId; + private String serviceCategoryKey; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql new file mode 100644 index 0000000000..d09a7eca73 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql @@ -0,0 +1 @@ +alter table ic_service_record_v2 add COLUMN SERVICE_CATEGORY_KEY VARCHAR(64) comment '服务类别KEY' AFTER remark; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 7a7b4f1a68..89f8764a30 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -19,6 +19,7 @@ left JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0 INNER JOIN ic_service_scope_v2 ss ON ss.SERVICE_RECORD_ID = sr.ID AND ss.DEL_FLAG = '0' WHERE sr.DEL_FLAG = '0' + AND sr.SERVICE_CATEGORY_KEY = #{serviceCategoryKey} AND ss.OBJECT_ID_PATH LIKE concat('%',#{orgId},'%') AND sr.CUSTOMER_ID = #{customerId} From fa150c76dce247396938ac05c1a7df96b7908a30 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 25 Jul 2022 17:54:00 +0800 Subject: [PATCH 71/76] weiyi --- .../epmet/dto/form/policy/IcPolicyFormDTO.java | 2 ++ .../epmet/service/impl/IcPolicyServiceImpl.java | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java index c96aa65540..2e1f6896a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java @@ -95,5 +95,7 @@ public class IcPolicyFormDTO implements Serializable { @Valid @NotEmpty(message = "政策细则不能为空",groups =AddUserShowGroup.class ) private List ruleList; + + private String agencyId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 194b9561b2..424af6e5ae 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -13,7 +13,6 @@ import com.epmet.commons.tools.feign.ResultDataResolver; 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.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.*; @@ -27,7 +26,6 @@ import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; -import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPolicyService; @@ -98,13 +96,14 @@ public class IcPolicyServiceImpl extends BaseServiceImpl policyEntityLambdaQueryWrapper=new LambdaQueryWrapper<>(); + policyEntityLambdaQueryWrapper.eq(IcPolicyEntity::getTitle,formDTO.getTitle()) + .eq(IcPolicyEntity::getOrgId,formDTO.getAgencyId()); + policyEntityLambdaQueryWrapper.ne(StringUtils.isNotBlank(formDTO.getPolicyId()),IcPolicyEntity::getId,formDTO.getPolicyId()); + int count=baseDao.selectCount(policyEntityLambdaQueryWrapper); + if(count>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"当前组织内已经存在相同标题的政策","当前组织内已经存在相同标题的政策"); + } List ruleList = formDTO.getRuleList(); for (IcPolicyRuleFormDTO rule : ruleList) { if (CollectionUtils.isEmpty(rule.getResiRuleList()) From c0176da35c570b00f5e3c0937475c775285f5fda Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 26 Jul 2022 15:44:06 +0800 Subject: [PATCH 72/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiServiceImpl.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 9c613b2c56..acc29d12f1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -94,6 +94,11 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民 int housePageNo = 1; int total = 0; + + // 只能手动分页了 + int start = (pageNo - 1) * pageSize; + int end = pageNo * pageSize; // 不包含 + do { // 拿到房屋id列表,去查询居民列表 List houseIds = govOrgService.listHouseIdsByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, @@ -104,30 +109,32 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { break; } + // 查询居民数量 + Integer count = epmetUserService.getTotalByPolicyRules( + customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, resiRule, houseIds); + + total += count; + // 查询居民,满了20个,不再查询数据,只查询数量 - if (resultResis.size() < pageSize) { + if (resultResis.size() < end) { List resis = epmetUserService.listByPolicyRules( customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); + houseId, idCard, name, 1, end, resiRule, houseIds); resultResis.addAll(resis); } - // 查询数量 - Integer count = epmetUserService.getTotalByPolicyRules( - customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, resiRule, houseIds); - - total += count; - housePageNo ++; } while (true); - // 够了20个,那就截取前20个,否则直接返回 - if (resultResis.size() > 20) { - resultResis = resultResis.subList(0, 20); + // 查出来所有的数据都没够到这一页的起始条数,返回空 + if (resultResis.size() < start) { + return new PageData<>(new ArrayList<>(), total); } + resultResis = resultResis.subList(start, Math.min(end, resultResis.size())); + // 补充额外信息 fillResisExtraInfoForPolicy(resultResis); return new PageData<>(resultResis, total); From 05b6a6b6114c609bdf46b7190e01f962e829656c Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 26 Jul 2022 16:27:36 +0800 Subject: [PATCH 73/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5varchar=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84birthday=E6=8E=A5=E6=94=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ResiByPolicyInfoResultDTO.java | 2 +- .../dataaggre/service/impl/ResiServiceImpl.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java index da425762d7..822b444390 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java @@ -42,5 +42,5 @@ public class ResiByPolicyInfoResultDTO { @ColumnWidth(10) private Integer age; @ExcelIgnore - private Date birthday; + private String birthday; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index acc29d12f1..1b87efe324 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -43,6 +43,8 @@ import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalUnit; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; @Service @@ -60,6 +62,8 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; + public static final Pattern REG_DATE = Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})"); + @Override public PageData listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, @@ -212,8 +216,14 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { if (r.getBirthday() != null) { Integer age = null; try { - LocalDate birthdayLocalDate = LocalDateTime.ofInstant(r.getBirthday().toInstant(), ZoneId.systemDefault()).toLocalDate(); - age = Period.between(birthdayLocalDate, LocalDate.now()).getYears(); + Matcher matcher = REG_DATE.matcher(r.getBirthday()); + if (matcher.matches()) { + String year = matcher.group(1); + String month = matcher.group(2); + String day = matcher.group(3); + LocalDate birthdayLocalDate = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); + age = Period.between(birthdayLocalDate, LocalDate.now()).getYears(); + } } catch (DateTimeException e) { throw new EpmetException("居民生日计算错误"); } From c7d77cffcf43ca52f93870bee2f016bfb7ec5fe7 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 26 Jul 2022 16:38:46 +0800 Subject: [PATCH 74/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5varchar=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84birthday=E6=8E=A5=E6=94=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dataaggre/service/impl/ResiServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 1b87efe324..35d364e4c5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -223,11 +223,11 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { String day = matcher.group(3); LocalDate birthdayLocalDate = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); age = Period.between(birthdayLocalDate, LocalDate.now()).getYears(); + r.setAge(age); } } catch (DateTimeException e) { - throw new EpmetException("居民生日计算错误"); + logger.error(r.getIcResiUserId() + "居民生日计算错误"); } - r.setAge(age); } }); } From 09b3ee4ca08b6492017a331622df79b58a55b897 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 26 Jul 2022 16:49:51 +0800 Subject: [PATCH 75/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/impl/ResiServiceImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index 35d364e4c5..a74ee4eb2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -150,13 +150,15 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { */ private void specificRuleConvert(List resiRule) { // 使用年龄计算出生日期 - resiRule.stream().forEach((r) -> { - if ("BIRTHDAY".equals(r.getColKey())) { - LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS); - r.setQueryType(revertQueryType(r.getQueryType())); - r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); - } - }); + if (resiRule != null) { + resiRule.stream().forEach((r) -> { + if ("BIRTHDAY".equals(r.getColKey())) { + LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS); + r.setQueryType(revertQueryType(r.getQueryType())); + r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + } + }); + } } /** From 7b159e8d6b066e1a0817fd231ec24ce0c3019fe3 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 26 Jul 2022 17:06:10 +0800 Subject: [PATCH 76/76] =?UTF-8?q?=E3=80=90=E6=94=BF=E7=AD=96=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/epmetuser/IcResiUserDao.xml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index 703bcc2bfa..ffe08008ac 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -132,18 +132,22 @@ ic_resi_user.`VILLAGE_ID` as neighborhoodId, ic_resi_user.`BIRTHDAY` from ic_resi_user - - inner join #{rule.colTable} - + + + inner join #{rule.colTable} + +