From 76de3478bb5e41e4be9ab0e23cf21ce2203f6533 Mon Sep 17 00:00:00 2001 From: lzh Date: Sun, 7 Nov 2021 15:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=B1=BB=E5=88=AB=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/BuildingResultDTO.java | 24 ++ .../epmet/feign/GovOrgOpenFeignClient.java | 3 + .../GovOrgOpenFeignClientFallback.java | 5 + .../epmet/controller/BuildingController.java | 14 +- .../java/com/epmet/dao/IcBuildingDao.java | 3 + .../com/epmet/service/BuildingService.java | 3 + .../service/impl/BuildingServiceImpl.java | 7 + .../main/resources/mapper/IcBuildingDao.xml | 20 ++ .../IcResiCategoryStatsConfigSortFormDTO.java | 3 +- .../feign/OperCustomizeOpenFeignClient.java | 14 ++ .../OperCustomizeOpenFeignClientFallback.java | 16 ++ .../ResiCategoryStatsConfigController.java | 43 ++++ .../IcResiCategoryWarnConfigEntity.java | 4 + .../ResiCategoryStatsConfigServiceImpl.java | 26 ++- .../com/epmet/dto/IcStatsResiWarnDTO.java | 111 +++++++++ .../epmet/dto/form/StatsResiListFormDTO.java | 46 ++++ .../epmet/dto/form/StatsResiWarnFormDTO.java | 55 +++++ .../dto/result/IcStatsResiResultDTO.java | 44 ++++ .../IcStatsResiWarnBuildingResultDTO.java | 58 +++++ .../result/IcStatsResiWarnUserResultDTO.java | 47 ++++ .../com/epmet/constant/LevelConstant.java | 8 + .../controller/IcStatsResiWarnController.java | 94 ++++++++ .../controller/StatsResiWarnController.java | 95 ++++++++ .../com/epmet/dao/IcStatsResiWarnDao.java | 49 ++++ .../epmet/entity/IcStatsResiWarnEntity.java | 81 +++++++ .../com/epmet/excel/IcStatsResiWarnExcel.java | 80 +++++++ .../com/epmet/redis/IcStatsResiWarnRedis.java | 47 ++++ .../epmet/service/IcStatsResiWarnService.java | 95 ++++++++ .../epmet/service/StatsResiWarnService.java | 41 ++++ .../impl/IcStatsResiWarnServiceImpl.java | 104 +++++++++ .../impl/StatsResiWarnServiceImpl.java | 210 ++++++++++++++++++ .../resources/mapper/IcStatsResiWarnDao.xml | 106 +++++++++ 32 files changed, 1553 insertions(+), 3 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcStatsResiWarnDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcStatsResiWarnEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java new file mode 100644 index 0000000000..4835cefba5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingResultDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + private String buildingId; + + private String gridName; + + private String neighborhoodName; + + private String buildingName; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 5b18f345d2..08cee7d65d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -519,4 +519,7 @@ public interface GovOrgOpenFeignClient { @GetMapping("/gov/org/ichouse/{id}") Result get(@PathVariable("id") String id); + + @PostMapping("/gov/org/building/buildinglistbyids") + Result> buildingListByIds(@RequestBody List buildingIdList); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index c6e0f96aa4..7734d66901 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -315,6 +315,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "get", id); } + @Override + public Result> buildingListByIds(List buildingIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java index e576abec7c..c3222f2ad4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -37,6 +37,7 @@ import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.IcBulidingUnitFormDTO; import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.IcBuildingUnitEntity; import com.epmet.excel.IcBuildingExcel; @@ -206,7 +207,7 @@ public class BuildingController { * @return * @throws IOException */ - @PostMapping("buildingunitlist") + public Result buildingunitlist(@LoginUser TokenDto tokenDTO,@RequestBody IcBulidingUnitFormDTO icBulidingUnitFormDTO ){ ValidatorUtils.validateEntity(icBulidingUnitFormDTO); List icBuildingUnitEntityList = icBuildingUnitDao.selectList(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId, icBulidingUnitFormDTO.getBuildingId()).orderByAsc(IcBuildingUnitEntity::getUnitNum)); @@ -221,4 +222,15 @@ public class BuildingController { return new Result().ok(result); } + + @PostMapping("buildinglistbyids") + public Result> buildingListByIds(@RequestBody List buildingIdList){ + if(CollectionUtils.isEmpty(buildingIdList)){ + return new Result(); + } + List result = buildingService.buildingListByIds(buildingIdList); + return new Result>().ok(result); + + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index ddae0aca45..accf59bb87 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; +import com.epmet.dto.result.BuildingResultDTO; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcHouseEntity; @@ -69,4 +70,6 @@ public interface IcBuildingDao extends BaseDao { * @date 2021/11/2 9:25 上午 */ List baseInfoFamilyBuilding(@Param("neighborHoodId")String neighborHoodId); + + List buildingListByIds(@Param("buildingIdList") List buildingIdList); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java index 39df4d14df..728c472116 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcNeighborHoodExcel; @@ -57,4 +58,6 @@ public interface BuildingService { IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO); void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; + + List buildingListByIds(List buildingIdList); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 10371e3369..ef09973b53 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.*; import com.epmet.enums.BuildingTypeEnums; @@ -278,6 +279,12 @@ public class BuildingServiceImpl implements BuildingService { ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); return ; } + + @Override + public List buildingListByIds(List buildingIdList) { + return icBuildingDao.buildingListByIds(buildingIdList); + } + private List searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) { // QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index 3d110df7bd..6be098c62c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -300,5 +300,25 @@ AND b.NEIGHBOR_HOOD_ID = #{neighborHoodId} + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java index b5e7347e4c..9e843dd7da 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java @@ -21,6 +21,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -44,7 +45,7 @@ public class IcResiCategoryStatsConfigSortFormDTO implements Serializable { /** * 排序 */ - @NotBlank(message = "排序不能为空") + @NotNull(message = "排序不能为空") private Integer sort; 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 7726abe6dd..519594fb62 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 @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; import com.epmet.dto.form.CustomerFormQueryDTO; @@ -101,4 +102,17 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icresicategorystatsconfig/categorylist") Result> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto); + + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd") + Result> resiCategoryStatsListShowd(); + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") + Result> resiCategoryWarnList(); + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") + Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); + + + } 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 c08fe76f86..cad357aca5 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 @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; import com.epmet.dto.form.CustomerFormQueryDTO; @@ -85,4 +86,19 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> getCategoryList(IcResiCategoryStatsConfigDTO dto) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCategoryList", dto); } + + @Override + public Result> resiCategoryStatsListShowd() { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryStatsListShowd"); + } + + @Override + public Result> resiCategoryWarnList() { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList"); + } + + @Override + public Result resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto); + } } 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 be1a538f1b..c2639023d4 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 @@ -17,9 +17,11 @@ package com.epmet.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -27,17 +29,25 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dao.IcResiCategoryWarnConfigDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; import com.epmet.dto.form.UpGovRoleFormDTO; import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; import com.epmet.excel.IcResiCategoryStatsConfigExcel; import com.epmet.service.IcResiCategoryStatsConfigService; import com.epmet.service.ResiCategoryStatsConfigService; +import com.github.pagehelper.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; @@ -58,6 +68,10 @@ public class ResiCategoryStatsConfigController { @Autowired private ResiCategoryStatsConfigService resiCategoryStatsConfigService; + @Resource + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Resource + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; /** * 居民类别配置列表 @@ -103,5 +117,34 @@ public class ResiCategoryStatsConfigController { return new Result().ok(resiCategoryStatsConfigService.info(formDTO.getId())); } + @PostMapping("resicategorystatslistshowd") + public Result> resiCategoryStatsListShowd(){ + //获取预警配置列表 + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper() + .lambda() + .eq(IcResiCategoryStatsConfigEntity::getStatus,"show") + .orderByAsc(IcResiCategoryStatsConfigEntity::getSort)); + + return new Result>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class)); + } + + @PostMapping("resicategorywarnlist") + public Result> resiCategoryWarnList(){ + //获取预警配置列表 + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper() + .lambda() + .orderByAsc(IcResiCategoryWarnConfigEntity::getSort)); + + return new Result>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class)); + } + @PostMapping("resicategorywarninfobyid") + public Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //获取预警配置列表 + if(StringUtils.isEmpty(dto.getId())){ + return new Result<>(); + } + return new Result().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class)); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java index a15c0c7958..f604689f81 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java @@ -17,6 +17,7 @@ package com.epmet.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -66,16 +67,19 @@ public class IcResiCategoryWarnConfigEntity extends BaseEpmetEntity { /** * 等级1阈值 */ + @TableField(value = "LEVEL_1") private Integer level1; /** * 等级2阈值 */ + @TableField(value = "LEVEL_2") private Integer level2; /** * 等级3阈值 */ + @TableField(value = "LEVEL_3") private Integer level3; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java index c5003a5d78..25eb5eafd0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java @@ -54,7 +54,10 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf return new ArrayList<>(); } Set groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(item->item.getItemGroupId()).collect(Collectors.toSet()); - List icFormItemGroupEntityList = icFormItemGroupDao.selectList(new QueryWrapper().lambda().in(IcFormItemGroupEntity::getId, groupIds)); + List icFormItemGroupEntityList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(groupIds)){ + icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper().lambda().in(IcFormItemGroupEntity::getId, groupIds))); + } //获取tableName和COLUMN_NAME Map tableColumnMap = new HashMap<>(); Map idTableMap = new HashMap<>(); @@ -202,6 +205,8 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf //更新配置预警 if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){ + //TODO 判断阈值范围 + //更新 IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper().lambda() .eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName()) @@ -259,6 +264,25 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf icResiCategoryStatsConfigEntity.setSort(formDTO.getSort()); entityList.add(icResiCategoryStatsConfigEntity); } + if(CollectionUtils.isEmpty(entityList)){ + return ; + } icResiCategoryStatsConfigService.updateBatchById(entityList); + //排序更新预警的 + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(null); + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(null); + if(CollectionUtils.isEmpty(warnConfigEntityList)){ + return ; + } + for (IcResiCategoryWarnConfigEntity warnConfigEntity : warnConfigEntityList) { + List collect = statsConfigEntityList.stream().filter(i -> i.getTableName().equals(warnConfigEntity.getTableName()) && i.getColumnName().equals(warnConfigEntity.getColumnName())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(collect)){ + continue; + } + warnConfigEntity.setSort(collect.get(0).getSort()); + } + icResiCategoryWarnConfigService.updateBatchById(warnConfigEntityList); + + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcStatsResiWarnDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcStatsResiWarnDTO.java new file mode 100644 index 0000000000..006cf7fb67 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcStatsResiWarnDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 预警配置ID + */ + private String configId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 该分类的居民数量 + */ + private Integer count; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java new file mode 100644 index 0000000000..1bb20c647a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class StatsResiListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织id + */ + @NotBlank(message = "id不能为空") + private String id; + + @NotBlank(message = "level不能为空") + private String level; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java new file mode 100644 index 0000000000..f14b15d409 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class StatsResiWarnFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface ListSelectedBuilding {}; + public interface ListSelectedUser {}; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空",groups = {ListSelectedBuilding.class}) + private String agencyId; + + @NotBlank(message = "配置id不能为空",groups = {ListSelectedUser.class}) + private String configId; + @NotNull(message = "楼宇不能为空",groups = {ListSelectedUser.class}) + private List buildingIdList; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java new file mode 100644 index 0000000000..4f670770f3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private String id; + private String label; + private Integer count; + private String managementIcon; + private String dataIcon; + private String houseShowIcon; + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..5a4369d6ba --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnBuildingResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 预警配置ID + */ + private String configId; + + private String label; + + private Integer sort; + private Integer level1; + private Integer levelCount1; + private Integer level2; + private Integer levelCount2; + private Integer level3; + private Integer levelCount3; + + private List buildingIdList1; + private List buildingIdList2; + private List buildingIdList3; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java new file mode 100644 index 0000000000..4cd3332dca --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnUserResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + + /** + * 预警配置ID + */ + private String configId; + private String buildingId; + private String gridName; + private String neighborhoodName; + private String buildingName; + private String residentNames; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java new file mode 100644 index 0000000000..5cd985c11a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java @@ -0,0 +1,8 @@ +package com.epmet.constant; + +public interface LevelConstant { + String AGENCY = "agency"; + String GRID = "grid"; + String NEIGHBORHOOD = "neighborHood"; + String BUILDING = "building"; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java new file mode 100644 index 0000000000..f0b9860e45 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcStatsResiWarnDTO; +import com.epmet.excel.IcStatsResiWarnExcel; +import com.epmet.service.IcStatsResiWarnService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("icstatsresiwarn") +public class IcStatsResiWarnController { + + @Autowired + private IcStatsResiWarnService icStatsResiWarnService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icStatsResiWarnService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcStatsResiWarnDTO data = icStatsResiWarnService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcStatsResiWarnDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icStatsResiWarnService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcStatsResiWarnDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icStatsResiWarnService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icStatsResiWarnService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icStatsResiWarnService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcStatsResiWarnExcel.class); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..6a872d078d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.StatsResiListFormDTO; +import com.epmet.dto.form.StatsResiWarnFormDTO; +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; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("statsresiwarn") +public class StatsResiWarnController { + + @Autowired + private IcStatsResiWarnService icStatsResiWarnService; + + @Autowired + private StatsResiWarnService statsResiWarnService; + + @PostMapping("list") + public Result list(@RequestBody StatsResiListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + List icStatsResiResultDTOList = statsResiWarnService.list(formDTO.getId(),formDTO.getLevel()); + return new Result().ok(icStatsResiResultDTOList); + + } + + @PostMapping("buildingwarnlist") + public Result buildingWarnList(@RequestBody StatsResiWarnFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedBuilding.class); + String agencyID = formDTO.getAgencyId(); + List icStatsResiWarnBuildingResultDTOS = statsResiWarnService.buildingwWarnList(agencyID); + return new Result().ok(icStatsResiWarnBuildingResultDTOS); + + } + @PostMapping("userwarnlist") + public Result userWarnList(@RequestBody StatsResiWarnFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedUser.class); + List buildingIdList = formDTO.getBuildingIdList(); + if(CollectionUtils.isEmpty(buildingIdList)){ + return new Result(); + } + List icStatsResiWarnUserResultDTOS = statsResiWarnService.userWarnList(formDTO.getConfigId(), formDTO.getBuildingIdList()); + return new Result().ok(icStatsResiWarnUserResultDTOS); + } + + /** + * 统计 + * @return + */ + @PostMapping("resiwarn") + public Result resiWarn(@LoginUser TokenDto tokenDto){ + statsResiWarnService.resiWarn(tokenDto.getCustomerId()); + return new Result(); + } + +} \ 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 new file mode 100644 index 0000000000..0cd26050a0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.entity.IcStatsResiWarnEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Mapper +public interface IcStatsResiWarnDao extends BaseDao { + + List selectResiWarnByAgencyId(@Param("agencyId") String agencyId); + + List> userWarnList(@Param("buildingIdList") List buildingIdList, @Param("tableName") String tableName, @Param("columnName") String columnName); + + Integer countListByLevelAndCol( + @Param("tableName") String tableName, + @Param("columnName") String columnName, + @Param("id")String id, + @Param("level")String level); + + List resiWarn(@Param("tableName") String tableName,@Param("columnName") String columnName); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcStatsResiWarnEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcStatsResiWarnEntity.java new file mode 100644 index 0000000000..fd636c095b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcStatsResiWarnEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_stats_resi_warn") +public class IcStatsResiWarnEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 预警配置ID + */ + private String configId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 该分类的居民数量 + */ + private Integer count; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java new file mode 100644 index 0000000000..59983add12 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnExcel { + + @Excel(name = "id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "预警配置ID") + private String configId; + + @Excel(name = "网格id") + private String gridId; + + @Excel(name = "组织id") + private String agencyId; + + @Excel(name = "组织的所有上级组织id") + private String agencyPids; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "楼宇id") + private String buildingId; + + @Excel(name = "该分类的居民数量") + private Integer count; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private String createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java new file mode 100644 index 0000000000..6f143a4264 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Component +public class IcStatsResiWarnRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java new file mode 100644 index 0000000000..6a0592adbe --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcStatsResiWarnDTO; +import com.epmet.entity.IcStatsResiWarnEntity; + +import java.util.List; +import java.util.Map; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcStatsResiWarnService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcStatsResiWarnDTO + * @author generator + * @date 2021-11-04 + */ + IcStatsResiWarnDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void save(IcStatsResiWarnDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void update(IcStatsResiWarnDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-04 + */ + void delete(String[] ids); +} \ No newline at end of file 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 new file mode 100644 index 0000000000..5192e27981 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.dto.result.IcStatsResiResultDTO; +import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; + +import java.util.List; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface StatsResiWarnService{ + + List buildingwWarnList(String agencyID); + + List userWarnList(String configId, List buildingIdList); + + List list(String id, String level); + + void resiWarn(String customerId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java new file mode 100644 index 0000000000..6d17d804ca --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcStatsResiWarnDao; +import com.epmet.dto.IcStatsResiWarnDTO; +import com.epmet.entity.IcStatsResiWarnEntity; +import com.epmet.redis.IcStatsResiWarnRedis; +import com.epmet.service.IcStatsResiWarnService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Service +public class IcStatsResiWarnServiceImpl extends BaseServiceImpl implements IcStatsResiWarnService { + + @Autowired + private IcStatsResiWarnRedis icStatsResiWarnRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcStatsResiWarnDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcStatsResiWarnDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcStatsResiWarnDTO get(String id) { + IcStatsResiWarnEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcStatsResiWarnDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcStatsResiWarnDTO dto) { + IcStatsResiWarnEntity entity = ConvertUtils.sourceToTarget(dto, IcStatsResiWarnEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcStatsResiWarnDTO dto) { + IcStatsResiWarnEntity entity = ConvertUtils.sourceToTarget(dto, IcStatsResiWarnEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 new file mode 100644 index 0000000000..33d30a3212 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -0,0 +1,210 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcStatsResiWarnDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.IcStatsResiResultDTO; +import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; +import com.epmet.entity.IcStatsResiWarnEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcStatsResiWarnService; +import com.epmet.service.StatsResiWarnService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class StatsResiWarnServiceImpl implements StatsResiWarnService { + @Resource + private IcStatsResiWarnDao icStatsResiWarnDao; + + @Autowired + private IcStatsResiWarnService icStatsResiWarnService; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + + @Override + public List buildingwWarnList(String agencyID) { + List result = new ArrayList<>(); + //feign获取当前需要预警的配置信息以及阈值 + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); + } + List icResiCategoryWarnConfigDTOList = warnResult.getData(); + + if(CollectionUtils.isEmpty(icResiCategoryWarnConfigDTOList )){ + return result; + } + result = icResiCategoryWarnConfigDTOList.stream().map(item -> { + IcStatsResiWarnBuildingResultDTO resiWarnBuildingResultDTO = new IcStatsResiWarnBuildingResultDTO(); + resiWarnBuildingResultDTO.setConfigId(item.getId()); + resiWarnBuildingResultDTO.setLabel(item.getLabel()); + resiWarnBuildingResultDTO.setLevel1(item.getLevel1()); + resiWarnBuildingResultDTO.setLevel2(item.getLevel2()); + resiWarnBuildingResultDTO.setLevel3(item.getLevel3()); + resiWarnBuildingResultDTO.setSort(item.getSort()); + resiWarnBuildingResultDTO.setLevelCount1(0); + resiWarnBuildingResultDTO.setLevelCount2(0); + resiWarnBuildingResultDTO.setLevelCount3(0); + resiWarnBuildingResultDTO.setBuildingIdList1(new ArrayList<>()); + resiWarnBuildingResultDTO.setBuildingIdList2(new ArrayList<>()); + resiWarnBuildingResultDTO.setBuildingIdList3(new ArrayList<>()); + return resiWarnBuildingResultDTO; + }).collect(Collectors.toList()); + //统计数量 + List icStatsResiWarnEntityList = icStatsResiWarnDao.selectResiWarnByAgencyId(agencyID); + if(CollectionUtils.isEmpty(icStatsResiWarnEntityList )){ + return result; + } + Map warnResultMap = result.stream().collect(Collectors.toMap(IcStatsResiWarnBuildingResultDTO::getConfigId, Function.identity(),(k1, k2)->k1)); + for (IcStatsResiWarnEntity item : icStatsResiWarnEntityList) { + //每栋楼的数量 + Integer count = Optional.ofNullable(item.getCount()).orElse(0); + IcStatsResiWarnBuildingResultDTO resiWarnBuildingResultDTO = warnResultMap.get(item.getConfigId()); + //判断数量 + Integer levle1= resiWarnBuildingResultDTO.getLevel1(); + Integer levle2= resiWarnBuildingResultDTO.getLevel2(); + Integer levle3= resiWarnBuildingResultDTO.getLevel3(); + if(0 == count){ + continue; + } + if(null!=levle1 && count>levle1){ + resiWarnBuildingResultDTO.setLevelCount1(resiWarnBuildingResultDTO.getLevelCount1()+1); + resiWarnBuildingResultDTO.getBuildingIdList1().add(item.getBuildingId()); + } + if(null!=levle1 && null!=levle2 && count<=levle1 && count>=levle2){ + resiWarnBuildingResultDTO.setLevelCount2(resiWarnBuildingResultDTO.getLevelCount2()+1); + resiWarnBuildingResultDTO.getBuildingIdList2().add(item.getBuildingId()); + } + if(null!=levle2 && null!=levle3 && count<=levle2 && count>=levle3){ + resiWarnBuildingResultDTO.setLevelCount3(resiWarnBuildingResultDTO.getLevelCount3()+1); + resiWarnBuildingResultDTO.getBuildingIdList3().add(item.getBuildingId()); + } + } + return result; + + } + + @Override + public List userWarnList(String configId, List buildingIdList) { + //feign根据buildingIdList 获取网格,小区,楼宇 信息 + Result> buildingList = govOrgOpenFeignClient.buildingListByIds(buildingIdList); + if (!buildingList.success() || null == buildingList.getData()) { + throw new RenException("楼宇信息查询失败,buildingList="+ JSON.toJSONString(buildingIdList)); + } + List buildingResultDTOList = buildingList.getData(); + + List result = ConvertUtils.sourceToTarget(buildingResultDTOList,IcStatsResiWarnUserResultDTO.class); + if(CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + //获取configId预警配置信息 + IcResiCategoryWarnConfigDTO formDto = new IcResiCategoryWarnConfigDTO(); + formDto.setId(configId); + Result warnResult = operCustomizeOpenFeignClient.resiCategoryWarnInfoById(formDto); + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("获取预警配置信息失败,configId="+ configId); + } + IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData(); + + //根据buildingID,tableName he columnName获取名字 + List> maps = icStatsResiWarnDao.userWarnList(buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); + result.forEach(item->{ + item.setConfigId(configId); + List> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); + item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); + }); + return result; + } + + @Override + public List list(String id, String level) { + //获取所有配置类项 getshow + Result> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(); + if (!statsResult.success() || null == statsResult.getData()) { + throw new RenException("获取配置类项失败"); + } + List icResiCategoryStatsConfigDTOList = statsResult.getData(); + //获取tableName 和columnName + List result = new ArrayList<>(); + icResiCategoryStatsConfigDTOList.forEach(item->{ + IcStatsResiResultDTO resultDTO = new IcStatsResiResultDTO(); + resultDTO.setId(item.getId()); + resultDTO.setLabel(item.getLabel()); + resultDTO.setDataIcon(item.getDataIcon()); + resultDTO.setHouseShowIcon(item.getHouseShowIcon()); + resultDTO.setManagementIcon(item.getManagementIcon()); + //根据id ,level 获取count + Integer count = icStatsResiWarnDao.countListByLevelAndCol(item.getTableName(),item.getColumnName(),id,level); + resultDTO.setCount(count); + result.add(resultDTO); + }); + return result; + } + + /** + * 统计 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void resiWarn(String customerId) { + // 获取预警配置项 + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); + } + List icResiCategoryWarnConfigDTOList = warnResult.getData(); + + //保存数据 + List icStatsResiWarnEntities = new ArrayList<>(); + for (IcResiCategoryWarnConfigDTO item : icResiCategoryWarnConfigDTOList) { + icStatsResiWarnDao.delete(new QueryWrapper().lambda().eq(IcStatsResiWarnEntity::getConfigId,item.getId())); + List maps = icStatsResiWarnDao.resiWarn(item.getTableName(), item.getColumnName()); + + + if(CollectionUtils.isEmpty(maps)){ + continue; + } + + maps.forEach(map->{ + IcStatsResiWarnEntity icStatsResiWarnEntity = new IcStatsResiWarnEntity(); + icStatsResiWarnEntity.setAgencyId(map.getAgencyId()); + icStatsResiWarnEntity.setAgencyPids(map.getAgencyPids()); + icStatsResiWarnEntity.setBuildingId(map.getBuildingId()); + icStatsResiWarnEntity.setConfigId(item.getId()); + icStatsResiWarnEntity.setCount(map.getCount()); + icStatsResiWarnEntity.setCustomerId(customerId); + icStatsResiWarnEntity.setGridId(map.getGridId()); + icStatsResiWarnEntity.setNeighborHoodId(map.getNeighborHoodId()); + icStatsResiWarnEntities.add(icStatsResiWarnEntity); + }); + + } + icStatsResiWarnService.insertBatch(icStatsResiWarnEntities,500); + + } +} 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 new file mode 100644 index 0000000000..4416ac2f2e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file