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-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-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/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-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..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 @@ -1,8 +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 lombok.Data; +import java.util.List; /** @@ -16,15 +21,7 @@ public class IcPolicyDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 主键 - */ - private String id; - - /** - * 客户id - */ - private String customerId; + private String policyId; /** * 政策创建人,所属组织id @@ -32,23 +29,25 @@ public class IcPolicyDTO implements Serializable { private String orgId; /** - * AGENCY_ID的全路径,含agency_id + * 政策级别,0市级;1区级;2街道级 */ - private String orgIdPath; + private String policyLevel; /** * 政策级别,0市级;1区级;2街道级 */ - private String policyLevel; + private String policyLevelName; /** * 生效起止日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date startDate; /** * 截止日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date endDate; /** @@ -62,33 +61,13 @@ public class IcPolicyDTO implements Serializable { private String content; /** - * 删除标识 0.未删除 1.已删除 + * 是否过期;1:已过期;0:未过期 */ - private Integer delFlag; + private String expiredFlag; - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; + //以下三个详情接口返回 + 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/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/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-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-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/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/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/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-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..e35df132dd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java @@ -0,0 +1,42 @@ +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; + + /** + * ruleId + */ + private String id; +} + 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..536e292c70 --- /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 String serviceTimeStart; + + /** + * 服务截止时间 + */ + private String 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-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/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index f9eda02bdc..aa6a390038 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,9 +1,18 @@ package com.epmet.controller; 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.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; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -44,4 +53,76 @@ public class IcPolicyController { icPolicyService.listResiUserByPolicyRules(customerId, ruleId, 1, 20); return null; } + /** + * 政策管理-新增/修改 + * + * @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.addOrUpdatePolicy(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.addOrUpdatePolicy(formDTO); + 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); + } + + /** + * 细则列表 + * @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/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/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index dc1ea6ce52..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 @@ -1,14 +1,20 @@ 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; 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.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.*; @@ -43,22 +49,32 @@ 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); 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){ //效验数据 @@ -67,4 +83,29 @@ 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)); + } + + /** + * 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/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/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/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/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/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/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/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/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/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; /** * 排序字段 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/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/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index ccc0f06a39..0c3534e2bb 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,7 +1,12 @@ 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.IcPolicyRuleDTO; +import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; @@ -15,11 +20,30 @@ import java.util.List; public interface IcPolicyService extends BaseService { /** * 房屋信息、统计信息查询有哪些可选项 + * * @param customerId * @param groupType * @return */ List itemList(String customerId, String groupType); + /** + * 政策管理-新增/修改 + * + * @param formDTO + */ + void addOrUpdatePolicy(IcPolicyFormDTO formDTO); + + /** + * 列表查询 + * @param formDTO + * @return + */ + PageData policyList(IcPolicyPageFormDTO formDTO); + + List ruleList(String customerId,String policyId); + + IcPolicyDTO policyDetail(String customerId,String policyId); + 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/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 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 addOrUpdatePolicy(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()); + if(StringUtils.isNotBlank(formDTO.getPolicyId())){ + icPolicyEntity.setId(formDTO.getPolicyId()); + baseDao.updateById(icPolicyEntity); + }else{ + // 插入政策主表 + baseDao.insert(icPolicyEntity); + //删除规则、规则明细、分类、附件 + icPolicyRuleDao.deleteByIcPolicyId(icPolicyEntity.getId()); + icPolicyCategoryDao.deleteByIcPolicyId(icPolicyEntity.getId()); + heartAttachmentDao.deleteByBusinessId(icPolicyEntity.getId()); + } + // 插入细则 + 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); + //删除规则明细 + icPolicyRuleDetailDao.deleteByRuleId(ruleEntity.getId()); + + 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 = ConvertUtils.sourceToTarget(fileCommonDTO,HeartAttachmentEntity.class); + heartAttachment.setCustomerId(formDTO.getCustomerId()); + heartAttachment.setBusinessId(icPolicyEntity.getId()); + heartAttachment.setAttachTo("ic_policy"); + // heartAttachment.setName(fileCommonDTO.getName()); + // heartAttachment.setFormat(fileCommonDTO.getFormat()); + // heartAttachment.setType(fileCommonDTO.getType()); + // heartAttachment.setUrl(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 + * @return + */ + @Override + public PageData 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); + 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; + } + @Override public void listResiUserByPolicyRules(String customerId, String ruleId, Integer pageNo, Integer pageSize) { LambdaQueryWrapper query = new LambdaQueryWrapper(); 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 a4f8904b18..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 @@ -1,19 +1,32 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcServiceFeedbackV2Dao; import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.dto.form.IcServiceFeedbackV2AddFormDTO; +import com.epmet.entity.HeartAttachmentEntity; import com.epmet.entity.IcServiceFeedbackV2Entity; +import com.epmet.entity.IcServiceOrgEntity; +import com.epmet.entity.IcServiceRecordV2Entity; +import com.epmet.service.HeartAttachmentService; import com.epmet.service.IcServiceFeedbackV2Service; +import com.epmet.service.IcServiceRecordV2Service; +import lombok.extern.slf4j.Slf4j; 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 org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -25,7 +38,13 @@ import java.util.Map; * @since v1.0.0 2022-07-18 */ @Service +@Slf4j public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl implements IcServiceFeedbackV2Service { + @Autowired + private IcServiceRecordV2Service icServiceRecordV2Service; + @Autowired + private HeartAttachmentService heartAttachmentService; + @Override public PageData page(Map params) { @@ -60,9 +79,50 @@ 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<>(); + 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 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java index cb88587cdf..0020054c21 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java @@ -249,7 +249,7 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl implements IcServiceRecordV2Service { + @Autowired + private IcPartyUnitRedis partyUnitRedis; + @Autowired + private IcServiceScopeV2Service icServiceScopeV2Service; + @Autowired + private IcServiceRecordServiceImpl icServiceRecordServiceImpl; + @Autowired + private IcServiceFeedbackV2Service icServiceFeedbackV2Service; + @Autowired + private HeartAttachmentService heartAttachmentService; + + @Autowired + private IcServiceScopeDao serviceScopeDao; + @Autowired + private IcServiceFeedbackV2Dao serviceFeedbackV2Dao; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -60,18 +106,80 @@ 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); + }); + + //3.新增服务反馈数据feedback + if(null != formDTO.getFeedback()){ + entity.setServiceStatus(formDTO.getFeedback().getServiceStatus()); + 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); + } + } + insert(entity); + } @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); } + @Override + public void cancel(IcServiceRecordV2AddEditFormDTO formDTO) { + //1.校验数据是否存在 + IcServiceRecordV2Entity entity = baseDao.selectById(formDTO.getServiceRecordId()); + if (null == entity) { + log.error(String.format("取消服务记录失败,未查询到服务记录,服务记录Id->%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) { @@ -79,4 +187,52 @@ 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; + } + + /** + * Desc: 详情 + * @param formDTO + * @author zxc + * @date 2022/7/19 16:37 + */ + @Override + public ServiceRecordV2DetailResultDTO serviceRecordV2Detail(ServiceRecordV2DetailFormDTO formDTO) { + IcServiceRecordV2Entity entity = baseDao.selectById(formDTO.getServiceRecordId()); + if (null == entity){ + return new ServiceRecordV2DetailResultDTO(); + } + ServiceRecordV2DetailResultDTO result = ConvertUtils.sourceToTarget(entity, ServiceRecordV2DetailResultDTO.class); + result.setServiceTimeStart(DateUtils.format(entity.getServiceTimeStart(),DateUtils.DATE_PATTERN)); + result.setServiceTimeEnd(DateUtils.format(entity.getServiceTimeEnd(),DateUtils.DATE_PATTERN)); + result.setServiceRecordId(entity.getId()); + List 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/HeartAttachmentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml index 6a4f001f8e..0a722db77b 100644 --- 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 @@ -24,5 +24,7 @@ - + + 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/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/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/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index f02037127c..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 @@ -42,4 +42,39 @@ and i.GROUP_TYPE = #{groupType} order by i.SORT asc + + \ 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 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/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 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