StatisticalReportController.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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. String receiveName
  77. ){
  78. if(carrierSsoId != null){
  79. if(!"null".equals(carrierSsoId)){
  80. mapValue.put("carrierSsoId", carrierSsoId);
  81. }
  82. }
  83. if (receiveName != null && !"null".equals(receiveName)) {
  84. mapValue.put("receivName","%" + receiveName + "%");
  85. }
  86. mapValue.put("orderType",orderType);
  87. mapValue.put("shipperId",shipperId);
  88. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  89. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  90. PageHelper.startPage(pageNum, pageSize);
  91. //分页数据
  92. List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
  93. PageListAdd pageList = columnDataUtil.tableColumnData2(apiId, allReport, report);
  94. return success(pageList);
  95. }
  96. @ApiOperation(value="查询销售统计报表筛选过后的总净重")
  97. @ApiImplicitParams({
  98. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  99. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  100. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  101. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  102. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  103. })
  104. @PostMapping("/getAllSaleReportTotal")
  105. public RESTfulResult getAllSaleReportTotal(@RequestBody(required=false) Map<String,Object> mapValue,
  106. String startTime,
  107. String endTime,
  108. String carrierSsoId
  109. ){
  110. if(carrierSsoId != null){
  111. if(!"null".equals(carrierSsoId)){
  112. mapValue.put("carrierSsoId", carrierSsoId);
  113. }
  114. }
  115. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  116. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  117. //获取销售统计报表筛选过后的总净重
  118. BigDecimal AllResultNetWeight = new BigDecimal(0);
  119. for (Map<String, Object> stringObjectMap : allReport) {
  120. if(stringObjectMap.get("resultNetWeight")!=null) {
  121. AllResultNetWeight = AllResultNetWeight.add(new BigDecimal(stringObjectMap.get("resultNetWeight").toString()));
  122. }
  123. }
  124. return success(AllResultNetWeight);
  125. }
  126. @ApiOperation(value="查询零星物资进厂统计报表")
  127. @ApiImplicitParams({
  128. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  129. @ApiImplicitParam(name = "apiId(424)", value = "动态表头", required = false, dataType = "Integer"),
  130. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  131. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  132. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  133. })
  134. @PostMapping("/getSporadicSuppliesReport1")
  135. public RESTfulResult getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
  136. Integer apiId,
  137. Integer pageNum,
  138. Integer pageSize,
  139. String startTime,
  140. String endTime,
  141. String carrierSsoId,
  142. String userId, String userIds, String con, Integer orderType
  143. ){
  144. if(carrierSsoId != null) {
  145. if (!"null".equals(carrierSsoId)) {
  146. mapValue.put("carrierSsoId", carrierSsoId);
  147. }
  148. }
  149. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  150. if (userId!=null){
  151. mapValue.put("userId",userId);
  152. }
  153. if (orderType!=null){
  154. mapValue.put("orderType",orderType);
  155. }
  156. if (userIds!=null){
  157. mapValue.put("userIds",userIds);
  158. }
  159. if (con!=null&&!con.equals("undefined")){
  160. mapValue.put("con","%"+con+"%");
  161. }
  162. List<Map<String, Object>> allReport = statisticalReportService.getSporadicSuppliesReportNum1(mapValue);
  163. PageHelper.startPage(pageNum, pageSize);
  164. //分页数据
  165. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
  166. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  167. return success(pageList);
  168. }
  169. @ApiOperation(value="查询零星物资出厂统计报表")
  170. @ApiImplicitParams({
  171. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  172. @ApiImplicitParam(name = "apiId(425)", value = "动态表头", required = false, dataType = "Integer"),
  173. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  174. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  175. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  176. })
  177. @PostMapping("/getSporadicSuppliesReport2")
  178. public RESTfulResult getSporadicSuppliesReport2(@RequestBody(required=false) Map<String,Object> mapValue,
  179. Integer apiId,
  180. Integer pageNum,
  181. Integer pageSize,
  182. String startTime,
  183. String endTime,
  184. String carrierSsoId,
  185. String userId,
  186. String userIds,
  187. String con,
  188. Integer orderType
  189. ){
  190. if(carrierSsoId != null){
  191. if(!"null".equals(carrierSsoId)){
  192. mapValue.put("carrierSsoId", carrierSsoId);
  193. }
  194. }
  195. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  196. if (con!=null&&!con.equals("undefined")){
  197. mapValue.put("con","%"+con+"%");
  198. }
  199. if (userId!=null){
  200. mapValue.put("userId",userId);
  201. }
  202. if (orderType!=null){
  203. mapValue.put("orderType",orderType);
  204. }
  205. if (userIds!=null){
  206. mapValue.put("userIds",userIds);
  207. }
  208. List<Map<String, Object>> allReport = statisticalReportService.getSporadicSuppliesReportNum2(mapValue);
  209. PageHelper.startPage(pageNum, pageSize);
  210. //分页数据
  211. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
  212. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
  213. return success(pageList);
  214. }
  215. @ApiOperation(value="查询采购内转统计报表")
  216. @ApiImplicitParams({
  217. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  218. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  219. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  220. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  221. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  222. })
  223. @PostMapping("/getPurInwardReport")
  224. public RESTfulResult getPurInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  225. Integer apiId,
  226. Integer pageNum,
  227. Integer pageSize,
  228. String startTime,
  229. String endTime
  230. ){
  231. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  232. PageHelper.startPage(pageNum, pageSize);
  233. //分页数据
  234. List<Map<String, Object>> report = statisticalReportService.getPurInwardReport(mapValue);
  235. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  236. return success(pageList);
  237. }
  238. @ApiOperation(value="查询零星内转统计报表")
  239. @ApiImplicitParams({
  240. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  241. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  242. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  243. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  244. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  245. })
  246. @PostMapping("/getLXInwardReport")
  247. public RESTfulResult getLXInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  248. Integer apiId,
  249. Integer pageNum,
  250. Integer pageSize,
  251. String startTime,
  252. String endTime
  253. ){
  254. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  255. PageHelper.startPage(pageNum, pageSize);
  256. //分页数据
  257. List<Map<String, Object>> report = statisticalReportService.getLXInwardReport(mapValue);
  258. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  259. return success(pageList);
  260. }
  261. @ApiOperation(value="查询内转统计报表")
  262. @ApiImplicitParams({
  263. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  264. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  265. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  266. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  267. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  268. })
  269. @PostMapping("/getInwardReport")
  270. public RESTfulResult getInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  271. Integer apiId,
  272. Integer pageNum,
  273. Integer pageSize,
  274. String startTime,
  275. String endTime
  276. ){
  277. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  278. PageHelper.startPage(pageNum, pageSize);
  279. //分页数据
  280. List<Map<String, Object>> report = statisticalReportService.getInwardReport(mapValue);
  281. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  282. return success(pageList);
  283. }
  284. @ApiOperation(value="查询拼装车统计报表")
  285. @ApiImplicitParams({
  286. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  287. @ApiImplicitParam(name = "apiId", value = "477", required = false, dataType = "Integer"),
  288. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  289. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  290. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  291. })
  292. @PostMapping("/getInwardReportForAssemble")
  293. public RESTfulResult getInwardReportForAssemble(@RequestBody(required=false) Map<String,Object> mapValue,
  294. Integer apiId,
  295. Integer pageNum,
  296. Integer pageSize,
  297. String startTime,
  298. String endTime
  299. ){
  300. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  301. PageHelper.startPage(pageNum, pageSize);
  302. //分页数据
  303. List<Map<String, Object>> report = statisticalReportService.getInwardReportForAssemble(mapValue);
  304. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  305. return success(pageList);
  306. }
  307. @ApiOperation("对内转车辆装货点进行统计")
  308. @PostMapping("/getLoading")
  309. public RESTfulResult getLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  310. Integer apiId,
  311. Integer pageNum,
  312. Integer pageSize,
  313. String startTime,
  314. String endTime){
  315. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  316. PageHelper.startPage(pageNum, pageSize);
  317. //分页数据
  318. List<Map<String, Object>> report = statisticalReportService.getLoading(mapValue);
  319. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  320. return success(pageList);
  321. }
  322. @ApiOperation("装载机所装车辆重量统计报表")
  323. @PostMapping("/getLoaderResult")
  324. public RESTfulResult getLoaderResult(@RequestBody(required=false) Map<String,Object> mapValue,
  325. Integer apiId,//apiId:463
  326. Integer pageNum,
  327. Integer pageSize,
  328. String startTime,
  329. String endTime){
  330. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  331. PageHelper.startPage(pageNum, pageSize);
  332. //分页数据
  333. List<Map<String, Object>> report = statisticalReportService.getLoaderResult(mapValue);
  334. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  335. return success(pageList);
  336. }
  337. @ApiOperation("对内转车辆装卸货点进行统计")
  338. @PostMapping("/getUnLoading")
  339. public RESTfulResult getUnLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  340. Integer apiId,
  341. Integer pageNum,
  342. Integer pageSize,
  343. String startTime,
  344. String endTime){
  345. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDate);//根据时间段查询数据
  346. PageHelper.startPage(pageNum, pageSize);
  347. //分页数据
  348. List<Map<String, Object>> report = statisticalReportService.getUnLoading(mapValue);
  349. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  350. return success(pageList);
  351. }
  352. //保卫部随机抽查车牌号查看所有信息
  353. @ApiOperation("保卫部随机抽查车牌号查看所有信息")
  354. @PostMapping("/getCapacityByDefend")
  355. public RESTfulResult getCapacityByDefend(@RequestBody(required = false) Map<String,Object> map,
  356. Integer apiId,
  357. Integer pageNum,
  358. Integer pageSize,
  359. String startTime,
  360. String endTime,
  361. String con){
  362. if (con != null && !"undefined".equals(con)) {
  363. map.put("con",con);
  364. }
  365. DataChange.queryDataByDateTime(startTime ,endTime, map, sdfDateTime);//根据时间段查询数据
  366. PageHelper.startPage(pageNum, pageSize);
  367. List<Map<String, Object>> report = statisticalReportService.getCapacityByDefend(map);
  368. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  369. return success(pageList);
  370. }
  371. }