From 6ab99298d737d827bd0c3e080d7b2f6bfdb1d5c5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 8 Sep 2022 15:38:13 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/IcResiCategoryStatsConfigFormDTO.java | 9 ++++++++- .../result/IcResiCategoryStatsConfigResultDTO.java | 14 +++++++++++++- .../entity/IcResiCategoryStatsConfigEntity.java | 8 ++++++++ .../mapper/IcResiCategoryStatsConfigDao.xml | 5 ++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java index 7d10474443..c5af9dc2c1 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java @@ -74,5 +74,12 @@ public class IcResiCategoryStatsConfigFormDTO implements Serializable { private Integer level2; private Integer level3; - + /** + * 自动匹配:开启1;不匹配:0 + */ + private String autoMatching; + /** + * 育龄妇女年龄范围,英文逗号隔开的数字例如:18,49 + */ + private String ylfnValue; } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java index e161b60f6d..45ee8f8ce3 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java @@ -44,7 +44,10 @@ public class IcResiCategoryStatsConfigResultDTO implements Serializable { */ private String label; - + /** + * 列名 + */ + private String columnName; /** * 管理平台分类图标 @@ -84,4 +87,13 @@ public class IcResiCategoryStatsConfigResultDTO implements Serializable { * 等级3阈值 */ private Integer level3; + + /** + * 自动匹配:开启1;不匹配:0 + */ + private String autoMatching; + /** + * 育龄妇女年龄范围,英文逗号隔开的数字例如:18,49 + */ + private String ylfnValue; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java index d0201db93d..4a292260b9 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java @@ -80,4 +80,12 @@ public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity { */ private Integer sort; + /** + * 自动匹配:开启1;不匹配:0 + */ + private String autoMatching; + /** + * 育龄妇女年龄范围,英文逗号隔开的数字例如:18,49 + */ + private String ylfnValue; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml index f138b59d0d..366690ed03 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml @@ -26,6 +26,7 @@ select a.ID as id, a.LABEL as label, + a.COLUMN_NAME as columnName, a.MANAGEMENT_ICON as managementIcon, a.DATA_ICON as dataIcon, a.HOUSE_SHOW_ICON as houseShowIcon, @@ -34,7 +35,9 @@ b.LEVEL_1 as level1, b.LEVEL_2 as level2, b.LEVEL_3 as level3, - b.WARN + b.WARN, + a.AUTO_MATCHING as , + a.YLFN_VALUE as from ic_resi_category_stats_config a left join ic_resi_category_warn_config b on a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME and b.DEL_FLAG =0 and b.CUSTOMER_ID = #{customerId} From bd5706aa6ca7c8b24b37b5d637a7cb04366f3389 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 8 Sep 2022 15:45:27 +0800 Subject: [PATCH 2/7] =?UTF-8?q?ic=5Fresi=5Fcategory=5Fstats=5Fconfig?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V0.0.38__ylfnv.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql new file mode 100644 index 0000000000..4ff1496be2 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql @@ -0,0 +1,4 @@ +alter table ic_resi_category_stats_config + add COLUMN `AUTO_MATCHING` varchar(1) NOT NULL DEFAULT '0' COMMENT '自动匹配:开启1;不匹配:0' after SORT; + +alter table ic_resi_category_stats_config add COLUMN `YLFN_VALUE` varchar(32) DEFAULT NULL COMMENT '育龄妇女年龄范围,英文逗号隔开的数字例如:18,49' after AUTO_MATCHING; \ No newline at end of file From ecc2d44161973ff85d88c8e7bd3ec907907ebc8f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 8 Sep 2022 15:46:36 +0800 Subject: [PATCH 3/7] buig --- .../main/resources/mapper/IcResiCategoryStatsConfigDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml index 366690ed03..49ec2d3bbd 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml @@ -36,8 +36,8 @@ b.LEVEL_2 as level2, b.LEVEL_3 as level3, b.WARN, - a.AUTO_MATCHING as , - a.YLFN_VALUE as + a.AUTO_MATCHING as autoMatching, + a.YLFN_VALUE as ylfnValue from ic_resi_category_stats_config a left join ic_resi_category_warn_config b on a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME and b.DEL_FLAG =0 and b.CUSTOMER_ID = #{customerId} From c14fd6416194b04ca3d1344015b1c38cc7c10203 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 8 Sep 2022 17:29:27 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=82=B2=E9=BE=84=E5=A6=87=E5=A5=B3=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/task/ic/IcUpdateYlfnTask.java | 35 +++++ .../epmet/dto/result/YlfnValueResultDTO.java | 18 +++ .../feign/OperCustomizeOpenFeignClient.java | 3 +- .../OperCustomizeOpenFeignClientFallback.java | 5 + .../IcResiCategoryStatsConfigController.java | 6 + .../IcResiCategoryStatsConfigService.java | 11 ++ .../IcResiCategoryStatsConfigServiceImpl.java | 32 +++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 3 + .../EpmetUserOpenFeignClientFallback.java | 5 + .../controller/IcResiUserController.java | 13 ++ .../com/epmet/service/IcResiUserService.java | 9 ++ .../service/impl/IcResiUserServiceImpl.java | 122 +++++++++++++++++- 12 files changed, 257 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java new file mode 100644 index 0000000000..b7a1ffb6ea --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java @@ -0,0 +1,35 @@ +package com.epmet.task.ic; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.task.ITask; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * desc:定时弥补数据 保证数据的一致性 + */ +@Slf4j +@Component("icUpdateYlfnTask") +public class IcUpdateYlfnTask implements ITask { + + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * 执行定时任务接口 + * + * @param params 参数,多参数使用JSON数据 + */ + @Override + public void run(String params) { + Result result = epmetUserOpenFeignClient.updateYlfn(); + if (result.success()) { + log.info("icUpdateYlfnTask定时任务正在执行定时任务执行成功"); + } else { + log.warn("icUpdateYlfnTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java new file mode 100644 index 0000000000..9056944c83 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/9/8 15:43 + */ +@Data +public class YlfnValueResultDTO implements Serializable { + private static final long serialVersionUID = -1416102274320519092L; + private String customerId; + private Integer min; + private Integer max; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index e93d9badaa..ce2063c361 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -178,5 +178,6 @@ public interface OperCustomizeOpenFeignClient { */ @PostMapping("/oper/customize/icformitemoptions/getItemConditions") Result> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input); - + @PostMapping("/oper/customize/icresicategorystatsconfig/getYlfnValue") + Result> getYlfnValue(); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index e59af2b818..70debfecf3 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -142,4 +142,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOptionsMap", input); } + @Override + public Result> getYlfnValue() { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getYlfnValue", null); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java index 775001770f..e8dbf8b1af 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java @@ -26,6 +26,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.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.result.YlfnValueResultDTO; import com.epmet.excel.IcResiCategoryStatsConfigExcel; import com.epmet.service.IcResiCategoryStatsConfigService; import org.springframework.beans.factory.annotation.Autowired; @@ -96,4 +97,9 @@ public class IcResiCategoryStatsConfigController { return new Result>().ok(icResiCategoryStatsConfigService.getCategoryList(dto)); } + @PostMapping("getYlfnValue") + public Result> getYlfnValue() { + return new Result>().ok(icResiCategoryStatsConfigService.getYlfnValue()); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java index f9092491aa..6f151130dd 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; +import com.epmet.dto.result.YlfnValueResultDTO; import com.epmet.entity.IcResiCategoryStatsConfigEntity; import java.util.List; @@ -111,4 +112,14 @@ public interface IcResiCategoryStatsConfigService extends BaseService getCustomerCategoryShowAndWarnList(String customerId); + /** + * 获取育龄妇女配置 + * + * @Param + * @Return {@link List< YlfnValueResultDTO>} + * @Author zhaoqifeng + * @Date 2022/9/8 15:50 + */ + List getYlfnValue(); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java index d5bfdbd521..bc6758ec21 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java @@ -22,11 +22,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcResiCategoryStatsConfigDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; +import com.epmet.dto.result.YlfnValueResultDTO; import com.epmet.entity.IcResiCategoryStatsConfigEntity; import com.epmet.redis.IcResiCategoryStatsConfigRedis; import com.epmet.service.IcResiCategoryStatsConfigService; @@ -37,6 +40,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.stream.Collectors; /** * 居民类别配置表 @@ -137,4 +141,32 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl(); } + /** + * 获取育龄妇女配置 + * + * @Param + * @Return {@link List< YlfnValueResultDTO >} + * @Author zhaoqifeng + * @Date 2022/9/8 15:50 + */ + @Override + public List getYlfnValue() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiCategoryStatsConfigEntity::getAutoMatching, NumConstant.ONE_STR); + wrapper.eq(IcResiCategoryStatsConfigEntity::getColumnName, "IS_YLFN"); + wrapper.isNotNull(IcResiCategoryStatsConfigEntity::getYlfnValue); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + YlfnValueResultDTO dto = new YlfnValueResultDTO(); + dto.setCustomerId(item.getCustomerId()); + String[] ages = item.getYlfnValue().split(StrConstant.COMMA); + dto.setMin(Integer.valueOf(ages[0])); + dto.setMax(Integer.valueOf(ages[1])); + return dto; + }).collect(Collectors.toList()); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 47a67e5fbd..73d770a411 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -882,4 +882,7 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/icresiuser/nonDynamic/listResi") Result> listResiNonDynamic(@RequestBody IcResiPageNonDynamicFormDTO input); + + @PostMapping("/epmetuser/icresiuser/updateYlfn") + Result updateYlfn(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 7c9cc3b2a4..2de7371623 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -678,4 +678,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> listResiNonDynamic(IcResiPageNonDynamicFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "listResiNonDynamic", input); } + + @Override + public Result updateYlfn() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateYlfn", null); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index a62980703a..0d5652074c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -1411,4 +1411,17 @@ public class IcResiUserController implements ResultDataResolver { return new Result>().ok(page); } + /** + * 更新育龄妇女状态定时任务 + * @Param + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/9/8 17:19 + */ + @PostMapping("updateYlfn") + public Result updateYlfn() { + icResiUserService.updateYlfn(); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 8975e06443..145ea7fc9e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -507,4 +507,13 @@ public interface IcResiUserService extends BaseService { IcUserMatchGridResultDTO icUserMatchGrid(IcUserMatchGridFormDTO formDTO); PageData listResiNonDynamic(Boolean fuzzy, String gridId, String name, String mobile, Integer pageNo, Integer pageSize); + + /** + * 更新育龄妇女状态定时任务 + * @Param + * @Return + * @Author zhaoqifeng + * @Date 2022/9/8 15:45 + */ + void updateYlfn(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 2f44c543d5..3c146c3f31 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -53,10 +53,7 @@ import com.epmet.commons.tools.utils.*; import com.epmet.constant.IcPlatformConstant; import com.epmet.constant.IcResiUserConstant; import com.epmet.constant.UserConstant; -import com.epmet.dao.IcPartyMemberDao; -import com.epmet.dao.IcResiUserDao; -import com.epmet.dao.IcVolunteerDao; -import com.epmet.dao.UserBaseInfoDao; +import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; @@ -160,6 +157,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = baseDao.selectList(query).stream().map((e) -> ConvertUtils.sourceToTarget(e, IcResiNonDynamicResultDTO.class)).collect(Collectors.toList()); return new PageData(list, new PageInfo<>(list).getTotal(), pageSize); } + + /** + * 更新育龄妇女状态定时任务 + * + * @Param + * @Return + * @Author zhaoqifeng + * @Date 2022/9/8 15:45 + */ + @Override + public void updateYlfn() { + //获取育龄妇女配置 + Result> value = operCustomizeOpenFeignClient.getYlfnValue(); + if(!value.success()) { + throw new EpmetException(value.getCode(), value.getMsg()); + } + value.getData().forEach(item -> { + //查询客户下的非育龄妇女的女性居民 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, item.getCustomerId()); + wrapper.eq(IcResiUserEntity::getGender, NumConstant.TWO_STR); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); + wrapper.eq(IcResiUserEntity::getIdCardType, NumConstant.ONE_STR); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(user -> { + IdCardRegexUtils pares = IdCardRegexUtils.parse(user.getIdCard()); + if (NumConstant.ONE_STR.equals(pares.getTypeEnum().getType())) { + if (!NumConstant.ONE_STR.equals(user.getIsYlfn())) { + //将不是育龄妇女的变为育龄妇女 + if (pares.getParsedResult().getAge() >= item.getMin() && pares.getParsedResult().getAge() <= item.getMax()) { + //更新育龄妇女状态 + IcResiUserEntity icResiUserEntity = new IcResiUserEntity(); + icResiUserEntity.setId(user.getId()); + icResiUserEntity.setIsYlfn(NumConstant.ONE_STR); + baseDao.updateById(icResiUserEntity); + + //添加居民变更记录 + IcUserChangeRecordEntity record = new IcUserChangeRecordEntity(); + record.setCustomerId(user.getCustomerId()); + record.setOperatorId("APP_USER"); + record.setOperatorName("系统"); + record.setIcUserId(user.getId()); + record.setIcUserName(user.getName()); + record.setType("category"); + record.setTypeName("类别"); + record.setBeforeChangeName("否"); + record.setAfterChangeName("是"); + record.setChangeTime(new Date()); + icUserChangeRecordDao.insert(record); + //添加变更明细 + IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity(); + detail.setCustomerId(user.getCustomerId()); + detail.setIcUserChangeRecordId(record.getId()); + detail.setPids(user.getPids()); + detail.setAgencyId(user.getAgencyId()); + detail.setGridId(user.getGridId()); + detail.setNeighborHoodId(user.getVillageId()); + detail.setBuildingId(user.getBuildId()); + detail.setBuildingUnitId(user.getUnitId()); + detail.setHouseId(user.getHomeId()); + detail.setIcUserId(user.getId()); + detail.setType("category"); + detail.setTypeName("类别"); + detail.setFieldName("IS_YLFN"); + detail.setValue(NumConstant.ONE); + icUserChangeDetailedDao.insert(detail); + } + } else { + //将是育龄妇女的变为非育龄妇女 + if (pares.getParsedResult().getAge() < item.getMin() || pares.getParsedResult().getAge() > item.getMax()) { + //更新育龄妇女状态 + IcResiUserEntity icResiUserEntity = new IcResiUserEntity(); + icResiUserEntity.setId(user.getId()); + icResiUserEntity.setIsYlfn(NumConstant.ZERO_STR); + baseDao.updateById(icResiUserEntity); + //添加居民变更记录 + IcUserChangeRecordEntity record = new IcUserChangeRecordEntity(); + record.setCustomerId(user.getCustomerId()); + record.setOperatorId("APP_USER"); + record.setOperatorName("系统"); + record.setIcUserId(user.getId()); + record.setIcUserName(user.getName()); + record.setType("category"); + record.setTypeName("类别"); + record.setBeforeChangeName("是"); + record.setAfterChangeName("否"); + record.setChangeTime(new Date()); + icUserChangeRecordDao.insert(record); + //添加变更明细 + IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity(); + detail.setCustomerId(user.getCustomerId()); + detail.setIcUserChangeRecordId(record.getId()); + detail.setPids(user.getPids()); + detail.setAgencyId(user.getAgencyId()); + detail.setGridId(user.getGridId()); + detail.setNeighborHoodId(user.getVillageId()); + detail.setBuildingId(user.getBuildId()); + detail.setBuildingUnitId(user.getUnitId()); + detail.setHouseId(user.getHomeId()); + detail.setIcUserId(user.getId()); + detail.setType("category"); + detail.setTypeName("类别"); + detail.setFieldName("IS_YLFN"); + detail.setValue(NumConstant.ONE_NEG); + icUserChangeDetailedDao.insert(detail); + } + } + } + }); + } + }); + } } From 038b8c47ca8f4fc143d83c7b76c6436697cae0e6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 9 Sep 2022 09:18:57 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=B8=8D=E7=AD=89=E4=BA=8E=E7=A9=BA?= =?UTF-8?q?=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java index bc6758ec21..a00f800733 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java @@ -155,6 +155,7 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); if(CollectionUtils.isEmpty(list)) { return Collections.emptyList(); From 06cc5e8ac40c6a17b62903bd36f502908cacd003 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 9 Sep 2022 09:35:13 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=82=B2=E9=BE=84=E5=A6=87=E5=A5=B3=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IcResiUserServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 3c146c3f31..648d315953 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -3362,6 +3362,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> value = operCustomizeOpenFeignClient.getYlfnValue(); @@ -3374,12 +3375,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(list)) { list.forEach(user -> { IdCardRegexUtils pares = IdCardRegexUtils.parse(user.getIdCard()); - if (NumConstant.ONE_STR.equals(pares.getTypeEnum().getType())) { + if (null != pares && NumConstant.ONE_STR.equals(pares.getTypeEnum().getType())) { if (!NumConstant.ONE_STR.equals(user.getIsYlfn())) { //将不是育龄妇女的变为育龄妇女 if (pares.getParsedResult().getAge() >= item.getMin() && pares.getParsedResult().getAge() <= item.getMax()) { From 4b06c587f7d0ceec965ff627628d4c34a4bc42b1 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 9 Sep 2022 11:18:35 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=82=B2=E9=BE=84=E5=A6=87=E5=A5=B3=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcResiUserServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 648d315953..ab854a3fd3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -3393,13 +3393,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl