Browse Source

楼宇预警数量列表和人员列表修改

dev
lzh 4 years ago
parent
commit
343785a88c
  1. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java
  2. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  3. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  4. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
  7. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  8. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  9. 7
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  10. 9
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  11. 15
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  12. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java
  13. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java
  14. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
  15. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java
  16. 57
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java

@ -0,0 +1,26 @@
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 BuildingResultPagedDTO implements Serializable {
private static final long serialVersionUID = -2129418426919785999L;
/**
*
*/
private Integer total;
/**
* 议题列表
*/
private List<BuildingResultDTO> list;
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -523,6 +523,9 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/building/buildinglistbyids") @PostMapping("/gov/org/building/buildinglistbyids")
Result<List<BuildingResultDTO>> buildingListByIds(@RequestBody List<String> buildingIdList); Result<List<BuildingResultDTO>> buildingListByIds(@RequestBody List<String> buildingIdList);
@PostMapping("/gov/org/building/buildinglistbyidsPage/{pageNo}/{pageSize}")
Result<BuildingResultPagedDTO> buildinglistbyidsPage(@RequestBody List<String> buildingIdList,@PathVariable("pageNo") Integer pageNo,@PathVariable("pageSize")Integer pageSize);
@PostMapping("/gov/org/icneighborhood/getlistbyids") @PostMapping("/gov/org/icneighborhood/getlistbyids")
Result<List<IcNeighborHoodDTO>> getListByIds(@RequestBody List<String> ids); Result<List<IcNeighborHoodDTO>> getListByIds(@RequestBody List<String> ids);
} }

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -319,6 +319,10 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<BuildingResultDTO>> buildingListByIds(List<String> buildingIdList) { public Result<List<BuildingResultDTO>> buildingListByIds(List<String> buildingIdList) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList);
} }
@Override
public Result<BuildingResultPagedDTO> buildinglistbyidsPage(List<String> buildingIdList,Integer pageNo,Integer pageSize) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList,pageNo,pageSize);
}
@Override @Override
public Result<List<IcNeighborHoodDTO>> getListByIds(List<String> ids) { public Result<List<IcNeighborHoodDTO>> getListByIds(List<String> ids) {

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -33,6 +33,7 @@ import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.IcBulidingUnitFormDTO; import com.epmet.dto.form.IcBulidingUnitFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.IcBuildingUnitEntity; import com.epmet.entity.IcBuildingUnitEntity;
import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcBuildingExcel;
@ -232,4 +233,15 @@ public class BuildingController {
} }
@PostMapping("buildinglistbyidsPage/{pageNo}/{pageSize}")
public Result<BuildingResultPagedDTO> buildinglistbyidsPage(@RequestBody List<String> buildingIdList, @PathVariable("pageNo") Integer pageNo, @PathVariable("pageSize") Integer pageSize){
if(CollectionUtils.isEmpty(buildingIdList)){
return new Result();
}
return new Result<BuildingResultPagedDTO>().ok(buildingService.buildinglistbyidsPage(buildingIdList,pageNo,pageSize));
}
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -71,4 +71,6 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
Integer checkBuildName(@Param("neighborHoodId") String neighborHoodId,@Param("buildingName")String buildingName, @Param("buildingId")String buildingId); Integer checkBuildName(@Param("neighborHoodId") String neighborHoodId,@Param("buildingName")String buildingName, @Param("buildingId")String buildingId);
List<BuildingResultDTO> buildingListByIds(@Param("buildingIdList") List<String> buildingIdList); List<BuildingResultDTO> buildingListByIds(@Param("buildingIdList") List<String> buildingIdList);
IPage<BuildingResultDTO> buildingListByIds(IPage<IcBuildingEntity> page,@Param("buildingIdList") List<String> buildingIdList);
} }

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java

