AppPageReportController.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. package com.huaxu.controller;
  2. import com.huaxu.dto.generalView.DeviceWaterSupply;
  3. import com.huaxu.model.AjaxMessage;
  4. import com.huaxu.model.ResultStatus;
  5. import com.huaxu.service.AppPageReportService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RequestMethod;
  12. import org.springframework.web.bind.annotation.RequestParam;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import java.math.BigDecimal;
  15. import java.time.LocalDate;
  16. import java.util.HashMap;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * @description
  21. * @auto wangbo
  22. * @data 2021/3/18 10:50
  23. */
  24. @RestController
  25. @RequestMapping("/appPageReport")
  26. @Api(tags = "App总览报表")
  27. public class AppPageReportController {
  28. @Autowired
  29. private AppPageReportService appPageReportService;
  30. /**
  31. * @Author wangbo
  32. * @Description App生产总览数据-本月数据
  33. * @param companyOrgId 公司ID
  34. * @return
  35. */
  36. @RequestMapping(value = "getProductionDataForSameMonth",method = RequestMethod.GET)
  37. @ApiOperation(value = "App总览——生产数据(本月)")
  38. public AjaxMessage<Map<String,Object>> getProductionDataForMonth(
  39. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  40. List<DeviceWaterSupply> intakeWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,1);
  41. List<DeviceWaterSupply> makingWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,1);
  42. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,1);
  43. Map<String,Object> map = new HashMap<String,Object>();
  44. map.put("intake", intakeWaterList);
  45. map.put("making", makingWaterList);
  46. map.put("seller", sellerWaterList);
  47. appPageReportService.CalculationNrw(intakeWaterList,makingWaterList,sellerWaterList,map);
  48. return new AjaxMessage<>(ResultStatus.OK,map);
  49. }
  50. /**
  51. * @Author wangbo
  52. * @Description App生产总览数据-本年数据
  53. * @param companyOrgId 公司ID
  54. * @return
  55. */
  56. @RequestMapping(value = "getProductionDataForSameYear",method = RequestMethod.GET)
  57. @ApiOperation(value = "App总览——生产数据(本年)")
  58. public AjaxMessage<Map<String,Object>> getProductionDataForSameYear(
  59. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  60. LocalDate localDate = LocalDate.now();
  61. List<DeviceWaterSupply> supplyWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,localDate.getMonthValue());
  62. List<DeviceWaterSupply> makingWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,localDate.getMonthValue());
  63. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,localDate.getMonthValue());
  64. Map<String,Object> map = new HashMap<String,Object>();
  65. map.put("intake", supplyWaterList);
  66. map.put("making", makingWaterList);
  67. map.put("seller", sellerWaterList);
  68. appPageReportService.CalculationNrw(supplyWaterList,makingWaterList,sellerWaterList,map);
  69. return new AjaxMessage<>(ResultStatus.OK,map);
  70. }
  71. /**
  72. * @Author wangbo
  73. * @Description App生产总览数据-近一年数据
  74. * @param companyOrgId 公司ID
  75. * @return
  76. */
  77. @RequestMapping(value = "getProductionDataFor12Month",method = RequestMethod.GET)
  78. @ApiOperation(value = "App总览——生产数据(近一年)")
  79. public AjaxMessage<Map<String,Object>> getProductionDataFor12Month(
  80. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  81. List<DeviceWaterSupply> supplyWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,12);
  82. List<DeviceWaterSupply> makingWaterList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,12);
  83. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,12);
  84. Map<String,Object> map = new HashMap<String,Object>();
  85. map.put("intake", supplyWaterList);
  86. map.put("making", makingWaterList);
  87. map.put("seller", sellerWaterList);
  88. appPageReportService.CalculationNrw(supplyWaterList,makingWaterList,sellerWaterList,map);
  89. return new AjaxMessage<>(ResultStatus.OK,map);
  90. }
  91. @RequestMapping(value = "getProductionComparisonForSameMonth",method = RequestMethod.GET)
  92. @ApiOperation(value = "App总览——生产数据-取水环比(本月)")
  93. public AjaxMessage<Object> getProductionComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  94. LocalDate now = LocalDate.now();
  95. List<DeviceWaterSupply> intakeComparisonList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,2);
  96. List<DeviceWaterSupply> makingComparisonList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,2);
  97. List<DeviceWaterSupply> sellerComparisonList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,2);
  98. Map<String,Object> map = new HashMap<String,Object>();
  99. map.put("intakeComparison",appPageReportService.CalculationComparison2(intakeComparisonList,1));
  100. map.put("makingComparison",appPageReportService.CalculationComparison2(makingComparisonList,1));
  101. map.put("sellerComparison", appPageReportService.CalculationComparison2(sellerComparisonList,1));
  102. return new AjaxMessage<>(ResultStatus.OK,map);
  103. }
  104. @RequestMapping(value = "getProductionComparisonForSameYear",method = RequestMethod.GET)
  105. @ApiOperation(value = "App总览——生产数据-取水环比、供水环比、售水环比(本年)")
  106. public AjaxMessage<Object> getProductionComparisonForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  107. LocalDate now = LocalDate.now();
  108. List<DeviceWaterSupply> intakeComparisonList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,now.getMonthValue()+12);
  109. List<DeviceWaterSupply> makingComparisonList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,now.getMonthValue()+12);
  110. List<DeviceWaterSupply> sellerComparisonList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,now.getMonthValue()+12);
  111. Map<String,Object> map = new HashMap<String,Object>();
  112. map.put("intakeComparison",appPageReportService.CalculationComparison2(intakeComparisonList,2));
  113. map.put("makingComparison",appPageReportService.CalculationComparison2(makingComparisonList,2));
  114. map.put("sellerComparison", appPageReportService.CalculationComparison2(sellerComparisonList,2));
  115. return new AjaxMessage<>(ResultStatus.OK,map);
  116. }
  117. @RequestMapping(value = "getProductionComparisonForLast12Month",method = RequestMethod.GET)
  118. @ApiOperation(value = "App总览——生产数据-取水环比、供水环比、售水环比(近一年)")
  119. public AjaxMessage<Object> getProductionComparisonForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  120. LocalDate now = LocalDate.now();
  121. List<DeviceWaterSupply> intakeComparisonList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,24);
  122. List<DeviceWaterSupply> makingComparisonList = appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,24);
  123. List<DeviceWaterSupply> sellerComparisonList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,24);
  124. Map<String,Object> map = new HashMap<String,Object>();
  125. map.put("intakeComparison",appPageReportService.CalculationComparison2(intakeComparisonList,3));
  126. map.put("makingComparison",appPageReportService.CalculationComparison2(makingComparisonList,3));
  127. map.put("sellerComparison", appPageReportService.CalculationComparison2(sellerComparisonList,3));
  128. return new AjaxMessage<>(ResultStatus.OK,map);
  129. }
  130. /**
  131. * @Author wangbo
  132. * @Description App 营业总览数据-本月应收实收回收率普通用户用量大用户用量数据
  133. * @param companyOrgId 公司ID
  134. * @return
  135. */
  136. @RequestMapping(value = "getBusinessDataForSameMonth",method = RequestMethod.GET)
  137. @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(本月)")
  138. public AjaxMessage<Map<String,Object>> getSameMonthBusinessData(
  139. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  140. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,1);
  141. BigDecimal sum = sellerWaterList.get(0).getGeneralUserAmount().add(sellerWaterList.get(0).getBigUserAmount());
  142. BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:sellerWaterList.get(0).getGeneralUserAmount().multiply(new BigDecimal(100)).divide(sum,3);
  143. Map<String,Object> map = new HashMap<String,Object>();
  144. map.put("totalReceivable", sellerWaterList.get(0).getReceivableAmount());
  145. map.put("totalReceived", sellerWaterList.get(0).getReceivedAmount());
  146. map.put("amountDetails",sellerWaterList);
  147. map.put("generalUser",sellerWaterList.get(0).getGeneralUserAmount());
  148. map.put("bigUser",sellerWaterList.get(0).getBigUserAmount());
  149. map.put("generalUserRate",generalRate);
  150. map.put("bigUserRate",new BigDecimal(100).subtract(generalRate));
  151. 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(),3));
  152. return new AjaxMessage<>(ResultStatus.OK,map);
  153. }
  154. /**
  155. * @Author wangbo
  156. * @Description App 营业数据-本月应收实收售水回收率数据
  157. * @param companyOrgId 公司ID
  158. * @return
  159. */
  160. @RequestMapping(value = "getRevenueDataForSameMonth",method = RequestMethod.GET)
  161. @ApiOperation(value = "App——营业数据-应收实收售水回收率数据(本月)")
  162. public AjaxMessage<Map<String,Object>> getRevenueDataForSameMonth(
  163. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  164. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,1);
  165. List<DeviceWaterSupply> sellerAmountList = appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,1);
  166. Map<String,Object> map = new HashMap<String,Object>();
  167. map.put("receivableAmount", sellerWaterList.get(0).getReceivableAmount());
  168. map.put("receivedAmount", sellerWaterList.get(0).getReceivedAmount());
  169. map.put("sellerAmount",sellerAmountList.get(0).getAmount());
  170. 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(),3));
  171. return new AjaxMessage<>(ResultStatus.OK,map);
  172. }
  173. /**
  174. * @Author wangbo
  175. * @Description App 营业总览数据-本月应收实收回收率数据
  176. * @param companyOrgId 公司ID
  177. * @return
  178. */
  179. @RequestMapping(value = "getBusinessDataForSameYear",method = RequestMethod.GET)
  180. @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(本年)")
  181. public AjaxMessage<Map<String,Object>> getBusinessDataForSameYear(
  182. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  183. LocalDate now = LocalDate.now();
  184. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,now.getMonthValue());
  185. BigDecimal totalReceivableAmount = new BigDecimal(0);
  186. BigDecimal totalReceivedAmount = new BigDecimal(0);
  187. BigDecimal totalGeneralUser = new BigDecimal(0);
  188. BigDecimal totalBigUser = new BigDecimal(0);
  189. for(DeviceWaterSupply amount: sellerWaterList){
  190. totalReceivableAmount =totalReceivableAmount.add(amount.getReceivableAmount());
  191. totalReceivedAmount=totalReceivedAmount.add(amount.getReceivedAmount());
  192. totalGeneralUser=totalGeneralUser.add(amount.getGeneralUserAmount());
  193. totalBigUser=totalBigUser.add(amount.getBigUserAmount());
  194. amount.setRecoveryRate(totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? BigDecimal.ZERO : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,3));
  195. }
  196. BigDecimal sum =totalBigUser.add(totalGeneralUser);
  197. BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:totalGeneralUser.multiply(new BigDecimal(100)).divide(sum,2);
  198. Map<String,Object> map = new HashMap<String,Object>();
  199. map.put("totalReceivable", totalReceivableAmount);
  200. map.put("totalReceived",totalReceivedAmount);
  201. map.put("amountDetails",sellerWaterList);
  202. map.put("generalUser",totalGeneralUser);
  203. map.put("bigUser",totalBigUser);
  204. map.put("generalUserRate",generalRate);
  205. map.put("bigUserRate",new BigDecimal(100).subtract(generalRate));
  206. map.put("recoveryRate", totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? 0 : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,3));
  207. return new AjaxMessage<>(ResultStatus.OK,map);
  208. }
  209. /**
  210. * @Author wangbo
  211. * @Description App 营业总览数据-近一年应收实收回收率数据
  212. * @param companyOrgId 公司ID
  213. * @return
  214. */
  215. @RequestMapping(value = "getBusinessDataForLast12Month",method = RequestMethod.GET)
  216. @ApiOperation(value = "App总览——营业总览应收实收回收率普通用户用量大用户用量数据(近一年)")
  217. public AjaxMessage<Map<String,Object>> getBusinessDataForLast12Month(
  218. @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  219. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,12);
  220. BigDecimal totalReceivableAmount = new BigDecimal(0);
  221. BigDecimal totalReceivedAmount = new BigDecimal(0);
  222. BigDecimal totalGeneralUser = new BigDecimal(0);
  223. BigDecimal totalBigUser = new BigDecimal(0);
  224. for(DeviceWaterSupply amount: sellerWaterList){
  225. totalReceivableAmount =totalReceivableAmount.add(amount.getReceivableAmount());
  226. totalReceivedAmount=totalReceivedAmount.add(amount.getReceivedAmount());
  227. totalGeneralUser=totalGeneralUser.add(amount.getGeneralUserAmount());
  228. totalBigUser=totalBigUser.add(amount.getBigUserAmount());
  229. amount.setRecoveryRate(totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? BigDecimal.ZERO : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,3));
  230. }
  231. BigDecimal sum =totalBigUser.add(totalGeneralUser);
  232. BigDecimal generalRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:totalGeneralUser.multiply(new BigDecimal(100)).divide(sum,3);
  233. BigDecimal bigUserRate =sum.compareTo(BigDecimal.ZERO)==0?BigDecimal.ZERO:totalBigUser.multiply(new BigDecimal(100)).divide(sum,3);
  234. Map<String,Object> map = new HashMap<String,Object>();
  235. map.put("totalReceivable", totalReceivableAmount);
  236. map.put("totalReceived",totalReceivedAmount);
  237. map.put("amountDetails",sellerWaterList);
  238. map.put("generalUser",totalGeneralUser);
  239. map.put("bigUser",totalBigUser);
  240. map.put("generalUserRate",generalRate);
  241. map.put("bigUserRate",bigUserRate);
  242. map.put("recoveryRate", totalReceivableAmount.compareTo(BigDecimal.ZERO)==0? 0 : totalReceivedAmount.multiply(new BigDecimal(100)).divide(totalReceivableAmount,3));
  243. return new AjaxMessage<>(ResultStatus.OK,map);
  244. }
  245. @RequestMapping(value = "getSellerComparisonForSameMonth",method = RequestMethod.GET)
  246. @ApiOperation(value = "App总览——营收数据-应收实收环比(本月)")
  247. public AjaxMessage<Object> getSellerComparisonForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  248. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,2);
  249. BigDecimal receivableComparison = sellerWaterList.get(1).getReceivableAmount().compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:sellerWaterList.get(0).getReceivableAmount().subtract(sellerWaterList.get(1).getReceivableAmount()).multiply(new BigDecimal(100)).divide(sellerWaterList.get(1).getReceivableAmount(),3);
  250. BigDecimal receivedComparison = sellerWaterList.get(1).getReceivedAmount().compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:sellerWaterList.get(0).getReceivedAmount().subtract(sellerWaterList.get(1).getReceivedAmount()).multiply(new BigDecimal(100)).divide(sellerWaterList.get(1).getReceivedAmount(),3);
  251. Map<String,Object> map = new HashMap<String,Object>();
  252. map.put("receivableComparison",receivableComparison);
  253. map.put("receivedComparison",receivedComparison);
  254. return new AjaxMessage<>(ResultStatus.OK,map);
  255. }
  256. @RequestMapping(value = "getSellerComparisonForSameYear",method = RequestMethod.GET)
  257. @ApiOperation(value = "App总览——营收数据-应收实收环比(本年)")
  258. public AjaxMessage<Object> getSellerComparisonForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  259. LocalDate now = LocalDate.now();
  260. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,12+now.getMonthValue());
  261. BigDecimal receivedSameYearComparison = new BigDecimal(0);
  262. BigDecimal receivedLastYearComparison = new BigDecimal(0);
  263. BigDecimal receivableSameYearComparison = new BigDecimal(0);
  264. BigDecimal receivableLastYearComparison = new BigDecimal(0);
  265. for(int i=0 ;i<sellerWaterList.size();i++){
  266. if(i>=12){
  267. receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
  268. receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
  269. }
  270. else{
  271. receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
  272. receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
  273. }
  274. }
  275. BigDecimal receivedComparison = receivedLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivedSameYearComparison.subtract(receivedLastYearComparison).multiply(new BigDecimal(100)).divide(receivedLastYearComparison,3);
  276. BigDecimal receivableComparison = receivableLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivableSameYearComparison.subtract(receivableLastYearComparison).multiply(new BigDecimal(100)).divide(receivableLastYearComparison,3);
  277. Map<String,Object> map = new HashMap<String,Object>();
  278. map.put("receivableComparison",receivableComparison);
  279. map.put("receivedComparison",receivedComparison);
  280. return new AjaxMessage<>(ResultStatus.OK,map);
  281. }
  282. @RequestMapping(value = "getSellerComparisonForLast12Month",method = RequestMethod.GET)
  283. @ApiOperation(value = "App总览——营收数据-应收实收环比(本年)")
  284. public AjaxMessage<Object> getSellerComparisonForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
  285. BigDecimal receivedSameYearComparison = new BigDecimal(0);
  286. BigDecimal receivedLastYearComparison = new BigDecimal(0);
  287. BigDecimal receivableSameYearComparison = new BigDecimal(0);
  288. BigDecimal receivableLastYearComparison = new BigDecimal(0);
  289. List<DeviceWaterSupply> sellerWaterList = appPageReportService.deviceSellerAmountReportForMonth(companyOrgId,24);
  290. for(int i=0;i<sellerWaterList.size();i++){
  291. if(i>=12){
  292. receivedSameYearComparison = receivedSameYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
  293. receivableSameYearComparison =receivableSameYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
  294. }
  295. else{
  296. receivedLastYearComparison = receivedLastYearComparison.add(sellerWaterList.get(i).getReceivedAmount());
  297. receivableLastYearComparison =receivableLastYearComparison.add(sellerWaterList.get(i).getReceivableAmount());
  298. }
  299. }
  300. BigDecimal receivedComparison = receivedLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivedSameYearComparison.subtract(receivedLastYearComparison).multiply(new BigDecimal(100)).divide(receivedLastYearComparison,3);
  301. BigDecimal receivableComparison = receivableLastYearComparison.compareTo(BigDecimal.ZERO)==0 ?BigDecimal.ZERO:receivableSameYearComparison.subtract(receivableLastYearComparison).multiply(new BigDecimal(100)).divide(receivableLastYearComparison,3);
  302. Map<String,Object> map = new HashMap<String,Object>();
  303. map.put("receivableComparison",receivableComparison);
  304. map.put("receivedComparison",receivedComparison);
  305. return new AjaxMessage<>(ResultStatus.OK,map);
  306. }
  307. @RequestMapping(value = "getSceneAmountForSameMonth",method = RequestMethod.GET)
  308. @ApiOperation(value = "App总览——资产情况本月")
  309. public AjaxMessage<Object> getSceneAmountForSameMonth(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Long companyOrgId){
  310. Map<String,Object> map = new HashMap<String,Object>();
  311. List<Map<String,Object>> amount = appPageReportService.findSceneAmount(companyOrgId,1);
  312. return new AjaxMessage<>(ResultStatus.OK,amount);
  313. }
  314. @RequestMapping(value = "getSceneAmountForSameYear",method = RequestMethod.GET)
  315. @ApiOperation(value = "App总览——资产情况本年")
  316. public AjaxMessage<Object> getSceneAmountForSameYear(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Long companyOrgId){
  317. Map<String,Object> map = new HashMap<String,Object>();
  318. LocalDate now = LocalDate.now();
  319. List<Map<String,Object>> amount = appPageReportService.findSceneAmount(companyOrgId,now.getMonthValue());
  320. return new AjaxMessage<>(ResultStatus.OK,amount);
  321. }
  322. @RequestMapping(value = "getSceneAmountForLast12Month",method = RequestMethod.GET)
  323. @ApiOperation(value = "App总览——资产情况近一年")
  324. public AjaxMessage<Object> getSceneAmountForLast12Month(@ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Long companyOrgId){
  325. List<Map<String,Object>> amount = appPageReportService.findSceneAmount(companyOrgId,12);
  326. return new AjaxMessage<>(ResultStatus.OK,amount);
  327. }
  328. }