StatisticalReportController.java 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.service.impl.StatisticalReportImpl;
  3. import com.steerinfo.dil.util.BaseRESTfulController;
  4. import com.steerinfo.dil.util.ColumnDataUtil;
  5. import com.steerinfo.dil.util.PageListAdd;
  6. import com.steerinfo.framework.controller.RESTfulResult;
  7. import com.steerinfo.framework.service.pagehelper.PageHelper;
  8. import io.swagger.annotations.ApiImplicitParam;
  9. import io.swagger.annotations.ApiImplicitParams;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.PostMapping;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import java.util.HashMap;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * @ author :TXF
  21. * @ time :2021/12/14 18:05
  22. */
  23. @RestController
  24. @RequestMapping("/${api.version}/statisticalReport")
  25. public class StatisticalReportController extends BaseRESTfulController {
  26. @Autowired
  27. StatisticalReportImpl statisticalReportService;
  28. @Autowired
  29. ColumnDataUtil columnDataUtil;
  30. @ApiOperation(value="查询辅料燃料统计报表")
  31. @ApiImplicitParams({
  32. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  33. @ApiImplicitParam(name = "apiId(220)", value = "动态表头", required = false, dataType = "Integer"),
  34. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  35. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  36. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  37. })
  38. @PostMapping("/getRLFLReport")
  39. public RESTfulResult getRLFLReport(@RequestBody(required=false) Map<String,Object> mapValue,
  40. Integer apiId,
  41. Integer pageNum,
  42. Integer pageSize,
  43. Integer orderType
  44. ){
  45. mapValue.put("orderTypee", orderType);
  46. List<Map<String, Object>> allReport = statisticalReportService.getAllPurchaseFLRLReport(mapValue);
  47. PageHelper.startPage(pageNum, pageSize);
  48. //分页数据
  49. List<Map<String, Object>> report = statisticalReportService.getRLFLReport(mapValue);
  50. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport,report);
  51. return success(pageList);
  52. }
  53. @ApiOperation(value="查询销售统计报表")
  54. @ApiImplicitParams({
  55. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  56. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  57. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  58. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  59. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  60. })
  61. @PostMapping("/getAllSaleReport")
  62. public RESTfulResult getAllSaleReport(@RequestBody(required=false) Map<String,Object> mapValue,
  63. Integer apiId,
  64. Integer pageNum,
  65. Integer pageSize,
  66. String carrierSsoId
  67. ){
  68. if(carrierSsoId != null){
  69. if(!"null".equals(carrierSsoId)){
  70. mapValue.put("carrierSsoId", carrierSsoId);
  71. }
  72. }
  73. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  74. PageHelper.startPage(pageNum, pageSize);
  75. //分页数据
  76. List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
  77. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  78. return success(pageList);
  79. }
  80. @ApiOperation(value="查询零星物资进厂统计报表")
  81. @ApiImplicitParams({
  82. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  83. @ApiImplicitParam(name = "apiId(424)", value = "动态表头", required = false, dataType = "Integer"),
  84. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  85. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  86. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  87. })
  88. @PostMapping("/getSporadicSuppliesReport1")
  89. public RESTfulResult getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
  90. Integer apiId,
  91. Integer pageNum,
  92. Integer pageSize,
  93. String carrierSsoId
  94. ){
  95. if(carrierSsoId != null){
  96. if(!"null".equals(carrierSsoId)){
  97. mapValue.put("carrierSsoId", carrierSsoId);
  98. }
  99. }
  100. List<Map<String, Object>> allReport = statisticalReportService.getSporadicSuppliesReportNum1(mapValue);
  101. PageHelper.startPage(pageNum, pageSize);
  102. //分页数据
  103. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
  104. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  105. return success(pageList);
  106. }
  107. @ApiOperation(value="查询零星物资出厂统计报表")
  108. @ApiImplicitParams({
  109. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  110. @ApiImplicitParam(name = "apiId(425)", value = "动态表头", required = false, dataType = "Integer"),
  111. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  112. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  113. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  114. })
  115. @PostMapping("/getSporadicSuppliesReport2")
  116. public RESTfulResult getSporadicSuppliesReport2(@RequestBody(required=false) Map<String,Object> mapValue,
  117. Integer apiId,
  118. Integer pageNum,
  119. Integer pageSize,
  120. String carrierSsoId
  121. ){
  122. if(carrierSsoId != null){
  123. if(!"null".equals(carrierSsoId)){
  124. mapValue.put("carrierSsoId", carrierSsoId);
  125. }
  126. }
  127. List<Map<String, Object>> allReport = statisticalReportService.getSporadicSuppliesReportNum2(mapValue);
  128. PageHelper.startPage(pageNum, pageSize);
  129. //分页数据
  130. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
  131. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  132. return success(pageList);
  133. }
  134. }