Explorar el Código

Merge remote-tracking branch 'origin/20210223' into 20210223

wangyangyang hace 4 años
padre
commit
3f371ad95b

+ 124 - 36
sms_water/src/main/java/com/huaxu/controller/AppPageReportController.java

@@ -44,10 +44,11 @@ public class AppPageReportController {
     @ApiOperation(value = "App总览——生产数据(本月)")
     public AjaxMessage<Map<String,Object>> getProductionDataForMonth(
             @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> supplyWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,1);
         List<DeviceWaterSupply> makingWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,1);
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,1);
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("intake", supplyWaterList);
         map.put("making", makingWaterList);
         map.put("seller", sellerWaterList);
@@ -66,10 +67,11 @@ public class AppPageReportController {
     public AjaxMessage<Map<String,Object>> getProductionDataForSameYear(
             @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
         LocalDate localDate = LocalDate.now();
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> supplyWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,localDate.getMonthValue());
         List<DeviceWaterSupply> makingWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,localDate.getMonthValue());
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,localDate.getMonthValue());
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("intake", supplyWaterList);
         map.put("making", makingWaterList);
         map.put("seller", sellerWaterList);
@@ -88,10 +90,11 @@ public class AppPageReportController {
     @ApiOperation(value = "App总览——生产数据(近一年)")
     public AjaxMessage<Map<String,Object>> getProductionDataFor12Month(
             @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> supplyWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,12);
         List<DeviceWaterSupply> makingWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,12);
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,12);
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("intake", supplyWaterList);
         map.put("making", makingWaterList);
         map.put("seller", sellerWaterList);
@@ -104,11 +107,12 @@ public class AppPageReportController {
     public AjaxMessage<Object> getProductionComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
         LocalDate now = LocalDate.now();
         LocalDate last = now.minusMonths(1);
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> sameMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, now.getYear(),now.getMonthValue(),1, now.getYear(),now.getMonthValue(),now.getDayOfMonth());
         List<DeviceWaterSupply> lastMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, last.getYear(),last.getMonthValue(),1, last.getYear(),last.getMonthValue(),last.getDayOfMonth());
         List<DeviceWaterSupply> sameSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, now.getYear(),now.getMonthValue(),1, now.getYear(),now.getMonthValue(),now.getDayOfMonth());
         List<DeviceWaterSupply> lastSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, last.getYear(),last.getMonthValue(),1, last.getYear(),last.getMonthValue(),last.getDayOfMonth());
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("intakeComparison",appPageReportService.CalculationComparison(sameMakingWaterList,lastMakingWaterList));
         map.put("makingComparison",appPageReportService.CalculationComparison(sameSupplyWaterList,lastSupplyWaterList));
         List<DeviceWaterSupply> sameSellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,2);
@@ -121,7 +125,7 @@ public class AppPageReportController {
     public AjaxMessage<Object> getProductionComparisonForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
         LocalDate now = LocalDate.now();
         LocalDate last = now.minusYears(1);
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> sameMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, now.getYear(),1,1, now.getYear(),now.getMonthValue(),now.getDayOfMonth());
         List<DeviceWaterSupply> lastMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, last.getYear(),1,1, last.getYear(),12,31);
         List<DeviceWaterSupply> sameSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, now.getYear(),1,1, now.getYear(),now.getMonthValue(),now.getDayOfMonth());
@@ -137,6 +141,7 @@ public class AppPageReportController {
                 lastSellerAmount = lastSellerAmount.add(sellerWaterList.get(i).getAmount());
             }
         }
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("intakeComparison",appPageReportService.CalculationComparison(sameMakingWaterList,lastMakingWaterList));
         map.put("makingComparison",appPageReportService.CalculationComparison(sameSupplyWaterList,lastSupplyWaterList));
         map.put("sellerComparison", lastSellerAmount.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : sameSellerAmount.multiply(new BigDecimal(100)).divide(lastSellerAmount,2));
@@ -149,26 +154,28 @@ public class AppPageReportController {
         LocalDate now = LocalDate.now();
         LocalDate last = now.minusMonths(11);
 
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> sameMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, last.getYear(),last.getMonthValue(),last.getDayOfMonth(), now.getYear(),now.getMonthValue(),now.getDayOfMonth());
         List<DeviceWaterSupply> sameSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, last.getYear(),last.getMonthValue(),last.getDayOfMonth(),now.getYear(),now.getMonthValue(),now.getDayOfMonth());
         LocalDate last2 = last.minusDays(1);
         LocalDate last3 = last2.minusMonths(11);
         List<DeviceWaterSupply> lastMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, last3.getYear(),last2.getMonthValue(),last2.getDayOfMonth(), last.getYear(),12,31);
         List<DeviceWaterSupply> lastSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, last.getYear(),1,1, last.getYear(),12,31);
