Browse Source

Merge branch 'dev_policy_service' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_policy_service

 Conflicts:
	epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java
	epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java
	epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java
master
wangxianzhang 3 years ago
parent
commit
8162f39d8a
  1. 16
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  3. 12
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  4. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java
  5. 57
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java
  6. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java
  7. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java
  8. 96
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java
  9. 91
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java
  10. 24
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java
  11. 55
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java
  12. 99
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java
  13. 39
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java
  14. 60
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java
  15. 42
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java
  16. 71
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java
  17. 66
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java
  18. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java
  19. 81
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java
  20. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java
  21. 53
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java
  22. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java
  23. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java
  24. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java
  25. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java
  26. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java
  27. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java
  28. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java
  29. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java
  30. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java
  31. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java
  32. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java
  33. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java
  34. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java
  35. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java
  36. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java
  37. 260
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java
  38. 66
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java
  39. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java
  40. 164
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java
  41. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml
  42. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  43. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml
  44. 35
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml
  45. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml
  46. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml
  47. 37
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml
  48. 58
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml
  49. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml

16
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";
}

1
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;

12
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);
}
}

8
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;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
private String format;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
private String type;
/**
* 附件地址
*/
private String attachmentUrl;
private String url;
/**
* 排序字段

57
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<IcPolicyCategoryDTO> categoryList;
private List<FileCommonDTO> attachmentList;
private List<IcPolicyRuleFormDTO> ruleList;
}

10
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;
}

3
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<HeartAttachmentDTO> fileList;
}

96
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<FileDTO> 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;
}
}

91
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> 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;
}
}

24
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;
}

55
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;
}

99
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<IcPolicyCategoryDTO> categoryList;
// @Valid
private List<FileCommonDTO> attachmentList;
@Valid
@NotEmpty(message = "政策细则不能为空",groups =AddUserShowGroup.class )
private List<IcPolicyRuleFormDTO> ruleList;
}

39
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;
}

60
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;
/**
* 与上一条的关系andor
*/
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;
}

42
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<IcPolicyRuleDetailDTO> resiRuleList;
/**
* 房屋信息
*/
private List<IcPolicyRuleDetailDTO> houseRuleList;
/**
* 统计信息
*/
private List<IcPolicyRuleDetailDTO> statRuleList;
/**
* ruleId
*/
private String id;
}

71
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<IcServiceScopeV2DTO> gridIdList;
private IcServiceFeedbackV2DTO feedback;
}

66
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;
}

4
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";
}

81
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<PageData<IcPolicyDTO>> 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<IcPolicyDTO> page = icPolicyService.policyList(formDTO);
return new Result<PageData<IcPolicyDTO>>().ok(page);
}
/**
* 细则列表
* @param customerId
* @param policyId
* @return
*/
@PostMapping("rulelist/{policyId}")
public Result<List<IcPolicyRuleDTO>> ruleList(@RequestHeader("customerId") String customerId,@PathVariable("policyId") String policyId) {
return new Result<List<IcPolicyRuleDTO>>().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<IcPolicyDTO> policyDetail(@LoginUser TokenDto tokenDto,@PathVariable("policyId") String policyId) {
return new Result<IcPolicyDTO>().ok(icPolicyService.policyDetail(tokenDto.getCustomerId(),policyId));
}
}

12
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();
}

53
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<PageData> serviceRecordV2List(@LoginUser TokenDto tokenDto, @RequestBody ServiceRecordV2ListFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData>().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO));
}
/**
* Desc: 详情
* @param formDTO
* @author zxc
* @date 2022/7/19 16:37
*/
@PostMapping("detail")
public Result<ServiceRecordV2DetailResultDTO> serviceRecordV2Detail(@RequestBody ServiceRecordV2DetailFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ServiceRecordV2DetailFormDTO.ServiceRecordV2DetailForm.class);
return new Result<ServiceRecordV2DetailResultDTO>().ok(icServiceRecordV2Service.serviceRecordV2Detail(formDTO));
}
}

