From 85e019535b252afac08dc5934be1f956bfb196cb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 9 Mar 2022 15:51:47 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E7=82=B9=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/OperCustomizeOpenFeignClient.java | 11 ++++++- .../ResiCategoryStatsConfigController.java | 11 +++++++ .../IcStatsResiWarnBuildingResultDTO.java | 32 ++++++++++++++++++- .../controller/StatsResiWarnController.java | 17 +++++++--- .../epmet/service/StatsResiWarnService.java | 18 +++++++++-- .../impl/StatsResiWarnServiceImpl.java | 6 ++++ 6 files changed, 86 insertions(+), 9 deletions(-) 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 133f98ab11..c714bd77e1 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 @@ -102,10 +102,19 @@ public interface OperCustomizeOpenFeignClient { Result> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto); - + /** + * 获取居民类别配置表ic_resi_category_stats_config,根据token里的客户id查询,可根据状态筛选:显示:show;隐藏:hidden; + * @param formDTO + * @return + */ @PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd") Result> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO); + /** + * 查询ic_resi_category_warn_config,返回预警的类别 + * @param customerId + * @return + */ @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") Result> resiCategoryWarnList(@RequestParam String customerId); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java index f43e75bf97..3c2004e714 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java @@ -128,6 +128,12 @@ public class ResiCategoryStatsConfigController { return new Result().ok(resiCategoryStatsConfigService.info(formDTO.getId(),tokenDTO.getCustomerId())); } + /** + * 获取居民类别配置表ic_resi_category_stats_config,根据token里的客户id查询,可根据状态筛选:显示:show;隐藏:hidden; + * @param tokenDTO + * @param formDTO + * @return + */ @PostMapping("resicategorystatslistshowd") public Result> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ //获取预警配置列表 @@ -145,6 +151,11 @@ public class ResiCategoryStatsConfigController { return new Result>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class)); } + /** + * 查询ic_resi_category_warn_config,返回预警的类别 + * @param customerId + * @return + */ @PostMapping("resicategorywarnlist") public Result> resiCategoryWarnList(@RequestParam String customerId){ //获取预警配置列表 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java index 3d4253f721..f4c317274a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java @@ -20,7 +20,6 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; -import java.util.Date; import java.util.List; @@ -38,21 +37,52 @@ public class IcStatsResiWarnBuildingResultDTO implements Serializable { /** * 预警配置ID + * ic_resi_category_warn_config.id */ private String configId; + /** + * ic_resi_category_warn_config.label + * 类别名 + */ private String label; + /** + * 排序 + */ private Integer sort; + + /** + * 等级1阈值 + */ private Integer level1; private Integer levelCount1; + + /** + * 等级2阈值 + */ private Integer level2; private Integer levelCount2; + + /** + * 等级3阈值 + */ private Integer level3; private Integer levelCount3; + /** + * 管理平台分类图标 + */ private String managementIcon; + + /** + * 数据平台分类图标 + */ private String dataIcon; + + /** + * 房屋显示分类图标 + */ private String houseShowIcon; private Integer count; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index 33855a2b2c..3d18050f66 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -17,19 +17,15 @@ package com.epmet.controller; -import com.epmet.common.token.annotation.Login; 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.form.CategoryCountListFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.form.StatsResiWarnCountFormDTO; import com.epmet.dto.form.StatsResiWarnFormDTO; -import com.epmet.dto.result.CategoryCountListResultDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; -import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; import com.epmet.service.IcStatsResiWarnService; import com.epmet.service.StatsResiWarnService; import org.springframework.beans.factory.annotation.Autowired; @@ -80,6 +76,12 @@ public class StatsResiWarnController { return new Result>().ok(statsResiWarnService.list2(formDTO)); } + /** + * 可视化分析-人员预警,各类别楼栋数量展示 + * @param tokenDto + * @param formDTO 只有agencyId + * @return + */ @PostMapping("buildingwarnlist") public Result buildingWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedBuilding.class); @@ -89,6 +91,13 @@ public class StatsResiWarnController { return new Result().ok(icStatsResiWarnBuildingResultDTOS); } + + /** + * 可视化分析-人员预警,楼栋列表展示 + * @param tokenDto + * @param formDTO + * @return + */ @PostMapping("userwarnlist") public Result userWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedUser.class); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java index f0c4e5f5f5..7c5477b61b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -17,12 +17,9 @@ package com.epmet.service; -import com.epmet.dto.form.CategoryCountListFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; -import com.epmet.dto.result.CategoryCountListResultDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; -import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; import java.util.List; import java.util.Map; @@ -35,8 +32,23 @@ import java.util.Map; */ public interface StatsResiWarnService{ + /** + * 可视化分析-人员预警,各类别楼栋数量展示 + * @param customerId + * @param agencyID + * @return + */ List buildingwWarnList(String customerId,String agencyID); + /** + * 可视化分析-人员预警,楼栋列表展示 + * @param customerId + * @param configId + * @param buildingIdList + * @param pageNo + * @param pageSize + * @return + */ Map userWarnList(String customerId, String configId, List buildingIdList, Integer pageNo, Integer pageSize); List list(String customerId,String id, String level); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index c6b33e482b..789b189016 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -50,6 +50,12 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { @Resource private IcResiUserDao icResiUserDao; + /** + * 可视化分析-人员预警,各类别楼栋数量展示 + * @param customerId + * @param agencyID + * @return + */ @Override public List buildingwWarnList(String customerId,String agencyID) { List result = new ArrayList<>(); From dd5f9e18f2d9d51ac15a28034cc2e2289fef2b20 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 10 Mar 2022 09:11:14 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PersonWarnRightListFormDTO.java | 2 ++ .../result/PersonWarnRightListResultDTO.java | 3 +++ .../service/impl/IcResiUserServiceImpl.java | 24 ++++++++++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java index 977390e31a..9be92d4233 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java @@ -22,4 +22,6 @@ public class PersonWarnRightListFormDTO implements Serializable { @NotNull(message = "pageSize不能为空",groups = PersonWarnRightListForm.class) private Integer pageSize; + + private String categoryCode; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java index c98b26cbec..a2739c6857 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java @@ -35,6 +35,9 @@ public class PersonWarnRightListResultDTO implements Serializable { */ private List type; + @JsonIgnore + private String sortString; + /** * 所属网格 */ 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 bab73c6909..df7bcd4458 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 @@ -1186,8 +1186,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl configList = configListResult.getData(); - PageInfo> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(configList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId())); + List configListOrigin = configListResult.getData(); + List configList = new ArrayList<>(); + if (StringUtils.isNotBlank(formDTO.getCategoryCode())){ + for (CustomerCategoryShowAndWarnListResultDTO c : configListOrigin) { + if (c.getColumnName().equals(formDTO.getCategoryCode())){ + configList.add(c); + } + } + }else { + configList = configListOrigin; + } + List finalConfigList = configList; + PageInfo> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(finalConfigList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId())); List> list = pageInfo.getList(); if (CollectionUtils.isEmpty(list)) { return result; @@ -1200,7 +1211,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl houseInfos = houseInfosResult.getData(); userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getAllName()))); - result.setList(userList); + // 类型+网格+家庭 排序 + userList.forEach(u -> { + String types = u.getType().stream().map(String::valueOf).collect(Collectors.joining("、")); + String s = types + u.getGridName() + u.getFamily(); + u.setSortString(s); + }); + List finalResult = userList.stream().sorted(Comparator.comparing(PersonWarnRightListResultDTO.PersonWarnRightList::getSortString)).collect(Collectors.toList()); + result.setList(finalResult); return result; } From 92da5a13d55fb9d9bd1c8ae9df0088a9bc4e3681 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 10 Mar 2022 11:20:01 +0800 Subject: [PATCH 03/11] /epmetuser/statsresiwarn/queryuserwarnnotice --- .../tools/feign/CommonAggFeignClient.java | 12 +++- .../CommonAggFeignClientFallback.java | 13 ++++ .../epmet/commons/tools/redis/RedisKeys.java | 9 +++ .../redis/common/CustomerIcHouseRedis.java | 65 +++++++++++++++++++ .../tools/redis/common/CustomerOrgRedis.java | 5 +- .../redis/common/bean/BuildingInfoCache.java | 44 +++++++++++++ .../controller/GovOrgController.java | 14 ++++ .../dataaggre/dao/govorg/IcBuildingDao.java | 15 +++++ .../service/govorg/GovOrgService.java | 8 +++ .../govorg/impl/GovOrgServiceImpl.java | 21 ++++++ .../resources/mapper/govorg/IcBuildingDao.xml | 24 +++++++ .../dto/form/IcUserWarnNoticeFormDTO.java | 27 ++++++++ .../IcStatsResiWarnBuildingResultDTO.java | 4 ++ .../dto/result/IcUserWarnNoticeResultDTO.java | 23 +++++++ .../controller/StatsResiWarnController.java | 15 +++++ .../com/epmet/dao/IcStatsResiWarnDao.java | 11 ++++ .../epmet/service/StatsResiWarnService.java | 9 +++ .../impl/StatsResiWarnServiceImpl.java | 40 ++++++++++++ .../resources/mapper/IcStatsResiWarnDao.xml | 16 +++++ 19 files changed, 371 insertions(+), 4 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/BuildingInfoCache.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcBuildingDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcBuildingDao.xml create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserWarnNoticeFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index 5a03583011..926c96e340 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactory; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.Result; @@ -17,7 +18,8 @@ import org.springframework.web.bind.annotation.RequestParam; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) +// @FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) +@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class,url = "localhost:8114") public interface CommonAggFeignClient { /** @@ -45,4 +47,12 @@ public interface CommonAggFeignClient { */ @PostMapping("/data/aggregator/org/grid") Result getGridInfo(@RequestParam("gridId")String gridId); + + /** + * 查询楼栋信息 + * @param buildingId + * @return + */ + @PostMapping("/data/aggregator/org/querybuildinginfo") + Result queryBuildingInfo(@RequestParam("buildingId")String buildingId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java index 02f209f4f2..8d6f5f1260 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ModuleUtils; @@ -32,4 +33,16 @@ public class CommonAggFeignClientFallback implements CommonAggFeignClient { public Result getGridInfo(String gridId) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getGridInfo", gridId); } + + /** + * 查询楼栋信息 + * + * @param buildingId + * @return + */ + @Override + public Result queryBuildingInfo(String buildingId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "queryBuildingInfo", buildingId); + } + } 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 0798627046..8ba08b9f05 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 @@ -539,6 +539,15 @@ public class RedisKeys { return rootPrefix.concat("gov:grid:").concat(gridId); } + /** + * 楼栋信息缓存key + * @param buildingId + * @return + */ + public static String getBuildingInfoKey(String buildingId) { + return rootPrefix.concat("gov:building:").concat(buildingId); + } + /** * @description 调查问卷accessKey * diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java new file mode 100644 index 0000000000..ec0a79f1db --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java @@ -0,0 +1,65 @@ +package com.epmet.commons.tools.redis.common; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.CommonAggFeignClient; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.Map; + +/** + * 楼栋 + * 房屋 + * 小区这三个的缓存放这吧 + */ +@Slf4j +@Component +public class CustomerIcHouseRedis { + @Autowired + private RedisUtils redisUtils; + @Autowired + private CommonAggFeignClient commonAggFeignClient; + private static CustomerIcHouseRedis customerIcHouseRedis; + + @PostConstruct + public void init() { + customerIcHouseRedis = this; + customerIcHouseRedis.redisUtils = this.redisUtils; + customerIcHouseRedis.commonAggFeignClient = this.commonAggFeignClient; + } + + + /** + * @Description 获取楼栋信息 + * @param buildingId + * @author yinzuomei + * @date 2022/03/09 + */ + public static BuildingInfoCache getBuildingInfo(String buildingId){ + String key = RedisKeys.getBuildingInfoKey(buildingId); + Map build = customerIcHouseRedis.redisUtils.hGetAll(key); + if (!MapUtils.isEmpty(build)) { + return ConvertUtils.mapToEntity(build, BuildingInfoCache.class); + } + Result buildInfoResult = customerIcHouseRedis.commonAggFeignClient.queryBuildingInfo(buildingId); + if (!buildInfoResult.success()){ + throw new RenException("查询楼栋信息失败..."); + } + if (null == buildInfoResult.getData()){ + return null; + } + Map map = BeanUtil.beanToMap(buildInfoResult.getData(), false, true); + customerIcHouseRedis.redisUtils.hMSet(key, map); + return buildInfoResult.getData(); + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 449a90116a..f624c04bbc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -1,12 +1,12 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.redis.common.bean.*; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; @@ -33,7 +33,6 @@ public class CustomerOrgRedis { private CommonAggFeignClient commonAggFeignClient; private static CustomerOrgRedis customerOrgRedis; - private static final String ROLE_MAP_KEY = "roleMap"; @PostConstruct public void init() { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/BuildingInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/BuildingInfoCache.java new file mode 100644 index 0000000000..4cb2416328 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/BuildingInfoCache.java @@ -0,0 +1,44 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 楼栋信息缓存 + */ +@Data +public class BuildingInfoCache implements Serializable { + /** + * !!!!!楼栋id + */ + private String buildingId; + + /** + * 楼栋名称 + */ + private String buildingName; + + /** + * 网格id + */ + private String gridId; + + /** + * XXX组织-网格名 + */ + private String gridName; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 小区名称 + */ + private String neighborHoodName; + private String agencyId; + + // 后续用到啥再加吧........ +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index c1b2b0e98a..45e29f3599 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -13,6 +13,7 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; @@ -412,4 +413,17 @@ public class GovOrgController { govOrgService.pcworkRecordListExportSendMsg(formDTO); return new Result(); } + + /** + * 查询楼栋信息 + * @param buildingId + * @return + */ + @PostMapping("/querybuildinginfo") + public Result queryBuildingInfo(@RequestParam("buildingId")String buildingId){ + if(StringUtils.isBlank(buildingId)){ + return new Result<>(); + } + return new Result().ok(govOrgService.queryBuildingInfo(buildingId)); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcBuildingDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcBuildingDao.java new file mode 100644 index 0000000000..fbf5d8de14 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcBuildingDao.java @@ -0,0 +1,15 @@ +package com.epmet.dataaggre.dao.govorg; + +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface IcBuildingDao { + + /** + * 查询楼栋信息,返回楼栋明,小区名....简要信息 + * @param buildingId + * @return + */ + BuildingInfoCache selectBuildInfo(String buildingId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 51d938bb2e..53c1f3200c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.service.govorg; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; @@ -188,4 +189,11 @@ public interface GovOrgService { * @Description 查询组织的直属下级组织下网格活跃度统计--文件导出 **/ void pcworkRecordListExportSendMsg(GridLivelyFormDTO formDTO); + + /** + * 获取楼栋信息 + * @param buildingId + * @return + */ + BuildingInfoCache queryBuildingInfo(String buildingId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index dc63adc141..9d66d82982 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -17,6 +17,8 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; @@ -88,6 +90,8 @@ public class GovOrgServiceImpl implements GovOrgService { private DataStatsService dataStatsService; @Autowired private OssFeignClient ossFeignClient; + @Autowired + private IcBuildingDao icBuildingDao; /** * @param staffId @@ -990,5 +994,22 @@ public class GovOrgServiceImpl implements GovOrgService { } } + /** + * 获取楼栋信息 + * + * @param buildingId + * @return + */ + @Override + public BuildingInfoCache queryBuildingInfo(String buildingId) { + BuildingInfoCache infoCache=icBuildingDao.selectBuildInfo(buildingId); + if(null!=infoCache){ + GridInfoCache gridInfoCache= CustomerOrgRedis.getGridInfo(infoCache.getGridId()); + //赋值 XXX-网格名 + infoCache.setGridName(null == gridInfoCache || StringUtils.isBlank(gridInfoCache.getGridNamePath()) ? StrConstant.EPMETY_STR : gridInfoCache.getGridNamePath()); + } + return infoCache; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcBuildingDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcBuildingDao.xml new file mode 100644 index 0000000000..342c05e0c8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcBuildingDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserWarnNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserWarnNoticeFormDTO.java new file mode 100644 index 0000000000..0179217f1d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserWarnNoticeFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 人员预警通知入参 + */ +@Data +public class IcUserWarnNoticeFormDTO implements Serializable { + + /** + * + */ + @NotBlank(message = "组织id不能为空",groups = AddGroup.class) + private String agencyId; + /** + * + */ + @NotBlank(message = "客户id不能为空",groups = AddGroup.class) + private String customerId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java index f4c317274a..ba3c2a9822 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java @@ -84,6 +84,10 @@ public class IcStatsResiWarnBuildingResultDTO implements Serializable { * 房屋显示分类图标 */ private String houseShowIcon; + + /** + * 当前类别,符合预警的共多少栋楼 + */ private Integer count; private List buildingIdList1; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java new file mode 100644 index 0000000000..fb6fde9599 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 人员预警通知返参 + */ +@Data +public class IcUserWarnNoticeResultDTO implements Serializable { + + /** + * 预警配置id + */ + private String configId; + /** + * 预警内容:南宁路社区第二网格亿联小区2号楼失业人员超出预警! + */ + private String noticeContent; + // @JsonIgnore + private String buildingId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index 3d18050f66..5f7ea56e4a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -21,11 +21,14 @@ 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.commons.tools.validator.group.AddGroup; +import com.epmet.dto.form.IcUserWarnNoticeFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.form.StatsResiWarnCountFormDTO; import com.epmet.dto.form.StatsResiWarnFormDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IcUserWarnNoticeResultDTO; import com.epmet.service.IcStatsResiWarnService; import com.epmet.service.StatsResiWarnService; import org.springframework.beans.factory.annotation.Autowired; @@ -128,4 +131,16 @@ public class StatsResiWarnController { return new Result(); } + /** + * 人员预警,通知列表 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("queryuserwarnnotice") + public Result> queryUserWarnNotice(@LoginUser TokenDto tokenDto,@RequestBody IcUserWarnNoticeFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + return new Result>().ok(statsResiWarnService.queryUserWarnNotice(formDTO)); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java index 0a46c4bc06..3e261b041f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.PersonWarnLeftPieDTO; +import com.epmet.dto.result.IcUserWarnNoticeResultDTO; import com.epmet.dto.result.UserWarnNameListResultDTO; import com.epmet.entity.IcStatsResiWarnEntity; import org.apache.ibatis.annotations.Mapper; @@ -76,4 +77,14 @@ public interface IcStatsResiWarnDao extends BaseDao { List> selectCategoryCountByColumn(@Param("columnNames") List columnNames,@Param("agencyId")String agencyId); + /** + * 获取预警楼栋列表 + * @param customerId + * @param agencyId + * @param configIds + * @return + */ + List queryUserWarnNotice(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("configIds") List configIds); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java index 7c5477b61b..babce11f37 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -17,9 +17,11 @@ package com.epmet.service; +import com.epmet.dto.form.IcUserWarnNoticeFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IcUserWarnNoticeResultDTO; import java.util.List; import java.util.Map; @@ -58,4 +60,11 @@ public interface StatsResiWarnService{ void resiWarn(String customerId); void resiWarnByOne(String customerId,String userId); + + /** + * 人员预警通知列表 + * @param formDTO + * @return + */ + List queryUserWarnNotice(IcUserWarnNoticeFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 789b189016..79fbdc4ca3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -3,7 +3,10 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcResiUserDao; @@ -11,6 +14,7 @@ import com.epmet.dao.IcStatsResiWarnDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcUserWarnNoticeFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; @@ -21,6 +25,7 @@ import com.epmet.service.IcStatsResiWarnService; import com.epmet.service.StatsResiWarnService; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -338,5 +343,40 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { } } + /** + * 人员预警通知列表 + * + * @param formDTO + * @return + */ + @Override + public List queryUserWarnNotice(IcUserWarnNoticeFormDTO formDTO) { + //1、feign查询是否有配置的预警分类 + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(formDTO.getCustomerId()); + if (!warnResult.success()) { + throw new RenException("预警配置查询失败:" + warnResult.getMsg()); + } + if (CollectionUtils.isEmpty(warnResult.getData())) { + return new ArrayList<>(); + } + //2、符合条件的楼栋 + Map configMap = warnResult.getData().stream().collect(Collectors.toMap(IcResiCategoryWarnConfigDTO::getId, IcResiCategoryWarnConfigDTO::getLabel)); + List configIds = warnResult.getData().stream().map(m -> m.getId()).collect(Collectors.toList()); + List list = icStatsResiWarnDao.queryUserWarnNotice(formDTO.getCustomerId(), formDTO.getAgencyId(), configIds); + List resList = new ArrayList<>(); + for (IcUserWarnNoticeResultDTO dto : list) { + //南宁路社区第二网格亿联小区2号楼失业人员超出预警! + BuildingInfoCache infoCache = CustomerIcHouseRedis.getBuildingInfo(dto.getBuildingId()); + if (null == infoCache) { + log.error(String.format("获取楼栋信息为null,buildingId=%s", dto.getBuildingId())); + continue; + } + String categoryName = StringUtils.isBlank(configMap.get(dto.getConfigId())) ? StrConstant.EPMETY_STR : configMap.get(dto.getConfigId()); + dto.setNoticeContent(String.format("%s%s%s%s超出预警!", infoCache.getGridName(), infoCache.getNeighborHoodName(), infoCache.getBuildingName(), categoryName)); + resList.add(dto); + } + return resList; + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index 572f9d8577..9a82e55133 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -184,4 +184,20 @@ AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%') + \ No newline at end of file From 1508cf9236132b165a74af5308db702cf6e0e74c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 10 Mar 2022 13:38:33 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/IcFormController.java | 6 ++++++ .../com/epmet/service/impl/IcFormItemServiceImpl.java | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java index cce2730c6f..b247addf24 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -102,6 +102,12 @@ public class IcFormController { return new Result>().ok(icFormItemService.queryConditionList(formDto)); } + /** + * 居民信息列表_表头 + * @param tokenDto + * @param formDto + * @return + */ @PostMapping("tableheaders") public Result> queryTableHeaderList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto){ formDto.setCustomerId(tokenDto.getCustomerId()); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index f53226d51c..79fce30efb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -18,8 +18,6 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.dao.IcFormItemDao; @@ -30,12 +28,10 @@ import com.epmet.service.IcFormItemService; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; import java.util.ArrayList; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; /** * 表单项 @@ -60,6 +56,11 @@ public class IcFormItemServiceImpl extends BaseServiceImpl queryTableHeaderList(CustomerFormQueryDTO formDto) { List list=new ArrayList<>(); From c616bbc370fe1a0e8495a3fb3ceea9877f1bb519 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 10 Mar 2022 14:28:29 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=96=B0=E5=A2=9Eic=5Fform=5Flist=5Fitem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IcFormItemServiceImpl.java | 1 + .../V0.0.14__create_ic_form_list_item.sql | 22 +++++++++++++++++++ .../main/resources/mapper/IcFormItemDao.xml | 22 ++++++++++--------- 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__create_ic_form_list_item.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index 79fce30efb..3a881b52d8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -69,6 +69,7 @@ public class IcFormItemServiceImpl extends BaseServiceImpl result=baseDao.queryTableHeaderList(formDto.getCustomerId(),formDto.getFormCode()); if(!CollectionUtils.isEmpty(result)){ list.addAll(result); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__create_ic_form_list_item.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__create_ic_form_list_item.sql new file mode 100644 index 0000000000..0a894c8445 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__create_ic_form_list_item.sql @@ -0,0 +1,22 @@ +CREATE TABLE `ic_form_list_item` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `FORM_ITEM_ID` varchar(64) NOT NULL COMMENT 'ic_form_item.id', + `FORM_CODE` varchar(64) NOT NULL COMMENT 'ic_form.form_code,举例:resi_base_info', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` int(10) NOT NULL COMMENT '0未删除,1已删除', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='列表展示项'; + +insert into ic_form_list_item +select UUID(),i.CUSTOMER_ID,i.id,i.FORM_CODE,i.sort, +'0','0','APP_USER',NOW(),'APP_USER',NOW() +from ic_form_item i +where i.DEL_FLAG='0' +and i.LIST_DISPLAY='1' +order by i.sort asc; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 9af84eaee4..61ad0c8aa0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -74,18 +74,20 @@ From 5f98ecc2acdb9605c90abfe131ab5185db829117 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 10 Mar 2022 15:24:36 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=A1=B9=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.15__alter_ic_form_list_item_sort.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.15__alter_ic_form_list_item_sort.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.15__alter_ic_form_list_item_sort.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.15__alter_ic_form_list_item_sort.sql new file mode 100644 index 0000000000..6a1201a224 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.15__alter_ic_form_list_item_sort.sql @@ -0,0 +1,26 @@ +update ic_form_list_item set sort='1' where DEL_FLAG='0' and FORM_ITEM_ID like '%1006' ; +update ic_form_list_item set sort='2' where DEL_FLAG='0' and FORM_ITEM_ID like '%1001' ; +update ic_form_list_item set sort='3' where DEL_FLAG='0' and FORM_ITEM_ID like '%1004' ; +update ic_form_list_item set sort='4' where DEL_FLAG='0' and FORM_ITEM_ID like '%1007' ; +update ic_form_list_item set sort='5' where DEL_FLAG='0' and FORM_ITEM_ID like '%1008' ; +update ic_form_list_item set sort='6' where DEL_FLAG='0' and FORM_ITEM_ID like '%1009' ; +update ic_form_list_item set sort='7' where DEL_FLAG='0' and FORM_ITEM_ID like '%1010' ; +update ic_form_list_item set sort='8' where DEL_FLAG='0' and FORM_ITEM_ID like '%1011' ; +update ic_form_list_item set sort='9' where DEL_FLAG='0' and FORM_ITEM_ID like '%1015' ; +update ic_form_list_item set sort='10' where DEL_FLAG='0' and FORM_ITEM_ID like '%1016' ; +update ic_form_list_item set sort='11' where DEL_FLAG='0' and FORM_ITEM_ID like '%1017' ; +update ic_form_list_item set sort='12' where DEL_FLAG='0' and FORM_ITEM_ID like '%1018' ; +update ic_form_list_item set sort='13' where DEL_FLAG='0' and FORM_ITEM_ID like '%1019' ; +update ic_form_list_item set sort='14' where DEL_FLAG='0' and FORM_ITEM_ID like '%1020' ; +update ic_form_list_item set sort='15' where DEL_FLAG='0' and FORM_ITEM_ID like '%1021' ; +update ic_form_list_item set sort='16' where DEL_FLAG='0' and FORM_ITEM_ID like '%1022' ; +update ic_form_list_item set sort='17' where DEL_FLAG='0' and FORM_ITEM_ID like '%1023' ; +update ic_form_list_item set sort='18' where DEL_FLAG='0' and FORM_ITEM_ID like '%1024' ; +update ic_form_list_item set sort='19' where DEL_FLAG='0' and FORM_ITEM_ID like '%1025' ; +update ic_form_list_item set sort='20' where DEL_FLAG='0' and FORM_ITEM_ID like '%1026' ; +update ic_form_list_item set sort='21' where DEL_FLAG='0' and FORM_ITEM_ID like '%1027' ; +update ic_form_list_item set sort='22' where DEL_FLAG='0' and FORM_ITEM_ID like '%1028' ; +update ic_form_list_item set sort='23' where DEL_FLAG='0' and FORM_ITEM_ID like '%1029' ; +update ic_form_list_item set sort='24' where DEL_FLAG='0' and FORM_ITEM_ID like '%1030' ; +update ic_form_list_item set sort='25' where DEL_FLAG='0' and FORM_ITEM_ID like '%1031' ; +update ic_form_list_item set sort='26' where DEL_FLAG='0' and FORM_ITEM_ID like '%10310' ; \ No newline at end of file From c16f1fb805f7584ecdad93c0cf29fdc63c314435 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 11 Mar 2022 14:25:21 +0800 Subject: [PATCH 07/11] feign url --- .../com/epmet/commons/tools/feign/CommonAggFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index 926c96e340..cb7146138d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java @@ -18,8 +18,8 @@ import org.springframework.web.bind.annotation.RequestParam; * @Description * @Author sun */ -// @FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) -@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class,url = "localhost:8114") +@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) +// @FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class,url = "localhost:8114") public interface CommonAggFeignClient { /** From 44484685d58215c448ef683688072ade59dfc092 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Mar 2022 14:24:13 +0800 Subject: [PATCH 08/11] warn --- .../java/com/epmet/service/impl/StatsResiWarnServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 79fbdc4ca3..e7507aeefb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -368,7 +368,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { //南宁路社区第二网格亿联小区2号楼失业人员超出预警! BuildingInfoCache infoCache = CustomerIcHouseRedis.getBuildingInfo(dto.getBuildingId()); if (null == infoCache) { - log.error(String.format("获取楼栋信息为null,buildingId=%s", dto.getBuildingId())); + log.warn(String.format("获取楼栋信息为null,buildingId=%s", dto.getBuildingId())); continue; } String categoryName = StringUtils.isBlank(configMap.get(dto.getConfigId())) ? StrConstant.EPMETY_STR : configMap.get(dto.getConfigId()); From 606d7a303fd79cf473a9a7272f030a3672f402d2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 21:09:31 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=85=B7=E5=90=8D=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/IcUserWarnNoticeResultDTO.java | 4 ++++ .../com/epmet/service/impl/StatsResiWarnServiceImpl.java | 6 +++++- .../src/main/resources/mapper/IcStatsResiWarnDao.xml | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java index fb6fde9599..a9a847e6d8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserWarnNoticeResultDTO.java @@ -20,4 +20,8 @@ public class IcUserWarnNoticeResultDTO implements Serializable { private String noticeContent; // @JsonIgnore private String buildingId; + /** + * desc:该号楼有多少个符合条件的人 + */ + private Integer count; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index e7507aeefb..26da3f073d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -361,10 +361,14 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { } //2、符合条件的楼栋 Map configMap = warnResult.getData().stream().collect(Collectors.toMap(IcResiCategoryWarnConfigDTO::getId, IcResiCategoryWarnConfigDTO::getLabel)); - List configIds = warnResult.getData().stream().map(m -> m.getId()).collect(Collectors.toList()); + List configIds = warnResult.getData().stream().map(IcResiCategoryWarnConfigDTO::getId).collect(Collectors.toList()); List list = icStatsResiWarnDao.queryUserWarnNotice(formDTO.getCustomerId(), formDTO.getAgencyId(), configIds); List resList = new ArrayList<>(); + Map level1ThresholdMap = warnResult.getData().stream().collect(Collectors.toMap(IcResiCategoryWarnConfigDTO::getId, IcResiCategoryWarnConfigDTO::getLevel1)); for (IcUserWarnNoticeResultDTO dto : list) { + if (dto.getCount() SELECT ir.BUILDING_ID, - ir.CONFIG_ID + ir.CONFIG_ID, + ir.COUNT FROM ic_stats_resi_warn ir WHERE @@ -200,4 +201,4 @@ ) - \ No newline at end of file + From 46735be430b42a6d1332a21cf391f536352b8e2a Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:52:02 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=85=8D=E7=BD=AE=20=E5=88=97=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/TableHeaderResultDTO.java | 1 + .../db/migration/V0.0.16__alter_ic_form_list_item_width.sql | 2 ++ .../src/main/resources/mapper/IcFormItemDao.xml | 1 + 3 files changed, 4 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.16__alter_ic_form_list_item_width.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java index dd39f668e7..fbe06770ad 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -17,6 +17,7 @@ public class TableHeaderResultDTO implements Serializable { private String label; private String columnName; private String itemType; + private Integer width; private List options; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.16__alter_ic_form_list_item_width.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.16__alter_ic_form_list_item_width.sql new file mode 100644 index 0000000000..f5de0a85b9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.16__alter_ic_form_list_item_width.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_oper_customize`.`ic_form_list_item` + ADD COLUMN `WIDTH` int(3) NULL COMMENT '表头宽度' AFTER `FORM_CODE`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 61ad0c8aa0..4c78e1cc14 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -75,6 +75,7 @@