|
@@ -48,27 +48,27 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
private MonitorDataReportService monitorDataReportService;
|
|
|
|
|
|
@Override
|
|
|
- public List<DeviceWaterSupply> deviceWaterReportForSixMonth(Integer companyOrgId,String sceneType, Integer parmType) {
|
|
|
+ public List<DeviceWaterSupply> deviceWaterReportForSixMonth(Integer companyOrgId, String sceneType, Integer parmType) {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
String tenantId = loginUser.getTenantId();
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
|
|
|
|
|
|
- List<DeviceWaterSupply> deviceWaterSupplies = homePageReportMapper.getDeviceWaterForSixMonth(companyOrgId,sceneType,parmType ,tenantId,loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ List<DeviceWaterSupply> deviceWaterSupplies = homePageReportMapper.getDeviceWaterForSixMonth(companyOrgId, sceneType, parmType, tenantId, loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
- BigDecimal amountCount = monitorDataReportService.getAmountCount(companyOrgId,null, sceneType, parmType,2 );
|
|
|
+ BigDecimal amountCount = monitorDataReportService.getAmountCount(companyOrgId, null, sceneType, parmType, 2);
|
|
|
|
|
|
DeviceWaterSupply deviceWaterSupplyMonth = new DeviceWaterSupply();
|
|
|
deviceWaterSupplyMonth.setOrderNo(1);
|
|
|
- deviceWaterSupplyMonth.setAmount(amountCount!=null?amountCount.divide(new BigDecimal("10000")):BigDecimal.ZERO);
|
|
|
+ deviceWaterSupplyMonth.setAmount(amountCount != null ? amountCount.divide(new BigDecimal("10000")) : BigDecimal.ZERO);
|
|
|
deviceWaterSupplyMonth.setYear(localDate.getYear());
|
|
|
deviceWaterSupplyMonth.setMonth(localDate.getMonthValue());
|
|
|
deviceWaterSupplyMonth.setDate(localDate);
|
|
|
- deviceWaterSupplyMonth.setDateLabel(localDate.getYear()+"-"+localDate.getMonthValue());
|
|
|
+ deviceWaterSupplyMonth.setDateLabel(localDate.getYear() + "-" + localDate.getMonthValue());
|
|
|
deviceWaterSupplies.add(0, deviceWaterSupplyMonth);
|
|
|
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
- LocalDate newLocalDate = localDate.plusMonths(-i );
|
|
|
+ LocalDate newLocalDate = localDate.plusMonths(-i);
|
|
|
if (i == deviceWaterSupplies.size()
|
|
|
|| newLocalDate.getMonthValue() != deviceWaterSupplies.get(i).getMonth().intValue()
|
|
|
|| newLocalDate.getYear() != deviceWaterSupplies.get(i).getYear().intValue()) {
|
|
@@ -79,27 +79,26 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
deviceWaterSupply.setYear(newLocalDate.getYear());
|
|
|
deviceWaterSupply.setMonth(newLocalDate.getMonthValue());
|
|
|
deviceWaterSupply.setDate(newLocalDate);
|
|
|
- deviceWaterSupply.setDateLabel(newLocalDate.getYear()+"-"+newLocalDate.getMonthValue());
|
|
|
+ deviceWaterSupply.setDateLabel(newLocalDate.getYear() + "-" + newLocalDate.getMonthValue());
|
|
|
deviceWaterSupplies.add(i, deviceWaterSupply);
|
|
|
} else {
|
|
|
deviceWaterSupplies.get(i).setOrderNo(i + 1);
|
|
|
deviceWaterSupplies.get(i).setDate(newLocalDate);
|
|
|
- deviceWaterSupplies.get(i).setDateLabel(newLocalDate.getYear()+"-"+newLocalDate.getMonthValue());
|
|
|
+ deviceWaterSupplies.get(i).setDateLabel(newLocalDate.getYear() + "-" + newLocalDate.getMonthValue());
|
|
|
}
|
|
|
}
|
|
|
deviceWaterSupplies.sort(Comparator.comparing(DeviceWaterSupply::getOrderNo).reversed());
|
|
|
|
|
|
|
|
|
-
|
|
|
return deviceWaterSupplies;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public CompanyCount countSceneByType(Integer companyOrgId) {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
- CompanyCount companyCount = homePageReportMapper.countSceneByType(companyOrgId,loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ CompanyCount companyCount = homePageReportMapper.countSceneByType(companyOrgId, loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
Integer company = userCenterClient.countCompanyByUser();
|
|
|
- companyCount.setCompany(company != null ? company:0);
|
|
|
+ companyCount.setCompany(company != null ? company : 0);
|
|
|
return companyCount;
|
|
|
}
|
|
|
|
|
@@ -112,17 +111,17 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
|
|
|
- CompanyProduce companyProduce = homePageReportMapper.getWaterSalesDetails(companyOrgId,loginUser.getTenantId(),loginUser.getType(),loginUser.getProgramItemList());
|
|
|
+ CompanyProduce companyProduce = homePageReportMapper.getWaterSalesDetails(companyOrgId, loginUser.getTenantId(), loginUser.getType(), loginUser.getProgramItemList());
|
|
|
|
|
|
- if(companyProduce == null ){
|
|
|
+ if (companyProduce == null) {
|
|
|
companyProduce = new CompanyProduce();
|
|
|
}
|
|
|
BigDecimal waterSupplyAmountForDay = BigDecimal.ZERO;
|
|
|
BigDecimal waterIntakeAmountForDay = BigDecimal.ZERO;
|
|
|
|
|
|
//3供水 4取水
|
|
|
- List<DeviceWaterDetail> deviceSupplyWaterDetailsForDay = monitorDataReportMapper.getDeviceWaterDetailForDay(companyOrgId,null,"水厂", 3, tenantId, localDate.plusDays(-1).getYear(), localDate.plusDays(-1).getMonthValue(), localDate.plusDays(-1).getDayOfMonth(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
- List<DeviceWaterDetail> deviceIntakeWaterDetailsForDay = monitorDataReportMapper.getDeviceWaterDetailForDay(companyOrgId,null,"水源", 4, tenantId, localDate.plusDays(-1).getYear(), localDate.plusDays(-1).getMonthValue(), localDate.plusDays(-1).getDayOfMonth(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ List<DeviceWaterDetail> deviceSupplyWaterDetailsForDay = monitorDataReportMapper.getDeviceWaterDetailForDay(companyOrgId, null, "水厂", 3, tenantId, localDate.plusDays(-1).getYear(), localDate.plusDays(-1).getMonthValue(), localDate.plusDays(-1).getDayOfMonth(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
+ List<DeviceWaterDetail> deviceIntakeWaterDetailsForDay = monitorDataReportMapper.getDeviceWaterDetailForDay(companyOrgId, null, "水源", 4, tenantId, localDate.plusDays(-1).getYear(), localDate.plusDays(-1).getMonthValue(), localDate.plusDays(-1).getDayOfMonth(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
//水厂获取实时流量并计算出当天流量
|
|
|
for (DeviceWaterDetail deviceWaterDetail : deviceSupplyWaterDetailsForDay) {
|
|
@@ -151,21 +150,21 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- BigDecimal waterSupplyAmountForMonth = monitorDataReportMapper.getDeviceWaterDetailForMonth(companyOrgId,null,"水厂", 3, tenantId, localDate.getYear(), localDate.getMonthValue(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal waterSupplyAmountForMonth = monitorDataReportMapper.getDeviceWaterDetailForMonth(companyOrgId, null, "水厂", 3, tenantId, localDate.getYear(), localDate.getMonthValue(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
if (waterSupplyAmountForMonth == null) {
|
|
|
waterSupplyAmountForMonth = BigDecimal.ZERO;
|
|
|
}
|
|
|
//水厂当月流量
|
|
|
companyProduce.setWaterSupply(
|
|
|
- (waterSupplyAmountForMonth.add(waterSupplyAmountForDay)).divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP));
|
|
|
+ (waterSupplyAmountForMonth.add(waterSupplyAmountForDay)).divide(new BigDecimal("10000"), 3, BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
|
- BigDecimal waterIntakeAmountForMonth = monitorDataReportMapper.getDeviceWaterDetailForMonth(companyOrgId,null,"水源", 4, tenantId, localDate.getYear(), localDate.getMonthValue(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal waterIntakeAmountForMonth = monitorDataReportMapper.getDeviceWaterDetailForMonth(companyOrgId, null, "水源", 4, tenantId, localDate.getYear(), localDate.getMonthValue(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
if (waterIntakeAmountForMonth == null) {
|
|
|
waterIntakeAmountForMonth = BigDecimal.ZERO;
|
|
|
}
|
|
|
//水源当月流量
|
|
|
companyProduce.setWaterIntake(
|
|
|
- (waterIntakeAmountForMonth.add(waterIntakeAmountForDay)).divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP));
|
|
|
+ (waterIntakeAmountForMonth.add(waterIntakeAmountForDay)).divide(new BigDecimal("10000"), 3, BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
|
return companyProduce;
|
|
|
}
|
|
@@ -178,47 +177,47 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
List<Integer> list1 = Stream.of(15, 7, 9, 11, 18, 19).collect(Collectors.toList()); //取水
|
|
|
List<Integer> list2 = Stream.of(15, 8, 10, 11, 18, 19).collect(Collectors.toList()); //供水
|
|
|
//管网水质
|
|
|
- WaterQualityRate pipeNetworkQuality = homePageReportMapper.getPipeNetworkQualification(companyOrgId,loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ WaterQualityRate pipeNetworkQuality = homePageReportMapper.getPipeNetworkQualification(companyOrgId, loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//水源水质
|
|
|
- WaterQualityRate waterSourceQuality = homePageReportMapper.getWaterQualification(companyOrgId,"水源",list1,loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ WaterQualityRate waterSourceQuality = homePageReportMapper.getWaterQualification(companyOrgId, "水源", list1, loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//水厂水质
|
|
|
- WaterQualityRate waterFactoryQuality = homePageReportMapper.getWaterQualification(companyOrgId,"水厂",list2,loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ WaterQualityRate waterFactoryQuality = homePageReportMapper.getWaterQualification(companyOrgId, "水厂", list2, loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//二供水质
|
|
|
- WaterQualityRate pumpingStationQuality = homePageReportMapper.getWaterQualification(companyOrgId,"泵站",list2,loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ WaterQualityRate pumpingStationQuality = homePageReportMapper.getWaterQualification(companyOrgId, "泵站", list2, loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
- if(pipeNetworkQuality != null){
|
|
|
- waterQualityRate.setAbnormal(waterQualityRate.getAbnormal()+pipeNetworkQuality.getAbnormal());
|
|
|
+ if (pipeNetworkQuality != null) {
|
|
|
+ waterQualityRate.setAbnormal(waterQualityRate.getAbnormal() + pipeNetworkQuality.getAbnormal());
|
|
|
waterQualityRate.setPipeNetworkQuality(pipeNetworkQuality.getAverageQuality());
|
|
|
waterQualityRate.setPipeNetworkAbnormal(pipeNetworkQuality.getAbnormal());
|
|
|
waterQualityRate.setAverageQuality(pipeNetworkQuality.getAverageQuality());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
waterQualityRate.setAverageQuality(new BigDecimal("100"));
|
|
|
}
|
|
|
- if(waterSourceQuality != null){
|
|
|
- waterQualityRate.setAbnormal(waterQualityRate.getAbnormal()+waterSourceQuality.getAbnormal());
|
|
|
+ if (waterSourceQuality != null) {
|
|
|
+ waterQualityRate.setAbnormal(waterQualityRate.getAbnormal() + waterSourceQuality.getAbnormal());
|
|
|
waterQualityRate.setWaterSourceQuality(waterSourceQuality.getAverageQuality());
|
|
|
waterQualityRate.setWaterSourceAbnormal(waterQualityRate.getAbnormal());
|
|
|
waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().add(waterSourceQuality.getAverageQuality()));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().add(new BigDecimal("100")));
|
|
|
}
|
|
|
- if(waterFactoryQuality != null){
|
|
|
- waterQualityRate.setAbnormal(waterQualityRate.getAbnormal()+waterFactoryQuality.getAbnormal());
|
|
|
+ if (waterFactoryQuality != null) {
|
|
|
+ waterQualityRate.setAbnormal(waterQualityRate.getAbnormal() + waterFactoryQuality.getAbnormal());
|
|
|
waterQualityRate.setWaterFactoryQuality(waterFactoryQuality.getAverageQuality());
|
|
|
waterQualityRate.setWaterFactoryAbnormal(waterFactoryQuality.getAbnormal());
|
|
|
waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().add(waterFactoryQuality.getAverageQuality()));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().add(new BigDecimal("100")));
|
|
|
}
|
|
|
- if(pumpingStationQuality != null){
|
|
|
- waterQualityRate.setAbnormal(waterQualityRate.getAbnormal()+pumpingStationQuality.getAbnormal());
|
|
|
+ if (pumpingStationQuality != null) {
|
|
|
+ waterQualityRate.setAbnormal(waterQualityRate.getAbnormal() + pumpingStationQuality.getAbnormal());
|
|
|
waterQualityRate.setPumpingStationQuality(pumpingStationQuality.getAverageQuality());
|
|
|
waterQualityRate.setPumpingStationAbnormal(pumpingStationQuality.getAbnormal());
|
|
|
waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().add(pumpingStationQuality.getAverageQuality()));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().add(new BigDecimal("100")));
|
|
|
}
|
|
|
- waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().divide(new BigDecimal("4"),3,BigDecimal.ROUND_HALF_UP));
|
|
|
+ waterQualityRate.setAverageQuality(waterQualityRate.getAverageQuality().divide(new BigDecimal("4"), 3, BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
|
return waterQualityRate;
|
|
|
}
|
|
@@ -226,27 +225,28 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
/**
|
|
|
* 水厂泵站 3 水源 4 水位 12
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public List<DeviceWaterSupply> monitorDataFifteenDays(Integer sceneId, String sceneType, Integer parmType) {
|
|
|
BigDecimal multipleData;
|
|
|
- if(sceneType.equals("泵站")){
|
|
|
+ if (sceneType.equals("泵站")) {
|
|
|
multipleData = new BigDecimal("1");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
multipleData = new BigDecimal("10000");
|
|
|
}
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
|
|
|
- List<DeviceWaterSupply> deviceWaterSupplies = homePageReportMapper.getMonitorDataFifteenDays( sceneId, sceneType, parmType,
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ List<DeviceWaterSupply> deviceWaterSupplies = homePageReportMapper.getMonitorDataFifteenDays(sceneId, sceneType, parmType,
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
//当天数据
|
|
|
- BigDecimal amountCount = monitorDataReportService.getAmountCount(null,sceneId, sceneType, parmType,1 );
|
|
|
+ BigDecimal amountCount = monitorDataReportService.getAmountCount(null, sceneId, sceneType, parmType, 1);
|
|
|
DeviceWaterSupply deviceWaterSupplyToday = new DeviceWaterSupply();
|
|
|
deviceWaterSupplyToday.setOrderNo(1);
|
|
|
- deviceWaterSupplyToday.setAmount(amountCount != null?amountCount:BigDecimal.ZERO);
|
|
|
+ deviceWaterSupplyToday.setAmount(amountCount != null ? amountCount : BigDecimal.ZERO);
|
|
|
deviceWaterSupplyToday.setYear(localDate.getYear());
|
|
|
deviceWaterSupplyToday.setMonth(localDate.getMonthValue());
|
|
|
deviceWaterSupplyToday.setDay(localDate.getDayOfMonth());
|
|
@@ -270,7 +270,7 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
deviceWaterSupplies.add(i, deviceWaterSupply);
|
|
|
} else {
|
|
|
deviceWaterSupplies.get(i).setOrderNo(i + 1);
|
|
|
- if(parmType != 12 ){ //不是水位就除以1000 转化为万
|
|
|
+ if (parmType != 12) { //不是水位就除以1000 转化为万
|
|
|
deviceWaterSupplies.get(i).amountConvert(multipleData);
|
|
|
}
|
|
|
deviceWaterSupplies.get(i).setDate(newLocalDate);
|
|
@@ -288,23 +288,23 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
LocalDate localDate = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
|
|
//余氯
|
|
|
- BigDecimal chlorine = homePageReportMapper.getWaterQualificationByMonth(localDate,11,sceneId,"水源",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal chlorine = homePageReportMapper.getWaterQualificationByMonth(localDate, 11, sceneId, "水源",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//浊度
|
|
|
- BigDecimal turbidity = homePageReportMapper.getWaterQualificationByMonth(localDate,10,sceneId,"水源",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal turbidity = homePageReportMapper.getWaterQualificationByMonth(localDate, 10, sceneId, "水源",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//PH
|
|
|
- BigDecimal ph = homePageReportMapper.getWaterQualificationByMonth(localDate,7,sceneId,"水源",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
- //压力
|
|
|
- BigDecimal pressure = homePageReportMapper.getWaterQualificationByMonth(localDate,13,sceneId,"水源",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal ph = homePageReportMapper.getWaterQualificationByMonth(localDate, 7, sceneId, "水源",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
+ //压力
|
|
|
+ BigDecimal pressure = homePageReportMapper.getWaterQualificationByMonth(localDate, 13, sceneId, "水源",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
WaterQualityRateForScene waterQualityRateForScene = new WaterQualityRateForScene();
|
|
|
- waterQualityRateForScene.setChlorine(chlorine!=null?chlorine:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setTurbidity(turbidity!=null?turbidity:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setPh(ph!=null?ph:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setPressure(pressure!=null?pressure:new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setChlorine(chlorine != null ? chlorine : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setTurbidity(turbidity != null ? turbidity : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setPh(ph != null ? ph : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setPressure(pressure != null ? pressure : new BigDecimal("100"));
|
|
|
return waterQualityRateForScene;
|
|
|
}
|
|
|
|
|
@@ -314,23 +314,23 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
LocalDate localDate = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
|
|
//余氯
|
|
|
- BigDecimal chlorine = homePageReportMapper.getWaterQualificationByMonth(localDate,11,sceneId,"泵站",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal chlorine = homePageReportMapper.getWaterQualificationByMonth(localDate, 11, sceneId, "泵站",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//浊度
|
|
|
- BigDecimal turbidity = homePageReportMapper.getWaterQualificationByMonth(localDate,10,sceneId,"泵站",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal turbidity = homePageReportMapper.getWaterQualificationByMonth(localDate, 10, sceneId, "泵站",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//PH
|
|
|
- BigDecimal ph = homePageReportMapper.getWaterQualificationByMonth(localDate,8,sceneId,"泵站",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal ph = homePageReportMapper.getWaterQualificationByMonth(localDate, 8, sceneId, "泵站",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//压力
|
|
|
- BigDecimal pressure = homePageReportMapper.getWaterQualificationByMonth(localDate,13,sceneId,"泵站",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal pressure = homePageReportMapper.getWaterQualificationByMonth(localDate, 13, sceneId, "泵站",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
WaterQualityRateForScene waterQualityRateForScene = new WaterQualityRateForScene();
|
|
|
- waterQualityRateForScene.setChlorine(chlorine!=null?chlorine:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setTurbidity(turbidity!=null?turbidity:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setPh(ph!=null?ph:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setPressure(pressure!=null?pressure:new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setChlorine(chlorine != null ? chlorine : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setTurbidity(turbidity != null ? turbidity : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setPh(ph != null ? ph : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setPressure(pressure != null ? pressure : new BigDecimal("100"));
|
|
|
return waterQualityRateForScene;
|
|
|
}
|
|
|
|
|
@@ -340,54 +340,54 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
LocalDate localDate = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
|
|
//余氯
|
|
|
- BigDecimal chlorine = homePageReportMapper.getWaterQualificationByMonth(localDate,11,sceneId,"水厂",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal chlorine = homePageReportMapper.getWaterQualificationByMonth(localDate, 11, sceneId, "水厂",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//浊度
|
|
|
- BigDecimal turbidity = homePageReportMapper.getWaterQualificationByMonth(localDate,10,sceneId,"水厂",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal turbidity = homePageReportMapper.getWaterQualificationByMonth(localDate, 10, sceneId, "水厂",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//PH
|
|
|
- BigDecimal ph = homePageReportMapper.getWaterQualificationByMonth(localDate,8,sceneId,"水厂",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal ph = homePageReportMapper.getWaterQualificationByMonth(localDate, 8, sceneId, "水厂",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
//压力
|
|
|
- BigDecimal pressure = homePageReportMapper.getWaterQualificationByMonth(localDate,13,sceneId,"水厂",
|
|
|
- loginUser.getTenantId(),loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ BigDecimal pressure = homePageReportMapper.getWaterQualificationByMonth(localDate, 13, sceneId, "水厂",
|
|
|
+ loginUser.getTenantId(), loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
WaterQualityRateForScene waterQualityRateForScene = new WaterQualityRateForScene();
|
|
|
- waterQualityRateForScene.setChlorine(chlorine!=null?chlorine:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setTurbidity(turbidity!=null?turbidity:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setPh(ph!=null?ph:new BigDecimal("100"));
|
|
|
- waterQualityRateForScene.setPressure(pressure!=null?pressure:new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setChlorine(chlorine != null ? chlorine : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setTurbidity(turbidity != null ? turbidity : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setPh(ph != null ? ph : new BigDecimal("100"));
|
|
|
+ waterQualityRateForScene.setPressure(pressure != null ? pressure : new BigDecimal("100"));
|
|
|
return waterQualityRateForScene;
|
|
|
}
|
|
|
+
|
|
|
//制水、药耗、电耗对比曲线
|
|
|
@Override
|
|
|
- public List<WaterSupplyChart> waterEnergyConsumption( Integer sceneId,String sceneType) {
|
|
|
+ public List<WaterSupplyChart> waterEnergyConsumption(Integer sceneId, String sceneType) {
|
|
|
BigDecimal multipleData;
|
|
|
- if(sceneType.equals("泵站")){
|
|
|
+ if (sceneType.equals("泵站")) {
|
|
|
multipleData = new BigDecimal("1");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
multipleData = new BigDecimal("10000");
|
|
|
}
|
|
|
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
String tenantId = loginUser.getTenantId();
|
|
|
|
|
|
- List<WaterSupplyData> waterSupplyDatas = homePageReportMapper.getWaterSupplyData(sceneId,sceneType,tenantId,loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
+ List<WaterSupplyData> waterSupplyDatas = homePageReportMapper.getWaterSupplyData(sceneId, sceneType, tenantId, loginUser.getType(), loginUser.getPermissonType(), loginUser.getProgramItemList());
|
|
|
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
//当天数据
|
|
|
- BigDecimal waterDataCountDay = monitorDataReportService.getAmountCount(null,sceneId, sceneType, 3,1 );
|
|
|
- BigDecimal powerDataCountDay = monitorDataReportService.getAmountCount(null,sceneId, sceneType, 5,1 );
|
|
|
- BigDecimal drugDataCountDay = monitorDataReportService.getAmountCount(null,sceneId, sceneType, 6,1 );
|
|
|
+ BigDecimal waterDataCountDay = monitorDataReportService.getAmountCount(null, sceneId, sceneType, 3, 1);
|
|
|
+ BigDecimal powerDataCountDay = monitorDataReportService.getAmountCount(null, sceneId, sceneType, 5, 1);
|
|
|
+ BigDecimal drugDataCountDay = monitorDataReportService.getAmountCount(null, sceneId, sceneType, 6, 1);
|
|
|
WaterSupplyChart waterSupplyChartToday = new WaterSupplyChart();
|
|
|
waterSupplyChartToday.setSort(localDate.getDayOfMonth());
|
|
|
waterSupplyChartToday.setDate(DateTimeFormatter.ofPattern("yyyy-MM-dd").format(localDate));
|
|
|
- waterSupplyChartToday.setWaterData(waterDataCountDay.divide(multipleData,3,BigDecimal.ROUND_HALF_UP));
|
|
|
- waterSupplyChartToday.setPowerData(powerDataCountDay.divide(multipleData,3,BigDecimal.ROUND_HALF_UP));
|
|
|
+ waterSupplyChartToday.setWaterData(waterDataCountDay.divide(multipleData, 3, BigDecimal.ROUND_HALF_UP));
|
|
|
+ waterSupplyChartToday.setPowerData(powerDataCountDay.divide(multipleData, 3, BigDecimal.ROUND_HALF_UP));
|
|
|
waterSupplyChartToday.setDrugData(drugDataCountDay);
|
|
|
|
|
|
|
|
|
-
|
|
|
List<WaterSupplyChart> waterSupplyCharts = new ArrayList<>();
|
|
|
waterSupplyDatas.stream()
|
|
|
.collect(Collectors.groupingBy(item -> item.getYear() + "-" + item.getMonth() + "-" + item.getDay()))
|
|
@@ -398,9 +398,9 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
waterSupplyChart.setSort(waterSupplyData.getDay());
|
|
|
|
|
|
if (waterSupplyData.getParmType() == 3) { //供水
|
|
|
- waterSupplyChart.setWaterData(waterSupplyData.getAmount().divide(multipleData,3,BigDecimal.ROUND_HALF_UP));
|
|
|
+ waterSupplyChart.setWaterData(waterSupplyData.getAmount().divide(multipleData, 3, BigDecimal.ROUND_HALF_UP));
|
|
|
} else if (waterSupplyData.getParmType() == 5) {//电耗
|
|
|
- waterSupplyChart.setPowerData(waterSupplyData.getAmount().divide(multipleData,3,BigDecimal.ROUND_HALF_UP));
|
|
|
+ waterSupplyChart.setPowerData(waterSupplyData.getAmount().divide(multipleData, 3, BigDecimal.ROUND_HALF_UP));
|
|
|
} else if (waterSupplyData.getParmType() == 6) {//药耗
|
|
|
waterSupplyChart.setDrugData(waterSupplyData.getAmount());
|
|
|
}
|
|
@@ -410,12 +410,12 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
waterSupplyCharts.sort(Comparator.comparing(WaterSupplyChart::getSort));
|
|
|
|
|
|
- Integer maxDay = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth();
|
|
|
- for(int i=0;i<maxDay;i++){
|
|
|
- if(i+1 == localDate.getDayOfMonth()){
|
|
|
- waterSupplyCharts.add(i,waterSupplyChartToday);
|
|
|
- }else if(i == waterSupplyCharts.size() || !waterSupplyCharts.get(i).getSort().equals(i+1)){
|
|
|
- waterSupplyCharts.add(i,new WaterSupplyChart(i+1, localDate.getYear()+"-"+localDate.getMonthValue()+"-"+(i+1)));
|
|
|
+ Integer maxDay = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth();
|
|
|
+ for (int i = 0; i < maxDay; i++) {
|
|
|
+ if (i + 1 == localDate.getDayOfMonth()) {
|
|
|
+ waterSupplyCharts.add(i, waterSupplyChartToday);
|
|
|
+ } else if (i == waterSupplyCharts.size() || !waterSupplyCharts.get(i).getSort().equals(i + 1)) {
|
|
|
+ waterSupplyCharts.add(i, new WaterSupplyChart(i + 1, localDate.getYear() + "-" + localDate.getMonthValue() + "-" + (i + 1)));
|
|
|
}
|
|
|
|
|
|
}
|