|
@@ -11,14 +11,9 @@ import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.common.core.util.Arith;
|
|
|
import com.usky.common.core.util.DateUtils;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
-import com.usky.fire.domain.BscLawTrend;
|
|
|
-import com.usky.fire.domain.DemEnforceReportAttach;
|
|
|
-import com.usky.fire.domain.DemEnforceReportComplaint;
|
|
|
+import com.usky.fire.domain.*;
|
|
|
import com.usky.fire.mapper.BscLawTrendMapper;
|
|
|
-import com.usky.fire.service.BscLawTrendService;
|
|
|
-import com.usky.fire.service.DemEnforceReportAttachService;
|
|
|
-import com.usky.fire.service.DemEnforceReportComplaintService;
|
|
|
-import com.usky.fire.service.DemLawStatisticsService;
|
|
|
+import com.usky.fire.service.*;
|
|
|
import com.usky.fire.service.vo.ReportComplaintVO;
|
|
|
import com.usky.fire.service.vo.SiAeAllVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -48,6 +43,15 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
|
|
|
@Autowired
|
|
|
private DemEnforceReportAttachService demEnforceReportAttachService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BaseCompanyService baseCompanyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DemFireStatisticsService demFireStatisticsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DemFireStatisticsAttachService demFireStatisticsAttachService;
|
|
|
+
|
|
|
@Override
|
|
|
public Object lawTrendList(String moduleType) {
|
|
|
LambdaQueryWrapper<BscLawTrend> queryWrapper = Wrappers.lambdaQuery();
|
|
@@ -102,6 +106,95 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> companyData(String companyId) {
|
|
|
+ List<Map<String, Object>> list3 = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyName, BaseCompany::getCompanyId, BaseCompany::getCompanyCode,
|
|
|
+ BaseCompany::getAddress, BaseCompany::getLinkPerson, BaseCompany::getLinkPhone)
|
|
|
+ .eq(BaseCompany::getCompanyId, companyId).eq(BaseCompany::getEnable, 0);
|
|
|
+ List<BaseCompany> companylist = baseCompanyService.list(queryWrapper);
|
|
|
+ if (CollectionUtils.isNotEmpty(companylist)){
|
|
|
+ LambdaQueryWrapper<DemLawStatistics> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.eq(DemLawStatistics::getCompanyCode, companylist.get(0).getCompanyCode())
|
|
|
+ .eq(DemLawStatistics::getDeleteFlag, 0);
|
|
|
+ int count = demLawStatisticsService.count(queryWrapper1);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<DemFireStatistics> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper2.eq(DemFireStatistics::getCompanyCode, companylist.get(0).getCompanyCode());
|
|
|
+ int count1 = demFireStatisticsService.count(queryWrapper2);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<DemFireStatistics> queryWrapper3 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper3.select(DemFireStatistics::getFireTime, DemFireStatistics::getBurnedArea, DemFireStatistics::getFireGrade,
|
|
|
+ DemFireStatistics::getFireNumber)
|
|
|
+ .eq(DemFireStatistics::getCompanyCode, companylist.get(0).getCompanyCode())
|
|
|
+ .orderByDesc(DemFireStatistics::getId)
|
|
|
+ .last(" limit 1");
|
|
|
+ List<DemFireStatistics> list1 = demFireStatisticsService.list(queryWrapper3);
|
|
|
+ List<DemFireStatisticsAttach> list2 = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(list1)) {
|
|
|
+ LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper4 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper4.select(DemFireStatisticsAttach::getInitialFuelType1)
|
|
|
+ .eq(DemFireStatisticsAttach::getFireNumber, list1.get(0).getFireNumber());
|
|
|
+ list2 = demFireStatisticsAttachService.list(queryWrapper4);
|
|
|
+ }
|
|
|
+
|
|
|
+ QueryWrapper<DemLawStatistics> query = Wrappers.query();
|
|
|
+ query.select("COALESCE(sum(inspect_company)) as inspectCompany", "COALESCE(sum(fire_hazard)) as fireHazard",
|
|
|
+ "COALESCE(sum(rectificate_fire_hazard)) as rectificateFireHazard", "COALESCE(sum(penalty_amount)) as penaltyAmount",
|
|
|
+ "COALESCE(sum(correction_notice)) as correctionNotice", "COALESCE(sum(punishment_decision)) as punishmentDecision",
|
|
|
+ "COALESCE(sum(order_three_stops)) as orderThreeStops", "COALESCE(sum(temporary_seizure)) as temporarySeizure")
|
|
|
+ .eq("delete_flag", 0).eq("company_code", companylist.get(0).getCompanyCode());
|
|
|
+ List<Map<String, Object>> list = demLawStatisticsService.listMaps(query);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("companyAddress", companylist.get(0).getAddress());
|
|
|
+ map.put("linkPerson", companylist.get(0).getLinkPerson());
|
|
|
+ map.put("linkPhone", companylist.get(0).getLinkPhone());
|
|
|
+ map.put("censorCount", count);
|
|
|
+ map.put("fireCount", count1);
|
|
|
+ map.put("processDate", null);
|
|
|
+ map.put("carefullyCheckDate", null);
|
|
|
+ map.put("securityCheckDate", null);
|
|
|
+ map.put("inspectCompany", 0);
|
|
|
+ map.put("fireHazard", 0);
|
|
|
+ map.put("rectificateFireHazard", 0);
|
|
|
+ map.put("penaltyAmount", 0);
|
|
|
+ map.put("correctionNotice", 0);
|
|
|
+ map.put("punishmentDecision", 0);
|
|
|
+ map.put("orderThreeStops", 0);
|
|
|
+ map.put("temporarySeizure", 0);
|
|
|
+ map.put("fireTime", null);
|
|
|
+ map.put("disposalDuration", null);
|
|
|
+ map.put("burnedArea", null);
|
|
|
+ map.put("fireGrade", null);
|
|
|
+ map.put("mobilizeVehicles", 0);
|
|
|
+ map.put("squadron", null);
|
|
|
+ map.put("status", null);
|
|
|
+ map.put("initialFuelType1", null);
|
|
|
+ if (CollectionUtils.isNotEmpty(list1)) {
|
|
|
+ map.put("fireTime", list1.get(0).getFireTime());
|
|
|
+ map.put("burnedArea", list1.get(0).getBurnedArea());
|
|
|
+ map.put("fireGrade", list1.get(0).getFireGrade());
|
|
|
+ if (CollectionUtils.isNotEmpty(list2)){
|
|
|
+ map.put("initialFuelType1", list2.get(0).getInitialFuelType1());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(list.get(0))) {
|
|
|
+ map.put("inspectCompany", list.get(0).get("inspectCompany"));
|
|
|
+ map.put("fireHazard", list.get(0).get("fireHazard"));
|
|
|
+ map.put("rectificateFireHazard", list.get(0).get("rectificateFireHazard"));
|
|
|
+ map.put("penaltyAmount", list.get(0).get("penaltyAmount"));
|
|
|
+ map.put("correctionNotice", list.get(0).get("correctionNotice"));
|
|
|
+ map.put("punishmentDecision", list.get(0).get("punishmentDecision"));
|
|
|
+ map.put("orderThreeStops", list.get(0).get("orderThreeStops"));
|
|
|
+ map.put("temporarySeizure", list.get(0).get("temporarySeizure"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list3.add(map);
|
|
|
+ }
|
|
|
+ return list3;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public List<SiAeAllVO> monthLaw() {
|