@ -21,6 +21,7 @@ import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcBuildingExcel;
@ -59,4 +60,6 @@ public interface BuildingService {
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ;
List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList); List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList);
BuildingResultPagedDTO buildinglistbyidsPage(List<String> buildingIdList, Integer pageNo, Integer pageSize);
} }

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -16,6 +16,7 @@ import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.*; import com.epmet.entity.*;
import com.epmet.enums.BuildingTypeEnums; import com.epmet.enums.BuildingTypeEnums;
@ -325,6 +326,17 @@ public class BuildingServiceImpl implements BuildingService {
public List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList) { public List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList) {
return icBuildingDao.buildingListByIds(buildingIdList); return icBuildingDao.buildingListByIds(buildingIdList);
} }
@Override
public BuildingResultPagedDTO buildinglistbyidsPage(List<String> buildingIdList,Integer pageNo, Integer pageSize) {
IPage<IcBuildingEntity> page = new Page<IcBuildingEntity>(pageNo,pageSize);
IPage<BuildingResultDTO> buildingResultDTOIPage = icBuildingDao.buildingListByIds(page, buildingIdList);
BuildingResultPagedDTO result = new BuildingResultPagedDTO();
result.setTotal(Long.valueOf(buildingResultDTOIPage.getTotal()).intValue());
result.setList(buildingResultDTOIPage.getRecords());
return result;
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) { private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>(); // QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();

1
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -329,6 +329,7 @@
<foreach collection="buildingIdList" open="(" separator="," close=")" item="val"> <foreach collection="buildingIdList" open="(" separator="," close=")" item="val">
#{val} #{val}
</foreach> </foreach>
order by gridName,neighborHoodName,buildingName
</select> </select>

7
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.form.CustomerFunctionListFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
@ -106,7 +103,7 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd") @PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd")
Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(); Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist")
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(); Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList();

9
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -6,10 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.form.CustomerFunctionListFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
@ -88,8 +85,8 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
} }
@Override @Override
public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd() { public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(IcResiCategoryStatsConfigFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryStatsListShowd"); return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryStatsListShowd",formDTO);
} }
@Override @Override

15
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -134,13 +134,18 @@ public class ResiCategoryStatsConfigController {
} }
@PostMapping("resicategorystatslistshowd") @PostMapping("resicategorystatslistshowd")
public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO){ public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){
//获取预警配置列表 //获取预警配置列表
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>() QueryWrapper<IcResiCategoryStatsConfigEntity> queryWrapper = new QueryWrapper();
.lambda() queryWrapper.lambda()
.eq(IcResiCategoryStatsConfigEntity::getCustomerId,tokenDTO.getCustomerId()) .eq(IcResiCategoryStatsConfigEntity::getCustomerId,tokenDTO.getCustomerId())
.eq(IcResiCategoryStatsConfigEntity::getStatus,"show")
.orderByAsc(IcResiCategoryStatsConfigEntity::getSort)); .orderByAsc(IcResiCategoryStatsConfigEntity::getSort);
if(!StringUtils.isEmpty(formDTO.getStatus())){
queryWrapper.lambda().eq(IcResiCategoryStatsConfigEntity::getStatus,formDTO.getStatus());
}
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(queryWrapper);
return new Result<List<IcResiCategoryStatsConfigDTO>>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class)); return new Result<List<IcResiCategoryStatsConfigDTO>>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class));
} }

10
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java

