diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java index e739baca1d..822b444390 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ResiByPolicyInfoResultDTO.java @@ -1,5 +1,8 @@ package com.epmet.dataaggre.dto.epmetuser.result; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -11,16 +14,33 @@ import java.util.Date; @AllArgsConstructor public class ResiByPolicyInfoResultDTO { + @ExcelIgnore private String icResiUserId; + + @ExcelProperty(value = "姓名") + @ColumnWidth(10) private String name; + + @ExcelProperty("手机号") + @ColumnWidth(20) private String mobile; + + @ExcelProperty("身份证号") + @ColumnWidth(30) private String idCard; /** * 小区全名,包含小区前面的属性,比如网格等 */ + @ExcelIgnore private String gridId; + @ExcelIgnore private String neighborhoodId; + @ExcelProperty("小区名称") + @ColumnWidth(30) private String neighborHoodName; + @ExcelProperty("年龄") + @ColumnWidth(10) private Integer age; - private Date birthday; + @ExcelIgnore + private String birthday; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java index 1216c2b193..63d686260c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -114,13 +114,13 @@ public class IcUserController implements ResultDataResolver { * 导出政策查找到的居民 * @param input */ - @PostMapping("exportByPolicy") + @PostMapping("exportByPolicyRules") public void exportResisByPolicy(@RequestBody ResisByPolicyRulesFormDTO input, HttpServletResponse response) { try { icResiService.exportResisByPolicy( input.getOrgId(), input.getOrgType(), input.getNeighborHoodId(), input.getBuildingId(), input.getUnitId(), - input.getHouseId(), input.getIdCard(), input.getName(), input.getPageNo(), input.getPageSize(), - input.getRuleId(), input.getRuleList().getResiRuleList(), input.getRuleList().getHouseRuleList(), input.getRuleList().getStatRuleList(), response); + input.getHouseId(), input.getIdCard(), input.getName(), input.getRuleId(), input.getRuleList().getResiRuleList(), + input.getRuleList().getHouseRuleList(), input.getRuleList().getStatRuleList(), response); } catch (IOException e) { throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "导出Excel文件失败", "导出Excel文件失败"); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java index f160f4a8f3..a77e94ceb7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/ResiService.java @@ -39,12 +39,10 @@ public interface ResiService { * @param houseId * @param idCard * @param name - * @param pageNo - * @param pageSize * @param ruleId */ void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, - String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + String houseId, String idCard, String name, String ruleId, List resiRule, List houseRule, List statRule, diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java index d661afd960..0df05a3831 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -12,6 +13,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; @@ -41,6 +43,8 @@ import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalUnit; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; @Service @@ -58,6 +62,8 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; + public static final Pattern REG_DATE = Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})"); + @Override public PageData listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, Integer pageNo, Integer pageSize, @@ -92,6 +98,11 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民 int housePageNo = 1; int total = 0; + + // 只能手动分页了 + int start = (pageNo - 1) * pageSize; + int end = pageNo * pageSize; // 不包含 + do { // 拿到房屋id列表,去查询居民列表 List houseIds = govOrgService.listHouseIdsByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, @@ -102,30 +113,32 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { break; } + // 查询居民数量 + Integer count = epmetUserService.getTotalByPolicyRules( + customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, resiRule, houseIds); + + total += count; + // 查询居民,满了20个,不再查询数据,只查询数量 - if (resultResis.size() < pageSize) { + if (resultResis.size() < end) { List resis = epmetUserService.listByPolicyRules( customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); + houseId, idCard, name, 1, end, resiRule, houseIds); resultResis.addAll(resis); } - // 查询数量 - Integer count = epmetUserService.getTotalByPolicyRules( - customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, resiRule, houseIds); - - total += count; - housePageNo ++; } while (true); - // 够了20个,那就截取前20个,否则直接返回 - if (resultResis.size() > 20) { - resultResis = resultResis.subList(0, 20); + // 查出来所有的数据都没够到这一页的起始条数,返回空 + if (resultResis.size() < start) { + return new PageData<>(new ArrayList<>(), total); } + resultResis = resultResis.subList(start, Math.min(end, resultResis.size())); + // 补充额外信息 fillResisExtraInfoForPolicy(resultResis); return new PageData<>(resultResis, total); @@ -137,13 +150,15 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { */ private void specificRuleConvert(List resiRule) { // 使用年龄计算出生日期 - resiRule.stream().forEach((r) -> { - if ("BIRTHDAY".equals(r.getColKey())) { - LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS); - r.setQueryType(revertQueryType(r.getQueryType())); - r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); - } - }); + if (resiRule != null) { + resiRule.stream().forEach((r) -> { + if ("BIRTHDAY".equals(r.getColKey())) { + LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS); + r.setQueryType(revertQueryType(r.getQueryType())); + r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + } + }); + } } /** @@ -203,19 +218,25 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { if (r.getBirthday() != null) { Integer age = null; try { - LocalDate birthdayLocalDate = LocalDateTime.ofInstant(r.getBirthday().toInstant(), ZoneId.systemDefault()).toLocalDate(); - age = Period.between(birthdayLocalDate, LocalDate.now()).getYears(); + Matcher matcher = REG_DATE.matcher(r.getBirthday()); + if (matcher.matches()) { + String year = matcher.group(1); + String month = matcher.group(2); + String day = matcher.group(3); + LocalDate birthdayLocalDate = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); + age = Period.between(birthdayLocalDate, LocalDate.now()).getYears(); + r.setAge(age); + } } catch (DateTimeException e) { - throw new EpmetException("居民生日计算错误"); + logger.error(r.getIcResiUserId() + "居民生日计算错误"); } - r.setAge(age); } }); } @Override public void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, - String houseId, String idCard, String name, Integer pageNo, Integer pageSize, + String houseId, String idCard, String name, String ruleId, List resiRule, List houseRule, List statRule, @@ -234,24 +255,34 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class); } - ServletOutputStream ostream = response.getOutputStream(); - ExcelWriterSheetBuilder sheetBuilder = EasyExcel.write(ostream, ResisByPolicyExcel.class).sheet("居民列表"); - - // 循环填充数据 - do { - PageData resis = this.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, - houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); - List list = resis.getList(); - List excelDatas = ConvertUtils.sourceToTarget(list, ResisByPolicyExcel.class); - if (CollectionUtils.isEmpty(excelDatas)) { - break; - } - //sheetBuilder.write(excelDatas); - } while (true); - - + // 模板导出 + ExcelWriter writer = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("政策人员预览信息导出.xlsx", response)) + //.withTemplate(inputStream) + .build(); + + WriteSheet writeSheet = EasyExcel.writerSheet("政策人员列表") + .head(ResiByPolicyInfoResultDTO.class) + .build(); + + Integer pageSize = 500; + Integer pageNo = 1; + + try { + do { + PageData resis = this.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, + houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); + List list = resis.getList(); + List excelDatas = ConvertUtils.sourceToTarget(list, ResisByPolicyExcel.class); + if (CollectionUtils.isEmpty(excelDatas)) { + break; + } - System.out.println(666); + writer.write(resis.getList(), writeSheet); + pageNo++; + } while (true); + } finally { + writer.finish(); + } } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index 6c8ef4c9a1..adcb55f269 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -141,18 +141,22 @@ ic_resi_user.`VILLAGE_ID` as neighborhoodId, ic_resi_user.`BIRTHDAY` from ic_resi_user - - inner join #{rule.colTable} - + + + inner join ${rule.colTable} + + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java index d86138657e..be41f030b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -109,4 +110,6 @@ public class IcServiceRecordV2DTO implements Serializable { */ private String policyId; + private String serviceCategoryKey; + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java index fff02eb997..0de6bc737f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java @@ -37,6 +37,9 @@ public class IcServiceRecordV2AddEditFormDTO implements Serializable { */ @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) private String serviceOrgType; + + @NotBlank(message = "serviceCategoryKey不能为空", groups = {AddGroup.class}) + private String serviceCategoryKey; /** * 服务组织Id */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java index 675bd575b4..a9eea1aa2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -15,11 +16,16 @@ public class ServiceRecordV2ListFormDTO extends PageFormDTO implements Serializa private static final long serialVersionUID = 88592831607216246L; + public interface ServiceRecordV2ListForm{} + /** * 服务名称 */ private String serviceName; + @NotBlank(message = "serviceCategoryKey不能为空",groups = ServiceRecordV2ListForm.class) + private String serviceCategoryKey; + /** * 服务组织ID */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java index 3ebd110fad..2e1f6896a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyFormDTO.java @@ -83,7 +83,7 @@ public class IcPolicyFormDTO implements Serializable { /** * 政策内容 */ - @NotBlank(message = "政策内容不能为空", groups = AddUserShowGroup.class) + // @NotBlank(message = "政策内容不能为空", groups = AddUserShowGroup.class) @Length(max = 2000, groups = AddUserShowGroup.class, message = "政策内容最多输入2000字") private String content; @@ -95,5 +95,7 @@ public class IcPolicyFormDTO implements Serializable { @Valid @NotEmpty(message = "政策细则不能为空",groups =AddUserShowGroup.class ) private List ruleList; + + private String agencyId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index f451fafc81..9449689fc2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -92,6 +92,7 @@ public class IcServiceRecordV2Controller { */ @PostMapping("list") public Result serviceRecordV2List(@LoginUser TokenDto tokenDto, @RequestBody ServiceRecordV2ListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceRecordV2ListFormDTO.ServiceRecordV2ListForm.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java index e18eda964e..7f32333f2e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java @@ -79,4 +79,6 @@ public class IcServiceRecordV2Entity extends BaseEpmetEntity { */ private String policyId; + private String serviceCategoryKey; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java index 194b9561b2..424af6e5ae 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java @@ -13,7 +13,6 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.*; @@ -27,7 +26,6 @@ import com.epmet.dto.form.policy.IcPolicyFormDTO; import com.epmet.dto.form.policy.IcPolicyPageFormDTO; import com.epmet.dto.form.policy.IcPolicyRuleDetailDTO; import com.epmet.dto.form.policy.IcPolicyRuleFormDTO; -import com.epmet.dto.result.resi.ResiByPolicyInfoResultDTO; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPolicyService; @@ -98,13 +96,14 @@ public class IcPolicyServiceImpl extends BaseServiceImpl policyEntityLambdaQueryWrapper=new LambdaQueryWrapper<>(); + policyEntityLambdaQueryWrapper.eq(IcPolicyEntity::getTitle,formDTO.getTitle()) + .eq(IcPolicyEntity::getOrgId,formDTO.getAgencyId()); + policyEntityLambdaQueryWrapper.ne(StringUtils.isNotBlank(formDTO.getPolicyId()),IcPolicyEntity::getId,formDTO.getPolicyId()); + int count=baseDao.selectCount(policyEntityLambdaQueryWrapper); + if(count>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"当前组织内已经存在相同标题的政策","当前组织内已经存在相同标题的政策"); + } List ruleList = formDTO.getRuleList(); for (IcPolicyRuleFormDTO rule : ruleList) { if (CollectionUtils.isEmpty(rule.getResiRuleList()) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql index 86d1472abb..ebf16c860c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.24__ic_policy.sql @@ -99,4 +99,14 @@ CREATE TABLE `ic_policy_item` ( `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='政策找人规则组件表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='政策找人规则组件表'; + + + +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', 'house', '房屋类型', 'HOUSE_TYPE', 'select', 'ic_house', 1, '从字典表获取', 'remote', '/sys/dict/data/dictlist', '{\"dictType\":\"house_type\"}', '0', 0, 'APP_USER', '2022-07-19 10:01:39', 'APP_USER', '2022-07-19 10:01:42'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', 'house', '房屋用途', 'PURPOSE', 'select', 'ic_house', 2, '从字典表获取', 'remote', '/sys/dict/data/dictlist', '{\"dictType\":\"house_purpose\"}', '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', 'house', '房屋状态', 'RENT_FLAG', 'select', 'ic_house', 3, '从字典表获取', 'remote', '/sys/dict/data/dictlist', '{\"dictType\":\"house_status\"}', '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', 'house', '创建时间', 'CREATED_TIME', 'date', 'ic_house', 4, '日期格式', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', 'house', '备注', 'REMARK', 'input', 'ic_house', 5, '文本域', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', 'stat', '人均收入', 'AVG_YSR', 'inputNum', '', 1, '只能输入数字,可以是小数', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); +INSERT INTO `epmet_heart`.`ic_policy_item` (`ID`, `CUSTOMER_ID`, `GROUP_TYPE`, `LABEL`, `COL_KEY`, `ITEM_TYPE`, `TABLE_NAME`, `SORT`, `REMARK`, `OPTION_SOURCE_TYPE`, `OPTION_SOURCE_URL`, `OPTION_SOURCE_PARAM`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', 'stat', '家庭人数', 'RESI_NUMBER', 'inputNum', '', 2, '只能输入数字', NULL, NULL, NULL, '0', 0, 'APP_USER', '2022-07-19 10:02:54', 'APP_USER', '2022-07-19 10:03:01'); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql new file mode 100644 index 0000000000..d09a7eca73 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql @@ -0,0 +1 @@ +alter table ic_service_record_v2 add COLUMN SERVICE_CATEGORY_KEY VARCHAR(64) comment '服务类别KEY' AFTER remark; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 7a7b4f1a68..89f8764a30 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -19,6 +19,7 @@ left JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0 INNER JOIN ic_service_scope_v2 ss ON ss.SERVICE_RECORD_ID = sr.ID AND ss.DEL_FLAG = '0' WHERE sr.DEL_FLAG = '0' + AND sr.SERVICE_CATEGORY_KEY = #{serviceCategoryKey} AND ss.OBJECT_ID_PATH LIKE concat('%',#{orgId},'%') AND sr.CUSTOMER_ID = #{customerId} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql new file mode 100644 index 0000000000..ea437f22b7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.33__policy_flagbugfix.sql @@ -0,0 +1,3 @@ +update ic_form_item i set i.UPDATED_TIME=NOW(),i.POLICY_FLAG='0' +where i.DEL_FLAG='0' + and i.DYNAMIC='0'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.34__policy_nianling.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.34__policy_nianling.sql new file mode 100644 index 0000000000..b2792374e8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.34__policy_nianling.sql @@ -0,0 +1,8 @@ +-- 恢复年龄组件 +UPDATE ic_form_item i +SET i.DEL_FLAG = '0', + i.COLUMN_NAME = 'BIRTHDAY', + i.POLICY_FLAG='1', + i.UPDATED_TIME = NOW() +WHERE + i.LABEL = '年龄'; \ No newline at end of file