|
@@ -5,11 +5,11 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.common.core.util.Arith;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
-import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.fire.domain.*;
|
|
|
import com.usky.fire.mapper.BscEnterpriseAutonomyMapper;
|
|
|
import com.usky.fire.service.*;
|
|
@@ -71,6 +71,21 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
@Autowired
|
|
|
private BaseCompanyAttach1Service baseCompanyAttach1Service;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AlarmElectricalFireService alarmElectricalFireService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AlarmSprayWaterService alarmSprayWaterService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AlarmHydrantWaterService alarmHydrantWaterService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AlarmSmokeControlService alarmSmokeControlService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AlarmVideoService alarmVideoService;
|
|
|
+
|
|
|
@Override
|
|
|
public Object enterpriseAutonomy(String moduleType, String dataType) {
|
|
|
LambdaQueryWrapper<BscEnterpriseAutonomy> queryWrapper = Wrappers.lambdaQuery();
|
|
@@ -155,7 +170,7 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
queryWrapper3.select(BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
|
|
|
BaseCompanyAttach1::getRegisteredCapital, BaseCompanyAttach1::getBusinessStatus, BaseCompanyAttach1::getPaidCapital,
|
|
|
BaseCompanyAttach1::getRegistrar, BaseCompanyAttach1::getCompletedTime, BaseCompanyAttach1::getFireRating,
|
|
|
- BaseCompanyAttach1::getBuildingHeight, BaseCompanyAttach1::getBuildingStructure,BaseCompanyAttach1::getConstruction)
|
|
|
+ BaseCompanyAttach1::getBuildingHeight, BaseCompanyAttach1::getBuildingStructure, BaseCompanyAttach1::getConstruction)
|
|
|
.eq(BaseCompanyAttach1::getCompanyId, companyId);
|
|
|
List<BaseCompanyAttach1> list3 = baseCompanyAttach1Service.list(queryWrapper3);
|
|
|
for (int i = 0; i < list1.size(); i++) {
|
|
@@ -678,7 +693,7 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
query.select("street_town as streetTown", "company_type as companyType", "count(id) as count")
|
|
|
.eq("enable", 0)
|
|
|
// .ne("street_town", "")
|
|
|
- .in("street_town",streetTownList)
|
|
|
+ .in("street_town", streetTownList)
|
|
|
.groupBy("street_town,company_type");
|
|
|
List<Map<String, Object>> list1 = baseCompanyService.listMaps(query);
|
|
|
|
|
@@ -686,7 +701,7 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
query1.select("street_town as streetTown")
|
|
|
.eq("enable", 0)
|
|
|
// .ne("street_town", "")
|
|
|
- .in("street_town",streetTownList)
|
|
|
+ .in("street_town", streetTownList)
|
|
|
.groupBy("street_town");
|
|
|
List<Map<String, Object>> list2 = baseCompanyService.listMaps(query1);
|
|
|
|
|
@@ -738,4 +753,30 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
|
|
|
map.put("data", data);
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> iotDisposal(String streetTown, String startDate, String endDate) {
|
|
|
+ List<String> companyIdList = new ArrayList<>();
|
|
|
+ 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;
|
|
|
+ double alarmProcessedRate = Arith.div(alarmProcessedCount, alarmCount, 2) * 100;
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("alarmCount", alarmCount);
|
|
|
+ map.put("alarmProcessedCount", alarmProcessedCount);
|
|
|
+ map.put("alarmProcessedRate", alarmProcessedRate + "%");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|