3
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<HeartAttachmentEntity> {
int deleteByBusinessId(String businessId);
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java

@ -75,4 +75,7 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao<IcCommunitySelfO
List<CommunitySelfOrganizationListDTO> queryCoordinateList(CategorySelfOrgFormDTO formDTO);
List<IcCommunitySelfOrganizationEntity> selectByIds(@Param("communityOrgIds") List<String> communityOrgIds);
String getCommunityOrgName(@Param("id") String id);
String getPartyUnitName(@Param("id") String id);
}

3
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<IcPolicyCategoryEntity> {
int deleteByIcPolicyId(String icPolicyId);
}

4
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<IcPolicyEntity> {
* @return
*/
List<IcPolicyItemResultDTO> selectItemList(@Param("customerId") String customerId, @Param("groupType") String groupType);
List<IcPolicyDTO> policyList(IcPolicyPageFormDTO formDTO);
}

3
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<IcPolicyRuleEntity> {
int deleteByIcPolicyId(String policyId);
}

3
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<IcPolicyRuleDetailEntity> {
int deleteByRuleId(String ruleId);
}

6
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<IcServiceFeedbackV2Entity> {
IcServiceFeedbackV2DTO getFeedbackV2(@Param("serviceRecordId") String serviceRecordId);
}

14
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<IcServiceRecordV2Entity> {
/**
* Desc:服务管理列表
* @param formDTO
* @author zxc
* @date 2022/7/19 10:24
*/
List<ServiceRecordV2ListResultDTO> serviceRecordV2List(ServiceRecordV2ListFormDTO formDTO);
}

3
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<IcServiceScopeEntity> {
int update(@Param("serviceId") String serviceId, @Param("userId") String userId);
List<IcServiceScopeDTO> selectList(String serviceRecordId);
List<IcServiceScopeV2DTO> selectListV2(@Param("serviceRecordId") String serviceRecordId);
}

8
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;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
private String format;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
private String type;
/**
* 附件地址
*/
private String attachmentUrl;
private String url;
/**
* 排序字段

5
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;

33
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> 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;
}
}

24
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<IcPolicyEntity> {
/**
* 房屋信息统计信息查询有哪些可选项
*
* @param customerId
* @param groupType
* @return
*/
List<IcPolicyItemResultDTO> itemList(String customerId, String groupType);
/**
* 政策管理-新增/修改
*
* @param formDTO
*/
void addOrUpdatePolicy(IcPolicyFormDTO formDTO);
/**
* 列表查询
* @param formDTO
* @return
*/
PageData<IcPolicyDTO> policyList(IcPolicyPageFormDTO formDTO);
List<IcPolicyRuleDTO> ruleList(String customerId,String policyId);
IcPolicyDTO policyDetail(String customerId,String policyId);
void listResiUserByPolicyRules(String customerId, String ruleId, Integer pageNo, Integer pageSize);
}

3
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<IcServiceFeedbac
* @author generator
* @date 2022-07-18
*/
void save(IcServiceFeedbackV2DTO dto);
void save(IcServiceFeedbackV2AddFormDTO dto);
/**
* 默认更新

26
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java

@ -3,6 +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;
@ -54,7 +58,7 @@ public interface IcServiceRecordV2Service extends BaseService<IcServiceRecordV2E
* @author generator
* @date 2022-07-18
*/
void save(IcServiceRecordV2DTO dto);
void save(IcServiceRecordV2AddEditFormDTO dto);
/**
* 默认更新
@ -64,7 +68,7 @@ public interface IcServiceRecordV2Service extends BaseService<IcServiceRecordV2E
* @author generator
* @date 2022-07-18
*/
void update(IcServiceRecordV2DTO dto);
void update(IcServiceRecordV2AddEditFormDTO dto);
/**
* 批量删除
@ -75,4 +79,22 @@ public interface IcServiceRecordV2Service extends BaseService<IcServiceRecordV2E
* @date 2022-07-18
*/
void delete(String[] ids);
/**
* Desc:服务管理列表
* @param formDTO
* @author zxc
* @date 2022/7/19 10:24
*/
PageData serviceRecordV2List(ServiceRecordV2ListFormDTO formDTO);
/**
* Desc: 详情
* @param formDTO
* @author zxc
* @date 2022/7/19 16:37
*/
ServiceRecordV2DetailResultDTO serviceRecordV2Detail(ServiceRecordV2DetailFormDTO formDTO);
void cancel(IcServiceRecordV2AddEditFormDTO dto);
}

