|
@@ -1,10 +1,8 @@
|
|
|
package com.huaxu.controller;
|
|
|
-import com.huaxu.dto.MonthRevenueDto;
|
|
|
import com.huaxu.dto.generalView.DeviceWaterSupply;
|
|
|
import com.huaxu.model.AjaxMessage;
|
|
|
import com.huaxu.model.ResultStatus;
|
|
|
import com.huaxu.service.AppPageReportService;
|
|
|
-import com.huaxu.service.RevenueService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -29,11 +27,10 @@ import java.util.Map;
|
|
|
@RequestMapping("/appPageReport")
|
|
|
@Api(tags = "App总览报表")
|
|
|
public class AppPageReportController {
|
|
|
- @Autowired
|
|
|
- private RevenueService revenueService;
|
|
|
@Autowired
|
|
|
private AppPageReportService appPageReportService;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @Author wangbo
|
|
|
* @Description App生产总览数据-本月数据
|
|
@@ -200,7 +197,7 @@ public class AppPageReportController {
|
|
|
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("amountDetails",sellerWaterList);
|
|
|
map.put("generalUser",sellerWaterList.get(0).getGeneralUserAmount());
|
|
|
map.put("bigUser",sellerWaterList.get(0).getBigUserAmount());
|
|
|
map.put("generalUserRate",generalRate);
|
|
@@ -209,6 +206,27 @@ public class AppPageReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Author wangbo
|
|
|
+ * @Description App 营业数据-本月应收实收售水回收率数据
|
|
|
+ * @param companyOrgId 公司ID
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "getRevenueDataForSameMonth ",method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "App——营业数据-应收实收售水回收率数据(本月)")
|
|
|
+ public AjaxMessage<Map<String,Object>> getRevenueDataForSameMonth(
|
|
|
+ @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
|
|
|
+ List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,1);
|
|
|
+ List<DeviceWaterSupply> sellerAmountList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,1);
|
|
|
+ Map<String,Object> map = new HashMap<String,Object>();
|
|
|
+ map.put("receivableAmount", sellerWaterList.get(0).getReceivableAmount());
|
|
|
+ map.put("receivedAmount", sellerWaterList.get(0).getReceivedAmount());
|
|
|
+ map.put("sellerAmount",sellerAmountList.get(0).getAmount());
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @Author wangbo
|
|
|
* @Description App 营业总览数据-本月应收实收回收率数据
|
|
@@ -230,6 +248,7 @@ public class AppPageReportController {
|
|
|
totalReceivedAmount=totalReceivedAmount.add(amount.getReceivedAmount());
|
|
|
totalGeneralUser=totalGeneralUser.add(amount.getGeneralUserAmount());
|
|
|
totalBigUser=totalBigUser.add(amount.getBigUserAmount());
|
|
|
+ amount.setRecoveryRate(totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? BigDecimal.ZERO : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,2));
|
|
|
}
|
|
|
BigDecimal sum =totalBigUser.add(totalGeneralUser);
|
|
|
BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:totalGeneralUser.multiply(new BigDecimal(100)).divide(sum,2);
|
|
@@ -266,6 +285,8 @@ public class AppPageReportController {
|
|
|
totalReceivedAmount=totalReceivedAmount.add(amount.getReceivedAmount());
|
|
|
totalGeneralUser=totalGeneralUser.add(amount.getGeneralUserAmount());
|
|
|
totalBigUser=totalBigUser.add(amount.getBigUserAmount());
|
|
|
+
|
|
|
+ amount.setRecoveryRate(totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? BigDecimal.ZERO : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,2));
|
|
|
}
|
|
|
|
|
|
BigDecimal sum =totalBigUser.add(totalGeneralUser);
|
|
@@ -345,7 +366,6 @@ public class AppPageReportController {
|
|
|
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>();
|
|
@@ -354,5 +374,37 @@ public class AppPageReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "getSceneAmountForSameMonth",method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "App总览——资产情况本月")
|
|
|
+ public AjaxMessage<Object> getSceneAmountForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Long companyOrgId){
|
|
|
+ Map<String,Object> map = new HashMap<String,Object>();
|
|
|
+ List<Map<String,Object>> amount = appPageReportService.findSceneAmount(companyOrgId,null);
|
|
|
+ List<Map<String,Object>> newAount = appPageReportService.findSceneAmount(companyOrgId,1);
|
|
|
+ map.put("assets",amount);
|
|
|
+ map.put("newAssets",newAount);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "getSceneAmountForSameYear",method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "App总览——资产情况本年")
|
|
|
+ public AjaxMessage<Object> getSceneAmountForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Long companyOrgId){
|
|
|
+ Map<String,Object> map = new HashMap<String,Object>();
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
+ List<Map<String,Object>> amount = appPageReportService.findSceneAmount(companyOrgId,null);
|
|
|
+ List<Map<String,Object>> newAount = appPageReportService.findSceneAmount(companyOrgId,now.getMonthValue());
|
|
|
+ map.put("assets",amount);
|
|
|
+ map.put("newAssets",newAount);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
+ }
|
|
|
|
|
|
+ @RequestMapping(value = "getSceneAmountForLast12Month",method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "App总览——资产情况近一年")
|
|
|
+ public AjaxMessage<Object> getSceneAmountForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Long companyOrgId){
|
|
|
+ Map<String,Object> map = new HashMap<String,Object>();
|
|
|
+ List<Map<String,Object>> amount = appPageReportService.findSceneAmount(companyOrgId,null);
|
|
|
+ List<Map<String,Object>> newAount = appPageReportService.findSceneAmount(companyOrgId,12);
|
|
|
+ map.put("assets",amount);
|
|
|
+ map.put("newAssets",newAount);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,map);
|
|
|
+ }
|
|
|
}
|