StatisticalReportController.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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.DataChange;
  6. import com.steerinfo.dil.util.PageListAdd;
  7. import com.steerinfo.framework.controller.RESTfulResult;
  8. import com.steerinfo.framework.service.pagehelper.PageHelper;
  9. import io.swagger.annotations.ApiImplicitParam;
  10. import io.swagger.annotations.ApiImplicitParams;
  11. import io.swagger.annotations.ApiOperation;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import java.math.BigDecimal;
  18. import java.text.SimpleDateFormat;
  19. import java.util.*;
  20. /**
  21. * @ author :TXF
  22. * @ time :2021/12/14 18:05
  23. */
  24. @RestController
  25. @RequestMapping("/${api.version}/statisticalReport")
  26. public class StatisticalReportController extends BaseRESTfulController {
  27. @Autowired
  28. StatisticalReportImpl statisticalReportService;
  29. @Autowired
  30. ColumnDataUtil columnDataUtil;
  31. private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
  32. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  33. @ApiOperation(value="查询辅料燃料统计报表")
  34. @ApiImplicitParams({
  35. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  36. @ApiImplicitParam(name = "apiId(220)", value = "动态表头", required = false, dataType = "Integer"),
  37. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  38. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  39. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  40. })
  41. @PostMapping("/getRLFLReport")
  42. public RESTfulResult getRLFLReport(@RequestBody(required=false) Map<String,Object> mapValue,
  43. Integer apiId,
  44. Integer pageNum,
  45. Integer pageSize,
  46. String startTime,
  47. String endTime,
  48. Integer orderType
  49. ){
  50. mapValue.put("orderTypee", orderType);
  51. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  52. PageHelper.startPage(pageNum, pageSize);
  53. //分页数据
  54. List<Map<String, Object>> report = statisticalReportService.getRLFLReport(mapValue);
  55. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,report);
  56. return success(pageList);
  57. }
  58. @ApiOperation(value="查询销售统计报表")
  59. @ApiImplicitParams({
  60. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  61. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  62. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  63. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  64. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  65. })
  66. @PostMapping("/getAllSaleReport")
  67. public RESTfulResult getAllSaleReport(@RequestBody(required=false) Map<String,Object> mapValue,
  68. Integer apiId,
  69. Integer pageNum,
  70. Integer pageSize,
  71. String startTime,
  72. String endTime,
  73. String carrierSsoId,
  74. Integer orderType,
  75. Integer shipperId
  76. ){
  77. if(carrierSsoId != null){
  78. if(!"null".equals(carrierSsoId)){
  79. mapValue.put("carrierSsoId", carrierSsoId);
  80. }
  81. }
  82. mapValue.put("orderType",orderType);
  83. mapValue.put("shipperId",shipperId);
  84. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  85. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  86. PageHelper.startPage(pageNum, pageSize);
  87. //分页数据
  88. List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
  89. PageListAdd pageList = columnDataUtil.tableColumnData2(apiId, allReport, report);
  90. return success(pageList);
  91. }
  92. @ApiOperation(value="查询销售统计报表筛选过后的总净重")
  93. @ApiImplicitParams({
  94. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  95. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  96. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  97. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  98. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  99. })
  100. @PostMapping("/getAllSaleReportTotal")
  101. public RESTfulResult getAllSaleReportTotal(@RequestBody(required=false) Map<String,Object> mapValue,
  102. String startTime,
  103. String endTime,
  104. String carrierSsoId
  105. ){
  106. if(carrierSsoId != null){
  107. if(!"null".equals(carrierSsoId)){
  108. mapValue.put("carrierSsoId", carrierSsoId);
  109. }
  110. }
  111. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  112. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  113. //获取销售统计报表筛选过后的总净重
  114. BigDecimal AllResultNetWeight = new BigDecimal(0);
  115. for (Map<String, Object> stringObjectMap : allReport) {
  116. if(stringObjectMap.get("resultNetWeight")!=null) {
  117. AllResultNetWeight = AllResultNetWeight.add(new BigDecimal(stringObjectMap.get("resultNetWeight").toString()));
  118. }
  119. }
  120. return success(AllResultNetWeight);
  121. }
  122. @ApiOperation(value="查询零星物资进厂统计报表")
  123. @ApiImplicitParams({
  124. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  125. @ApiImplicitParam(name = "apiId(424)", value = "动态表头", required = false, dataType = "Integer"),
  126. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  127. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  128. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  129. })
  130. @PostMapping("/getSporadicSuppliesReport1")
  131. public RESTfulResult getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
  132. Integer apiId,
  133. Integer pageNum,
  134. Integer pageSize,
  135. String startTime,
  136. String endTime,
  137. String carrierSsoId,
  138. String userId, String userIds, String con, Integer orderType
  139. ){
  140. if(carrierSsoId != null) {
  141. if (!"null".equals(carrierSsoId)) {
  142. mapValue.put("carrierSsoId", carrierSsoId);
  143. }
  144. }
  145. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  146. if (userId!=null){
  147. mapValue.put("userId",userId);
  148. }
  149. if (orderType!=null){
  150. mapValue.put("orderType",orderType);
  151. }
  152. if (userIds!=null){
  153. mapValue.put("userIds",userIds);
  154. }
  155. if (con!=null&&!con.equals("undefined")){
  156. mapValue.put("con","%"+con+"%");
  157. }
  158. List<Map<String, Object>> allReport = statisticalReportService.getSporadicSuppliesReportNum1(mapValue);
  159. PageHelper.startPage(pageNum, pageSize);
  160. //分页数据
  161. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
  162. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  163. return success(pageList);
  164. }
  165. @ApiOperation(value="查询零星物资出厂统计报表")
  166. @ApiImplicitParams({
  167. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  168. @ApiImplicitParam(name = "apiId(425)", value = "动态表头", required = false, dataType = "Integer"),
  169. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  170. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  171. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  172. })
  173. @PostMapping("/getSporadicSuppliesReport2")
  174. public RESTfulResult getSporadicSuppliesReport2(@RequestBody(required=false) Map<String,Object> mapValue,
  175. Integer apiId,
  176. Integer pageNum,
  177. Integer pageSize,
  178. String startTime,
  179. String endTime,
  180. String carrierSsoId,
  181. String userId,
  182. String userIds,
  183. String con,
  184. Integer orderType
  185. ){
  186. if(carrierSsoId != null){
  187. if(!"null".equals(carrierSsoId)){
  188. mapValue.put("carrierSsoId", carrierSsoId);
  189. }
  190. }
  191. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  192. if (con!=null&&!con.equals("undefined")){
  193. mapValue.put("con","%"+con+"%");
  194. }
  195. if (userId!=null){
  196. mapValue.put("userId",userId);
  197. }
  198. if (orderType!=null){
  199. mapValue.put("orderType",orderType);
  200. }
  201. if (userIds!=null){
  202. mapValue.put("userIds",userIds);
  203. }
  204. List<Map<String, Object>> allReport = statisticalReportService.getSporadicSuppliesReportNum2(mapValue);
  205. PageHelper.startPage(pageNum, pageSize);
  206. //分页数据
  207. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
  208. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  209. return success(pageList);
  210. }
  211. @ApiOperation(value="查询采购内转统计报表")
  212. @ApiImplicitParams({
  213. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  214. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  215. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  216. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  217. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  218. })
  219. @PostMapping("/getPurInwardReport")
  220. public RESTfulResult getPurInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  221. Integer apiId,
  222. Integer pageNum,
  223. Integer pageSize,
  224. String startTime,
  225. String endTime
  226. ){
  227. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  228. PageHelper.startPage(pageNum, pageSize);
  229. //分页数据
  230. List<Map<String, Object>> report = statisticalReportService.getPurInwardReport(mapValue);
  231. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  232. return success(pageList);
  233. }
  234. @ApiOperation(value="查询零星内转统计报表")
  235. @ApiImplicitParams({
  236. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  237. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  238. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  239. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  240. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  241. })
  242. @PostMapping("/getLXInwardReport")
  243. public RESTfulResult getLXInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  244. Integer apiId,
  245. Integer pageNum,
  246. Integer pageSize,
  247. String startTime,
  248. String endTime
  249. ){
  250. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  251. PageHelper.startPage(pageNum, pageSize);
  252. //分页数据
  253. List<Map<String, Object>> report = statisticalReportService.getLXInwardReport(mapValue);
  254. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  255. return success(pageList);
  256. }
  257. @ApiOperation(value="查询内转统计报表")
  258. @ApiImplicitParams({
  259. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  260. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  261. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  262. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  263. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  264. })
  265. @PostMapping("/getInwardReport")
  266. public RESTfulResult getInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  267. Integer apiId,
  268. Integer pageNum,
  269. Integer pageSize,
  270. String startTime,
  271. String endTime
  272. ){
  273. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  274. PageHelper.startPage(pageNum, pageSize);
  275. //分页数据
  276. List<Map<String, Object>> report = statisticalReportService.getInwardReport(mapValue);
  277. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  278. return success(pageList);
  279. }
  280. @ApiOperation(value="查询拼装车统计报表")
  281. @ApiImplicitParams({
  282. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  283. @ApiImplicitParam(name = "apiId", value = "477", required = false, dataType = "Integer"),
  284. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  285. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  286. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  287. })
  288. @PostMapping("/getInwardReportForAssemble")
  289. public RESTfulResult getInwardReportForAssemble(@RequestBody(required=false) Map<String,Object> mapValue,
  290. Integer apiId,
  291. Integer pageNum,
  292. Integer pageSize,
  293. String startTime,
  294. String endTime
  295. ){
  296. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  297. PageHelper.startPage(pageNum, pageSize);
  298. //分页数据
  299. List<Map<String, Object>> report = statisticalReportService.getInwardReportForAssemble(mapValue);
  300. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  301. return success(pageList);
  302. }
  303. @ApiOperation("对内转车辆装货点进行统计")
  304. @PostMapping("/getLoading")
  305. public RESTfulResult getLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  306. Integer apiId,
  307. Integer pageNum,
  308. Integer pageSize,
  309. String startTime,
  310. String endTime){
  311. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  312. PageHelper.startPage(pageNum, pageSize);
  313. //分页数据
  314. List<Map<String, Object>> report = statisticalReportService.getLoading(mapValue);
  315. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  316. return success(pageList);
  317. }
  318. @ApiOperation("装载机所装车辆重量统计报表")
  319. @PostMapping("/getLoaderResult")
  320. public RESTfulResult getLoaderResult(@RequestBody(required=false) Map<String,Object> mapValue,
  321. Integer apiId,//apiId:463
  322. Integer pageNum,
  323. Integer pageSize,
  324. String startTime,
  325. String endTime){
  326. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  327. PageHelper.startPage(pageNum, pageSize);
  328. //分页数据
  329. List<Map<String, Object>> report = statisticalReportService.getLoaderResult(mapValue);
  330. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  331. return success(pageList);
  332. }
  333. @ApiOperation("对内转车辆装卸货点进行统计")
  334. @PostMapping("/getUnLoading")
  335. public RESTfulResult getUnLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  336. Integer apiId,
  337. Integer pageNum,
  338. Integer pageSize,
  339. String startTime,
  340. String endTime){
  341. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDate);//根据时间段查询数据
  342. PageHelper.startPage(pageNum, pageSize);
  343. //分页数据
  344. List<Map<String, Object>> report = statisticalReportService.getUnLoading(mapValue);
  345. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  346. return success(pageList);
  347. }
  348. //保卫部随机抽查车牌号查看所有信息
  349. @ApiOperation("保卫部随机抽查车牌号查看所有信息")
  350. @PostMapping("/getCapacityByDefend")
  351. public RESTfulResult getCapacityByDefend(@RequestBody(required = false) Map<String,Object> map,
  352. Integer apiId,
  353. Integer pageNum,
  354. Integer pageSize,
  355. String startTime,
  356. String endTime,
  357. String con){
  358. if (con != null && !"undefined".equals(con)) {
  359. map.put("con",con);
  360. }
  361. DataChange.queryDataByDateTime(startTime ,endTime, map, sdfDateTime);//根据时间段查询数据
  362. PageHelper.startPage(pageNum, pageSize);
  363. List<Map<String, Object>> report = statisticalReportService.getCapacityByDefend(map);
  364. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  365. return success(pageList);
  366. }
  367. }