-        List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,now.getMonthValue()+12);
+
+        List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,24);
 
         BigDecimal sameSellerAmount = new BigDecimal(0);
         BigDecimal lastSellerAmount = new BigDecimal(0);
 
         for( int i =0 ;i<sellerWaterList.size(); i++){
-            if(i<now.getMonthValue()){
+            if(i>=12){
                 sameSellerAmount = sameSellerAmount.add(sellerWaterList.get(i).getAmount());
             }
             else{
                 lastSellerAmount = lastSellerAmount.add(sellerWaterList.get(i).getAmount());
             }
         }
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("intakeComparison",appPageReportService.CalculationComparison(sameMakingWaterList,lastMakingWaterList));
         map.put("makingComparison",appPageReportService.CalculationComparison(sameSupplyWaterList,lastSupplyWaterList));
         map.put("sellerComparison",lastSellerAmount.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : sameSellerAmount.multiply(new BigDecimal(100)).divide(lastSellerAmount,2));
@@ -177,20 +184,28 @@ public class AppPageReportController {
 
     /**
      * @Author wangbo
-     * @Description App 营业总览数据-本月应收实收回收率数据
+     * @Description App 营业总览数据-本月应收实收回收率普通用户用量大用户用量数据
      * @param companyOrgId 公司ID
      * @return
      */
     @RequestMapping(value = "getBusinessDataForSameMonth",method = RequestMethod.GET)
-    @ApiOperation(value = "App总览——营业总览应收实收回收率数据(本月)")
+    @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(本月)")
     public AjaxMessage<Map<String,Object>> getSameMonthBusinessData(
             @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,1);
-        map.put("totalReceivable", sellerWaterList.get(0).getAmount());
-        map.put("totalReceived", sellerWaterList.get(0).getAmount2());
+        BigDecimal sum = sellerWaterList.get(0).getGeneralUserAmount().add(sellerWaterList.get(0).getBigUserAmount());
+        BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:sellerWaterList.get(0).getGeneralUserAmount().multiply(new BigDecimal(100)).divide(sum,2);
+
+        Map<String,Object> map = new HashMap<String,Object>();
+        map.put("totalReceivable", sellerWaterList.get(0).getReceivableAmount());
+        map.put("totalReceived", sellerWaterList.get(0).getReceivedAmount());
         map.put("amount",sellerWaterList);
-        map.put("rate", sellerWaterList.get(0).getAmount().compareTo(BigDecimal.ZERO)==0? 0 : sellerWaterList.get(0).getAmount2().multiply(new BigDecimal(100)).divide(sellerWaterList.get(0).getAmount(),2));
+        map.put("generalUser",sellerWaterList.get(0).getGeneralUserAmount());
+        map.put("bigUser",sellerWaterList.get(0).getBigUserAmount());
+        map.put("generalUserRate",generalRate);
+        map.put("bigUserRate",new BigDecimal(100).subtract(generalRate));
+        map.put("recoveryRate", sellerWaterList.get(0).getReceivableAmount().compareTo(BigDecimal.ZERO)==0? 0 : sellerWaterList.get(0).getReceivedAmount().multiply(new BigDecimal(100)).divide(sellerWaterList.get(0).getReceivableAmount(),2));
         return new AjaxMessage<>(ResultStatus.OK,map);
     }
 
@@ -201,22 +216,32 @@ public class AppPageReportController {
      * @return
      */
     @RequestMapping(value = "getBusinessDataForSameYear",method = RequestMethod.GET)
-    @ApiOperation(value = "App总览——营业总览应收实收回收率数据(本年)")
+    @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(本年)")
     public AjaxMessage<Map<String,Object>> getBusinessDataForSameYear(
             @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
         LocalDate now = LocalDate.now();
-        Map<String,Object> map = new HashMap<String,Object>();
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,now.getMonthValue());
         BigDecimal totalReceivableAmount = new BigDecimal(0);
         BigDecimal totalReceivedAmount = new BigDecimal(0);
+        BigDecimal totalGeneralUser = new BigDecimal(0);
+        BigDecimal totalBigUser = new BigDecimal(0);
         for(DeviceWaterSupply amount: sellerWaterList){
-            totalReceivableAmount.add(amount.getAmount());
-            totalReceivedAmount.add(amount.getAmount2());
+            totalReceivableAmount =totalReceivableAmount.add(amount.getReceivableAmount());
+            totalReceivedAmount=totalReceivedAmount.add(amount.getReceivedAmount());
+            totalGeneralUser=totalGeneralUser.add(amount.getGeneralUserAmount());
+            totalBigUser=totalBigUser.add(amount.getBigUserAmount());
         }
+        BigDecimal sum =totalBigUser.add(totalGeneralUser);
+        BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:totalGeneralUser.multiply(new BigDecimal(100)).divide(sum,2);
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("totalReceivable", totalReceivableAmount);
         map.put("totalReceived",totalReceivedAmount);
         map.put("amountDetails",sellerWaterList);
-        map.put("rate", sellerWaterList.get(0).getAmount().compareTo(BigDecimal.ZERO)==0? 0 : sellerWaterList.get(0).getAmount2().multiply(new BigDecimal(100)).divide(sellerWaterList.get(0).getAmount(),2));
+        map.put("generalUser",totalGeneralUser);
+        map.put("bigUser",totalBigUser);
+        map.put("generalUserRate",generalRate);
+        map.put("bigUserRate",new BigDecimal(100).subtract(generalRate));
+        map.put("recoveryRate", totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? 0 : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,2));
         return new AjaxMessage<>(ResultStatus.OK,map);
     }
 
