|
@@ -99,9 +99,9 @@ public class AppPageReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "getSameMonthComparison",method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "getProductionComparisonForSameMonth",method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "App总览——生产数据-取水环比(本月)")
|
|
|
- public AjaxMessage<Object> getSameMonthComparison(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
|
|
|
+ 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>();
|
|
@@ -116,9 +116,9 @@ public class AppPageReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "getSameYearComparison",method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "getProductionComparisonForSameYear",method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "App总览——生产数据-取水环比、供水环比、售水环比(本年)")
|
|
|
- public AjaxMessage<Object> getWaterIntakeComparison(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
|
|
|
+ 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>();
|
|
@@ -143,9 +143,9 @@ public class AppPageReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "getComparisonForLast12Month",method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "getProductionComparisonForLast12Month",method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "App总览——生产数据-取水环比、供水环比、售水环比(近一年)")
|
|
|
- public AjaxMessage<Object> getComparisonForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
|
|
|
+ public AjaxMessage<Object> getProductionComparisonForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
|
|
|
LocalDate now = LocalDate.now();
|
|
|
LocalDate last = now.minusMonths(11);
|
|
|
|
|
@@ -245,4 +245,26 @@ public class AppPageReportController {
|
|
|
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){
|
|
|
+ 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.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));
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|