|
@@ -14,6 +14,7 @@ import com.usky.fire.domain.*;
|
|
|
import com.usky.fire.mapper.BscEnterpriseAutonomyMapper;
|
|
|
import com.usky.fire.service.*;
|
|
|
import com.usky.fire.service.util.OnlineMethod;
|
|
|
+import com.usky.fire.service.vo.DataCountVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -757,21 +758,12 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
@Override
|
|
|
public Map<String, Object> iotDisposal(String streetTown, String startDate, String endDate) {
|
|
|
List<String> companyIdList = new ArrayList<>();
|
|
|
- if(StringUtils.isNotBlank(streetTown)){
|
|
|
+ if (StringUtils.isNotBlank(streetTown)) {
|
|
|
companyIdList = baseCompanyService.companyIdList(streetTown);
|
|
|
}
|
|
|
- int untreatedCount1 = alarmElectricalFireService.electricalFireCount(companyIdList, 0, null, startDate, endDate);
|
|
|
- int processedCount1 = alarmElectricalFireService.electricalFireCount(companyIdList, 1, null, startDate, endDate);
|
|
|
- int untreatedCount2 = alarmSprayWaterService.sprayWaterCount(companyIdList, 0, null, startDate, endDate);
|
|
|
- int processedCount2 = alarmSprayWaterService.sprayWaterCount(companyIdList, 1, null, startDate, endDate);
|
|
|
- int untreatedCount3 = alarmHydrantWaterService.hydrantWaterCount(companyIdList, 0, null, startDate, endDate);
|
|
|
- int processedCount3 = alarmHydrantWaterService.hydrantWaterCount(companyIdList, 1, null, startDate, endDate);
|
|
|
- int untreatedCount4 = alarmSmokeControlService.smokeCount(companyIdList, 0, null, startDate, endDate);
|
|
|
- int processedCount4 = alarmSmokeControlService.smokeCount(companyIdList, 1, null, startDate, endDate);
|
|
|
- int untreatedCount5 = alarmVideoService.videoCount(companyIdList, 0, null, startDate, endDate);
|
|
|
- int processedCount5 = alarmVideoService.videoCount(companyIdList, 1, null, startDate, endDate);
|
|
|
- int alarmCount = untreatedCount1 + processedCount1 + untreatedCount2 + processedCount2 + untreatedCount3 + processedCount3 + untreatedCount4 + processedCount4 + untreatedCount5 + processedCount5;
|
|
|
- int alarmProcessedCount = processedCount1 + processedCount2 + processedCount3 + processedCount4 + processedCount5;
|
|
|
+ int alarmUntreatedCount = this.alarmCount(companyIdList, 0, startDate, endDate);
|
|
|
+ int alarmProcessedCount = this.alarmCount(companyIdList, 1, startDate, endDate);
|
|
|
+ int alarmCount = alarmUntreatedCount + alarmProcessedCount;
|
|
|
double alarmProcessedRate = Arith.div(alarmProcessedCount, alarmCount, 2) * 100;
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("alarmCount", alarmCount);
|
|
@@ -779,4 +771,64 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
map.put("alarmProcessedRate", alarmProcessedRate + "%");
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int alarmCount(List<String> companyIdList, Integer handlingStatus, String startDate, String endDate) {
|
|
|
+ int count1 = alarmElectricalFireService.electricalFireCount(companyIdList, handlingStatus, null, startDate, endDate);
|
|
|
+ int count2 = alarmSprayWaterService.sprayWaterCount(companyIdList, handlingStatus, null, startDate, endDate);
|
|
|
+ int count3 = alarmHydrantWaterService.hydrantWaterCount(companyIdList, handlingStatus, null, startDate, endDate);
|
|
|
+ int count4 = alarmSmokeControlService.smokeCount(companyIdList, handlingStatus, null, startDate, endDate);
|
|
|
+ int count5 = alarmVideoService.videoCount(companyIdList, handlingStatus, null, startDate, endDate);
|
|
|
+ int count6 = alarmFireService.fireCount(companyIdList, handlingStatus, null, null, startDate, endDate);
|
|
|
+ int count = count1 + count2 + count3 + count4 + count5 + count6;
|
|
|
+ return count;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> streetDynamic() {
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ List<String> streetTownList = new ArrayList<>();
|
|
|
+ streetTownList.add("华漕镇");
|
|
|
+ streetTownList.add("新虹街道");
|
|
|
+ streetTownList.add("七宝镇");
|
|
|
+ streetTownList.add("虹桥镇");
|
|
|
+ streetTownList.add("古美路街道");
|
|
|
+ streetTownList.add("莘庄镇");
|
|
|
+ streetTownList.add("梅陇镇");
|
|
|
+ streetTownList.add("颛桥镇");
|
|
|
+ streetTownList.add("马桥镇");
|
|
|
+ streetTownList.add("江川路街道");
|
|
|
+ streetTownList.add("吴泾镇");
|
|
|
+ streetTownList.add("浦锦街道");
|
|
|
+ streetTownList.add("浦江镇");
|
|
|
+ List<DataCountVo> dataCountVos = baseMapper.deviceStatusCount(streetTownList);
|
|
|
+ for (int i = 0; i < streetTownList.size(); i++) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("streetTown", streetTownList.get(i));
|
|
|
+ map.put("processedRate", "0%");
|
|
|
+ List<String> companyIdList = baseCompanyService.companyIdList(streetTownList.get(i));
|
|
|
+ if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
+ int alarmUntreatedCount = this.alarmCount(companyIdList, 0, null, null);
|
|
|
+ int alarmProcessedCount = this.alarmCount(companyIdList, 1, null, null);
|
|
|
+ double alarmProcessedRate = Arith.div(alarmProcessedCount, alarmUntreatedCount + alarmProcessedCount, 2) * 100;
|
|
|
+ map.put("processedRate", alarmProcessedRate + "%");
|
|
|
+ }
|
|
|
+ int deviceCount = 0;
|
|
|
+ int onLineCount = 0;
|
|
|
+ for (int j = 0; j < dataCountVos.size(); j++) {
|
|
|
+ if (streetTownList.get(i).equals(dataCountVos.get(j).getListName())) {
|
|
|
+ deviceCount = deviceCount + dataCountVos.get(j).getListCount();
|
|
|
+ if (dataCountVos.get(j).getListType() == 1) {
|
|
|
+ onLineCount = onLineCount + dataCountVos.get(j).getListCount();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("deviceCount", deviceCount);
|
|
|
+ map.put("onLineCount", onLineCount);
|
|
|
+ double onLineRate = Arith.div(onLineCount, deviceCount, 2) * 100;
|
|
|
+ map.put("onLineRate", onLineRate + "%");
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|