|
@@ -3,6 +3,7 @@ package com.zoniot.ccrc.service.impl;
|
|
|
import com.zoniot.ccrc.commom.utils.UserUtil;
|
|
|
import com.zoniot.ccrc.commom.utils.Util;
|
|
|
import com.zoniot.ccrc.dao.AreaMapper;
|
|
|
+import com.zoniot.ccrc.dao.CommunityMapper;
|
|
|
import com.zoniot.ccrc.dao.DeviceMapper;
|
|
|
import com.zoniot.ccrc.dto.BuildingInfoListDto;
|
|
|
import com.zoniot.ccrc.dto.LoginUser;
|
|
@@ -27,6 +28,8 @@ public class StatAndAnalysisServiceImpl implements StatAndAnalysisService {
|
|
|
private AreaMapper areaMapper;
|
|
|
@Resource
|
|
|
private DeviceMapper deviceMapper;
|
|
|
+ @Resource
|
|
|
+ private CommunityMapper communityMapper;
|
|
|
|
|
|
@Override
|
|
|
public List<MapStatisticalDto> realTimeMapStatistical(Integer sysId, Integer type, String northEast, String southWest, Integer province, Integer city, Integer region, Integer community) {
|
|
@@ -49,7 +52,8 @@ public class StatAndAnalysisServiceImpl implements StatAndAnalysisService {
|
|
|
Integer userId = null;
|
|
|
if (loginUser.getRoleType() !=null && loginUser.getRoleType() == 4) userId = loginUser.getId();
|
|
|
|
|
|
- List<BuildingInfoListDto> buildingInfoListDtoList = deviceMapper.getBuildingStatistics(loginUser.getSiteId(),sysId, userId, null, province, city, region, community, type, longitudeMin, longitudeMax, latitudeMin, latitudeMax);
|
|
|
+ //List<BuildingInfoListDto> buildingInfoListDtoList = deviceMapper.getBuildingStatistics(loginUser.getSiteId(),sysId, userId, null, province, city, region, community, type, longitudeMin, longitudeMax, latitudeMin, latitudeMax);
|
|
|
+ List<BuildingInfoListDto> buildingInfoListDtoList = communityMapper.getStatistics(loginUser.getSiteId(),sysId, userId, null, province, city, region, community, type, longitudeMin, longitudeMax, latitudeMin, latitudeMax);
|
|
|
return this.mapStatistical(type, buildingInfoListDtoList);
|
|
|
}
|
|
|
|
|
@@ -133,32 +137,7 @@ public class StatAndAnalysisServiceImpl implements StatAndAnalysisService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- } else if(type == 5){
|
|
|
- //建筑
|
|
|
- if (buildingInfoListDtoList != null && buildingInfoListDtoList.size() > 0) {
|
|
|
- for (BuildingInfoListDto buildingInfoListDto : buildingInfoListDtoList) {
|
|
|
- MapStatisticalDto mapStatisticalDto = new MapStatisticalDto();
|
|
|
- mapStatisticalDto.setId(buildingInfoListDto.getBuildingId());
|
|
|
- mapStatisticalDto.setName(buildingInfoListDto.getBuildingName());
|
|
|
- mapStatisticalDto.setBuildingId(buildingInfoListDto.getBuildingId());
|
|
|
- mapStatisticalDto.setLongitude(buildingInfoListDto.getLongitude());
|
|
|
- mapStatisticalDto.setLatitude(buildingInfoListDto.getLatitude());
|
|
|
- mapStatisticalDto.setNormalCount(buildingInfoListDto.getNormalCount());
|
|
|
- mapStatisticalDto.setAlarmCount(buildingInfoListDto.getAlarmCount());
|
|
|
- mapStatisticalDto.setFaultCount(buildingInfoListDto.getFaultCount());
|
|
|
- mapStatisticalDto.setOfflineCount(buildingInfoListDto.getOfflineCount());
|
|
|
- mapStatisticalDto.setUnusedCount(buildingInfoListDto.getDeviceUnusedCount());
|
|
|
- mapStatisticalDto.setDeviceCount(buildingInfoListDto.getDeviceCount());
|
|
|
- mapStatisticalDto.setAddress(buildingInfoListDto.getAddress());
|
|
|
- mapStatisticalDto.setProvince(buildingInfoListDto.getProvince());
|
|
|
- mapStatisticalDto.setCity(buildingInfoListDto.getCity());
|
|
|
- mapStatisticalDto.setRegion(buildingInfoListDto.getRegion());
|
|
|
- mapStatisticalDto.setCommunity(buildingInfoListDto.getCommunity());
|
|
|
- mapStatisticalDto.setCode("BUILDING");
|
|
|
- list.add(mapStatisticalDto);
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if (provinceIds.size() > 1) {
|
|
|
//省
|
|
|
List<Area> areaList = areaMapper.findByIds(provinceIds);
|
|
@@ -185,30 +164,6 @@ public class StatAndAnalysisServiceImpl implements StatAndAnalysisService {
|
|
|
for (Integer id : communityIds) {
|
|
|
list.add(this.countAreaDeviceNum(buildingInfoListDtoList, id, null, null, 4));
|
|
|
}
|
|
|
- } else {
|
|
|
- //建筑
|
|
|
- if (buildingInfoListDtoList.size() > 0) {
|
|
|
- for (BuildingInfoListDto buildingInfoListDto : buildingInfoListDtoList) {
|
|
|
- MapStatisticalDto mapStatisticalDto = new MapStatisticalDto();
|
|
|
- mapStatisticalDto.setCode("BUILDING");
|
|
|
- mapStatisticalDto.setName(buildingInfoListDto.getBuildingName());
|
|
|
- mapStatisticalDto.setBuildingId(buildingInfoListDto.getBuildingId());
|
|
|
- mapStatisticalDto.setLongitude(buildingInfoListDto.getLongitude());
|
|
|
- mapStatisticalDto.setLatitude(buildingInfoListDto.getLatitude());
|
|
|
- mapStatisticalDto.setNormalCount(buildingInfoListDto.getNormalCount());
|
|
|
- mapStatisticalDto.setAlarmCount(buildingInfoListDto.getAlarmCount());
|
|
|
- mapStatisticalDto.setFaultCount(buildingInfoListDto.getFaultCount());
|
|
|
- mapStatisticalDto.setOfflineCount(buildingInfoListDto.getOfflineCount());
|
|
|
- mapStatisticalDto.setUnusedCount(buildingInfoListDto.getDeviceUnusedCount());
|
|
|
- mapStatisticalDto.setDeviceCount(buildingInfoListDto.getDeviceCount());
|
|
|
- mapStatisticalDto.setAddress(buildingInfoListDto.getAddress());
|
|
|
- mapStatisticalDto.setProvince(buildingInfoListDto.getProvince());
|
|
|
- mapStatisticalDto.setCity(buildingInfoListDto.getCity());
|
|
|
- mapStatisticalDto.setRegion(buildingInfoListDto.getRegion());
|
|
|
- mapStatisticalDto.setCommunity(buildingInfoListDto.getCommunity());
|
|
|
- list.add(mapStatisticalDto);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|