Browse Source

App总览-营业数据-环比

wangbo 4 years ago
parent
commit
01719a7461

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

@@ -195,10 +195,10 @@ public class AppPageReportController {
 
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,1);
         Map<String,Object> map = new HashMap<String,Object>();
-        map.put("totalReceivable", sellerWaterList.get(0).getAmount());
-        map.put("totalReceived", sellerWaterList.get(0).getAmount2());
+        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("rate", 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);
     }
 
@@ -218,14 +218,14 @@ public class AppPageReportController {
         BigDecimal totalReceivableAmount = new BigDecimal(0);
         BigDecimal totalReceivedAmount = new BigDecimal(0);
         for(DeviceWaterSupply amount: sellerWaterList){
-            totalReceivableAmount.add(amount.getAmount());
-            totalReceivedAmount.add(amount.getAmount2());
+            totalReceivableAmount.add(amount.getReceivableAmount());
+            totalReceivedAmount.add(amount.getReceivedAmount());
         }
         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("rate", 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);
     }
 
@@ -244,14 +244,14 @@ public class AppPageReportController {
         BigDecimal totalReceivableAmount = new BigDecimal(0);
         BigDecimal totalReceivedAmount = new BigDecimal(0);
         for(DeviceWaterSupply amount: sellerWaterList){
-            totalReceivableAmount.add(amount.getAmount());
-            totalReceivedAmount.add(amount.getAmount2());
+            totalReceivableAmount.add(amount.getReceivableAmount());
+            totalReceivedAmount.add(amount.getReceivedAmount());
         }
         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("rate", 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);
     }
 
@@ -261,8 +261,8 @@ public class AppPageReportController {
     public AjaxMessage<Object> getSellerComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
 
         List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,2);
-        BigDecimal receivableComparison = sellerWaterList.get(1).getAmount().compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:sellerWaterList.get(0).getAmount().multiply(new BigDecimal(100)).divide(sellerWaterList.get(1).getAmount(),2);
-        BigDecimal receivedComparison = sellerWaterList.get(1).getAmount2().compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:sellerWaterList.get(0).getAmount2().multiply(new BigDecimal(100)).divide(sellerWaterList.get(1).getAmount2(),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);
@@ -281,12 +281,12 @@ public class AppPageReportController {
         BigDecimal receivableLastYearComparison = new BigDecimal(0);
         for(int i=0 ;i<sellerWaterList.size();i++){
             if(i>=12){
-                receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getAmount2());
-                receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getAmount());
+                receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
             }
             else{
-                receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getAmount2());
-                receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getAmount());
+                receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
             }
         }
 
@@ -310,12 +310,12 @@ public class AppPageReportController {
         for(int i=0;i<sellerWaterList.size();i++){
 
             if(i>=12){
-                receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getAmount2());
-                receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getAmount());
+                receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
             }
             else{
-                receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getAmount2());
-                receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getAmount());
+                receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
+                receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
             }
         }
 

+ 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);
         }