|
@@ -41,12 +41,13 @@ public class AppPageReportController {
|
|
|
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.put("取水量",appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,1));
|
|
|
- map.put("制水量",makingWaterList);
|
|
|
- map.put("售水量",sellerWaterList);
|
|
|
- map.put("产销差",CalculationNrw(makingWaterList,sellerWaterList));
|
|
|
+ map.put("取水量", supplyWaterList);
|
|
|
+ map.put("制水量", makingWaterList);
|
|
|
+ map.put("售水量", sellerWaterList);
|
|
|
+ CalculationWaterData(supplyWaterList,makingWaterList,sellerWaterList,map);
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
@@ -62,18 +63,17 @@ public class AppPageReportController {
|
|
|
@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.put("取水量",appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,localDate.getMonthValue()));
|
|
|
- map.put("制水量",makingWaterList);
|
|
|
- map.put("售水量",sellerWaterList);
|
|
|
- map.put("产销差",CalculationNrw(makingWaterList,sellerWaterList));
|
|
|
+ map.put("取水量", supplyWaterList);
|
|
|
+ map.put("制水量", makingWaterList);
|
|
|
+ map.put("售水量", sellerWaterList);
|
|
|
+ CalculationWaterData(supplyWaterList,makingWaterList,sellerWaterList,map);
|
|
|
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* @Author wangbo
|
|
|
* @Description App生产总览数据-近一年数据
|
|
@@ -85,13 +85,13 @@ public class AppPageReportController {
|
|
|
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.put("取水量",appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,12));
|
|
|
- map.put("制水量",makingWaterList);
|
|
|
- map.put("售水量",sellerWaterList);
|
|
|
- map.put("产销差",CalculationNrw(makingWaterList,sellerWaterList));
|
|
|
-
|
|
|
+ map.put("取水量", supplyWaterList);
|
|
|
+ map.put("制水量", makingWaterList);
|
|
|
+ map.put("售水量", sellerWaterList);
|
|
|
+ CalculationWaterData(supplyWaterList,makingWaterList,sellerWaterList,map);
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
@@ -100,11 +100,17 @@ public class AppPageReportController {
|
|
|
* @Description 计算产销差
|
|
|
* @param makingWaterList 制水量数据
|
|
|
* @param sellerWaterList 售水量数据
|
|
|
+ * @param map
|
|
|
* @return
|
|
|
*/
|
|
|
- private BigDecimal CalculationNrw( List<DeviceWaterSupply> makingWaterList,List<DeviceWaterSupply> sellerWaterList){
|
|
|
+ private void CalculationWaterData(List<DeviceWaterSupply> supplyWaterList, List<DeviceWaterSupply> makingWaterList,List<DeviceWaterSupply> sellerWaterList,Map<String,Object> map){
|
|
|
+ BigDecimal supplyWaterAmount = new BigDecimal(0);
|
|
|
BigDecimal makingWaterAmount = new BigDecimal(0);
|
|
|
BigDecimal sellerWaterAmount = new BigDecimal(0);
|
|
|
+
|
|
|
+ for(DeviceWaterSupply water : supplyWaterList){
|
|
|
+ supplyWaterAmount = supplyWaterAmount.add(water.getAmount());
|
|
|
+ }
|
|
|
for(DeviceWaterSupply water : makingWaterList){
|
|
|
makingWaterAmount = makingWaterAmount.add(water.getAmount());
|
|
|
}
|
|
@@ -112,6 +118,9 @@ public class AppPageReportController {
|
|
|
sellerWaterAmount = sellerWaterAmount.add(water.getAmount());
|
|
|
}
|
|
|
BigDecimal nrw = makingWaterAmount ==BigDecimal.ZERO ? BigDecimal.ZERO : makingWaterAmount.subtract(sellerWaterAmount).multiply(new BigDecimal(100)).divide(makingWaterAmount,2);
|
|
|
- return nrw;
|
|
|
+ map.put("取水总量",supplyWaterAmount);
|
|
|
+ map.put("制水总量",makingWaterAmount);
|
|
|
+ map.put("售水总量",sellerWaterAmount);
|
|
|
+ map.put("产销差",nrw);
|
|
|
}
|
|
|
}
|