@@ -227,44 +252,107 @@ public class AppPageReportController {
      * @return
      */
     @RequestMapping(value = "getBusinessDataForLast12Month",method = RequestMethod.GET)
-    @ApiOperation(value = "App总览——营业总览应收实收回收率数据(近一年)")
+    @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(近一年)")
     public AjaxMessage<Map<String,Object>> getBusinessDataForLast12Month(
             @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
-        Map<String,Object> map = new HashMap<String,Object>();
+
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,12);
         BigDecimal totalReceivableAmount = new BigDecimal(0);
         BigDecimal totalReceivedAmount = new BigDecimal(0);
+        BigDecimal totalGeneralUser = new BigDecimal(0);
+        BigDecimal totalBigUser = new BigDecimal(0);
         for(DeviceWaterSupply amount: sellerWaterList){
-            totalReceivableAmount.add(amount.getAmount());
-            totalReceivedAmount.add(amount.getAmount2());
+            totalReceivableAmount =totalReceivableAmount.add(amount.getReceivableAmount());
+            totalReceivedAmount=totalReceivedAmount.add(amount.getReceivedAmount());
+            totalGeneralUser=totalGeneralUser.add(amount.getGeneralUserAmount());
+            totalBigUser=totalBigUser.add(amount.getBigUserAmount());
         }
+
+        BigDecimal sum =totalBigUser.add(totalGeneralUser);
+        BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:totalGeneralUser.multiply(new BigDecimal(100)).divide(sum,2);
+        Map<String,Object> map = new HashMap<String,Object>();
         map.put("totalReceivable", totalReceivableAmount);
         map.put("totalReceived",totalReceivedAmount);
         map.put("amountDetails",sellerWaterList);
-        map.put("rate", sellerWaterList.get(0).getAmount().compareTo(BigDecimal.ZERO)==0? 0 : sellerWaterList.get(0).getAmount2().multiply(new BigDecimal(100)).divide(sellerWaterList.get(0).getAmount(),2));
+        map.put("generalUser",totalGeneralUser);
+        map.put("bigUser",totalBigUser);
+        map.put("generalUserRate",generalRate);
+        map.put("bigUserRate",new BigDecimal(100).subtract(generalRate));
+        map.put("recoveryRate", totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? 0 : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,2));
         return new AjaxMessage<>(ResultStatus.OK,map);
     }
 
 
+    @RequestMapping(value = "getSellerComparisonForSameMonth",method = RequestMethod.GET)
+    @ApiOperation(value = "App总览——营收数据-应收实收环比(本月)")
+    public AjaxMessage<Object> getSellerComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
+
+        List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,2);
+        BigDecimal receivableComparison = sellerWaterList.get(1).getReceivableAmount().compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:sellerWaterList.get(0).getReceivableAmount().multiply(new BigDecimal(100)).divide(sellerWaterList.get(1).getReceivableAmount(),2);
+        BigDecimal receivedComparison = sellerWaterList.get(1).getReceivedAmount().compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:sellerWaterList.get(0).getReceivedAmount().multiply(new BigDecimal(100)).divide(sellerWaterList.get(1).getReceivedAmount(),2);
+        Map<String,Object> map = new HashMap<String,Object>();
+        map.put("receivableComparison",receivableComparison);
+        map.put("receivedComparison",receivedComparison);
+        return new AjaxMessage<>(ResultStatus.OK,map);
+    }
 
