|
@@ -387,10 +387,15 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
|
|
|
@Override
|
|
|
public IndexValCensusVo indexValCensus(Long deptId, Long category) {
|
|
|
+ IndexValCensusVo vo = new IndexValCensusVo();
|
|
|
Set<Long> stationIds = null;
|
|
|
if (deptId != null && category != null) {
|
|
|
List<Long> deptIdList = departmentClient.getDepartmentPage(deptId,"1").getResult()
|
|
|
.stream().map(Department::getId).collect(Collectors.toList());
|
|
|
+ vo.setUserCount(customDisplayMapper.getDeptUserCount(deptIdList));
|
|
|
+ vo.setSewageCount(customDisplayMapper.getDeptSewageCount("1", deptIdList));
|
|
|
+ vo.setSludgeCount(customDisplayMapper.getDeptSewageCount("2", deptIdList));
|
|
|
+ vo.setPumpCount(customDisplayMapper.getDeptPumpCount(deptIdList));
|
|
|
if (category == 50701) {
|
|
|
List<TfDeptSewage> deptSewages = deptSewageService.list(new QueryWrapper<TfDeptSewage>()
|
|
|
.lambda().in(TfDeptSewage::getDeptId, deptIdList));
|
|
@@ -408,10 +413,18 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
stationIds = new HashSet<>();
|
|
|
stationIds.add(1000000000000000000L);
|
|
|
}
|
|
|
+
|
|
|
+ List<Department> deptCounts = departmentClient.getDepartmentPage(deptId,"0").getResult();
|
|
|
+ if (CollUtil.isNotEmpty(deptCounts)) {
|
|
|
+ vo.setDeptCount(deptCounts.size());
|
|
|
+ } else {
|
|
|
+ vo.setDeptCount(0);
|
|
|
+ }
|
|
|
}
|
|
|
- IndexValCensusVo vo = new IndexValCensusVo();
|
|
|
+
|
|
|
BigDecimal sewageWaterLastM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValLastM(stationIds).get("sewageWater")));
|
|
|
BigDecimal sewageWaterThisM = BigDecimal.valueOf(customDisplayMapper.getFillStcDayTotal(null, DateUtil.format(new Date(), "yyyy-MM"), null, stationIds));
|
|
|
+ BigDecimal sludgeHandleThisM = BigDecimal.valueOf(customDisplayMapper.getFillSludgeDayTotal(null, DateUtil.format(new Date(), "yyyy-MM"), null, stationIds));
|
|
|
BigDecimal sewageWaterToday = BigDecimal.valueOf(customDisplayMapper.getFillStcDayTotal(DateUtil.format(new Date(), "yyyy-MM-dd"), null, null, stationIds));
|
|
|
vo.setSewageWaterToday(sewageWaterToday);
|
|
|
|
|
@@ -433,24 +446,42 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
c.add(Calendar.DATE, +1);
|
|
|
String thisYear = sdfYear.format(c.getTime());
|
|
|
String thisYearMonth = sdfMonth.format(c.getTime());
|
|
|
- BigDecimal sewageWaterThisY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(thisYear, null, stationIds).get("sewageWater")));
|
|
|
- BigDecimal sewageWaterThisYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, thisYearMonth, stationIds).get("sewageWater")));
|
|
|
+ BigDecimal sewageWaterThisY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, thisYear, null, stationIds).get("sewageWater")));
|
|
|
+ BigDecimal sludgeHandleThisY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, thisYear, null, stationIds).get("sludgeHandle")));
|
|
|
+ BigDecimal sewageWaterThisYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, null, thisYearMonth, stationIds).get("sewageWater")));
|
|
|
c.add(Calendar.YEAR, -1);
|
|
|
String lastYear = sdfYear.format(c.getTime());
|
|
|
String lastYearMonth = sdfMonth.format(c.getTime());
|
|
|
- BigDecimal sewageWaterLastY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(lastYear, null, stationIds).get("sewageWater")));
|
|
|
- BigDecimal sewageWaterLastYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, lastYearMonth, stationIds).get("sewageWater")));
|
|
|
+ BigDecimal sewageWaterLastY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, lastYear, null, stationIds).get("sewageWater")));
|
|
|
+ BigDecimal sewageWaterLastYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, null, lastYearMonth, stationIds).get("sewageWater")));
|
|
|
vo.setSewageWaterLastM(sewageWaterLastM);
|
|
|
vo.setSewageWaterThisM(sewageWaterThisM);
|
|
|
+ vo.setSludgeHandleThisM(sludgeHandleThisM);
|
|
|
vo.setSewageWaterLastY(sewageWaterLastY);
|
|
|
vo.setAvgSewageWater(sewageWaterLastY.divide(BigDecimal.valueOf(365), 2, RoundingMode.HALF_UP).doubleValue());
|
|
|
vo.setSewageWaterThisY(sewageWaterThisY);
|
|
|
+ vo.setSludgeHandleThisY(sludgeHandleThisY);
|
|
|
vo.setSewageWaterPropY(getIndexValRate(sewageWaterLastM,sewageWaterThisYM));
|
|
|
vo.setYearOnYearSewageWaterRate(getYoyOrMomRate(sewageWaterThisYM,sewageWaterLastYM));
|
|
|
vo.setLinkRatioSewageWaterRate(getYoyOrMomRate(sewageWaterThisM,sewageWaterLastM));
|
|
|
vo.setDesignSewageWaterAll(customDisplayMapper.getDesignSewageWaterAll(stationIds));
|
|
|
vo.setBuildSewageStationNum(customDisplayMapper.getSewageStationNum("1", stationIds));
|
|
|
vo.setOperateSewageStationNum(customDisplayMapper.getSewageStationNum("0", stationIds));
|
|
|
+
|
|
|
+
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.add(Calendar.YEAR, -1);
|
|
|
+ calendar.add(Calendar.MONTH, -1);
|
|
|
+ String endTime = DateUtil.format(calendar.getTime(), "yyyy-MM");
|
|
|
+ calendar.set(Calendar.MONTH, 1);
|
|
|
+ String startTime = DateUtil.format(calendar.getTime(), "yyyy-MM");
|
|
|
+ BigDecimal sewageWaterLast = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(startTime, endTime, null, null, stationIds).get("sewageWater")));
|
|
|
+ BigDecimal sludgeHandleLast = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(startTime, endTime, null, null, stationIds).get("sludgeHandle")));
|
|
|
+ vo.setSewageWaterThisYYoY(getYoyOrMomRate(sewageWaterThisY,sewageWaterLast));
|
|
|
+ vo.setSludgeHandleThisYYOY(getYoyOrMomRate(sludgeHandleThisY,sludgeHandleLast));
|
|
|
+
|
|
|
+ vo.setSewageReportNumList(customDisplayMapper.viewSewageReportNum(stationIds, DateUtil.format(new Date(), "yyyy-MM-dd")));
|
|
|
+ vo.setDeviceCount(customDisplayMapper.viewSewageDeviceNum(stationIds, category));
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
@@ -472,6 +503,7 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
info.setEnergy(0.0);
|
|
|
info.setSludgeHandle(0.0);
|
|
|
info.setSludgeWaterRate(0f);
|
|
|
+ info.setSludgeDispose(0.0);
|
|
|
info.setSewageWater(0.0);
|
|
|
info.setEnergyWater(0.0);
|
|
|
info.setEnergyWaterThousand(0.0);
|
|
@@ -483,6 +515,7 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
info.setSludgeHandle(dayStatisticsFinal.get(0).getSludgeHandle());
|
|
|
info.setEnergy(dayStatisticsFinal.get(0).getEnergy());
|
|
|
info.setSludgeWaterRate(dayStatisticsFinal.get(0).getSludgeWaterRate());
|
|
|
+ info.setSludgeDispose(dayStatisticsFinal.get(0).getSludgeDispose());
|
|
|
}
|
|
|
if (info.getSewageWater() != null && info.getEnergy() != null && info.getSewageWater() != 0) {
|
|
|
BigDecimal energy = BigDecimal.valueOf(info.getEnergy());
|
|
@@ -591,6 +624,22 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
info.setEnergyMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergy()), BigDecimal.valueOf(statistics.getEnergy())));
|
|
|
info.setEnergyWaterMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergyWater()), BigDecimal.valueOf(statistics.getEnergyWater())));
|
|
|
info.setEnergySludgeMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergySludge()), BigDecimal.valueOf(statistics.getEnergySludge())));
|
|
|
+
|
|
|
+ info.setInCumulativeFlowMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInCumulativeFlow()), BigDecimal.valueOf(statistics.getInCumulativeFlow())));
|
|
|
+ info.setInCodMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInCod()), BigDecimal.valueOf(statistics.getInCod())));
|
|
|
+ info.setInSsMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInSs()), BigDecimal.valueOf(statistics.getInSs())));
|
|
|
+ info.setInNh3nMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInNh3n()), BigDecimal.valueOf(statistics.getInNh3n())));
|
|
|
+ info.setInPhMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInPh()), BigDecimal.valueOf(statistics.getInPh())));
|
|
|
+ info.setInTnMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInTn()), BigDecimal.valueOf(statistics.getInTn())));
|
|
|
+ info.setInTpMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInTp()), BigDecimal.valueOf(statistics.getInTp())));
|
|
|
+
|
|
|
+ info.setOutCumulativeFlowMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCumulativeFlow()), BigDecimal.valueOf(statistics.getOutCumulativeFlow())));
|
|
|
+ info.setOutCodMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCod()), BigDecimal.valueOf(statistics.getOutCod())));
|
|
|
+ info.setOutSsMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutSs()), BigDecimal.valueOf(statistics.getOutSs())));
|
|
|
+ info.setOutNh3nMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutNh3n()), BigDecimal.valueOf(statistics.getOutNh3n())));
|
|
|
+ info.setOutPhMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutPh()), BigDecimal.valueOf(statistics.getOutPh())));
|
|
|
+ info.setOutTnMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTn()), BigDecimal.valueOf(statistics.getOutTn())));
|
|
|
+ info.setOutTpMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTp()), BigDecimal.valueOf(statistics.getOutTp())));
|
|
|
}
|
|
|
|
|
|
calendar.add(Calendar.YEAR, -1);
|
|
@@ -609,6 +658,22 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
info.setEnergyYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergy()), BigDecimal.valueOf(statistics.getEnergy())));
|
|
|
info.setEnergyWaterYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergyWater()), BigDecimal.valueOf(statistics.getEnergyWater())));
|
|
|
info.setEnergySludgeYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergySludge()), BigDecimal.valueOf(statistics.getEnergySludge())));
|
|
|
+
|
|
|
+ info.setInCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCumulativeFlow()), BigDecimal.valueOf(statistics.getInCumulativeFlow())));
|
|
|
+ info.setInCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCod()), BigDecimal.valueOf(statistics.getInCod())));
|
|
|
+ info.setInSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInSs()), BigDecimal.valueOf(statistics.getInSs())));
|
|
|
+ info.setInNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInNh3n()), BigDecimal.valueOf(statistics.getInNh3n())));
|
|
|
+ info.setInPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInPh()), BigDecimal.valueOf(statistics.getInPh())));
|
|
|
+ info.setInTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTn()), BigDecimal.valueOf(statistics.getInTn())));
|
|
|
+ info.setInTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTp()), BigDecimal.valueOf(statistics.getInTp())));
|
|
|
+
|
|
|
+ info.setOutCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCumulativeFlow()), BigDecimal.valueOf(statistics.getOutCumulativeFlow())));
|
|
|
+ info.setOutCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCod()), BigDecimal.valueOf(statistics.getOutCod())));
|
|
|
+ info.setOutSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutSs()), BigDecimal.valueOf(statistics.getOutSs())));
|
|
|
+ info.setOutNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutNh3n()), BigDecimal.valueOf(statistics.getOutNh3n())));
|
|
|
+ info.setOutPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutPh()), BigDecimal.valueOf(statistics.getOutPh())));
|
|
|
+ info.setOutTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTn()), BigDecimal.valueOf(statistics.getOutTn())));
|
|
|
+ info.setOutTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTp()), BigDecimal.valueOf(statistics.getOutTp())));
|
|
|
});
|
|
|
break;
|
|
|
|
|
@@ -641,6 +706,22 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
|
|
|
info.setEnergyYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergy()), BigDecimal.valueOf(statistics.getEnergy())));
|
|
|
info.setEnergyWaterYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergyWater()), BigDecimal.valueOf(statistics.getEnergyWater())));
|
|
|
info.setEnergySludgeYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergySludge()), BigDecimal.valueOf(statistics.getEnergySludge())));
|
|
|
+
|
|
|
+ info.setInCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCumulativeFlow()), BigDecimal.valueOf(statistics.getInCumulativeFlow())));
|
|
|
+ info.setInCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCod()), BigDecimal.valueOf(statistics.getInCod())));
|
|
|
+ info.setInSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInSs()), BigDecimal.valueOf(statistics.getInSs())));
|
|
|
+ info.setInNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInNh3n()), BigDecimal.valueOf(statistics.getInNh3n())));
|
|
|
+ info.setInPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInPh()), BigDecimal.valueOf(statistics.getInPh())));
|
|
|
+ info.setInTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTn()), BigDecimal.valueOf(statistics.getInTn())));
|
|
|
+ info.setInTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTp()), BigDecimal.valueOf(statistics.getInTp())));
|
|
|
+
|
|
|
+ info.setOutCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCumulativeFlow()), BigDecimal.valueOf(statistics.getOutCumulativeFlow())));
|
|
|
+ info.setOutCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCod()), BigDecimal.valueOf(statistics.getOutCod())));
|
|
|
+ info.setOutSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutSs()), BigDecimal.valueOf(statistics.getOutSs())));
|
|
|
+ info.setOutNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutNh3n()), BigDecimal.valueOf(statistics.getOutNh3n())));
|
|
|
+ info.setOutPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutPh()), BigDecimal.valueOf(statistics.getOutPh())));
|
|
|
+ info.setOutTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTn()), BigDecimal.valueOf(statistics.getOutTn())));
|
|
|
+ info.setOutTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTp()), BigDecimal.valueOf(statistics.getOutTp())));
|
|
|
});
|
|
|
break;
|
|
|
}
|