@ -40,6 +40,16 @@ public class StatsResiWarnFormDTO implements Serializable {
public interface ListSelectedBuilding {}; public interface ListSelectedBuilding {};
public interface ListSelectedUser {}; public interface ListSelectedUser {};
/**
* 当前页
*/
private Integer pageNo = 1;
/**
* 当前页数量
*/
private Integer pageSize = 10;
/** /**
* 组织id * 组织id
*/ */

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java

@ -51,6 +51,11 @@ public class IcStatsResiWarnBuildingResultDTO implements Serializable {
private Integer level3; private Integer level3;
private Integer levelCount3; private Integer levelCount3;
private String managementIcon;
private String dataIcon;
private String houseShowIcon;
private Integer count;
private List<String> buildingIdList1; private List<String> buildingIdList1;
private List<String> buildingIdList2; private List<String> buildingIdList2;
private List<String> buildingIdList3; private List<String> buildingIdList3;

11
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java

@ -37,7 +37,10 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
@ -80,10 +83,12 @@ public class StatsResiWarnController {
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
List<String> buildingIdList = formDTO.getBuildingIdList(); List<String> buildingIdList = formDTO.getBuildingIdList();
if(CollectionUtils.isEmpty(buildingIdList)){ if(CollectionUtils.isEmpty(buildingIdList)){
return new Result(); Map<String,Object> map = new HashMap<>();
map.put("total",0);
map.put("list",new ArrayList<>());
return new Result().ok(map);
} }
List<IcStatsResiWarnUserResultDTO> icStatsResiWarnUserResultDTOS = statsResiWarnService.userWarnList(customerId,formDTO.getConfigId(), formDTO.getBuildingIdList()); return new Result().ok(statsResiWarnService.userWarnList(customerId,formDTO.getConfigId(), formDTO.getBuildingIdList(),formDTO.getPageNo(),formDTO.getPageSize()));
return new Result().ok(icStatsResiWarnUserResultDTOS);
} }
/** /**

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java

@ -22,6 +22,7 @@ import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; import com.epmet.dto.result.IcStatsResiWarnUserResultDTO;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 预警统计表 * 预警统计表
@ -33,7 +34,7 @@ public interface StatsResiWarnService{
List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID); List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID);
List<IcStatsResiWarnUserResultDTO> userWarnList(String customerId,String configId, List<String> buildingIdList); Map<String,Object> userWarnList(String customerId, String configId, List<String> buildingIdList, Integer pageNo, Integer pageSize);
List<IcStatsResiResultDTO> list(String customerId,String id, String level); List<IcStatsResiResultDTO> list(String customerId,String id, String level);

57
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -9,10 +9,8 @@ import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcStatsResiWarnDao; import com.epmet.dao.IcStatsResiWarnDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO;
import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO;
import com.epmet.dto.result.IcStatsResiWarnUserResultDTO;
import com.epmet.entity.IcResiUserEntity; import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcStatsResiWarnEntity; import com.epmet.entity.IcStatsResiWarnEntity;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
@ -26,10 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -54,8 +49,15 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Override @Override
public List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID) { public List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID) {
List<IcStatsResiWarnBuildingResultDTO> result = new ArrayList<>(); List<IcStatsResiWarnBuildingResultDTO> result = new ArrayList<>();
//feign 获取当前配置类别列表
Result<List<IcResiCategoryStatsConfigDTO>> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(new IcResiCategoryStatsConfigFormDTO());
if (!statsResult.success() || null == statsResult.getData()) {
throw new RenException("配置类别查询失败:"+ statsResult.getMsg());
}
List<IcResiCategoryStatsConfigDTO> icResiCategoryStatsConfigDTOList = statsResult.getData();
//feign获取当前需要预警的配置信息以及阈值 //feign获取当前需要预警的配置信息以及阈值
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList();
if (!warnResult.success() || null == warnResult.getData()) { if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
} }
@ -75,9 +77,20 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
resiWarnBuildingResultDTO.setLevelCount1(0); resiWarnBuildingResultDTO.setLevelCount1(0);
resiWarnBuildingResultDTO.setLevelCount2(0); resiWarnBuildingResultDTO.setLevelCount2(0);
resiWarnBuildingResultDTO.setLevelCount3(0); resiWarnBuildingResultDTO.setLevelCount3(0);
resiWarnBuildingResultDTO.setCount(0);
resiWarnBuildingResultDTO.setBuildingIdList1(new ArrayList<>()); resiWarnBuildingResultDTO.setBuildingIdList1(new ArrayList<>());
resiWarnBuildingResultDTO.setBuildingIdList2(new ArrayList<>()); resiWarnBuildingResultDTO.setBuildingIdList2(new ArrayList<>());
resiWarnBuildingResultDTO.setBuildingIdList3(new ArrayList<>()); resiWarnBuildingResultDTO.setBuildingIdList3(new ArrayList<>());
//获取各类别数量
List<IcResiCategoryStatsConfigDTO> collect = icResiCategoryStatsConfigDTOList.stream().filter(i -> i.getTableName().equals(item.getTableName()) && i.getColumnName().equals(item.getColumnName())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(collect)){
resiWarnBuildingResultDTO.setManagementIcon(collect.get(0).getManagementIcon());
resiWarnBuildingResultDTO.setDataIcon(collect.get(0).getDataIcon());
resiWarnBuildingResultDTO.setHouseShowIcon(collect.get(0).getHouseShowIcon());
}
return resiWarnBuildingResultDTO; return resiWarnBuildingResultDTO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
//统计数量 //统计数量
@ -87,13 +100,17 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
} }
Map<String,IcStatsResiWarnBuildingResultDTO> warnResultMap = result.stream().collect(Collectors.toMap(IcStatsResiWarnBuildingResultDTO::getConfigId, Function.identity(),(k1, k2)->k1)); Map<String,IcStatsResiWarnBuildingResultDTO> warnResultMap = result.stream().collect(Collectors.toMap(IcStatsResiWarnBuildingResultDTO::getConfigId, Function.identity(),(k1, k2)->k1));
for (IcStatsResiWarnEntity item : icStatsResiWarnEntityList) { for (IcStatsResiWarnEntity item : icStatsResiWarnEntityList) {
IcStatsResiWarnBuildingResultDTO resiWarnBuildingResultDTO = warnResultMap.get(item.getConfigId());
//每栋楼的数量 //每栋楼的数量
Integer count = Optional.ofNullable(item.getCount()).orElse(0); Integer count = Optional.ofNullable(item.getCount()).orElse(0);
IcStatsResiWarnBuildingResultDTO resiWarnBuildingResultDTO = warnResultMap.get(item.getConfigId());
//判断数量 //判断数量
Integer levle1= resiWarnBuildingResultDTO.getLevel1(); Integer levle1= resiWarnBuildingResultDTO.getLevel1();
Integer levle2= resiWarnBuildingResultDTO.getLevel2(); Integer levle2= resiWarnBuildingResultDTO.getLevel2();
Integer levle3= resiWarnBuildingResultDTO.getLevel3(); Integer levle3= resiWarnBuildingResultDTO.getLevel3();
resiWarnBuildingResultDTO.setCount(resiWarnBuildingResultDTO.getCount()+count);
if(0 == count){ if(0 == count){
continue; continue;
} }
@ -115,17 +132,20 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
} }
@Override @Override
public List<IcStatsResiWarnUserResultDTO> userWarnList(String customerId,String configId, List<String> buildingIdList) { public Map<String,Object> userWarnList(String customerId,String configId, List<String> buildingIdList,Integer pageNo,Integer pageSize) {
//feign根据buildingIdList 获取网格,小区,楼宇 信息 //feign根据buildingIdList 获取网格,小区,楼宇 信息
Result<List<BuildingResultDTO>> buildingList = govOrgOpenFeignClient.buildingListByIds(buildingIdList); Result<BuildingResultPagedDTO> buildingPageList = govOrgOpenFeignClient.buildinglistbyidsPage(buildingIdList,pageNo,pageSize);
if (!buildingList.success() || null == buildingList.getData()) { if (!buildingPageList.success() || null == buildingPageList.getData()) {
throw new RenException("楼宇信息查询失败,buildingList="+ JSON.toJSONString(buildingIdList)); throw new RenException("楼宇信息查询失败,buildingList="+ JSON.toJSONString(buildingIdList));
} }
List<BuildingResultDTO> buildingResultDTOList = buildingList.getData(); BuildingResultPagedDTO pageData = buildingPageList.getData();
List<BuildingResultDTO> buildingResultDTOList = pageData.getList();
List<IcStatsResiWarnUserResultDTO> result = ConvertUtils.sourceToTarget(buildingResultDTOList,IcStatsResiWarnUserResultDTO.class); List<IcStatsResiWarnUserResultDTO> result = ConvertUtils.sourceToTarget(buildingResultDTOList,IcStatsResiWarnUserResultDTO.class);
Map<String,Object> mapResult = new HashMap<>();
mapResult.put("total",pageData.getTotal());
mapResult.put("list",result);
if(CollectionUtils.isEmpty(result)){ if(CollectionUtils.isEmpty(result)){
return new ArrayList<>(); return mapResult;
} }
//获取configId预警配置信息 //获取configId预警配置信息
IcResiCategoryWarnConfigDTO formDto = new IcResiCategoryWarnConfigDTO(); IcResiCategoryWarnConfigDTO formDto = new IcResiCategoryWarnConfigDTO();
@ -143,13 +163,16 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
List<Map<String, String>> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); List<Map<String, String>> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList());
item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames"));
}); });
return result;
return mapResult;
} }
@Override @Override
public List<IcStatsResiResultDTO> list(String customerId,String id, String level) { public List<IcStatsResiResultDTO> list(String customerId,String id, String level) {
//获取所有配置类项 getshow //获取所有配置类项 getshow
Result<List<IcResiCategoryStatsConfigDTO>> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(); IcResiCategoryStatsConfigFormDTO dto = new IcResiCategoryStatsConfigFormDTO();
dto.setStatus("show");
Result<List<IcResiCategoryStatsConfigDTO>> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(dto);
if (!statsResult.success() || null == statsResult.getData()) { if (!statsResult.success() || null == statsResult.getData()) {
throw new RenException("获取配置类项失败"); throw new RenException("获取配置类项失败");
} }

Loading…
Cancel
Save