-    @RequestMapping(value = "getReceivableComparisonForSameMonth",method = RequestMethod.GET)
-    @ApiOperation(value = "App总览——营收数据-应收环比(本月)")
-    public AjaxMessage<Object> getReceivableComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
+    @RequestMapping(value = "getSellerComparisonForSameYear",method = RequestMethod.GET)
+    @ApiOperation(value = "App总览——营收数据-应收实收环比(本年)")
+    public AjaxMessage<Object> getSellerComparisonForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
         LocalDate now = LocalDate.now();
-        LocalDate last = now.minusMonths(1);
+
+        List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,12+now.getMonthValue());
+        BigDecimal receivedSameYearComparison = new BigDecimal(0);
+        BigDecimal receivedLastYearComparison = new BigDecimal(0);
+        BigDecimal receivableSameYearComparison = new BigDecimal(0);
+        BigDecimal receivableLastYearComparison = new BigDecimal(0);
+        for(int i=0 ;i<sellerWaterList.size();i++){
+            if(i>=12){
+                receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
+            }
+            else{
+                receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
+            }
+        }
+
+        BigDecimal receivedComparison = receivedLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivedSameYearComparison.multiply(new BigDecimal(100)).divide(receivedLastYearComparison,2);
+        BigDecimal receivableComparison = receivableLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivableSameYearComparison.multiply(new BigDecimal(100)).divide(receivableLastYearComparison,2);
         Map<String,Object> map = new HashMap<String,Object>();
-        List<DeviceWaterSupply> sameMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, now.getYear(),now.getMonthValue(),1, now.getYear(),now.getMonthValue(),now.getDayOfMonth());
-        List<DeviceWaterSupply> lastMakingWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水源",4, last.getYear(),last.getMonthValue(),1, last.getYear(),last.getMonthValue(),last.getDayOfMonth());
-        List<DeviceWaterSupply> sameSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, now.getYear(),now.getMonthValue(),1, now.getYear(),now.getMonthValue(),now.getDayOfMonth());
-        List<DeviceWaterSupply> lastSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, last.getYear(),last.getMonthValue(),1, last.getYear(),last.getMonthValue(),last.getDayOfMonth());
-        map.put("intakeComparison",appPageReportService.CalculationComparison(sameMakingWaterList,lastMakingWaterList));
-        map.put("makingComparison",appPageReportService.CalculationComparison(sameSupplyWaterList,lastSupplyWaterList));
-        List<DeviceWaterSupply> sameSellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,2);
-        map.put("sellerComparison", sameSellerWaterList.get(0).getAmount().compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : sameSellerWaterList.get(0).getAmount().multiply(new BigDecimal(100)).divide(sameSellerWaterList.get(1).getAmount(),2));
+        map.put("receivableComparison",receivableComparison);
+        map.put("receivedComparison",receivedComparison);
         return new AjaxMessage<>(ResultStatus.OK,map);
     }
 
+    @RequestMapping(value = "getSellerComparisonForLast12Month",method = RequestMethod.GET)
+    @ApiOperation(value = "App总览——营收数据-应收实收环比(本年)")
+    public AjaxMessage<Object> getSellerComparisonForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
+        BigDecimal receivedSameYearComparison = new BigDecimal(0);
+        BigDecimal receivedLastYearComparison = new BigDecimal(0);
+        BigDecimal receivableSameYearComparison = new BigDecimal(0);
+        BigDecimal receivableLastYearComparison = new BigDecimal(0);
+        List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,24);
+
+        for(int i=0;i<sellerWaterList.size();i++){
 
+            if(i>=12){
+                receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
+            }
+            else{
+                receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
+            }
+        }
+
+        BigDecimal receivedComparison = receivedLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivedSameYearComparison.multiply(new BigDecimal(100)).divide(receivedLastYearComparison,2);
+        BigDecimal receivableComparison = receivableLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivableSameYearComparison.multiply(new BigDecimal(100)).divide(receivableLastYearComparison,2);
+        Map<String,Object> map = new HashMap<String,Object>();
+        map.put("receivableComparison",receivableComparison);
+        map.put("receivedComparison",receivedComparison);
+        return new AjaxMessage<>(ResultStatus.OK,map);
+    }
 
 
 }

+ 0 - 2
sms_water/src/main/java/com/huaxu/controller/AppReportMonitorController.java

