123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- 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;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import java.math.BigDecimal;
- import java.time.LocalDate;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @description
- * @auto wangbo
- * @data 2021/3/18 10:50
- */
- @RestController
- @RequestMapping("/appPageReport")
- @Api(tags = "App总览报表")
- public class AppPageReportController {
- @Autowired
- private RevenueService revenueService;
- @Autowired
- private AppPageReportService appPageReportService;
- /**
- * @Author wangbo
- * @Description App生产总览数据-本月数据
- * @param companyOrgId 公司ID
- * @return
- */
- @RequestMapping(value = "getProductionDataForSameMonth",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——生产数据(本月)")
- public AjaxMessage<Map<String,Object>> getProductionDataForMonth(
- @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- 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);
- appPageReportService.CalculationNrw(supplyWaterList,makingWaterList,sellerWaterList,map);
- return new AjaxMessage<>(ResultStatus.OK,map);
- }
- /**
- * @Author wangbo
- * @Description App生产总览数据-本年数据
- * @param companyOrgId 公司ID
- * @return
- */
- @RequestMapping(value = "getProductionDataForSameYear",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——生产数据(本年)")
- public AjaxMessage<Map<String,Object>> getProductionDataForSameYear(
- @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- LocalDate localDate = LocalDate.now();
- 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);
- appPageReportService.CalculationNrw(supplyWaterList,makingWaterList,sellerWaterList,map);
- return new AjaxMessage<>(ResultStatus.OK,map);
- }
- /**
- * @Author wangbo
- * @Description App生产总览数据-近一年数据
- * @param companyOrgId 公司ID
- * @return
- */
- @RequestMapping(value = "getProductionDataFor12Month",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——生产数据(近一年)")
- public AjaxMessage<Map<String,Object>> getProductionDataFor12Month(
- @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- 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);
- appPageReportService.CalculationNrw(supplyWaterList,makingWaterList,sellerWaterList,map);
- return new AjaxMessage<>(ResultStatus.OK,map);
- }
- @RequestMapping(value = "getProductionComparisonForSameMonth",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——生产数据-取水环比(本月)")
- public AjaxMessage<Object> getProductionComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- LocalDate now = LocalDate.now();
- LocalDate last = now.minusMonths(1);
- 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);
- 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);
- }
- @RequestMapping(value = "getProductionComparisonForSameYear",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——生产数据-取水环比、供水环比、售水环比(本年)")
- public AjaxMessage<Object> getProductionComparisonForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- LocalDate now = LocalDate.now();
- LocalDate last = now.minusYears(1);
- 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());
- List<DeviceWaterSupply> lastSupplyWaterList = appPageReportService.deviceWaterReportForDay(companyOrgId,"水厂",3, last.getYear(),1,1, last.getYear(),12,31);
- List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,now.getMonthValue()+12);
- BigDecimal sameSellerAmount = new BigDecimal(0);
- BigDecimal lastSellerAmount = new BigDecimal(0);
- for( int i =0 ;i<sellerWaterList.size(); i++){
- 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));
- return new AjaxMessage<>(ResultStatus.OK,map);
- }
- @RequestMapping(value = "getProductionComparisonForLast12Month",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——生产数据-取水环比、供水环比、售水环比(近一年)")
- public AjaxMessage<Object> getProductionComparisonForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- LocalDate now = LocalDate.now();
- LocalDate last = now.minusMonths(11);
- 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,24);
- BigDecimal sameSellerAmount = new BigDecimal(0);
- BigDecimal lastSellerAmount = new BigDecimal(0);
- for( int i =0 ;i<sellerWaterList.size(); i++){
- 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));
- return new AjaxMessage<>(ResultStatus.OK,map);
- }
- /**
- * @Author wangbo
- * @Description App 营业总览数据-本月应收实收回收率普通用户用量大用户用量数据
- * @param companyOrgId 公司ID
- * @return
- */
- @RequestMapping(value = "getBusinessDataForSameMonth",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(本月)")
- public AjaxMessage<Map<String,Object>> getSameMonthBusinessData(
- @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,1);
- 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("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);
- }
- /**
- * @Author wangbo
- * @Description App 营业总览数据-本月应收实收回收率数据
- * @param companyOrgId 公司ID
- * @return
- */
- @RequestMapping(value = "getBusinessDataForSameYear",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(本年)")
- public AjaxMessage<Map<String,Object>> getBusinessDataForSameYear(
- @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- LocalDate now = LocalDate.now();
- 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 =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("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);
- }
- /**
- * @Author wangbo
- * @Description App 营业总览数据-近一年应收实收回收率数据
- * @param companyOrgId 公司ID
- * @return
- */
- @RequestMapping(value = "getBusinessDataForLast12Month",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(近一年)")
- public AjaxMessage<Map<String,Object>> getBusinessDataForLast12Month(
- @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- 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 =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("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 = "getSellerComparisonForSameYear",method = RequestMethod.GET)
- @ApiOperation(value = "App总览——营收数据-应收实收环比(本年)")
- public AjaxMessage<Object> getSellerComparisonForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
- LocalDate now = LocalDate.now();
- 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>();
- 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);
- }
- }
|