From e7f9b111bc1f7c23936ca9e76762545a3e7d464c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 15:05:25 +0800 Subject: [PATCH 01/13] commityixia --- .../commons/tools/constant/Constant.java | 16 ++ .../dto/form/policy/IcPolicyFormDTO.java | 99 +++++++++++ .../form/policy/IcPolicyRuleDetailDTO.java | 60 +++++++ .../dto/form/policy/IcPolicyRuleFormDTO.java | 37 ++++ .../epmet/controller/IcPolicyController.java | 36 ++++ .../entity/IcPolicyRuleDetailEntity.java | 5 +- .../com/epmet/service/IcPolicyService.java | 15 ++ .../service/impl/IcPolicyServiceImpl.java | 158 +++++++++++++++++- 8 files changed, 416 insertions(+), 10 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 77875d5415..95cc929784 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -174,4 +174,20 @@ public interface Constant { String OPITON_SOURCE_REMOTE = "remote"; String OPITON_SOURCE_LOCAL = "local"; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + String AUDITING="auditing"; + String AUTO_PASSED="auto_passed"; + String REVIEW="review"; + String BLOCK="block"; + String REJECTED="rejected"; + String APPROVED="approved"; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java new file mode 100644 index 0000000000..c605e8b062 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java @@ -0,0 +1,99 @@ +package com.epmet.dto.form.policy; + +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dto.IcPolicyCategoryDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 13:09 + */ + +@Data +public class IcPolicyFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateUserInternalGroup { + } + @NotBlank(message = "政策id不能为空",groups = UpdateUserInternalGroup.class) + private String policyId; + /** + * 政策创建人,所属组织id + */ + @NotBlank(message = "orgId不能为空",groups = UpdateUserInternalGroup.class) + private String orgId; + + /** + * AGENCY_ID的全路径,含agency_id + */ + @NotBlank(message = "orgIdPath不能为空",groups = UpdateUserInternalGroup.class) + private String orgIdPath; + + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + private String staffId; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + @NotBlank(message = "政策级别不能为空", groups = AddUserShowGroup.class) + private String policyLevel; + + /** + * 生效起止日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + @NotNull(message = "政策开始日期不能为空", groups = AddUserShowGroup.class) + private Date startDate; + + /** + * 截止日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + @NotNull(message = "政策截止日期不能为空", groups = AddUserShowGroup.class) + private Date endDate; + + /** + * 政策标题 + */ + @NotBlank(message = "政策标题不能为空", groups = AddUserShowGroup.class) + @Length(max = 100, groups = AddUserShowGroup.class, message = "政策标题最多输入100字") + private String title; + + /** + * 政策内容 + */ + @NotBlank(message = "政策内容不能为空", groups = AddUserShowGroup.class) + @Length(max = 2000, groups = AddUserShowGroup.class, message = "政策内容最多输入2000字") + private String content; + + private List categoryList; + + // @Valid + private List attachmentList; + + @Valid + @NotEmpty(message = "政策细则不能为空",groups =AddUserShowGroup.class ) + private List ruleList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java new file mode 100644 index 0000000000..b88ac693c6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.form.policy; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 13:32 + */ +@Data +public class IcPolicyRuleDetailDTO { + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 规则描述文字,例如:基础信息性别等于女 + */ + private String ruleDesc; + + /** + * 与上一条的关系;and、or + */ + private String lastLogicalRel; + + /** + * 分组id;人员信息有值; + */ + private String itemGroupId; + + /** + * 表名;人员信息有值;房屋信息也有值 + */ + private String itemId; + + /** + * 查询类型:等于、不等于....;来源于字典表sql_query_type + */ + @NotBlank(message = "查询类型不能为空", groups = AddUserShowGroup.class) + private String queryType; + + /** + * 表名;人员信息有值; + */ + private String colTable; + + /** + * 人员信息存储组件对应的列名;房屋信息存储ic_house表的列名;统计信息应该是定义到字典表,这里存储字典key就行吧 + */ + @NotBlank(message = "条件不能为空", groups = AddUserShowGroup.class) + private String colKey; + + /** + * 参数值 + */ + @NotBlank(message = "参数值不能为空", groups = AddUserShowGroup.class) + private String colVal; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java new file mode 100644 index 0000000000..99ed14eb4e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form.policy; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 13:31 + */ +@Data +public class IcPolicyRuleFormDTO implements Serializable { + + /** + * 细则名称 + */ + @NotBlank(message = "细则名称不能为空", groups = IcPolicyFormDTO.AddUserShowGroup.class) + private String ruleName; + /** + * 人员信息 + */ + // @Valid + // @NotEmpty + private List resiRuleList; + /** + * 房屋信息 + */ + private List houseRuleList; + /** + * 统计信息 + */ + private List statRuleList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 1cebba0484..8b17d4d6ed 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,7 +1,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,4 +38,36 @@ public class IcPolicyController { return new Result>().ok(list); } + /** + * 政策管理-新增/修改 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class); + icPolicyService.addPolicy(formDTO); + return new Result(); + } + + /** + * 编辑政策 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class,IcPolicyFormDTO.UpdateUserInternalGroup.class); + icPolicyService.updatePolicy(formDTO); + return new Result(); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java index 57d8f91ab1..ee959255b0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java @@ -1,13 +1,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 政策匹配规则明细 * @@ -67,7 +64,7 @@ public class IcPolicyRuleDetailEntity extends BaseEpmetEntity { private String queryType; /** - * 表名;人员信息有值; + * 表名;人员信息有值;房屋信息也有值 */ private String colTable; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 86a984760f..b464facd1a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; @@ -15,9 +16,23 @@ import java.util.List; public interface IcPolicyService extends BaseService { /** * 房屋信息、统计信息查询有哪些可选项 + * * @param customerId * @param groupType * @return */ List itemList(String customerId, String groupType); + + /** + * 政策管理-新增/修改 + * + * @param formDTO + */ + void addPolicy(IcPolicyFormDTO formDTO); + + /** + * 修改政策 + * @param formDTO + */ + void updatePolicy(IcPolicyFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 90162b4231..183a1d4cad 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -2,13 +2,26 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; -import com.epmet.dao.IcPolicyDao; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.*; +import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyItemResultDTO; -import com.epmet.entity.IcPolicyEntity; +import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; +import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; +import com.epmet.entity.*; import com.epmet.service.IcPolicyService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -22,6 +35,15 @@ import java.util.List; @Service public class IcPolicyServiceImpl extends BaseServiceImpl implements IcPolicyService { + @Autowired + private IcPolicyCategoryDao icPolicyCategoryDao; + @Autowired + private IcPolicyRuleDao icPolicyRuleDao; + @Autowired + private HeartAttachmentDao heartAttachmentDao; + @Autowired + private IcPolicyRuleDetailDao icPolicyRuleDetailDao; + /** * 房屋信息、统计信息查询有哪些可选项 @@ -32,13 +54,137 @@ public class IcPolicyServiceImpl extends BaseServiceImpl itemList(String customerId, String groupType) { - if(StringUtils.isBlank(groupType)){ + if (StringUtils.isBlank(groupType)) { return new ArrayList<>(); } - List resultList=baseDao.selectItemList(customerId,groupType); - if(CollectionUtils.isEmpty(resultList)){ - return baseDao.selectItemList(Constant.DEFAULT_CUSTOMER,groupType); + List resultList = baseDao.selectItemList(customerId, groupType); + if (CollectionUtils.isEmpty(resultList)) { + return baseDao.selectItemList(Constant.DEFAULT_CUSTOMER, groupType); } return resultList; } + + /** + * 政策管理-新增/修改 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void addPolicy(IcPolicyFormDTO formDTO) { + // 校验参数 + checkAddFormDTO(formDTO); + // 设置所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); + } + IcPolicyEntity icPolicyEntity = ConvertUtils.sourceToTarget(formDTO, IcPolicyEntity.class); + icPolicyEntity.setOrgId(staffInfo.getAgencyId()); + icPolicyEntity.setOrgIdPath(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId()) : staffInfo.getAgencyId()); + // 插入政策主表 + baseDao.insert(icPolicyEntity); + // 插入细则 + int ruleSort = 1; + for (IcPolicyRuleFormDTO rule : formDTO.getRuleList()) { + IcPolicyRuleEntity ruleEntity = new IcPolicyRuleEntity(); + ruleEntity.setCustomerId(formDTO.getCustomerId()); + ruleEntity.setIcPolicyId(icPolicyEntity.getId()); + ruleEntity.setRuleName(rule.getRuleName()); + ruleEntity.setSort(ruleSort); + icPolicyRuleDao.insert(ruleEntity); + if (CollectionUtils.isNotEmpty(rule.getResiRuleList())) { + int resiRuleSort = 1; + for (IcPolicyRuleDetailDTO ruleDetailDTO : rule.getResiRuleList()) { + IcPolicyRuleDetailEntity icPolicyRuleDetailEntity = ConvertUtils.sourceToTarget(ruleDetailDTO, IcPolicyRuleDetailEntity.class); + icPolicyRuleDetailEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyRuleDetailEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyRuleDetailEntity.setRuleId(ruleEntity.getId()); + icPolicyRuleDetailEntity.setSort(resiRuleSort); + icPolicyRuleDetailEntity.setGroupType("resi"); + icPolicyRuleDetailDao.insert(icPolicyRuleDetailEntity); + resiRuleSort++; + } + } + if (CollectionUtils.isNotEmpty(rule.getHouseRuleList())) { + int houseRuleSort = 1; + for (IcPolicyRuleDetailDTO ruleDetailDTO : rule.getHouseRuleList()) { + IcPolicyRuleDetailEntity icPolicyRuleDetailEntity = ConvertUtils.sourceToTarget(ruleDetailDTO, IcPolicyRuleDetailEntity.class); + icPolicyRuleDetailEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyRuleDetailEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyRuleDetailEntity.setRuleId(ruleEntity.getId()); + icPolicyRuleDetailEntity.setSort(houseRuleSort); + icPolicyRuleDetailEntity.setGroupType("house"); + icPolicyRuleDetailDao.insert(icPolicyRuleDetailEntity); + houseRuleSort++; + } + } + if (CollectionUtils.isNotEmpty(rule.getStatRuleList())) { + int statRuleSort = 1; + for (IcPolicyRuleDetailDTO ruleDetailDTO : rule.getStatRuleList()) { + IcPolicyRuleDetailEntity icPolicyRuleDetailEntity = ConvertUtils.sourceToTarget(ruleDetailDTO, IcPolicyRuleDetailEntity.class); + icPolicyRuleDetailEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyRuleDetailEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyRuleDetailEntity.setRuleId(ruleEntity.getId()); + icPolicyRuleDetailEntity.setSort(statRuleSort); + icPolicyRuleDetailEntity.setGroupType("stat"); + icPolicyRuleDetailDao.insert(icPolicyRuleDetailEntity); + statRuleSort++; + } + } + } + // 插入分类 + if (CollectionUtils.isNotEmpty(formDTO.getCategoryList())) { + for (IcPolicyCategoryDTO categoryDTO : formDTO.getCategoryList()) { + IcPolicyCategoryEntity icPolicyCategoryEntity = new IcPolicyCategoryEntity(); + icPolicyCategoryEntity.setCustomerId(formDTO.getCustomerId()); + icPolicyCategoryEntity.setIcPolicyId(icPolicyEntity.getId()); + icPolicyCategoryEntity.setCategoryCode(categoryDTO.getCategoryCode()); + icPolicyCategoryEntity.setCodePath(categoryDTO.getCodePath()); + icPolicyCategoryDao.insert(icPolicyCategoryEntity); + } + } + // 插入附件 + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())) { + int sort = 1; + for (FileCommonDTO fileCommonDTO : formDTO.getAttachmentList()) { + HeartAttachmentEntity heartAttachment = new HeartAttachmentEntity(); + heartAttachment.setCustomerId(formDTO.getCustomerId()); + heartAttachment.setBusinessId(icPolicyEntity.getId()); + heartAttachment.setAttachTo("ic_policy"); + heartAttachment.setAttachmentName(fileCommonDTO.getName()); + heartAttachment.setAttachmentFormat(fileCommonDTO.getFormat()); + heartAttachment.setAttachmentType(fileCommonDTO.getType()); + heartAttachment.setAttachmentUrl(fileCommonDTO.getUrl()); + heartAttachment.setSort(sort); + heartAttachment.setStatus(Constant.AUTO_PASSED); + heartAttachment.setDuration(fileCommonDTO.getDuration()); + heartAttachmentDao.insert(heartAttachment); + sort++; + } + } + } + + + private void checkAddFormDTO(IcPolicyFormDTO formDTO) { + List ruleList = formDTO.getRuleList(); + for (IcPolicyRuleFormDTO rule : ruleList) { + if (CollectionUtils.isEmpty(rule.getResiRuleList()) + && CollectionUtils.isEmpty(rule.getHouseRuleList()) + && CollectionUtils.isEmpty(rule.getStatRuleList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息、房屋信息、统计信息任意选择一项填写", "请填写细则明细"); + } + } + // 政策文件最多3个先不限制了吧,前端控制下 + } + + /** + * 修改政策 + * + * @param formDTO + */ + @Override + public void updatePolicy(IcPolicyFormDTO formDTO) { + // todo + } } \ No newline at end of file From 05baa8c94f8aa8dc70ddb040df752a21784379cb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 19 Jul 2022 15:09:23 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 12 ++++ .../dto/form/ServiceRecordV2ListFormDTO.java | 55 ++++++++++++++++ .../result/ServiceRecordV2ListResultDTO.java | 66 +++++++++++++++++++ .../IcCommunitySelfOrganizationConstant.java | 4 ++ .../IcServiceRecordV2Controller.java | 17 +++++ .../dao/IcCommunitySelfOrganizationDao.java | 3 + .../com/epmet/dao/IcServiceRecordV2Dao.java | 14 +++- .../com/epmet/redis/IcPartyUnitRedis.java | 33 ++++++++++ .../service/IcServiceRecordV2Service.java | 9 +++ .../impl/IcServiceRecordV2ServiceImpl.java | 40 +++++++++++ .../mapper/IcCommunitySelfOrganizationDao.xml | 7 ++ .../resources/mapper/IcServiceRecordV2Dao.xml | 58 ++++++++++------ 12 files changed, 297 insertions(+), 21 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 579f8ee9cf..97dfa853b7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -817,4 +817,16 @@ public class RedisKeys { } return rootPrefix.concat("datasync:").concat(bizType); } + + /** + * Desc: 服务组织名称 + * @param customerId + * @param serviceOrgType + * @param serviceOrgId + * @author zxc + * @date 2022/7/19 14:08 + */ + public static String getServiceOrgNameKey(String customerId,String serviceOrgType,String serviceOrgId){ + return rootPrefix.concat("serviceOrgName:").concat(serviceOrgType).concat(":").concat(customerId).concat(":").concat(serviceOrgId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java new file mode 100644 index 0000000000..675bd575b4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/19 10:10 + * @DESC + */ +@Data +public class ServiceRecordV2ListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 88592831607216246L; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 起始服务时间yyyy-MM-dd + */ + private String serviceTimeStart; + + /** + * 终止服务时间yyyy-MM-dd + */ + private String serviceTimeEnd; + + /** + * in_service服务中;completed:已完成;cancel:取消 + */ + private String serviceStatus; + + /** + * 满意度 0:不满意,1:基本满意,2:非常满意 + */ + private String satisfaction; + private String customerId; + private String userId; + + /** + * 当前工作人员所属组织ID + */ + private String orgId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java new file mode 100644 index 0000000000..d4c591a469 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2ListResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/19 10:16 + * @DESC + */ +@Data +public class ServiceRecordV2ListResultDTO implements Serializable { + + private static final long serialVersionUID = -7486208970876756573L; + + /** + * 服务ID + */ + private String serviceRecordId; + + /** + * 政策ID + */ + private String policyId; + + /** + * 服务组织类别 + */ + private String serviceOrgType; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名字 + */ + private String serviceOrgName; + + /** + * 服务名字 + */ + private String serviceName; + + /** + * 起始服务时间yyyy-MM-dd + */ + private String serviceTimeStart; + + /** + * 终止服务时间yyyy-MM-dd + */ + private String serviceTimeEnd; + + /** + * 服务状态 + */ + private String serviceStatus; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java index ffd87124bf..a94b3304b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java @@ -8,4 +8,8 @@ package com.epmet.constant; public interface IcCommunitySelfOrganizationConstant { String ORG_TYPE_AGENCY = "agency"; + + String SERVICE_ORG_TYPE_COMMUNITY_ORG = "community_org"; + String SERVICE_ORG_TYPE_IC_USER_VOLUNTEEr = "ic_user_volunteer"; + String SERVICE_ORG_TYPE_PARTY_UNIT = "party_unit"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index dc1ea6ce52..aa8b978b4c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -9,6 +11,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -67,4 +70,18 @@ public class IcServiceRecordV2Controller { return new Result(); } + /** + * Desc:【服务管理】列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/7/19 10:24 + */ + @PostMapping("list") + public Result serviceRecordV2List(@LoginUser TokenDto tokenDto, @RequestBody ServiceRecordV2ListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index 3ba576777b..e97091463e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -75,4 +75,7 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao queryCoordinateList(CategorySelfOrgFormDTO formDTO); List selectByIds(@Param("communityOrgIds") List communityOrgIds); + + String getCommunityOrgName(@Param("id") String id); + String getPartyUnitName(@Param("id") String id); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java index 340747b8a0..55ae94e6aa 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordV2Dao.java @@ -1,9 +1,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ServiceRecordV2ListFormDTO; +import com.epmet.dto.result.ServiceRecordV2ListResultDTO; import com.epmet.entity.IcServiceRecordV2Entity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 服务记录表 * @@ -12,5 +16,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcServiceRecordV2Dao extends BaseDao { - + + /** + * Desc:【服务管理】列表 + * @param formDTO + * @author zxc + * @date 2022/7/19 10:24 + */ + List serviceRecordV2List(ServiceRecordV2ListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java index 83113e7903..8ce4a285ce 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java @@ -17,7 +17,14 @@ package com.epmet.redis; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IcCommunitySelfOrganizationConstant; +import com.epmet.dao.IcCommunitySelfOrganizationDao; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,6 +38,10 @@ import org.springframework.stereotype.Component; public class IcPartyUnitRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private IcCommunitySelfOrganizationDao communitySelfOrganizationDao; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; public void delete(Object[] ids) { @@ -44,4 +55,26 @@ public class IcPartyUnitRedis { return null; } + public String getServiceOrgName(String customerId,String serviceOrgType,String serviceOrgId){ + String serviceOrgNameKey = RedisKeys.getServiceOrgNameKey(customerId, serviceOrgType, serviceOrgId); + Object o = redisUtils.get(serviceOrgNameKey); + if (null != o){ + return o.toString(); + } + String name = ""; + if (serviceOrgType.equals(IcCommunitySelfOrganizationConstant.SERVICE_ORG_TYPE_COMMUNITY_ORG)){ + name = communitySelfOrganizationDao.getCommunityOrgName(serviceOrgId); + }else if (serviceOrgType.equals(IcCommunitySelfOrganizationConstant.SERVICE_ORG_TYPE_PARTY_UNIT)){ + name = communitySelfOrganizationDao.getPartyUnitName(serviceOrgId); + }else if (serviceOrgType.equals(IcCommunitySelfOrganizationConstant.SERVICE_ORG_TYPE_IC_USER_VOLUNTEEr)){ + Result icResiUserDTO = userOpenFeignClient.getIcResiUserDTO(serviceOrgId); + if (!icResiUserDTO.success()){ + throw new EpmetException("getIcResiUserDTO method is failure"); + } + name = icResiUserDTO.getData().getName(); + } + redisUtils.set(serviceOrgNameKey,name,RedisUtils.DEFAULT_EXPIRE); + return name; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index c2065d0107..f10012c762 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.entity.IcServiceRecordV2Entity; import java.util.List; @@ -75,4 +76,12 @@ public interface IcServiceRecordV2Service extends BaseService implements IcServiceRecordV2Service { + @Autowired + private IcPartyUnitRedis partyUnitRedis; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -79,4 +94,29 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl result = new PageData<>(new ArrayList<>(), NumConstant.ZERO_L); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息+"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.serviceRecordV2List(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + if (CollectionUtils.isNotEmpty(result.getList())){ + result.getList().forEach(r -> { + r.setServiceOrgName(partyUnitRedis.getServiceOrgName(formDTO.getCustomerId(), r.getServiceOrgType(),r.getServiceOrgId())); + }); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml index fd457a3628..872caf9999 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -196,4 +196,11 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 38033e4e4a..7c8a86b911 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -3,26 +3,44 @@ - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file From f4aea85b12dafe3a1b9d87a6ba0ac849f3a82eab Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 19 Jul 2022 15:25:10 +0800 Subject: [PATCH 03/13] =?UTF-8?q?dto=E5=92=8Centity=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/HeartAttachmentDTO.java | 8 ++++---- .../main/java/com/epmet/entity/HeartAttachmentEntity.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java index 6c87b6d3d6..ff807d1da3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartAttachmentDTO.java @@ -40,22 +40,22 @@ public class HeartAttachmentDTO implements Serializable { /** * 附件名 */ - private String attachmentName; + private String name; /** * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) */ - private String attachmentFormat; + private String format; /** * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) */ - private String attachmentType; + private String type; /** * 附件地址 */ - private String attachmentUrl; + private String url; /** * 排序字段 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java index f0eb7f7fd5..c96dc8d6cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartAttachmentEntity.java @@ -36,22 +36,22 @@ public class HeartAttachmentEntity extends BaseEpmetEntity { /** * 附件名 */ - private String attachmentName; + private String name; /** * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) */ - private String attachmentFormat; + private String format; /** * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) */ - private String attachmentType; + private String type; /** * 附件地址 */ - private String attachmentUrl; + private String url; /** * 排序字段 From 084fb6ed6ec43ebb488a762ed451d2e1c65c5dd5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 15:31:24 +0800 Subject: [PATCH 04/13] commityixia --- .../epmet/controller/IcPolicyController.java | 4 +- .../com/epmet/dao/HeartAttachmentDao.java | 3 +- .../com/epmet/dao/IcPolicyCategoryDao.java | 3 +- .../java/com/epmet/dao/IcPolicyRuleDao.java | 3 +- .../com/epmet/dao/IcPolicyRuleDetailDao.java | 3 +- .../com/epmet/service/IcPolicyService.java | 8 +--- .../service/impl/IcPolicyServiceImpl.java | 39 ++++++++++--------- .../resources/mapper/HeartAttachmentDao.xml | 4 +- .../resources/mapper/IcPolicyCategoryDao.xml | 4 +- .../main/resources/mapper/IcPolicyRuleDao.xml | 4 +- .../mapper/IcPolicyRuleDetailDao.xml | 3 ++ 11 files changed, 44 insertions(+), 34 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 8b17d4d6ed..49e144a4e5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -50,7 +50,7 @@ public class IcPolicyController { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class); - icPolicyService.addPolicy(formDTO); + icPolicyService.addOrUpdatePolicy(formDTO); return new Result(); } @@ -65,7 +65,7 @@ public class IcPolicyController { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, IcPolicyFormDTO.AddUserShowGroup.class, IcPolicyFormDTO.AddUserInternalGroup.class,IcPolicyFormDTO.UpdateUserInternalGroup.class); - icPolicyService.updatePolicy(formDTO); + icPolicyService.addOrUpdatePolicy(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java index e42ae13d94..6dba23af2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartAttachmentDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface HeartAttachmentDao extends BaseDao { - + + int deleteByBusinessId(String businessId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java index 5a48211281..e81d230a1b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyCategoryDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyCategoryDao extends BaseDao { - + + int deleteByIcPolicyId(String icPolicyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java index c69ad22f47..adb211432f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyRuleDao extends BaseDao { - + + int deleteByIcPolicyId(String policyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java index c776a5a386..41147f9eae 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyRuleDetailDao.java @@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPolicyRuleDetailDao extends BaseDao { - + + int deleteByRuleId(String ruleId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index b464facd1a..6f12cfbb66 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -28,11 +28,5 @@ public interface IcPolicyService extends BaseService { * * @param formDTO */ - void addPolicy(IcPolicyFormDTO formDTO); - - /** - * 修改政策 - * @param formDTO - */ - void updatePolicy(IcPolicyFormDTO formDTO); + void addOrUpdatePolicy(IcPolicyFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 183a1d4cad..78b1a5eec7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -71,7 +71,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl - + + delete from heart_attachment where BUSINESS_ID=#{businessId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml index 58145c7134..b862cc8112 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyCategoryDao.xml @@ -17,5 +17,7 @@ - + + delete from ic_policy_category where IC_POLICY_ID=#{icPolicyId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml index 9c83835fdf..777da08654 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDao.xml @@ -17,5 +17,7 @@ - + + delete from ic_policy_rule where IC_POLICY_ID=#{policyId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml index df78f56e7e..82a78d96f5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyRuleDetailDao.xml @@ -26,5 +26,8 @@ + + delete from ic_policy_rule_detail where RULE_ID=#{ruleId} + \ No newline at end of file From 7c4a16df19db0ec8238843193de78446169d3a5b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 15:40:36 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcServiceFeedbackV2AddFormDTO.java | 96 +++++++++++++++++++ .../IcServiceFeedbackV2Controller.java | 12 ++- .../service/IcServiceFeedbackV2Service.java | 3 +- .../impl/IcServiceFeedbackV2ServiceImpl.java | 62 +++++++++++- 4 files changed, 165 insertions(+), 8 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java new file mode 100644 index 0000000000..9a82fc9872 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceFeedbackV2AddFormDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Data +public class IcServiceFeedbackV2AddFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 服务ID + */ + @NotBlank(message = "服务Id不能为空", groups = {UpdateGroup.class}) + private String serviceRecordId; + /** + * 服务目标 + */ + private String serviceGoal; + /** + * 服务效果 + */ + private String serviceEffect; + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + /** + * 服务状态[服务状态,cancel:取消,closed:已关闭,underway:进行中] + */ + private String serviceStatus; + /** + * 地址 + */ + private String address; + /** + * 地址经度 + */ + private String longitude; + /** + * 地址纬度 + */ + private String latitude; + /** + * 地址纬度 + */ + private List fileList; + + private String customerId; + private String userId; + + @Data + public static class FileDTO { + + /** + * 文件名 + */ + private String name; + /** + * url地址 + */ + private String url; + /** + * 文件类型(图片 - image、 视频 - video、 语音 - voice、 文档 - doc) + */ + private String type; + /** + * 后缀名 + */ + private String format; + /** + * 文件大小 kb + */ + private Integer size; + /** + * 语音或视频文件时长,单位秒 + */ + private Integer duration; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java index 1ecb5fec9d..01cc032b9b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceFeedbackV2Controller.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -9,6 +11,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.dto.form.IcServiceFeedbackV2AddFormDTO; import com.epmet.service.IcServiceFeedbackV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -43,10 +46,11 @@ public class IcServiceFeedbackV2Controller { @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody IcServiceFeedbackV2DTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icServiceFeedbackV2Service.save(dto); + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceFeedbackV2AddFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceFeedbackV2Service.save(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java index e1b949bc33..d9a40725bd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceFeedbackV2Service.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.dto.form.IcServiceFeedbackV2AddFormDTO; import com.epmet.entity.IcServiceFeedbackV2Entity; import java.util.List; @@ -54,7 +55,7 @@ public interface IcServiceFeedbackV2Service extends BaseService implements IcServiceFeedbackV2Service { + @Autowired + private IcServiceRecordV2Service icServiceRecordV2Service; + @Autowired + private HeartAttachmentService heartAttachmentService; + @Override public PageData page(Map params) { @@ -60,9 +79,46 @@ public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增服务反馈记录失败,未查询到服务记录"); + } + + //2.校验是否已存在服务反馈 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceFeedbackV2Entity::getServiceRecordId, formDTO.getServiceRecordId()); + List feedbackList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(feedbackList)) { + log.error(String.format("新增服务反馈记录失败,当前服务记录已存在反馈记录,服务记录Id->%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增服务反馈记录失败,当前服务记录已存在反馈记录"); + } + + //3.更新服务记录表数据状态 + recordV2Entity.setServiceStatus(formDTO.getServiceStatus()); + icServiceRecordV2Service.updateById(recordV2Entity); + + //4.新增服务反馈记录 + IcServiceFeedbackV2Entity feedback = ConvertUtils.sourceToTarget(formDTO, IcServiceFeedbackV2Entity.class); + feedback.setCustomerId(formDTO.getCustomerId()); + feedback.setServiceRecordId(formDTO.getServiceRecordId()); + baseDao.insert(feedback); + List AttachmentList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(formDTO.getFileList())) { + int sort = 0; + for (IcServiceFeedbackV2AddFormDTO.FileDTO file : formDTO.getFileList()) { + HeartAttachmentEntity attachment = ConvertUtils.sourceToTarget(file, HeartAttachmentEntity.class); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setBusinessId(feedback.getId()); + attachment.setAttachTo("ic_service_record_v2"); + attachment.setSort(sort++); + attachment.setStatus("auto_passed"); + AttachmentList.add(attachment); + } + heartAttachmentService.insertBatch(AttachmentList); + } } @Override From 72b4dc5898aa643c87697548c263a186435021b5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 15:56:01 +0800 Subject: [PATCH 06/13] commityixia --- .../main/java/com/epmet/dto/IcPolicyDTO.java | 50 +++---------------- .../dto/form/policy/IcPolicyPageFormDTO.java | 39 +++++++++++++++ .../epmet/controller/IcPolicyController.java | 19 +++++++ .../main/java/com/epmet/dao/IcPolicyDao.java | 4 ++ .../com/epmet/service/IcPolicyService.java | 10 ++++ .../service/impl/IcPolicyServiceImpl.java | 24 +++++++++ .../src/main/resources/mapper/IcPolicyDao.xml | 29 +++++++++++ 7 files changed, 131 insertions(+), 44 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index dfd47f23bc..2037ce05c7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -16,26 +18,13 @@ public class IcPolicyDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 主键 - */ - private String id; - - /** - * 客户id - */ - private String customerId; + private String policyId; /** * 政策创建人,所属组织id */ private String orgId; - /** - * AGENCY_ID的全路径,含agency_id - */ - private String orgIdPath; - /** * 政策级别,0市级;1区级;2街道级 */ @@ -44,11 +33,13 @@ public class IcPolicyDTO implements Serializable { /** * 生效起止日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date startDate; /** * 截止日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date endDate; /** @@ -61,34 +52,5 @@ public class IcPolicyDTO implements Serializable { */ private String content; - /** - * 删除标识 0.未删除 1.已删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java new file mode 100644 index 0000000000..c1b3591b7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form.policy; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/7/19 15:36 + */ +@Data +public class IcPolicyPageFormDTO extends PageFormDTO implements Serializable { + /** + * 客户id + */ + private String customerId; + private String staffId; + + /** + * 政策标题 + */ + private String title; + + /** + * 政策内容 + */ + private String content; + + /** + * 是否过期;1:已过期;0:未过期 + */ + private String expiredFlag; + + private String agencyId; + +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 49e144a4e5..5211d232c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -1,11 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.service.IcPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -69,5 +73,20 @@ public class IcPolicyController { return new Result(); } + /** + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("list") + public Result> policyList(@LoginUser TokenDto tokenDto, @RequestBody IcPolicyPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class,PageFormDTO.AddUserShowGroup.class); + PageData page = icPolicyService.policyList(formDTO); + return new Result>().ok(page); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java index 2da10a4941..d2e34e23f4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java @@ -1,7 +1,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -24,4 +26,6 @@ public interface IcPolicyDao extends BaseDao { * @return */ List selectItemList(@Param("customerId") String customerId, @Param("groupType") String groupType); + + List policyList(IcPolicyPageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 6f12cfbb66..63e0d0636b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -1,8 +1,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; import java.util.List; @@ -29,4 +32,11 @@ public interface IcPolicyService extends BaseService { * @param formDTO */ void addOrUpdatePolicy(IcPolicyFormDTO formDTO); + + /** + * 列表查询 + * @param formDTO + * @return + */ + PageData policyList(IcPolicyPageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 78b1a5eec7..93d04fe879 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -7,16 +7,21 @@ import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.*; import com.epmet.dto.IcPolicyCategoryDTO; +import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; +import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; import com.epmet.entity.*; import com.epmet.service.IcPolicyService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -190,4 +195,23 @@ public class IcPolicyServiceImpl extends BaseServiceImpl policyList(IcPolicyPageFormDTO formDTO) { + // 设置所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常"); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.policyList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index f02037127c..6727f2cb81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -42,4 +42,33 @@ and i.GROUP_TYPE = #{groupType} order by i.SORT asc + + \ No newline at end of file From 37f8ed1b591a04a9998bfa09a146d2f1cef112f6 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 16:36:59 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E3=80=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcServiceRecordV2AddEditFormDTO.java | 91 +++++++++++++++++++ .../IcServiceRecordV2Controller.java | 15 +-- .../service/IcServiceRecordV2Service.java | 5 +- .../impl/IcServiceRecordServiceImpl.java | 2 +- .../impl/IcServiceRecordV2ServiceImpl.java | 80 +++++++++++++++- 5 files changed, 178 insertions(+), 15 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java new file mode 100644 index 0000000000..615e9b7a20 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java @@ -0,0 +1,91 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + + +/** + * 服务记录反馈表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-18 + */ +@Data +public class IcServiceRecordV2AddEditFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务Id + */ + @NotBlank(message = "服务Id不能为空", groups = {UpdateGroup.class}) + private String serviceRecordId; + /** + * 服务名称 + */ + @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) + private String serviceName; + /** + * 服务组织类型 社区自组织:community_org, 志愿者:ic_user_volunteer, 联建单位:party_unit + */ + @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) + private String serviceOrgType; + /** + * 服务组织Id + */ + @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) + private String serviceOrgId; + /** + * 服务范围集合 + */ + private List objList; + /** + * 政策依据Id + */ + private Integer policyId; + /** + * 经办人姓名 + */ + private String principalName; + /** + * 联系方式 + */ + private String principalContact; + /** + * 起始服务时间 + */ + @NotNull(message = "起始服务时间不能为空", groups = {AddGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd") + private String serviceTimeStart; + /** + * 终止服务时间 + */ + @NotNull(message = "终止服务时间不能为空", groups = {AddGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd") + private String serviceTimeEnd; + /** + * 备注信息 + */ + private String remark; + /** + * 反馈记录数据 + */ + private IcServiceFeedbackV2AddFormDTO feedback; + + private String customerId; + private String userId; + + @Data + public static class ObjList { + private String objectType; + private String objectId; + private String objectName; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index aa8b978b4c..538bee258d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -7,10 +7,10 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; @@ -46,16 +46,17 @@ public class IcServiceRecordV2Controller { @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody IcServiceRecordV2DTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icServiceRecordV2Service.save(dto); + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceRecordV2AddEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceRecordV2Service.save(formDTO); return new Result(); } @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody IcServiceRecordV2DTO dto){ + public Result update(@RequestBody IcServiceRecordV2AddEditFormDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); icServiceRecordV2Service.update(dto); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index f10012c762..a88b4f1a13 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; import com.epmet.entity.IcServiceRecordV2Entity; @@ -55,7 +56,7 @@ public interface IcServiceRecordV2Service extends BaseService implements IcServiceRecordV2Service { @Autowired private IcPartyUnitRedis partyUnitRedis; + @Autowired + private IcServiceScopeV2Service icServiceScopeV2Service; + @Autowired + private IcServiceRecordServiceImpl icServiceRecordServiceImpl; + @Autowired + private IcServiceFeedbackV2Service icServiceFeedbackV2Service; + @Autowired + private HeartAttachmentService heartAttachmentService; + @Override public PageData page(Map params) { @@ -75,15 +93,67 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeList = new ArrayList<>(); + formDTO.getObjList().stream().forEach(s -> { + String[] scopeObjectIdPathAndName = icServiceRecordServiceImpl.getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); + IcServiceScopeV2Entity scope = new IcServiceScopeV2Entity(); + scope.setCustomerId(formDTO.getCustomerId()); + scope.setServiceRecordId(entity.getId()); + scope.setObjectType(s.getObjectType()); + scope.setObjectId(s.getObjectId()); + scope.setObjectIdPath(scopeObjectIdPathAndName[0]); + scope.setObjectName(scopeObjectIdPathAndName[1]); + scopeList.add(scope); + }); + + //4.新增服务反馈数据feedback + if(null != formDTO.getFeedback()){ + IcServiceFeedbackV2Entity feedback = ConvertUtils.sourceToTarget(formDTO.getFeedback(), IcServiceFeedbackV2Entity.class); + feedback.setCustomerId(formDTO.getCustomerId()); + feedback.setServiceRecordId(entity.getId()); + icServiceFeedbackV2Service.insert(feedback); + // 反馈附件列表 + if (CollectionUtils.isNotEmpty(formDTO.getFeedback().getFileList())) { + List attachmentList = new ArrayList<>(); + int[] sort = {0}; + formDTO.getFeedback().getFileList().forEach(f->{ + HeartAttachmentEntity attachment = ConvertUtils.sourceToTarget(f, HeartAttachmentEntity.class); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setBusinessId(feedback.getId()); + attachment.setAttachTo("ic_service_record_v2"); + attachment.setSort(sort[0]); + attachment.setStatus("auto_passed"); + sort[0]++; + attachmentList.add(attachment); + }); + heartAttachmentService.insertBatch(attachmentList); + } + } + } @Override @Transactional(rollbackFor = Exception.class) - public void update(IcServiceRecordV2DTO dto) { - IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(dto, IcServiceRecordV2Entity.class); + public void update(IcServiceRecordV2AddEditFormDTO formDTO) { + //1.校验数据是否存在 + if (null == baseDao.selectById(formDTO.getServiceRecordId())) { + log.error(String.format("修改服务记录失败,未查询到服务记录,服务记录Id->%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "修改服务记录失败,未查询到服务记录"); + } + IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceRecordV2Entity.class); + entity.setId(formDTO.getServiceRecordId()); updateById(entity); } From bbfe442096b9b4e5ea1335fa6b7bb7d8d6209a9b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 16:43:18 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcServiceRecordV2Controller.java | 9 +++++++++ .../com/epmet/service/IcServiceRecordV2Service.java | 2 ++ .../service/impl/IcServiceRecordV2ServiceImpl.java | 12 ++++++++++++ 3 files changed, 23 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index 538bee258d..92a3966962 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -63,6 +63,15 @@ public class IcServiceRecordV2Controller { return new Result(); } + @NoRepeatSubmit + @PostMapping("cancel") + public Result cancel(@RequestBody IcServiceRecordV2AddEditFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceRecordV2Service.cancel(dto); + return new Result(); + } + @PostMapping("delete") public Result delete(@RequestBody String[] ids){ //效验数据 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index a88b4f1a13..6d7860ea1c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -85,4 +85,6 @@ public interface IcServiceRecordV2Service extends BaseService%s", formDTO.getServiceRecordId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消服务记录失败,未查询到服务记录"); + } + entity.setServiceStatus("cancel"); + baseDao.updateById(entity); + } + @Override @Transactional(rollbackFor = Exception.class) public void delete(String[] ids) { From 63b31e8618c57aeb43dfac5a11f9cd81d9202ed2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 16:44:17 +0800 Subject: [PATCH 09/13] 140 --- .../commons/tools/enums/DictTypeEnum.java | 1 + .../main/java/com/epmet/dto/IcPolicyDTO.java | 12 +++ .../java/com/epmet/dto/IcPolicyRuleDTO.java | 10 ++- .../dto/form/policy/IcPolicyRuleFormDTO.java | 5 ++ .../epmet/controller/IcPolicyController.java | 28 ++++++- .../com/epmet/service/IcPolicyService.java | 5 ++ .../service/impl/IcPolicyServiceImpl.java | 81 ++++++++++++++++++- 7 files changed, 139 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index f552db723a..e900f79875 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -27,6 +27,7 @@ public enum DictTypeEnum { IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), IC_SERVICE_TYPE("ic_service_type","服务类别",20), IC_DANGER_TYPE("ic_danger_type","危化品种类",24), + POLICY_LEVEL("policy_level","政策级别",25), ; private final String code; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index 2037ce05c7..e3822ddf27 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -1,10 +1,13 @@ package com.epmet.dto; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -30,6 +33,11 @@ public class IcPolicyDTO implements Serializable { */ private String policyLevel; + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevelName; + /** * 生效起止日期 */ @@ -52,5 +60,9 @@ public class IcPolicyDTO implements Serializable { */ private String content; + //以下三个详情接口返回 + private List categoryList; + private List attachmentList; + private List ruleList; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java index be1c02628d..112474a76f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyRuleDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,31 +46,37 @@ public class IcPolicyRuleDTO implements Serializable { /** * 删除标记 0:未删除,1:已删除 */ + @JsonIgnore private String delFlag; /** * 乐观锁 */ + @JsonIgnore private Integer revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** * 创建时间 */ + @JsonIgnore private Date createdTime; /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java index 99ed14eb4e..e35df132dd 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleFormDTO.java @@ -33,5 +33,10 @@ public class IcPolicyRuleFormDTO implements Serializable { * 统计信息 */ private List statRuleList; + + /** + * ruleId + */ + private String id; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java index 5211d232c2..44432ab0ee 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.service.IcPolicyService; @@ -74,7 +75,7 @@ public class IcPolicyController { } /** - * + * 政策列表 * @param tokenDto * @param formDTO * @return @@ -88,5 +89,30 @@ public class IcPolicyController { return new Result>().ok(page); } + /** + * 细则列表 + * @param customerId + * @param policyId + * @return + */ + @PostMapping("rulelist/{policyId}") + public Result> ruleList(@RequestHeader("customerId") String customerId,@PathVariable("policyId") String policyId) { + return new Result>().ok(icPolicyService.ruleList(customerId,policyId)); + } + + /** + * 删除政策 + * @param policyId + * @return + */ + @PostMapping("delete/{policyId}") + public Result deletePolicy(@PathVariable("policyId") String policyId) { + icPolicyService.deleteById(policyId); + return new Result<>(); + } + @PostMapping("detail/{policyId}") + public Result policyDetail(@LoginUser TokenDto tokenDto,@PathVariable("policyId") String policyId) { + return new Result().ok(icPolicyService.policyDetail(tokenDto.getCustomerId(),policyId)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java index 63e0d0636b..60564097ec 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.entity.IcPolicyEntity; @@ -39,4 +40,8 @@ public interface IcPolicyService extends BaseService { * @return */ PageData policyList(IcPolicyPageFormDTO formDTO); + + List ruleList(String customerId,String policyId); + + IcPolicyDTO policyDetail(String customerId,String policyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 93d04fe879..64648b3358 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -1,35 +1,43 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; import com.epmet.dto.IcPolicyCategoryDTO; import com.epmet.dto.IcPolicyDTO; import com.epmet.dto.IcPolicyItemResultDTO; +import com.epmet.dto.IcPolicyRuleDTO; import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPolicyService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 政策表 @@ -48,7 +56,8 @@ public class IcPolicyServiceImpl extends BaseServiceImpl list = baseDao.policyList(formDTO); + if (CollectionUtils.isNotEmpty(list)) { + for (IcPolicyDTO icPolicyDTO : list) { + // 查询字典表 + Result> levelRes = adminOpenFeignClient.dictMap(DictTypeEnum.POLICY_LEVEL.getCode()); + Map levelMap = levelRes.success() && MapUtils.isNotEmpty(levelRes.getData()) ? levelRes.getData() : new HashMap<>(); + icPolicyDTO.setPolicyLevelName(MapUtils.isNotEmpty(levelMap) && levelMap.containsKey(icPolicyDTO.getPolicyLevel()) ? levelMap.get(icPolicyDTO.getPolicyLevel()) : StrConstant.EPMETY_STR); + } + } PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } + + @Override + public List ruleList(String customerId, String policyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPolicyRuleEntity::getCustomerId, customerId) + .eq(IcPolicyRuleEntity::getIcPolicyId, policyId) + .orderByAsc(IcPolicyRuleEntity::getSort); + List list = icPolicyRuleDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, IcPolicyRuleDTO.class); + } + + @Override + public IcPolicyDTO policyDetail(String customerId, String policyId) { + IcPolicyEntity policyEntity = baseDao.selectById(policyId); + IcPolicyDTO icPolicyDTO = ConvertUtils.sourceToTarget(policyEntity, IcPolicyDTO.class); + if (null != icPolicyDTO) { + icPolicyDTO.setPolicyId(policyId); + + LambdaQueryWrapper attWrapper = new LambdaQueryWrapper<>(); + attWrapper.eq(HeartAttachmentEntity::getBusinessId, policyId) + .orderByAsc(HeartAttachmentEntity::getSort); + List attList = heartAttachmentDao.selectList(attWrapper); + icPolicyDTO.setAttachmentList(CollectionUtils.isNotEmpty(attList) ? ConvertUtils.sourceToTarget(attList, FileCommonDTO.class) : new ArrayList<>()); + + LambdaQueryWrapper cateWrapper = new LambdaQueryWrapper<>(); + cateWrapper.eq(IcPolicyCategoryEntity::getIcPolicyId, policyId); + List cateList = icPolicyCategoryDao.selectList(cateWrapper); + icPolicyDTO.setCategoryList(CollectionUtils.isNotEmpty(cateList) ? ConvertUtils.sourceToTarget(cateList, IcPolicyCategoryDTO.class) : new ArrayList<>()); + + List ruleDTOList = ruleList(customerId, policyId); + List ruleList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(ruleDTOList)) { + ruleList = ConvertUtils.sourceToTarget(ruleDTOList, IcPolicyRuleFormDTO.class); + for (IcPolicyRuleFormDTO rule : ruleList) { + LambdaQueryWrapper ruleDetailWrapper = new LambdaQueryWrapper<>(); + ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + .eq(IcPolicyRuleDetailEntity::getGroupType, "resi") + .orderByAsc(IcPolicyRuleDetailEntity::getSort); + List resiList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List resiRuleList = CollectionUtils.isNotEmpty(resiList) ? ConvertUtils.sourceToTarget(resiList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); + rule.setResiRuleList(resiRuleList); + + ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + .eq(IcPolicyRuleDetailEntity::getGroupType, "house") + .orderByAsc(IcPolicyRuleDetailEntity::getSort); + List houseList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List houseRuleList = CollectionUtils.isNotEmpty(houseList) ? ConvertUtils.sourceToTarget(houseList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); + rule.setHouseRuleList(houseRuleList); + + ruleDetailWrapper.eq(IcPolicyRuleDetailEntity::getRuleId, rule.getId()) + .eq(IcPolicyRuleDetailEntity::getGroupType, "stat") + .orderByAsc(IcPolicyRuleDetailEntity::getSort); + List statList = icPolicyRuleDetailDao.selectList(ruleDetailWrapper); + List statRuleList = CollectionUtils.isNotEmpty(statList) ? ConvertUtils.sourceToTarget(statList, IcPolicyRuleDetailDTO.class) : new ArrayList<>(); + ; + rule.setStatRuleList(statRuleList); + } + } + icPolicyDTO.setRuleList(ruleList); + } + return icPolicyDTO; + } } \ No newline at end of file From e3e2c148cf591ab0864b69d2fc9a187b4a820402 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 17:05:39 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=9B=BD=E4=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcPolicyDTO.java | 5 +++++ .../src/main/resources/mapper/IcPolicyDao.xml | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index e3822ddf27..8c7fc33767 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -60,6 +60,11 @@ public class IcPolicyDTO implements Serializable { */ private String content; + /** + * 是否过期;1:已过期;0:未过期 + */ + private String expiredFlag; + //以下三个详情接口返回 private List categoryList; private List attachmentList; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index 6727f2cb81..9ab37dc06a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -51,7 +51,12 @@ ip.START_DATE, ip.END_DATE, ip.TITLE, - ip.CONTENT + ip.CONTENT, + ( + case when ip.END_DATE < now() then '1' + when ip.END_DATE >= now() then '0' + end + )as expiredFlag FROM ic_policy ip WHERE @@ -64,11 +69,12 @@ and ip.CONTENT like concat('%',#{content},'%') - + and ip.END_DATE < now() - + and ip.END_DATE >= now() - + order by ip.CREATED_TIME desc + \ No newline at end of file From 60cf5478e37654b75a339d4f125d2fc740f9f709 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 19 Jul 2022 17:30:19 +0800 Subject: [PATCH 11/13] detail --- .../com/epmet/dto/IcServiceFeedbackV2DTO.java | 3 + .../form/ServiceRecordV2DetailFormDTO.java | 24 +++++++ .../ServiceRecordV2DetailResultDTO.java | 71 +++++++++++++++++++ .../IcServiceRecordV2Controller.java | 14 ++++ .../com/epmet/dao/IcServiceFeedbackV2Dao.java | 6 +- .../java/com/epmet/dao/IcServiceScopeDao.java | 3 + .../service/IcServiceRecordV2Service.java | 10 +++ .../impl/IcServiceRecordV2ServiceImpl.java | 38 +++++++++- .../mapper/IcServiceFeedbackV2Dao.xml | 37 ++++++++++ .../resources/mapper/IcServiceScopeDao.xml | 11 +++ 10 files changed, 213 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java index 54e7469c7c..b0a39730f3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceFeedbackV2DTO.java @@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -97,4 +98,6 @@ public class IcServiceFeedbackV2DTO implements Serializable { */ private Integer delFlag; + private List fileList; + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java new file mode 100644 index 0000000000..7b783d0628 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2DetailFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/19 16:34 + * @DESC + */ +@Data +public class ServiceRecordV2DetailFormDTO implements Serializable { + + private static final long serialVersionUID = 476430342315532314L; + + public interface ServiceRecordV2DetailForm{} + + @NotBlank(message = "serviceRecordId不能为空",groups = ServiceRecordV2DetailForm.class) + private String serviceRecordId; + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java new file mode 100644 index 0000000000..7043ddfc0a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcServiceFeedbackV2DTO; +import com.epmet.dto.IcServiceScopeV2DTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/7/19 16:34 + * @DESC + */ +@Data +public class ServiceRecordV2DetailResultDTO implements Serializable { + + private static final long serialVersionUID = 3385425608362604836L; + + private String serviceRecordId; + + private String serviceName; + + /** + * 服务组织类型 + 社区自组织:community_org, + 志愿者:ic_user_volunteer, + 联建单位:party_unit + */ + private String serviceOrgType; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成;cancel:取消 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + private List gridIdList; + + private IcServiceFeedbackV2DTO feedback; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index 92a3966962..8698c3d08c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -7,11 +7,14 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2DetailFormDTO; import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; +import com.epmet.dto.result.ServiceRecordV2DetailResultDTO; import com.epmet.service.IcServiceRecordV2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -94,4 +97,15 @@ public class IcServiceRecordV2Controller { return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); } + /** + * Desc: 详情 + * @param formDTO + * @author zxc + * @date 2022/7/19 16:37 + */ + @PostMapping("detail") + public Result serviceRecordV2Detail(@RequestBody ServiceRecordV2DetailFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ServiceRecordV2DetailFormDTO.ServiceRecordV2DetailForm.class); + return new Result().ok(icServiceRecordV2Service.serviceRecordV2Detail(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java index a3d4eb7831..43a90f357d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackV2Dao.java @@ -1,8 +1,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcServiceFeedbackV2DTO; import com.epmet.entity.IcServiceFeedbackV2Entity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 服务记录反馈表 @@ -12,5 +14,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcServiceFeedbackV2Dao extends BaseDao { - + + IcServiceFeedbackV2DTO getFeedbackV2(@Param("serviceRecordId") String serviceRecordId); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java index c2fc96cfd9..6b4123134c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java @@ -1,6 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcServiceScopeV2DTO; import com.epmet.dto.result.IcServiceScopeDTO; import com.epmet.entity.IcServiceScopeEntity; import org.apache.ibatis.annotations.Mapper; @@ -20,4 +21,6 @@ public interface IcServiceScopeDao extends BaseDao { int update(@Param("serviceId") String serviceId, @Param("userId") String userId); List selectList(String serviceRecordId); + + List selectListV2(@Param("serviceRecordId") String serviceRecordId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java index 6d7860ea1c..4682517a00 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordV2Service.java @@ -3,8 +3,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceRecordV2DTO; +import com.epmet.dto.form.ServiceRecordV2DetailFormDTO; import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO; import com.epmet.dto.form.ServiceRecordV2ListFormDTO; +import com.epmet.dto.result.ServiceRecordV2DetailResultDTO; import com.epmet.entity.IcServiceRecordV2Entity; import java.util.List; @@ -86,5 +88,13 @@ public interface IcServiceRecordV2Service extends BaseService page(Map params) { @@ -201,4 +212,25 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeV2DTOS = serviceScopeDao.selectListV2(formDTO.getServiceRecordId()); + result.setGridIdList(scopeV2DTOS); + IcServiceFeedbackV2DTO feedbackV2 = serviceFeedbackV2Dao.getFeedbackV2(formDTO.getServiceRecordId()); + result.setFeedback(feedbackV2); + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml index 82d136814b..5443852817 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackV2Dao.xml @@ -22,5 +22,42 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml index 026d8c6ac4..0cb231d71c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml @@ -39,4 +39,15 @@ s.DEL_FLAG = '0' AND s.SERVICE_RECORD_ID = #{serviceRecordId} + \ No newline at end of file From fda99cf1ecb1df3daa025799ac6743fef0bf237e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 19 Jul 2022 17:35:50 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcServiceFeedbackV2ServiceImpl.java | 4 ++++ .../impl/IcServiceRecordV2ServiceImpl.java | 19 +++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java index 70525915ac..d1bdf326cc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceFeedbackV2ServiceImpl.java @@ -86,6 +86,10 @@ public class IcServiceFeedbackV2ServiceImpl extends BaseServiceImpl%s", formDTO.getServiceRecordId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增服务反馈记录失败,未查询到服务记录"); } + if (!"in_service".equals(recordV2Entity.getServiceStatus())) { + String msg = "服务状态不是进行中的,不允许反馈"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } //2.校验是否已存在服务反馈 LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java index 9071a364bc..f817137bde 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -105,17 +106,12 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeList = new ArrayList<>(); formDTO.getObjList().stream().forEach(s -> { String[] scopeObjectIdPathAndName = icServiceRecordServiceImpl.getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); @@ -129,8 +125,9 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl Date: Tue, 19 Jul 2022 17:40:26 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java | 4 ++-- .../com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java index 7043ddfc0a..536e292c70 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java @@ -48,12 +48,12 @@ public class ServiceRecordV2DetailResultDTO implements Serializable { /** * 服务时间 */ - private Date serviceTimeStart; + private String serviceTimeStart; /** * 服务截止时间 */ - private Date serviceTimeEnd; + private String serviceTimeEnd; /** * in_service服务中;completed:已完成;cancel:取消 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java index f817137bde..bf5997a1b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.IcServiceFeedbackV2Dao; import com.epmet.dao.IcServiceRecordV2Dao; import com.epmet.dao.IcServiceScopeDao; @@ -224,6 +225,8 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl scopeV2DTOS = serviceScopeDao.selectListV2(formDTO.getServiceRecordId()); result.setGridIdList(scopeV2DTOS);