StatisticalReportController.java 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  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.*;
  14. import java.math.BigDecimal;
  15. import java.text.SimpleDateFormat;
  16. import java.util.*;
  17. /**
  18. * @ author :TXF
  19. * @ time :2021/12/14 18:05
  20. */
  21. @RestController
  22. @RequestMapping("/${api.version}/statisticalReport")
  23. public class StatisticalReportController extends BaseRESTfulController {
  24. @Autowired
  25. StatisticalReportImpl statisticalReportService;
  26. @Autowired
  27. ColumnDataUtil columnDataUtil;
  28. private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
  29. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  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. String startTime,
  44. String endTime,
  45. Integer orderType,
  46. String con
  47. ){
  48. mapValue.put("orderTypee", orderType);
  49. if (con!=null && !"null".equals(con) && !"".equals(con)){
  50. mapValue.put("con",con);
  51. }
  52. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  53. PageHelper.startPage(pageNum, pageSize);
  54. //分页数据
  55. List<Map<String, Object>> report = statisticalReportService.getRLFLReport(mapValue);
  56. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,report);
  57. return success(pageList);
  58. }
  59. @ApiOperation(value="查询销售统计报表")
  60. @ApiImplicitParams({
  61. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  62. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  63. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  64. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  65. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  66. })
  67. @PostMapping("/getAllSaleReport")
  68. public RESTfulResult getAllSaleReport(@RequestBody(required=false) Map<String,Object> mapValue,
  69. Integer apiId,
  70. Integer pageNum,
  71. Integer pageSize,
  72. String startTime,
  73. String endTime,
  74. String carrierSsoId,
  75. Integer orderType,
  76. Integer shipperId,
  77. String receiveName,
  78. String materialName,
  79. String wareHouse
  80. ){
  81. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  82. if(carrierSsoId != null){
  83. if(!"null".equals(carrierSsoId)){
  84. mapValue.put("carrierSsoId", carrierSsoId);
  85. }
  86. }
  87. if (receiveName != null && !"null".equals(receiveName)) {
  88. mapValue.put("receivName","%" + receiveName + "%");
  89. }
  90. if (materialName != null && !"".equals(materialName) && !"null".equals(materialName)) {
  91. mapValue.put("remark","%" + materialName + "%");
  92. }
  93. if (wareHouse != null && !"".equals(wareHouse) && !"null".equals(wareHouse)) {
  94. mapValue.put("wareHouse","%" + wareHouse + "%");
  95. }
  96. mapValue.put("orderTypee",orderType);
  97. mapValue.put("shipperId",shipperId);
  98. if(orderType==1 && mapValue.get("orderField")==null){
  99. //如果没有使用排序且查询的表格类型为销售钢材内部专用表格,默认规格排序
  100. mapValue.put("orderField","materialCode");
  101. mapValue.put("orderType","desc");
  102. }
  103. PageHelper.startPage(pageNum, pageSize);
  104. //分页数据
  105. List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
  106. PageListAdd pageList = columnDataUtil.tableColumnData5(apiId, null, report);
  107. return success(pageList);
  108. }
  109. @ApiOperation(value="查询销售统计报表筛选过后的总净重")
  110. @ApiImplicitParams({
  111. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  112. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  113. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  114. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  115. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  116. })
  117. @PostMapping("/getAllSaleReportTotal")
  118. public RESTfulResult getAllSaleReportTotal(@RequestBody(required=false) Map<String,Object> mapValue,
  119. String startTime,
  120. String endTime,
  121. String carrierSsoId
  122. ){
  123. if(carrierSsoId != null){
  124. if(!"null".equals(carrierSsoId)){
  125. mapValue.put("carrierSsoId", carrierSsoId);
  126. }
  127. }
  128. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  129. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  130. //获取销售统计报表筛选过后的总净重
  131. BigDecimal AllResultNetWeight = new BigDecimal(0);
  132. for (Map<String, Object> stringObjectMap : allReport) {
  133. if(stringObjectMap.get("resultNetWeight")!=null) {
  134. AllResultNetWeight = AllResultNetWeight.add(new BigDecimal(stringObjectMap.get("resultNetWeight").toString()));
  135. }
  136. }
  137. return success(AllResultNetWeight);
  138. }
  139. @ApiOperation(value="查询零星物资进厂统计报表")
  140. @ApiImplicitParams({
  141. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  142. @ApiImplicitParam(name = "apiId(424)", value = "动态表头", required = false, dataType = "Integer"),
  143. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  144. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  145. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  146. })
  147. @PostMapping("/getSporadicSuppliesReport1")
  148. public RESTfulResult getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
  149. Integer apiId,
  150. Integer pageNum,
  151. Integer pageSize,
  152. String startTime,
  153. String endTime,
  154. String carrierSsoId,
  155. String userId, String userIds, String con, Integer orderType
  156. ){
  157. if(carrierSsoId != null) {
  158. if (!"null".equals(carrierSsoId)) {
  159. mapValue.put("carrierSsoId", carrierSsoId);
  160. }
  161. }
  162. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  163. if (userId!=null){
  164. mapValue.put("userId",userId);
  165. }
  166. if (orderType!=null){
  167. mapValue.put("orderType",orderType);
  168. }
  169. if (userIds!=null){
  170. mapValue.put("userIds",userIds);
  171. }
  172. if (con!=null&&!"null".equals(con)){
  173. mapValue.put("con","%"+con+"%");
  174. }
  175. PageHelper.startPage(pageNum, pageSize);
  176. //分页数据
  177. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
  178. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  179. return success(pageList);
  180. }
  181. @ApiOperation(value="查询零星物资出厂统计报表")
  182. @ApiImplicitParams({
  183. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  184. @ApiImplicitParam(name = "apiId(425)", value = "动态表头", required = false, dataType = "Integer"),
  185. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  186. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  187. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  188. })
  189. @PostMapping("/getSporadicSuppliesReport2")
  190. public RESTfulResult getSporadicSuppliesReport2(@RequestBody(required=false) Map<String,Object> mapValue,
  191. Integer apiId,
  192. Integer pageNum,
  193. Integer pageSize,
  194. String startTime,
  195. String endTime,
  196. String carrierSsoId,
  197. String userId,
  198. String userIds,
  199. String con,
  200. Integer orderType
  201. ){
  202. if(carrierSsoId != null){
  203. if(!"null".equals(carrierSsoId)){
  204. mapValue.put("carrierSsoId", carrierSsoId);
  205. }
  206. }
  207. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  208. if (con!=null&&!"null".equals(con)){
  209. mapValue.put("con","%"+con+"%");
  210. }
  211. if (userId!=null){
  212. mapValue.put("userId",userId);
  213. }
  214. if (orderType!=null){
  215. mapValue.put("orderType",orderType);
  216. }
  217. if (userIds!=null){
  218. mapValue.put("userIds",userIds);
  219. }
  220. PageHelper.startPage(pageNum, pageSize);
  221. //分页数据
  222. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
  223. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  224. return success(pageList);
  225. }
  226. @ApiOperation(value="查询采购内转统计报表")
  227. @ApiImplicitParams({
  228. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  229. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  230. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  231. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  232. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  233. })
  234. @PostMapping("/getPurInwardReport")
  235. public RESTfulResult getPurInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  236. Integer apiId,
  237. Integer pageNum,
  238. Integer pageSize,
  239. String startTime,
  240. String endTime
  241. ){
  242. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  243. PageHelper.startPage(pageNum, pageSize);
  244. //分页数据
  245. List<Map<String, Object>> report = statisticalReportService.getPurInwardReport(mapValue);
  246. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  247. return success(pageList);
  248. }
  249. @ApiOperation(value="查询零星内转统计报表")
  250. @ApiImplicitParams({
  251. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  252. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  253. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  254. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  255. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  256. })
  257. @PostMapping("/getLXInwardReport")
  258. public RESTfulResult getLXInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  259. Integer apiId,
  260. Integer pageNum,
  261. Integer pageSize,
  262. String startTime,
  263. String endTime,
  264. String con
  265. ){
  266. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  267. if(con != null && !"null".equals(con)){
  268. mapValue.put("con","%" + con + "%");
  269. }
  270. PageHelper.startPage(pageNum, pageSize);
  271. //分页数据
  272. List<Map<String, Object>> report = statisticalReportService.getLXInwardReport(mapValue);
  273. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  274. return success(pageList);
  275. }
  276. @ApiOperation(value="查询内转统计报表")
  277. @ApiImplicitParams({
  278. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  279. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  280. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  281. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  282. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  283. })
  284. @PostMapping("/getInwardReport")
  285. public RESTfulResult getInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  286. Integer apiId,
  287. Integer pageNum,
  288. Integer pageSize,
  289. String startTime,
  290. String endTime
  291. ){
  292. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  293. PageHelper.startPage(pageNum, pageSize);
  294. //分页数据
  295. List<Map<String, Object>> report = statisticalReportService.getInwardReport(mapValue);
  296. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  297. return success(pageList);
  298. }
  299. @ApiOperation(value="查询该组织机构下的销售统计报表")
  300. @ApiImplicitParams({
  301. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  302. @ApiImplicitParam(name = "apiId", value = "486", required = false, dataType = "Integer"),
  303. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  304. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  305. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  306. })
  307. @PostMapping("/getSaleOrderList")
  308. public RESTfulResult getSaleOrderList(@RequestBody(required=false) Map<String,Object> mapValue,
  309. Integer apiId,
  310. Integer pageNum,
  311. Integer pageSize,
  312. String startTime,
  313. String endTime,
  314. String orgCode,
  315. String isPage,
  316. String index
  317. ){
  318. if (orgCode!=null&&!"null".equals(orgCode)){
  319. mapValue.put("orgCode",orgCode);
  320. }
  321. if (index!=null&&!"null".equals(index)){
  322. mapValue.put("index",index);
  323. }
  324. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  325. if("yes".equals(isPage)){
  326. return success(statisticalReportService.getSaleOrderList(mapValue));
  327. }
  328. PageHelper.startPage(pageNum, pageSize);
  329. //分页数据
  330. List<Map<String, Object>> report = statisticalReportService.getSaleOrderList(mapValue);
  331. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  332. return success(pageList);
  333. }
  334. @ApiOperation(value="查询该组织机构下的采购统计报表")
  335. @ApiImplicitParams({
  336. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  337. @ApiImplicitParam(name = "apiId", value = "486", required = false, dataType = "Integer"),
  338. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  339. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  340. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  341. })
  342. @PostMapping("/getPurchaseOrderList")
  343. public RESTfulResult getPurchaseOrderList(@RequestBody(required=false) Map<String,Object> mapValue,
  344. Integer apiId,
  345. Integer pageNum,
  346. Integer pageSize,
  347. String startTime,
  348. String endTime,
  349. String orgCode,
  350. String isPage,
  351. String index
  352. ){
  353. if (orgCode!=null&&!"null".equals(orgCode)){
  354. mapValue.put("orgCode",orgCode);
  355. }
  356. if (index!=null&&!"null".equals(index)){
  357. mapValue.put("index",index);
  358. }
  359. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  360. if ("yes".equals(isPage)){
  361. return success(statisticalReportService.getPurchaseOrderList(mapValue));
  362. }
  363. PageHelper.startPage(pageNum, pageSize);
  364. //分页数据
  365. List<Map<String, Object>> report = statisticalReportService.getPurchaseOrderList(mapValue);
  366. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  367. return success(pageList);
  368. }
  369. @ApiOperation(value="查询该组织机构下的采购内转统计报表")
  370. @ApiImplicitParams({
  371. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  372. @ApiImplicitParam(name = "apiId", value = "s", required = false, dataType = "Integer"),
  373. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  374. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  375. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  376. })
  377. @PostMapping("/getPurchaseInwardList")
  378. public RESTfulResult getInwardList(@RequestBody(required=false) Map<String,Object> mapValue,
  379. Integer apiId,
  380. Integer pageNum,
  381. Integer pageSize,
  382. String startTime,
  383. String endTime,
  384. String orgCode,
  385. String isPage,
  386. String index
  387. ){
  388. if (index!=null&&!"null".equals(index)){
  389. mapValue.put("index",index);
  390. }
  391. if (orgCode!=null&&!"null".equals(orgCode)){
  392. mapValue.put("orgCode",orgCode);
  393. }
  394. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  395. if ("yes".equals(isPage)){
  396. return success(statisticalReportService.getPurchaseInwardList(mapValue));
  397. }
  398. PageHelper.startPage(pageNum, pageSize);
  399. //分页数据
  400. List<Map<String, Object>> report = statisticalReportService.getPurchaseInwardList(mapValue);
  401. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  402. return success(pageList);
  403. }
  404. @ApiOperation(value="查询该组织机构下的厂外进厂内转")
  405. @ApiImplicitParams({
  406. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  407. @ApiImplicitParam(name = "apiId", value = "s", required = false, dataType = "Integer"),
  408. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  409. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  410. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  411. })
  412. @PostMapping("/getOutFactoryInwardList")
  413. public RESTfulResult getOutFactoryInwardList(@RequestBody(required=false) Map<String,Object> mapValue,
  414. Integer apiId,
  415. Integer pageNum,
  416. Integer pageSize,
  417. String startTime,
  418. String endTime,
  419. String orgCode,
  420. String isPage,
  421. String index
  422. ){
  423. if (index!=null&&!"null".equals(index)){
  424. mapValue.put("index",index);
  425. }
  426. if (orgCode!=null&&!"null".equals(orgCode)){
  427. mapValue.put("orgCode",orgCode);
  428. }
  429. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  430. if ("yes".equals(isPage)){
  431. return success(statisticalReportService.getOutFactoryInwardList(mapValue));
  432. }
  433. PageHelper.startPage(pageNum, pageSize);
  434. //分页数据
  435. List<Map<String, Object>> report = statisticalReportService.getOutFactoryInwardList(mapValue);
  436. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  437. return success(pageList);
  438. }
  439. @ApiOperation(value="查询该组织机构下的内转统计报表")
  440. @ApiImplicitParams({
  441. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  442. @ApiImplicitParam(name = "apiId", value = "s", required = false, dataType = "Integer"),
  443. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  444. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  445. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  446. })
  447. @PostMapping("/getInwardInFactory")
  448. public RESTfulResult getInwardInFactory(@RequestBody(required=false) Map<String,Object> mapValue,
  449. Integer apiId,
  450. Integer pageNum,
  451. Integer pageSize,
  452. String startTime,
  453. String endTime,
  454. String orgCode,
  455. String isPage,
  456. String index
  457. ){
  458. if (index!=null&&!"null".equals(index)){
  459. mapValue.put("index",index);
  460. }
  461. if (orgCode!=null&&!"null".equals(orgCode)){
  462. mapValue.put("orgCode",orgCode);
  463. }
  464. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  465. if ("yes".equals(isPage)){
  466. return success(statisticalReportService.getInwardInFactory(mapValue));
  467. }
  468. PageHelper.startPage(pageNum, pageSize);
  469. //分页数据
  470. List<Map<String, Object>> report = statisticalReportService.getInwardInFactory(mapValue);
  471. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  472. return success(pageList);
  473. }
  474. @ApiOperation(value="查询拼装车统计报表")
  475. @ApiImplicitParams({
  476. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  477. @ApiImplicitParam(name = "apiId", value = "477", required = false, dataType = "Integer"),
  478. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  479. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  480. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  481. })
  482. @PostMapping("/getInwardReportForAssemble")
  483. public RESTfulResult getInwardReportForAssemble(@RequestBody(required=false) Map<String,Object> mapValue,
  484. Integer apiId,
  485. Integer pageNum,
  486. Integer pageSize,
  487. String startTime,
  488. String endTime, BigDecimal orderType, String index, String isPage,String orgCode
  489. ){
  490. if (index!=null&&!"null".equals(index)){
  491. mapValue.put("index",index);
  492. }
  493. if (orgCode!=null&&!"null".equals(orgCode)){
  494. mapValue.put("orgCode",orgCode);
  495. }
  496. if (orderType!=null&&!"null".equals(orderType)){
  497. mapValue.put("orderTypee",orderType);
  498. }
  499. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  500. if ("yes".equals(isPage)){
  501. return success(statisticalReportService.getInwardReportForAssemble(mapValue));
  502. }
  503. PageHelper.startPage(pageNum, pageSize);
  504. //分页数据
  505. List<Map<String, Object>> report = statisticalReportService.getInwardReportForAssemble(mapValue);
  506. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  507. return success(pageList);
  508. }
  509. @ApiOperation(value="装机展示明细")
  510. @ApiImplicitParams({
  511. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  512. @ApiImplicitParam(name = "apiId", value = "477", required = false, dataType = "Integer"),
  513. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  514. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  515. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  516. })
  517. @PostMapping("/getLoaderForResultDetail")
  518. public RESTfulResult getLoaderForResultDetail(@RequestBody(required=false) Map<String,Object> mapValue,
  519. Integer apiId,
  520. Integer pageNum,
  521. Integer pageSize,
  522. String startTime,
  523. String endTime,
  524. String con,
  525. String isPage
  526. ){
  527. if (con != null && !"undefined".equals(con)) {
  528. mapValue.put("con",con);
  529. }
  530. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  531. if(isPage != null && !"".equals(isPage)){
  532. List<Map<String, Object>> report = statisticalReportService.getLoaderForResultDetail(mapValue);
  533. return success(report);
  534. }
  535. PageHelper.startPage(pageNum, pageSize);
  536. //分页数据
  537. List<Map<String, Object>> report = statisticalReportService.getLoaderForResultDetail(mapValue);
  538. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  539. return success(pageList);
  540. }
  541. @ApiOperation("对内转车辆装货点进行统计")
  542. @PostMapping("/getLoading")
  543. public RESTfulResult getLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  544. Integer apiId,
  545. Integer pageNum,
  546. Integer pageSize,
  547. String startTime,
  548. String endTime){
  549. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  550. PageHelper.startPage(pageNum, pageSize);
  551. //分页数据
  552. List<Map<String, Object>> report = statisticalReportService.getLoading(mapValue);
  553. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  554. return success(pageList);
  555. }
  556. @ApiOperation("装载机所装车辆重量统计报表")
  557. @PostMapping("/getLoaderResult")
  558. public RESTfulResult getLoaderResult(@RequestBody(required=false) Map<String,Object> mapValue,
  559. Integer apiId,//apiId:463
  560. Integer pageNum,
  561. Integer pageSize,
  562. String startTime,
  563. String endTime){
  564. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  565. PageHelper.startPage(pageNum, pageSize);
  566. //分页数据
  567. List<Map<String, Object>> report = statisticalReportService.getLoaderResult(mapValue);
  568. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  569. return success(pageList);
  570. }
  571. @ApiOperation("对内转车辆装卸货点进行统计")
  572. @PostMapping("/getUnLoading")
  573. public RESTfulResult getUnLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  574. Integer apiId,
  575. Integer pageNum,
  576. Integer pageSize,
  577. String startTime,
  578. String endTime){
  579. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  580. PageHelper.startPage(pageNum, pageSize);
  581. //分页数据
  582. List<Map<String, Object>> report = statisticalReportService.getUnLoading(mapValue);
  583. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  584. return success(pageList);
  585. }
  586. //保卫部随机抽查车牌号查看所有信息
  587. @ApiOperation("保卫部随机抽查车牌号查看所有信息")
  588. @PostMapping("/getCapacityByDefend")
  589. public RESTfulResult getCapacityByDefend(@RequestBody(required = false) Map<String,Object> map,
  590. Integer apiId,
  591. Integer pageNum,
  592. Integer pageSize,
  593. String startTime,
  594. String endTime,
  595. String con,
  596. String yes){
  597. if (con != null && !"null".equals(con)) {
  598. map.put("con",con);
  599. }
  600. DataChange.queryDataByDateTime(startTime ,endTime, map, sdfDateTime);//根据时间段查询数据
  601. if(yes != null && !"null".equals(yes)){
  602. return success(statisticalReportService.getCapacityByDefend(map));
  603. }
  604. PageHelper.startPage(pageNum, pageSize);
  605. List<Map<String, Object>> report = statisticalReportService.getCapacityByDefend(map);
  606. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  607. return success(pageList);
  608. }
  609. @ApiOperation(value="查询销售统计报表")
  610. @ApiImplicitParams({
  611. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  612. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  613. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  614. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  615. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  616. })
  617. @PostMapping("/getSaleSteelReport")
  618. public RESTfulResult getSaleSteelReport(@RequestBody(required=false) Map<String,Object> map,
  619. String startTime,
  620. String endTime,
  621. String carrierSsoId,
  622. String receiveName,
  623. String materialName,
  624. String specification,
  625. String remark,
  626. String capacityNo,
  627. String carrierName,
  628. String consigneeName,
  629. String saler,
  630. String easPrimaryId
  631. ){
  632. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  633. if(carrierSsoId != null){
  634. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  635. map.put("carrierSsoId", carrierSsoId);
  636. }
  637. }
  638. if (receiveName != null && !"null".equals(receiveName)) {
  639. map.put("receivName","%" + receiveName + "%");
  640. }
  641. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  642. map.put("remark","%" + remark + "%");
  643. }
  644. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  645. map.put("capacityNum","%" + capacityNo + "%");
  646. }
  647. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  648. map.put("carrierNames","%" + carrierName + "%");
  649. }
  650. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  651. map.put("consigneeNames","%" + consigneeName + "%");
  652. }
  653. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  654. map.put("salers",saler);
  655. }
  656. if (easPrimaryId != null && !"".equals(easPrimaryId) && !"null".equals(easPrimaryId)) {
  657. map.put("easPrimaryId",easPrimaryId);
  658. }
  659. //分页数据
  660. List<Map<String, Object>> report = statisticalReportService.getSaleSteelReport(map);
  661. for (Map<String, Object> stringObjectMap : report) {
  662. String shippingAddressIds = (String) stringObjectMap.get("shippingAddressIds");
  663. String capacityNumbers= (String) stringObjectMap.get("capacityNumbers");
  664. //确认是否有多个收货单位
  665. if (shippingAddressIds !=null && !("".equals(shippingAddressIds))){
  666. String[] split = shippingAddressIds.split(",");
  667. String address="";
  668. int i=0;
  669. for (String s : split) {
  670. i++;
  671. String getaddress = statisticalReportService.getaddress(DataChange.dataToBigDecimal(s));
  672. if (i==1){
  673. address+="旧地址:"+getaddress+",";
  674. }else if (i==2){
  675. address+="新地址:"+getaddress;
  676. }
  677. }
  678. stringObjectMap.put("addressPlace",address);
  679. }
  680. //确认是否有多个车牌号
  681. if (capacityNumbers!=null &&!("".equals(capacityNumbers))){
  682. String[] split = capacityNumbers.split(",");
  683. String capacityNumber="";
  684. int flag=0;
  685. for (String s : split) {
  686. flag++;
  687. String s1 = statisticalReportService.getcapacityNumber(DataChange.dataToBigDecimal(s));
  688. if (flag==1){
  689. capacityNumber+="旧车号:"+s1+",";
  690. }else if (flag==2){
  691. capacityNumber+="新车号:"+s1;
  692. break;
  693. }
  694. }
  695. stringObjectMap.put("capacityNo",capacityNumber);
  696. }
  697. }
  698. return success(report);
  699. }
  700. @ApiOperation(value="查询销售统计报表")
  701. @ApiImplicitParams({
  702. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  703. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  704. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  705. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  706. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  707. })
  708. @PostMapping("/getInwardSaleSteelReport")
  709. public RESTfulResult getInwardSaleSteelReport(@RequestBody(required=false) Map<String,Object> map,
  710. String startTime,
  711. String endTime,
  712. String carrierSsoId,
  713. String receiveName,
  714. String materialName,
  715. String specification,
  716. String remark,
  717. String capacityNo,
  718. String carrierName,
  719. String consigneeName,
  720. String saler
  721. ){
  722. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  723. if(carrierSsoId != null){
  724. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  725. map.put("carrierSsoId", carrierSsoId);
  726. }
  727. }
  728. if (receiveName != null && !"null".equals(receiveName)) {
  729. map.put("receivName","%" + receiveName + "%");
  730. }
  731. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  732. map.put("remark","%" + remark + "%");
  733. }
  734. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  735. map.put("capacityNum","%" + capacityNo + "%");
  736. }
  737. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  738. map.put("carrierNames","%" + carrierName + "%");
  739. }
  740. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  741. map.put("consigneeNames","%" + consigneeName + "%");
  742. }
  743. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  744. map.put("salers",saler);
  745. }
  746. //分页数据
  747. List<Map<String, Object>> report = statisticalReportService.getInwardSaleSteelReport(map);
  748. return success(report);
  749. }
  750. @ApiOperation(value="查询销售钢材派单报表")
  751. @ApiImplicitParams({
  752. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  753. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  754. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  755. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  756. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  757. })
  758. @PostMapping("/getInwardSaleSteelOrder")
  759. public RESTfulResult getInwardSaleSteelOrder(@RequestBody(required=false) Map<String,Object> map,
  760. String startTime,
  761. String endTime,
  762. String remark,
  763. String capacityNo,
  764. String consigneeName
  765. ){
  766. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  767. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  768. map.put("remark","%" + remark + "%");
  769. }
  770. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  771. map.put("capacityNum","%" + capacityNo + "%");
  772. }
  773. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  774. map.put("consigneeNames","%" + consigneeName + "%");
  775. }
  776. //分页数据
  777. List<Map<String, Object>> report = statisticalReportService.getInwardSaleSteelOrder(map);
  778. return success(report);
  779. }
  780. @ApiOperation(value="根据车序号查询销售订单状态")
  781. @PostMapping("/getSteelReportDetailsBySmId")
  782. public RESTfulResult getSteelReportDetailsBySmId(@RequestParam BigDecimal saleOrderMaterialId){
  783. return success(statisticalReportService.getSteelReportDetailsBySmId(saleOrderMaterialId));
  784. }
  785. }