|
@@ -14,7 +14,6 @@ import com.huaxu.model.LoginUser;
|
|
|
import com.huaxu.service.HomePageReportService;
|
|
|
import com.huaxu.service.MonitorDataReportService;
|
|
|
import com.huaxu.util.UserUtil;
|
|
|
-import org.apache.commons.lang3.Conversion;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -45,7 +44,7 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
private MonitorDataReportMapper monitorDataReportMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private MonitorDataReportService MonitorDataReportService;
|
|
|
+ private MonitorDataReportService monitorDataReportService;
|
|
|
|
|
|
@Override
|
|
|
public List<DeviceWaterSupply> deviceWaterReportForSixMonth(Integer companyOrgId,String sceneType, Integer parmType) {
|
|
@@ -56,11 +55,11 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
List<DeviceWaterSupply> deviceWaterSupplies = homePageReportMapper.getDeviceWaterForSixMonth(companyOrgId,sceneType,parmType ,tenantId,loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList());
|
|
|
|
|
|
- BigDecimal AmountCountMonth = 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(AmountCountMonth!=null?AmountCountMonth.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);
|
|
@@ -102,7 +101,7 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
List<DeviceWaterSupply> deviceWaterSupplies = homePageReportMapper.getDeviceWaterForMonth(companyOrgId,sceneType,parmType ,tenantId,loginUser.getType(),loginUser.getPermissonType(),loginUser.getProgramItemList(),month);
|
|
|
|
|
|
- BigDecimal AmountCountMonth = MonitorDataReportService.getAmountCount(companyOrgId,null, sceneType, parmType,2 );
|
|
|
+ BigDecimal AmountCountMonth = monitorDataReportService.getAmountCount(companyOrgId,null, sceneType, parmType,2 );
|
|
|
|
|
|
DeviceWaterSupply deviceWaterSupplyMonth = new DeviceWaterSupply();
|
|
|
deviceWaterSupplyMonth.setOrderNo(1);
|
|
@@ -154,7 +153,7 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
public CompanyProduce deviceWaterAmount(Integer companyOrgId) {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
String tenantId = loginUser.getTenantId();
|
|
|
- Map<Integer, MonitorDataEntity> MonitorDataMap = MonitorDataReportService.getIntegerMonitorDataEntityMap(loginUser);
|
|
|
+ Map<Integer, MonitorDataEntity> MonitorDataMap = monitorDataReportService.getIntegerMonitorDataEntityMap(loginUser);
|
|
|
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
|
|
@@ -272,7 +271,7 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
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);
|
|
@@ -399,13 +398,13 @@ public class HomePageReportServiceImpl implements HomePageReportService {
|
|
|
|
|
|
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);
|
|
|
+ waterSupplyChartToday.setWaterData(waterDataCountDay.divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP));
|
|
|
waterSupplyChartToday.setPowerData(powerDataCountDay);
|
|
|
waterSupplyChartToday.setDrugData(drugDataCountDay);
|
|
|
|