|
|
|
|
@ -1,11 +1,14 @@
|
|
|
|
|
package com.mh.user.service.impl; |
|
|
|
|
|
|
|
|
|
import com.mh.user.constants.Constant; |
|
|
|
|
import com.mh.user.entity.AlarmInfoSumEntity; |
|
|
|
|
import com.mh.user.entity.DeviceStateEntity; |
|
|
|
|
import com.mh.user.entity.EnergySumEntity; |
|
|
|
|
import com.mh.user.entity.MaintainSumEntity; |
|
|
|
|
import com.mh.user.mapper.AreaMapper; |
|
|
|
|
import com.mh.user.mapper.SummaryMapper; |
|
|
|
|
import com.mh.user.service.BuildingService; |
|
|
|
|
import com.mh.user.service.DealDataService; |
|
|
|
|
import com.mh.user.service.SummaryService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
@ -29,6 +32,11 @@ public class SummaryServiceImpl implements SummaryService {
|
|
|
|
|
@Autowired |
|
|
|
|
private BuildingService buildingService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DealDataService dealDataService; |
|
|
|
|
@Autowired |
|
|
|
|
private AreaMapper areaMapper; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public DeviceStateEntity queryDeviceState() { |
|
|
|
|
return summaryMapper.queryDeviceState(); |
|
|
|
|
@ -39,7 +47,15 @@ public class SummaryServiceImpl implements SummaryService {
|
|
|
|
|
// 判断层级属于校区
|
|
|
|
|
if (level == 1) { |
|
|
|
|
// 根据buildingId查询对应的所有楼栋id
|
|
|
|
|
List<String> strings = buildingService.queryBuildingIdListByAreaId(buildingId); |
|
|
|
|
// 如果是属于华夏的,只需要对应area_id
|
|
|
|
|
String customName = dealDataService.customName(); |
|
|
|
|
List<String> strings = new ArrayList<>(); |
|
|
|
|
if (customName.contains(Constant.CUSTOM_NAME_HUAXIA)) { |
|
|
|
|
String areaId = areaMapper.selectById(buildingId).getAreaId(); |
|
|
|
|
strings.add(areaId); |
|
|
|
|
} else { |
|
|
|
|
strings = buildingService.queryBuildingIdListByAreaId(buildingId); |
|
|
|
|
} |
|
|
|
|
// 查询所有楼栋人数
|
|
|
|
|
int count = buildingService.queryCheckInCount(buildingId); |
|
|
|
|
// 遍历楼栋id,查询所有楼栋的energySum
|
|
|
|
|
|