260
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java

@ -8,20 +8,46 @@ 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.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.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.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;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.Map;
/**
* 政策表
@ -37,6 +63,16 @@ public class IcPolicyServiceImpl extends BaseServiceImpl<IcPolicyDao, IcPolicyEn
@Autowired
private DataAggregatorOpenFeignClient dataAggregatorOpenFeignClient;
@Autowired
private IcPolicyCategoryDao icPolicyCategoryDao;
@Autowired
private IcPolicyRuleDao icPolicyRuleDao;
@Autowired
private HeartAttachmentDao heartAttachmentDao;
@Autowired
private IcPolicyRuleDetailDao icPolicyRuleDetailDao;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
/**
* 房屋信息统计信息查询有哪些可选项
@ -47,16 +83,232 @@ public class IcPolicyServiceImpl extends BaseServiceImpl<IcPolicyDao, IcPolicyEn
*/
@Override
public List<IcPolicyItemResultDTO> itemList(String customerId, String groupType) {
if(StringUtils.isBlank(groupType)){
if (StringUtils.isBlank(groupType)) {
return new ArrayList<>();
}
List<IcPolicyItemResultDTO> resultList=baseDao.selectItemList(customerId,groupType);
if(CollectionUtils.isEmpty(resultList)){
return baseDao.selectItemList(Constant.DEFAULT_CUSTOMER,groupType);
List<IcPolicyItemResultDTO> 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<IcPolicyRuleFormDTO> 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<IcPolicyDTO> 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<IcPolicyDTO> list = baseDao.policyList(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
for (IcPolicyDTO icPolicyDTO : list) {
// 查询字典表
Result<Map<String, String>> levelRes = adminOpenFeignClient.dictMap(DictTypeEnum.POLICY_LEVEL.getCode());
Map<String, String> 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<IcPolicyDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public List<IcPolicyRuleDTO> ruleList(String customerId, String policyId) {
LambdaQueryWrapper<IcPolicyRuleEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPolicyRuleEntity::getCustomerId, customerId)
.eq(IcPolicyRuleEntity::getIcPolicyId, policyId)
.orderByAsc(IcPolicyRuleEntity::getSort);
List<IcPolicyRuleEntity> 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<HeartAttachmentEntity> attWrapper = new LambdaQueryWrapper<>();
attWrapper.eq(HeartAttachmentEntity::getBusinessId, policyId)
.orderByAsc(HeartAttachmentEntity::getSort);
List<HeartAttachmentEntity> attList = heartAttachmentDao.selectList(attWrapper);
icPolicyDTO.setAttachmentList(CollectionUtils.isNotEmpty(attList) ? ConvertUtils.sourceToTarget(attList, FileCommonDTO.class) : new ArrayList<>());
LambdaQueryWrapper<IcPolicyCategoryEntity> cateWrapper = new LambdaQueryWrapper<>();
cateWrapper.eq(IcPolicyCategoryEntity::getIcPolicyId, policyId);
List<IcPolicyCategoryEntity> cateList = icPolicyCategoryDao.selectList(cateWrapper);
icPolicyDTO.setCategoryList(CollectionUtils.isNotEmpty(cateList) ? ConvertUtils.sourceToTarget(cateList, IcPolicyCategoryDTO.class) : new ArrayList<>());
List<IcPolicyRuleDTO> ruleDTOList = ruleList(customerId, policyId);
List<IcPolicyRuleFormDTO> ruleList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(ruleDTOList)) {
ruleList = ConvertUtils.sourceToTarget(ruleDTOList, IcPolicyRuleFormDTO.class);
for (IcPolicyRuleFormDTO rule : ruleList) {
LambdaQueryWrapper<IcPolicyRuleDetailEntity> ruleDetailWrapper = new LambdaQueryWrapper<>();
ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId())
.eq(IcPolicyRuleDetailEntity::getGroupType, "resi")
.orderByAsc(IcPolicyRuleDetailEntity::getSort);
List<IcPolicyRuleDetailEntity> resiList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper);
List<IcPolicyRuleDetailDTO> 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<IcPolicyRuleDetailEntity> houseList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper);
List<IcPolicyRuleDetailDTO> 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<IcPolicyRuleDetailEntity> statList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper);
List<IcPolicyRuleDetailDTO> 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<IcPolicyRuleDetailEntity> query = new LambdaQueryWrapper();

66
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<IcServiceFeedbackV2Dao, IcServiceFeedbackV2Entity> implements IcServiceFeedbackV2Service {
@Autowired
private IcServiceRecordV2Service icServiceRecordV2Service;
@Autowired
private HeartAttachmentService heartAttachmentService;
@Override
public PageData<IcServiceFeedbackV2DTO> page(Map<String, Object> params) {
@ -60,9 +79,50 @@ public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl<IcServiceFee
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcServiceFeedbackV2DTO dto) {
IcServiceFeedbackV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceFeedbackV2Entity.class);
insert(entity);
public void save(IcServiceFeedbackV2AddFormDTO formDTO) {
//1.查询服务记录是否存在
IcServiceRecordV2Entity recordV2Entity = icServiceRecordV2Service.selectById(formDTO.getServiceRecordId());
if (null == recordV2Entity) {
log.error(String.format("新增服务反馈记录失败,未查询到服务记录,服务记录Id->%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<IcServiceFeedbackV2Entity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcServiceFeedbackV2Entity::getServiceRecordId, formDTO.getServiceRecordId());
List<IcServiceFeedbackV2Entity> 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<HeartAttachmentEntity> 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

2
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<IcServiceRecordD
* @param scopeObjectId
* @return
*/
private String[] getScopeObjectIdPath(String scopeObjectType, String scopeObjectId) {
public String[] getScopeObjectIdPath(String scopeObjectType, String scopeObjectId) {
if ("neighborhood".equals(scopeObjectType)) {
String msg = String.format("【服务项目】-发起服务-根据范围id查询小区信息失败。scopeObjectType:%s, scopeObjectId:%s",

164
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java

@ -2,18 +2,47 @@ 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;
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.commons.tools.utils.DateUtils;
import com.epmet.dao.IcServiceFeedbackV2Dao;
import com.epmet.dao.IcServiceRecordV2Dao;
import com.epmet.dao.IcServiceScopeDao;
import com.epmet.dto.IcServiceFeedbackV2DTO;
import com.epmet.dto.IcServiceRecordV2DTO;
import com.epmet.dto.IcServiceScopeV2DTO;
import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO;
import com.epmet.dto.form.ServiceRecordV2DetailFormDTO;
import com.epmet.dto.form.ServiceRecordV2ListFormDTO;
import com.epmet.dto.result.ServiceRecordV2DetailResultDTO;
import com.epmet.dto.result.ServiceRecordV2ListResultDTO;
import com.epmet.entity.HeartAttachmentEntity;
import com.epmet.entity.IcServiceFeedbackV2Entity;
import com.epmet.entity.IcServiceRecordV2Entity;
import com.epmet.entity.IcServiceScopeV2Entity;
import com.epmet.redis.IcPartyUnitRedis;
import com.epmet.service.HeartAttachmentService;
import com.epmet.service.IcServiceFeedbackV2Service;
import com.epmet.service.IcServiceRecordV2Service;
import com.epmet.service.IcServiceScopeV2Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
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.Arrays;
import java.util.List;
import java.util.Map;
@ -25,8 +54,25 @@ import java.util.Map;
* @since v1.0.0 2022-07-18
*/
@Service
@Slf4j
public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecordV2Dao, IcServiceRecordV2Entity> 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<IcServiceRecordV2DTO> page(Map<String, Object> params) {
IPage<IcServiceRecordV2Entity> page = baseDao.selectPage(
@ -60,18 +106,80 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcServiceRecordV2DTO dto) {
IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceRecordV2Entity.class);
public void save(IcServiceRecordV2AddEditFormDTO formDTO) {
//1.服务记录数据
IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceRecordV2Entity.class);
entity.setId(IdWorker.getIdStr());
entity.setServiceStatus("in_service");
//2.新增服务范围数据
List<IcServiceScopeV2Entity> 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<HeartAttachmentEntity> 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<IcServiceRecor
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* Desc:服务管理列表
* @param formDTO
* @author zxc
* @date 2022/7/19 10:24
*/
@Override
public PageData serviceRecordV2List(ServiceRecordV2ListFormDTO formDTO) {
PageData<ServiceRecordV2ListResultDTO> 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<ServiceRecordV2ListResultDTO> 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<IcServiceScopeV2DTO> scopeV2DTOS = serviceScopeDao.selectListV2(formDTO.getServiceRecordId());
result.setGridIdList(scopeV2DTOS);
IcServiceFeedbackV2DTO feedbackV2 = serviceFeedbackV2Dao.getFeedbackV2(formDTO.getServiceRecordId());
result.setFeedback(feedbackV2);
return result;
}
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartAttachmentDao.xml

@ -24,5 +24,7 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByBusinessId" parameterType="java.lang.String">
delete from heart_attachment where BUSINESS_ID=#{businessId}
</delete>
</mapper>

7
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml

@ -196,4 +196,11 @@
</foreach>
)
</select>
<select id="getCommunityOrgName" resultType="java.lang.String">
SELECT ORGANIZATION_NAME FROM ic_community_self_organization WHERE ID = #{id}
</select>
<select id="getPartyUnitName" resultType="java.lang.String">
SELECT UNIT_NAME FROM ic_party_unit WHERE ID = #{id}
</select>
</mapper>

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml

@ -17,5 +17,7 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByIcPolicyId" parameterType="java.lang.String">
delete from ic_policy_category where IC_POLICY_ID=#{icPolicyId}
</delete>
</mapper>

35
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
</select>
<select id="policyList" parameterType="com.epmet.dto.form.policy.IcPolicyPageFormDTO" resultType="com.epmet.dto.IcPolicyDTO">
SELECT
ip.id AS POLICY_ID,
ip.ORG_ID,
ip.POLICY_LEVEL,
ip.START_DATE,
ip.END_DATE,
ip.TITLE,
ip.CONTENT,
(
case when ip.END_DATE &lt; now() then '1'
when ip.END_DATE &gt;= now() then '0'
end
)as expiredFlag
FROM
ic_policy ip
WHERE
ip.DEL_FLAG = '0'
AND ip.CUSTOMER_ID = #{customerId}
AND ip.ORG_ID = #{agencyId}
<if test="null != title and title != '' ">
and ip.TITLE like concat('%',#{title},'%')
</if>
<if test="null != content and content != '' ">
and ip.CONTENT like concat('%',#{content},'%')
</if>
<if test="'1' == expiredFlag">
and ip.END_DATE &lt; now()
</if>
<if test="'0' == expiredFlag">
and ip.END_DATE &gt;= now()
</if>
order by ip.CREATED_TIME desc
</select>
</mapper>

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml

@ -17,5 +17,7 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByIcPolicyId" parameterType="java.lang.String">
delete from ic_policy_rule where IC_POLICY_ID=#{policyId}
</delete>
</mapper>

3
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml

@ -26,5 +26,8 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByRuleId" parameterType="java.lang.String">
delete from ic_policy_rule_detail where RULE_ID=#{ruleId}
</delete>
</mapper>

37
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml

@ -22,5 +22,42 @@
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<resultMap id="getFeedbackV2Map" type="com.epmet.dto.IcServiceFeedbackV2DTO">
<result column="serviceGoal" property="serviceGoal"/>
<result column="serviceEffect" property="serviceEffect"/>
<result column="servicePeopleNumber" property="servicePeopleNumber"/>
<result column="satisfaction" property="satisfaction"/>
<result column="address" property="address"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<collection property="fileList" ofType="com.epmet.dto.HeartAttachmentDTO">
<result column="url" property="url"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="format" property="format"/>
<result column="duration" property="duration"/>
<result column="id" property="id"/>
</collection>
</resultMap>
<select id="getFeedbackV2" resultMap="getFeedbackV2Map">
SELECT
sf.SERVICE_GOAL AS serviceGoal,
sf.SERVICE_EFFECT AS serviceEffect,
sf.SERVICE_PEOPLE_NUMBER AS servicePeopleNumber,
sf.SATISFACTION AS satisfaction,
sf.ADDRESS AS address,
sf.LONGITUDE AS longitude,
sf.LATITUDE AS latitude,
ha.url AS url,
ha.NAME AS name,
ha.type AS type,
ha.format AS format,
ha.duration AS duration,
ha.id AS id
FROM ic_service_feedback_v2 sf
LEFT JOIN heart_attachment ha ON ha.business_id = sf.ID AND ha.del_flag = '0'
WHERE sf.SERVICE_RECORD_ID = #{serviceRecordId}
</select>
</mapper>

58
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml

@ -3,26 +3,44 @@
<mapper namespace="com.epmet.dao.IcServiceRecordV2Dao">
<resultMap type="com.epmet.entity.IcServiceRecordV2Entity" id="icServiceRecordV2Map">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="serviceOrgType" column="SERVICE_ORG_TYPE"/>
<result property="serviceOrgId" column="SERVICE_ORG_ID"/>
<result property="principalName" column="PRINCIPAL_NAME"/>
<result property="principalContact" column="PRINCIPAL_CONTACT"/>
<result property="serviceTimeStart" column="SERVICE_TIME_START"/>
<result property="serviceTimeEnd" column="SERVICE_TIME_END"/>
<result property="serviceStatus" column="SERVICE_STATUS"/>
<result property="remark" column="REMARK"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="serviceName" column="SERVICE_NAME"/>
<result property="policyId" column="POLICY_ID"/>
</resultMap>
<!-- 【服务管理】列表 -->
<select id="serviceRecordV2List" resultType="com.epmet.dto.result.ServiceRecordV2ListResultDTO">
SELECT
sr.ID AS serviceRecordId,
sr.POLICY_ID,
sr.SERVICE_NAME,
sr.SERVICE_ORG_TYPE,
sr.SERVICE_ORG_ID,
sr.SERVICE_TIME_START,
sr.SERVICE_TIME_END,
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
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},'%')
AND sr.CUSTOMER_ID = #{customerId}
<if test='serviceName != null and serviceName != ""'>
AND sr.SERVICE_NAME LIKE CONCAT('%',#{serviceName},'%')
</if>
<if test='serviceOrgId != null and serviceOrgId != ""'>
AND sr.SERVICE_ORG_ID = #{serviceOrgId}
</if>
<if test='serviceStatus != null and serviceStatus != ""'>
AND sr.SERVICE_STATUS = #{serviceStatus}
</if>
<if test='satisfaction != null and satisfaction != ""'>
AND sf.SATISFACTION = #{satisfaction}
</if>
<if test='serviceTimeStart != null and serviceTimeStart != ""'>
AND sr.SERVICE_TIME_START >= #{serviceTimeStart}
</if>
<if test='serviceTimeEnd != null and serviceTimeEnd != ""'>
AND sr.SERVICE_TIME_END <![CDATA[ <= ]]> #{serviceTimeEnd}
</if>
ORDER BY sr.CREATED_TIME DESC
</select>
</mapper>

11
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}
</select>
<select id="selectListV2" resultType="com.epmet.dto.IcServiceScopeV2DTO">
SELECT
s.OBJECT_ID,
s.OBJECT_TYPE,
s.OBJECT_NAME
FROM
ic_service_scope_v2 s
WHERE
s.DEL_FLAG = '0'
AND s.SERVICE_RECORD_ID = #{serviceRecordId}
</select>
</mapper>
Loading…
Cancel
Save