Browse Source

App总览-生产数据-本月

wangbo 4 years ago
parent
commit
844a18eecb

+ 0 - 1
sms_water/src/main/java/com/huaxu/controller/AppPageReportController.java

@@ -29,7 +29,6 @@ import java.util.List;
 @RequestMapping("/appPageReport")
 @Api(tags = "App总览报表")
 public class AppPageReportController {
-
     @Autowired
     private AppPageReportService appPageReportService;
 

+ 5 - 2
sms_water/src/main/java/com/huaxu/service/impl/AppPageReportServiceImpl.java

@@ -75,10 +75,13 @@ public class AppPageReportServiceImpl implements AppPageReportService {
 
     @Override
     public List<DeviceWaterSupply> deviceSellerWaterReportForSameMonth(Integer companyOrgId) {
+        BigDecimal AmountCountMonth = null;
         LocalDate localDate = LocalDate.now();
         List<DeviceWaterSupply> deviceWaterSupplies = new ArrayList<DeviceWaterSupply>();
-        List<MonthRevenueDto> result = revenueService.selectMonthRevenue(companyOrgId, localDate.getMonthValue());
-        BigDecimal AmountCountMonth = new BigDecimal(result.get(0).getMeterReadingUsage());
+        List<MonthRevenueDto> sellerWater = revenueService.selectMonthRevenue(companyOrgId, localDate.getMonthValue());
+        if(sellerWater.size()>0){
+            AmountCountMonth = new BigDecimal(sellerWater.get(0).getMeterReadingUsage());
+        }
         DeviceWaterSupply deviceWaterSupplyMonth = new DeviceWaterSupply();
         deviceWaterSupplyMonth.setOrderNo(1);
         deviceWaterSupplyMonth.setAmount(AmountCountMonth != null ? AmountCountMonth.divide(new BigDecimal("10000")) : BigDecimal.ZERO);