@@ -37,8 +37,6 @@ public class AppReportMonitorController {
     @Autowired
     private AppReportMonitorService appReportMonitorService;
 
-
-
     @RequestMapping(value = "getSceneByCompany",method = RequestMethod.GET)
     @ApiOperation(value = "App报表展示————公司查询(点击公司查询水厂)")
     public AjaxMessage<List<SceneEntity>> getSceneByCompany(

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

@@ -9,7 +9,6 @@ import com.huaxu.dto.homePage.WaterQualityRateForScene;
 import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.ResultStatus;
 import com.huaxu.service.HomePageReportService;
-import com.huaxu.service.MonitorDataReportService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;

+ 11 - 2
sms_water/src/main/java/com/huaxu/dto/generalView/DeviceWaterSupply.java

@@ -31,9 +31,18 @@ public class DeviceWaterSupply implements Serializable {
     @ApiModelProperty("量")
     @JsonSerialize(using = BigDecimalJsonSerializer.class)
     private BigDecimal amount = BigDecimal.ZERO;
-    @ApiModelProperty("量2")
+    @ApiModelProperty("应收额")
     @JsonSerialize(using = BigDecimalJsonSerializer.class)
-    private BigDecimal amount2 = BigDecimal.ZERO;
+    private BigDecimal receivableAmount = BigDecimal.ZERO;
+    @ApiModelProperty("实收额")
+    @JsonSerialize(using = BigDecimalJsonSerializer.class)
+    private BigDecimal receivedAmount = BigDecimal.ZERO;
+    @ApiModelProperty("普通客户用量")
+    @JsonSerialize(using = BigDecimalJsonSerializer.class)
+    private BigDecimal generalUserAmount = BigDecimal.ZERO;
+    @ApiModelProperty("大客户用量")
+    @JsonSerialize(using = BigDecimalJsonSerializer.class)
+    private BigDecimal bigUserAmount = BigDecimal.ZERO;
     @ApiModelProperty("日期")
     private LocalDate date;
     @ApiModelProperty("日期格式化")

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

@@ -202,12 +202,12 @@ public class AppPageReportServiceImpl implements AppPageReportService {
             deviceWaterSupply.setDate(newLocalDate);
             deviceWaterSupply.setDateLabel(newLocalDate.getYear()+"-"+newLocalDate.getMonthValue());
             if(revenue == null){
-                deviceWaterSupply.setAmount(BigDecimal.ZERO);
-                deviceWaterSupply.setAmount2(BigDecimal.ZERO);
+                deviceWaterSupply.setReceivableAmount(BigDecimal.ZERO);
+                deviceWaterSupply.setReceivedAmount(BigDecimal.ZERO);
             }
             else{
-                deviceWaterSupply.setAmount(new BigDecimal(revenue.getReceivableTotalAmount()));
-                deviceWaterSupply.setAmount2(new BigDecimal(revenue.getReceivedTotalAmount()));
+                deviceWaterSupply.setReceivableAmount(new BigDecimal(revenue.getReceivableTotalAmount()));
+                deviceWaterSupply.setReceivedAmount(new BigDecimal(revenue.getReceivedTotalAmount()));
             }
             deviceWaterSupplies.add(i, deviceWaterSupply);
         }

+ 6 - 2
sms_water/src/main/resources/mapper/RevenueMapper.xml

@@ -102,7 +102,9 @@
         select date_format(t1.collect_date, '%Y-%m' ) collect_date_string,
         sum(METER_READING_USAGE) meter_reading_usage,
         sum(RECEIVABLE_TOTAL_AMOUNT) receivable_total_amount,
-        sum(RECEIVED_TOTAL_AMOUNT) received_total_amount
+        sum(RECEIVED_TOTAL_AMOUNT) received_total_amount,
+        sum(GENERAL_USER_USAGE) general_user_usage,
+        sum(BIG_USER_USAGE) big_user_usage
         from sms_month_revenue t1
         where t1.collect_date>=date_sub(date_format(curdate(), '%y-%m-1' ), interval #{months}-1 month)
         <if test="tenantId != null and tenantId != ''">
@@ -128,7 +130,9 @@
         select date_format(t1.collect_date, '%Y-%m' ) collect_date_string,
         sum(METER_READING_USAGE) meter_reading_usage,
         sum(RECEIVABLE_TOTAL_AMOUNT) receivable_total_amount,
-        sum(RECEIVED_TOTAL_AMOUNT) received_total_amount
+        sum(RECEIVED_TOTAL_AMOUNT) received_total_amount,
+        sum(GENERAL_USER_USAGE) general_user_usage,
+        sum(BIG_USER_USAGE) big_user_usage,
         from sms_month_revenue t1
         where t1.collect_date>=date_format(#{startDate}, '%y-%m-1' ) and t1.collect_date &lt;= date_format(#{endDate}, '%y-%m-1')
         <if test="tenantId != null and tenantId != ''">