StatisticalReportController.java 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.mapper.StatisticalReportMapper;
  3. import com.steerinfo.dil.service.impl.StatisticalReportImpl;
  4. import com.steerinfo.dil.util.BaseRESTfulController;
  5. import com.steerinfo.dil.util.ColumnDataUtil;
  6. import com.steerinfo.dil.util.DataChange;
  7. import com.steerinfo.dil.util.PageListAdd;
  8. import com.steerinfo.framework.controller.RESTfulResult;
  9. import com.steerinfo.framework.service.pagehelper.PageHelper;
  10. import io.swagger.annotations.ApiImplicitParam;
  11. import io.swagger.annotations.ApiImplicitParams;
  12. import io.swagger.annotations.ApiOperation;
  13. import oracle.jdbc.proxy.annotation.Post;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.*;
  16. import java.math.BigDecimal;
  17. import java.text.SimpleDateFormat;
  18. import java.util.*;
  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. private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
  31. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  32. @ApiOperation(value="查询辅料燃料统计报表")
  33. @ApiImplicitParams({
  34. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  35. @ApiImplicitParam(name = "apiId(220)", value = "动态表头", required = false, dataType = "Integer"),
  36. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  37. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  38. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  39. })
  40. @PostMapping("/getRLFLReport")
  41. public RESTfulResult getRLFLReport(@RequestBody(required=false) Map<String,Object> mapValue,
  42. Integer apiId,
  43. Integer pageNum,
  44. Integer pageSize,
  45. String startTime,
  46. String endTime,
  47. Integer orderType,
  48. String con
  49. ){
  50. mapValue.put("orderTypee", orderType);
  51. if (con!=null && !"null".equals(con) && !"".equals(con)){
  52. mapValue.put("con",con);
  53. }
  54. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  55. PageHelper.startPage(pageNum, pageSize);
  56. //分页数据
  57. List<Map<String, Object>> report = statisticalReportService.getRLFLReport(mapValue);
  58. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,report);
  59. return success(pageList);
  60. }
  61. @ApiOperation(value="查询销售统计报表")
  62. @ApiImplicitParams({
  63. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  64. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  65. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  66. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  67. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  68. })
  69. @PostMapping("/getAllSaleReport")
  70. public RESTfulResult getAllSaleReport(@RequestBody(required=false) Map<String,Object> mapValue,
  71. Integer apiId,
  72. Integer pageNum,
  73. Integer pageSize,
  74. String startTime,
  75. String endTime,
  76. String carrierSsoId,
  77. Integer orderType,
  78. Integer shipperId,
  79. String receiveName,
  80. String materialName,
  81. String wareHouse
  82. ){
  83. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  84. if(carrierSsoId != null){
  85. if(!"null".equals(carrierSsoId)){
  86. mapValue.put("carrierSsoId", carrierSsoId);
  87. }
  88. }
  89. if (receiveName != null && !"null".equals(receiveName)) {
  90. mapValue.put("receivName", receiveName);
  91. }
  92. if (materialName != null && !"".equals(materialName) && !"null".equals(materialName)) {
  93. mapValue.put("remark",materialName);
  94. }
  95. if (wareHouse != null && !"".equals(wareHouse) && !"null".equals(wareHouse)) {
  96. mapValue.put("wareHouse",wareHouse);
  97. }
  98. mapValue.put("orderTypee",orderType);
  99. mapValue.put("shipperId",shipperId);
  100. if(orderType==1 && mapValue.get("orderField")==null){
  101. //如果没有使用排序且查询的表格类型为销售钢材内部专用表格,默认规格排序
  102. mapValue.put("orderField","materialCode");
  103. mapValue.put("orderType","desc");
  104. }
  105. if(mapValue.get("isExcel")==null){
  106. PageHelper.startPage(pageNum, pageSize);
  107. }
  108. //分页数据
  109. List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
  110. PageListAdd pageList = columnDataUtil.tableColumnData5(apiId, null, report);
  111. return success(pageList);
  112. }
  113. @ApiOperation(value="查询销售统计报表")
  114. @ApiImplicitParams({
  115. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  116. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  117. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  118. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  119. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  120. })
  121. @PostMapping("/getAllSaleReportNew")
  122. public RESTfulResult getAllSaleReportNew(@RequestBody(required=false) Map<String,Object> mapValue,
  123. Integer apiId,
  124. Integer pageNum,
  125. Integer pageSize,
  126. String startTime,
  127. String endTime,
  128. String carrierSsoId,
  129. Integer orderType,
  130. Integer shipperId,
  131. String receiveName,
  132. String materialName,
  133. String wareHouse
  134. ){
  135. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  136. if(carrierSsoId != null){
  137. if(!"null".equals(carrierSsoId)){
  138. mapValue.put("carrierSsoId", carrierSsoId);
  139. }
  140. }
  141. if (receiveName != null && !"null".equals(receiveName)) {
  142. mapValue.put("receivName",receiveName);
  143. }
  144. if (materialName != null && !"".equals(materialName) && !"null".equals(materialName)) {
  145. mapValue.put("remark", materialName);
  146. }
  147. if (wareHouse != null && !"".equals(wareHouse) && !"null".equals(wareHouse)) {
  148. mapValue.put("wareHouse",wareHouse);
  149. }
  150. mapValue.put("orderTypee",orderType);
  151. mapValue.put("shipperId",shipperId);
  152. if(orderType==1 && mapValue.get("orderField")==null){
  153. //如果没有使用排序且查询的表格类型为销售钢材内部专用表格,默认规格排序
  154. mapValue.put("orderField","materialCode");
  155. mapValue.put("orderType","desc");
  156. }
  157. PageHelper.startPage(pageNum, pageSize);
  158. //分页数据
  159. List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
  160. PageListAdd pageList = columnDataUtil.tableColumnData5(apiId, null, report);
  161. return success(pageList);
  162. }
  163. @ApiOperation(value="查询销售统计报表筛选过后的总净重")
  164. @ApiImplicitParams({
  165. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  166. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  167. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  168. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  169. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  170. })
  171. @PostMapping("/getAllSaleReportTotal")
  172. public RESTfulResult getAllSaleReportTotal(@RequestBody(required=false) Map<String,Object> mapValue,
  173. String startTime,
  174. String endTime,
  175. String carrierSsoId
  176. ){
  177. if(carrierSsoId != null){
  178. if(!"null".equals(carrierSsoId)){
  179. mapValue.put("carrierSsoId", carrierSsoId);
  180. }
  181. }
  182. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  183. List<Map<String, Object>> allReport = statisticalReportService.getAllSaleReportNum(mapValue);
  184. //获取销售统计报表筛选过后的总净重
  185. BigDecimal AllResultNetWeight = new BigDecimal(0);
  186. for (Map<String, Object> stringObjectMap : allReport) {
  187. if(stringObjectMap.get("resultNetWeight")!=null) {
  188. AllResultNetWeight = AllResultNetWeight.add(new BigDecimal(stringObjectMap.get("resultNetWeight").toString()));
  189. }
  190. }
  191. return success(AllResultNetWeight);
  192. }
  193. @ApiOperation(value="查询零星物资进厂统计报表")
  194. @ApiImplicitParams({
  195. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  196. @ApiImplicitParam(name = "apiId(424)", value = "动态表头", required = false, dataType = "Integer"),
  197. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  198. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  199. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  200. })
  201. @PostMapping("/getSporadicSuppliesReport1")
  202. public RESTfulResult getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
  203. Integer apiId,
  204. Integer pageNum,
  205. Integer pageSize,
  206. String startTime,
  207. String endTime,
  208. String carrierSsoId,
  209. String userId, String userIds, String con, Integer orderType
  210. ){
  211. if(carrierSsoId != null) {
  212. if (!"null".equals(carrierSsoId)) {
  213. mapValue.put("carrierSsoId", carrierSsoId);
  214. }
  215. }
  216. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  217. if (userId!=null){
  218. mapValue.put("userId",userId);
  219. }
  220. if (orderType!=null){
  221. mapValue.put("orderType",orderType);
  222. }
  223. if (userIds!=null){
  224. mapValue.put("userIds",userIds);
  225. }
  226. if (con!=null&&!"null".equals(con)){
  227. mapValue.put("con","%"+con+"%");
  228. }
  229. if(mapValue.get("isExcel")==null){
  230. PageHelper.startPage(pageNum, pageSize);
  231. }
  232. //分页数据
  233. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
  234. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  235. return success(pageList);
  236. }
  237. @ApiOperation(value="查询零星物资出厂统计报表")
  238. @ApiImplicitParams({
  239. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  240. @ApiImplicitParam(name = "apiId(425)", value = "动态表头", required = false, dataType = "Integer"),
  241. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  242. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  243. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  244. })
  245. @PostMapping("/getSporadicSuppliesReport2")
  246. public RESTfulResult getSporadicSuppliesReport2(@RequestBody(required=false) Map<String,Object> mapValue,
  247. Integer apiId,
  248. Integer pageNum,
  249. Integer pageSize,
  250. String startTime,
  251. String endTime,
  252. String carrierSsoId,
  253. String userId,
  254. String userIds,
  255. String con,
  256. Integer orderType
  257. ){
  258. if(carrierSsoId != null){
  259. if(!"null".equals(carrierSsoId)){
  260. mapValue.put("carrierSsoId", carrierSsoId);
  261. }
  262. }
  263. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  264. if (con!=null&&!"null".equals(con)){
  265. mapValue.put("con","%"+con+"%");
  266. }
  267. if (userId!=null){
  268. mapValue.put("userId",userId);
  269. }
  270. if (orderType!=null){
  271. mapValue.put("orderType",orderType);
  272. }
  273. if (userIds!=null){
  274. mapValue.put("userIds",userIds);
  275. }
  276. if(mapValue.get("isExcel")==null){
  277. PageHelper.startPage(pageNum, pageSize);
  278. }
  279. //分页数据
  280. List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
  281. PageListAdd pageList = columnDataUtil.tableColumnData4(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 = "动态表头", 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("/getPurInwardReport")
  293. public RESTfulResult getPurInwardReport(@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.getPurInwardReport(mapValue);
  304. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  305. return success(pageList);
  306. }
  307. @ApiOperation(value="查询零星内转统计报表")
  308. @ApiImplicitParams({
  309. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  310. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  311. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  312. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  313. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  314. })
  315. @PostMapping("/getLXInwardReport")
  316. public RESTfulResult getLXInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  317. Integer apiId,
  318. Integer pageNum,
  319. Integer pageSize,
  320. String startTime,
  321. String endTime,
  322. String con
  323. ){
  324. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  325. if(con != null && !"null".equals(con)){
  326. mapValue.put("con","%" + con + "%");
  327. }
  328. if(mapValue.get("isExcel")==null){
  329. PageHelper.startPage(pageNum, pageSize);
  330. }
  331. //分页数据
  332. List<Map<String, Object>> report = statisticalReportService.getLXInwardReport(mapValue);
  333. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  334. return success(pageList);
  335. }
  336. @ApiOperation(value="查询内转统计报表")
  337. @ApiImplicitParams({
  338. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  339. @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
  340. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  341. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  342. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  343. })
  344. @PostMapping("/getInwardReport")
  345. public RESTfulResult getInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
  346. Integer apiId,
  347. Integer pageNum,
  348. Integer pageSize,
  349. String startTime,
  350. String endTime
  351. ){
  352. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  353. PageHelper.startPage(pageNum, pageSize);
  354. //分页数据
  355. List<Map<String, Object>> report = statisticalReportService.getInwardReport(mapValue);
  356. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  357. return success(pageList);
  358. }
  359. @ApiOperation(value="查询该组织机构下的销售统计报表")
  360. @ApiImplicitParams({
  361. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  362. @ApiImplicitParam(name = "apiId", value = "486", required = false, dataType = "Integer"),
  363. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  364. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  365. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  366. })
  367. @PostMapping("/getSaleOrderList")
  368. public RESTfulResult getSaleOrderList(@RequestBody(required=false) Map<String,Object> mapValue,
  369. Integer apiId,
  370. Integer pageNum,
  371. Integer pageSize,
  372. String startTime,
  373. String endTime,
  374. String orgCode,
  375. String isPage,
  376. String index
  377. ){
  378. if (orgCode!=null&&!"null".equals(orgCode)){
  379. mapValue.put("orgCode",orgCode);
  380. }
  381. if (index!=null&&!"null".equals(index)){
  382. mapValue.put("index",index);
  383. }
  384. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  385. if("yes".equals(isPage)){
  386. return success(statisticalReportService.getSaleOrderList(mapValue));
  387. }
  388. PageHelper.startPage(pageNum, pageSize);
  389. //分页数据
  390. List<Map<String, Object>> report = statisticalReportService.getSaleOrderList(mapValue);
  391. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  392. return success(pageList);
  393. }
  394. @ApiOperation(value="查询该组织机构下的采购统计报表")
  395. @ApiImplicitParams({
  396. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  397. @ApiImplicitParam(name = "apiId", value = "486", required = false, dataType = "Integer"),
  398. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  399. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  400. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  401. })
  402. @PostMapping("/getPurchaseOrderList")
  403. public RESTfulResult getPurchaseOrderList(@RequestBody(required=false) Map<String,Object> mapValue,
  404. Integer apiId,
  405. Integer pageNum,
  406. Integer pageSize,
  407. String startTime,
  408. String endTime,
  409. String orgCode,
  410. String isPage,
  411. String index
  412. ){
  413. if (orgCode!=null&&!"null".equals(orgCode)){
  414. mapValue.put("orgCode",orgCode);
  415. }
  416. if (index!=null&&!"null".equals(index)){
  417. mapValue.put("index",index);
  418. }
  419. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  420. if ("yes".equals(isPage)){
  421. return success(statisticalReportService.getPurchaseOrderList(mapValue));
  422. }
  423. PageHelper.startPage(pageNum, pageSize);
  424. //分页数据
  425. List<Map<String, Object>> report = statisticalReportService.getPurchaseOrderList(mapValue);
  426. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  427. return success(pageList);
  428. }
  429. @ApiOperation(value="查询该组织机构下的采购内转统计报表")
  430. @ApiImplicitParams({
  431. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  432. @ApiImplicitParam(name = "apiId", value = "s", required = false, dataType = "Integer"),
  433. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  434. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  435. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  436. })
  437. @PostMapping("/getPurchaseInwardList")
  438. public RESTfulResult getInwardList(@RequestBody(required=false) Map<String,Object> mapValue,
  439. Integer apiId,
  440. Integer pageNum,
  441. Integer pageSize,
  442. String startTime,
  443. String endTime,
  444. String orgCode,
  445. String isPage,
  446. String index
  447. ){
  448. if (index!=null&&!"null".equals(index)){
  449. mapValue.put("index",index);
  450. }
  451. if (orgCode!=null&&!"null".equals(orgCode)){
  452. mapValue.put("orgCode",orgCode);
  453. }
  454. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  455. if ("yes".equals(isPage)){
  456. return success(statisticalReportService.getPurchaseInwardList(mapValue));
  457. }
  458. PageHelper.startPage(pageNum, pageSize);
  459. //分页数据
  460. List<Map<String, Object>> report = statisticalReportService.getPurchaseInwardList(mapValue);
  461. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  462. return success(pageList);
  463. }
  464. @ApiOperation(value="查询该组织机构下的厂外进厂内转")
  465. @ApiImplicitParams({
  466. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  467. @ApiImplicitParam(name = "apiId", value = "s", required = false, dataType = "Integer"),
  468. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  469. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  470. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  471. })
  472. @PostMapping("/getOutFactoryInwardList")
  473. public RESTfulResult getOutFactoryInwardList(@RequestBody(required=false) Map<String,Object> mapValue,
  474. Integer apiId,
  475. Integer pageNum,
  476. Integer pageSize,
  477. String startTime,
  478. String endTime,
  479. String orgCode,
  480. String isPage,
  481. String index
  482. ){
  483. if (index!=null&&!"null".equals(index)){
  484. mapValue.put("index",index);
  485. }
  486. if (orgCode!=null&&!"null".equals(orgCode)){
  487. mapValue.put("orgCode",orgCode);
  488. }
  489. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  490. if ("yes".equals(isPage)){
  491. return success(statisticalReportService.getOutFactoryInwardList(mapValue));
  492. }
  493. PageHelper.startPage(pageNum, pageSize);
  494. //分页数据
  495. List<Map<String, Object>> report = statisticalReportService.getOutFactoryInwardList(mapValue);
  496. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  497. return success(pageList);
  498. }
  499. @ApiOperation(value="查询该组织机构下的内转统计报表")
  500. @ApiImplicitParams({
  501. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  502. @ApiImplicitParam(name = "apiId", value = "s", required = false, dataType = "Integer"),
  503. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  504. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  505. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  506. })
  507. @PostMapping("/getInwardInFactory")
  508. public RESTfulResult getInwardInFactory(@RequestBody(required=false) Map<String,Object> mapValue,
  509. Integer apiId,
  510. Integer pageNum,
  511. Integer pageSize,
  512. String startTime,
  513. String endTime,
  514. String orgCode,
  515. String isPage,
  516. String index
  517. ){
  518. if (index!=null&&!"null".equals(index)){
  519. mapValue.put("index",index);
  520. }
  521. if (orgCode!=null&&!"null".equals(orgCode)){
  522. mapValue.put("orgCode",orgCode);
  523. }
  524. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  525. if ("yes".equals(isPage)){
  526. return success(statisticalReportService.getInwardInFactory(mapValue));
  527. }
  528. PageHelper.startPage(pageNum, pageSize);
  529. //分页数据
  530. List<Map<String, Object>> report = statisticalReportService.getInwardInFactory(mapValue);
  531. PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
  532. return success(pageList);
  533. }
  534. @ApiOperation(value="查询拼装车统计报表")
  535. @ApiImplicitParams({
  536. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  537. @ApiImplicitParam(name = "apiId", value = "477", required = false, dataType = "Integer"),
  538. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  539. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  540. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  541. })
  542. @PostMapping("/getInwardReportForAssemble")
  543. public RESTfulResult getInwardReportForAssemble(@RequestBody(required=false) Map<String,Object> mapValue,
  544. Integer apiId,
  545. Integer pageNum,
  546. Integer pageSize,
  547. String startTime,
  548. String endTime, BigDecimal orderType, String index, String isPage,String orgCode
  549. ){
  550. if (index!=null&&!"null".equals(index)){
  551. mapValue.put("index",index);
  552. }
  553. if (orgCode!=null&&!"null".equals(orgCode)){
  554. mapValue.put("orgCode",orgCode);
  555. }
  556. if (orderType!=null&&!"null".equals(orderType)){
  557. mapValue.put("orderTypee",orderType);
  558. }
  559. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  560. if ("yes".equals(isPage)){
  561. return success(statisticalReportService.getInwardReportForAssemble(mapValue));
  562. }
  563. PageHelper.startPage(pageNum, pageSize);
  564. //分页数据
  565. List<Map<String, Object>> report = statisticalReportService.getInwardReportForAssemble(mapValue);
  566. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  567. return success(pageList);
  568. }
  569. @ApiOperation(value="装机展示明细")
  570. @ApiImplicitParams({
  571. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  572. @ApiImplicitParam(name = "apiId", value = "477", required = false, dataType = "Integer"),
  573. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  574. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  575. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  576. })
  577. @PostMapping("/getLoaderForResultDetail")
  578. public RESTfulResult getLoaderForResultDetail(@RequestBody(required=false) Map<String,Object> mapValue,
  579. Integer apiId,
  580. Integer pageNum,
  581. Integer pageSize,
  582. String startTime,
  583. String endTime,
  584. String con,
  585. String isPage
  586. ){
  587. if (con != null && !"undefined".equals(con)) {
  588. mapValue.put("con",con);
  589. }
  590. DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
  591. if(isPage != null && !"".equals(isPage)){
  592. List<Map<String, Object>> report = statisticalReportService.getLoaderForResultDetail(mapValue);
  593. return success(report);
  594. }
  595. PageHelper.startPage(pageNum, pageSize);
  596. //分页数据
  597. List<Map<String, Object>> report = statisticalReportService.getLoaderForResultDetail(mapValue);
  598. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  599. return success(pageList);
  600. }
  601. @ApiOperation("对内转车辆装货点进行统计")
  602. @PostMapping("/getLoading")
  603. public RESTfulResult getLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  604. Integer apiId,
  605. Integer pageNum,
  606. Integer pageSize,
  607. String startTime,
  608. String endTime){
  609. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  610. if(mapValue.get("isExcel")==null){
  611. PageHelper.startPage(pageNum, pageSize);
  612. }
  613. //分页数据
  614. List<Map<String, Object>> report = statisticalReportService.getLoading(mapValue);
  615. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  616. return success(pageList);
  617. }
  618. @ApiOperation("装载机所装车辆重量统计报表")
  619. @PostMapping("/getLoaderResult")
  620. public RESTfulResult getLoaderResult(@RequestBody(required=false) Map<String,Object> mapValue,
  621. Integer apiId,//apiId:463
  622. Integer pageNum,
  623. Integer pageSize,
  624. String startTime,
  625. String endTime){
  626. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  627. if(mapValue.get("isExcel")==null){
  628. PageHelper.startPage(pageNum, pageSize);
  629. }
  630. //分页数据
  631. List<Map<String, Object>> report = statisticalReportService.getLoaderResult(mapValue);
  632. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  633. return success(pageList);
  634. }
  635. @ApiOperation("对内转车辆装卸货点进行统计")
  636. @PostMapping("/getUnLoading")
  637. public RESTfulResult getUnLoading(@RequestBody(required=false) Map<String,Object> mapValue,
  638. Integer apiId,
  639. Integer pageNum,
  640. Integer pageSize,
  641. String startTime,
  642. String endTime){
  643. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  644. if(mapValue.get("isExcel")==null){
  645. PageHelper.startPage(pageNum, pageSize);
  646. }
  647. //分页数据
  648. List<Map<String, Object>> report = statisticalReportService.getUnLoading(mapValue);
  649. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  650. return success(pageList);
  651. }
  652. //保卫部随机抽查车牌号查看所有信息
  653. @ApiOperation("保卫部随机抽查车牌号查看所有信息")
  654. @PostMapping("/getCapacityByDefend")
  655. public RESTfulResult getCapacityByDefend(@RequestBody(required = false) Map<String,Object> map,
  656. Integer apiId,
  657. Integer pageNum,
  658. Integer pageSize,
  659. String startTime,
  660. String endTime,
  661. String con,
  662. String yes){
  663. if (con != null && !"null".equals(con)) {
  664. map.put("con",con);
  665. }
  666. DataChange.queryDataByDateTime(startTime ,endTime, map, sdfDateTime);//根据时间段查询数据
  667. if(yes != null && !"null".equals(yes)){
  668. return success(statisticalReportService.getCapacityByDefend(map));
  669. }
  670. PageHelper.startPage(pageNum, pageSize);
  671. List<Map<String, Object>> report = statisticalReportService.getCapacityByDefend(map);
  672. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
  673. return success(pageList);
  674. }
  675. @ApiOperation(value="查询销售统计报表")
  676. @ApiImplicitParams({
  677. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  678. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  679. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  680. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  681. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  682. })
  683. @PostMapping("/getSaleSteelReport")
  684. public RESTfulResult getSaleSteelReport(@RequestBody(required=false) Map<String,Object> map,
  685. String startTime,
  686. String endTime,
  687. String carrierSsoId,
  688. String receiveName,
  689. String materialName,
  690. String specification,
  691. String remark,
  692. String capacityNo,
  693. String carrierName,
  694. String consigneeName,
  695. String saler,
  696. String easPrimaryId
  697. ){
  698. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  699. if(carrierSsoId != null){
  700. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  701. map.put("carrierSsoId", carrierSsoId);
  702. }
  703. }
  704. if (receiveName != null && !"null".equals(receiveName)) {
  705. map.put("receivName","%" + receiveName + "%");
  706. }
  707. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  708. map.put("remark","%" + remark + "%");
  709. }
  710. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  711. map.put("capacityNum","%" + capacityNo + "%");
  712. }
  713. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  714. map.put("carrierNames","%" + carrierName + "%");
  715. }
  716. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  717. map.put("consigneeNames","%" + consigneeName + "%");
  718. }
  719. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  720. //如果业务员登录进来,就去查询业务员所关联的片区
  721. List<String> saleAreaRemark = statisticalReportService.getSaleAreaRemark(saler);
  722. if(saleAreaRemark.size() > 0) {
  723. map.put("saleAreaRemark",saleAreaRemark);
  724. }
  725. map.put("salers",saler);
  726. }
  727. if (easPrimaryId != null && !"".equals(easPrimaryId) && !"null".equals(easPrimaryId)) {
  728. map.put("easPrimaryId",easPrimaryId);
  729. }
  730. //分页数据
  731. List<Map<String, Object>> report = statisticalReportService.getSaleSteelReport(map);
  732. return success(report);
  733. }
  734. @ApiOperation(value="查询销售统计报表")
  735. @ApiImplicitParams({
  736. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  737. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  738. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  739. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  740. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  741. })
  742. @PostMapping("/getSaleSteelSpellingReport")
  743. public RESTfulResult getSaleSteelSpellingReport(@RequestBody(required=false) Map<String,Object> map
  744. ){
  745. String startTime = map.get("startTime").toString();
  746. String endTime = map.get("endTime").toString();
  747. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  748. //分页数据
  749. List<Map<String, Object>> report = statisticalReportService.getSaleSteelSpellingReport(map);
  750. //初始化Map的值
  751. Map<String,Object> map1=new HashMap<>();
  752. map1.put("pinZhuang",null);
  753. map1.put("chongQinSpellingData",0);//重庆
  754. map1.put("chengDuSpellingData",0);//成都
  755. map1.put("gongChengSpellingData",0);//工程
  756. map1.put("chaungDongSpellingData",0);//川东
  757. map1.put("zitiSpellingData",0);
  758. map1.put("AllSpellingData",0);//合计
  759. Map<String,Object> map2=new HashMap<>();//
  760. map2.put("pinZhuang",null);
  761. map2.put("chongQinSpellingData",0);
  762. map2.put("chengDuSpellingData",0);
  763. map2.put("gongChengSpellingData",0);
  764. map2.put("chaungDongSpellingData",0);
  765. map2.put("zitiSpellingData",0);
  766. map2.put("AllSpellingData",0);
  767. Map<String,Object> map3=new HashMap<>();
  768. map3.put("pinZhuang",null);
  769. map3.put("chongQinSpellingData",0);
  770. map3.put("chengDuSpellingData",0);
  771. map3.put("gongChengSpellingData",0);
  772. map3.put("chaungDongSpellingData",0);
  773. map3.put("zitiSpellingData",0);
  774. map3.put("AllSpellingData",0);
  775. Map<String,Object> map4=new HashMap<>();
  776. map4.put("pinZhuang",null);
  777. map4.put("chongQinSpellingData",0);
  778. map4.put("chengDuSpellingData",0);
  779. map4.put("gongChengSpellingData",0);
  780. map4.put("chaungDongSpellingData",0);
  781. map4.put("zitiSpellingData",0);
  782. map4.put("AllSpellingData",0);
  783. Map<String,Object> map5=new HashMap<>();
  784. map5.put("pinZhuang",null);
  785. map5.put("chongQinSpellingData",0);
  786. map5.put("chengDuSpellingData",0);
  787. map5.put("gongChengSpellingData",0);
  788. map5.put("chaungDongSpellingData",0);
  789. map5.put("zitiSpellingData",0);
  790. map5.put("AllSpellingData",0);
  791. Map<String,Object> map6=new HashMap<>();
  792. map6.put("pinZhuang",null);
  793. map6.put("chongQinSpellingData",0);
  794. map6.put("chengDuSpellingData",0);
  795. map6.put("gongChengSpellingData",0);
  796. map6.put("chaungDongSpellingData",0);
  797. map6.put("zitiSpellingData",0);
  798. map6.put("AllSpellingData",0);
  799. Map<String,Object> map7=new HashMap<>();
  800. map7.put("pinZhuang",null);
  801. map7.put("chongQinSpellingData",0);
  802. map7.put("chengDuSpellingData",0);
  803. map7.put("gongChengSpellingData",0);
  804. map7.put("chaungDongSpellingData",0);
  805. map7.put("zitiSpellingData",0);
  806. map7.put("AllSpellingData",0);
  807. Map<String,Object> map8=new HashMap<>();
  808. map8.put("pinZhuang",null);
  809. map8.put("chongQinSpellingData",0);
  810. map8.put("chengDuSpellingData",0);
  811. map8.put("gongChengSpellingData",0);
  812. map8.put("chaungDongSpellingData",0);
  813. map8.put("zitiSpellingData",0);
  814. map8.put("AllSpellingData",0);
  815. Map<String,Object> map9=new HashMap<>();
  816. map9.put("pinZhuang",null);
  817. map9.put("chongQinSpellingData",0);
  818. map9.put("chengDuSpellingData",0);
  819. map9.put("gongChengSpellingData",0);
  820. map9.put("chaungDongSpellingData",0);
  821. map9.put("zitiSpellingData",0);
  822. map9.put("AllSpellingData",0);
  823. //35个数据
  824. List<Map<String,Object>> spellingData=new LinkedList<>();
  825. //初始化list集合的值
  826. spellingData.add(map1);
  827. spellingData.add(map2);
  828. spellingData.add(map3);
  829. spellingData.add(map4);
  830. spellingData.add(map5);
  831. spellingData.add(map6);
  832. spellingData.add(map7);
  833. spellingData.add(map8);
  834. spellingData.add(map9);
  835. spellingData.get(0).put("pinZhuang","一拼");
  836. spellingData.get(1).put("pinZhuang","二拼");
  837. spellingData.get(2).put("pinZhuang","三拼");
  838. spellingData.get(3).put("pinZhuang","四拼");
  839. spellingData.get(4).put("pinZhuang","五拼");
  840. spellingData.get(5).put("pinZhuang","六拼");
  841. spellingData.get(6).put("pinZhuang","七拼");
  842. spellingData.get(7).put("pinZhuang","八拼");
  843. spellingData.get(8).put("pinZhuang","合计");
  844. for (Map<String, Object> item : report) {
  845. String areaName=""+item.get("areaName");
  846. if("是".equals(item.get("isSelfMention"))) {
  847. areaName = "自提";
  848. }
  849. int speNum=Integer.parseInt(""+item.get("speNum"));
  850. int total=Integer.parseInt(""+item.get("total"));
  851. //过滤无片区、拼装不在1-6之间的数据
  852. if(areaName==null || areaName.equals("") || speNum >= 9 || speNum <=0){
  853. continue;
  854. }
  855. if(areaName.contains("重庆组")){
  856. spellingData.get(speNum-1).put("chongQinSpellingData",total + Integer.parseInt(spellingData.get(speNum-1).get("chongQinSpellingData").toString()));
  857. spellingData.get(speNum-1).put("AllSpellingData",total+(int) spellingData.get(speNum-1).get("AllSpellingData"));
  858. }else if(areaName.contains("成都组")){
  859. spellingData.get(speNum-1).put("chengDuSpellingData",total + Integer.parseInt(spellingData.get(speNum-1).get("chengDuSpellingData").toString()));
  860. spellingData.get(speNum-1).put("AllSpellingData",total+(int) spellingData.get(speNum-1).get("AllSpellingData"));
  861. }else if(areaName.contains("工程组")){
  862. spellingData.get(speNum-1).put("gongChengSpellingData",total + Integer.parseInt(spellingData.get(speNum-1).get("gongChengSpellingData").toString()));
  863. spellingData.get(speNum-1).put("AllSpellingData",total+(int) spellingData.get(speNum-1).get("AllSpellingData"));
  864. }else if(areaName.contains("达州组") || areaName.contains("南充组") || areaName.contains("广安组") || areaName.contains("万州组") || areaName.contains("西安组")){
  865. spellingData.get(speNum-1).put("chaungDongSpellingData",total + Integer.parseInt(spellingData.get(speNum-1).get("chaungDongSpellingData").toString()));
  866. spellingData.get(speNum-1).put("AllSpellingData",total+(int) spellingData.get(speNum-1).get("AllSpellingData"));
  867. }else if(areaName.contains("自提")) {
  868. spellingData.get(speNum-1).put("zitiSpellingData",total + Integer.parseInt(spellingData.get(speNum-1).get("zitiSpellingData").toString()));
  869. spellingData.get(speNum-1).put("AllSpellingData",total+(int) spellingData.get(speNum-1).get("AllSpellingData"));
  870. }
  871. }
  872. //每一列的合计
  873. int oneData=0;
  874. int twoData=0;
  875. int threeData=0;
  876. int fourData=0;
  877. int fiveData=0;
  878. int sixData = 0;
  879. for (int i = 0; i < spellingData.size(); i++) {
  880. oneData+=(int) spellingData.get(i).get("chongQinSpellingData");
  881. twoData+=(int) spellingData.get(i).get("chengDuSpellingData");
  882. threeData+=(int) spellingData.get(i).get("gongChengSpellingData");
  883. fourData+=(int) spellingData.get(i).get("chaungDongSpellingData");
  884. fiveData+=(int) spellingData.get(i).get("AllSpellingData");
  885. sixData += (int) spellingData.get(i).get("zitiSpellingData");
  886. }
  887. spellingData.get(8).put("chongQinSpellingData",oneData);
  888. spellingData.get(8).put("chengDuSpellingData",twoData);
  889. spellingData.get(8).put("gongChengSpellingData",threeData);
  890. spellingData.get(8).put("chaungDongSpellingData",fourData);
  891. spellingData.get(8).put("zitiSpellingData",sixData);
  892. spellingData.get(8).put("AllSpellingData",fiveData);
  893. return success(spellingData);
  894. }
  895. @ApiOperation(value="查询销售统计报表")
  896. @ApiImplicitParams({
  897. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  898. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  899. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  900. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  901. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  902. })
  903. @PostMapping("/getSaleSteelReportNew")
  904. public RESTfulResult getSaleSteelReportNew(@RequestBody(required=false) Map<String,Object> map,
  905. String startTime,
  906. String endTime,
  907. String carrierSsoId,
  908. String receiveName,
  909. String materialName,
  910. String specification,
  911. String remark,
  912. String capacityNo,
  913. String carrierName,
  914. String consigneeName,
  915. String saler,
  916. String easPrimaryId
  917. ){
  918. if(map.get("saleMakeDate")!=null){
  919. DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  920. }else{
  921. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  922. }
  923. if(carrierSsoId != null){
  924. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  925. map.put("carrierSsoId", carrierSsoId);
  926. }
  927. }
  928. if (receiveName != null && !"null".equals(receiveName)) {
  929. map.put("receivName","%" + receiveName + "%");
  930. }
  931. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  932. map.put("remark","%" + remark + "%");
  933. }
  934. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  935. map.put("capacityNum","%" + capacityNo + "%");
  936. }
  937. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  938. map.put("carrierNames","%" + carrierName + "%");
  939. }
  940. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  941. map.put("consigneeNames","%" + consigneeName + "%");
  942. }
  943. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  944. //如果业务员登录进来,就去查询业务员所关联的片区
  945. List<String> saleAreaRemark = statisticalReportService.getSaleAreaRemark(saler);
  946. if(saleAreaRemark.size() > 0) {
  947. map.put("saleAreaRemark",saleAreaRemark);
  948. }
  949. map.put("salers",saler);
  950. }
  951. if (easPrimaryId != null && !"".equals(easPrimaryId) && !"null".equals(easPrimaryId)) {
  952. map.put("easPrimaryId","%" + easPrimaryId+ "%");
  953. }
  954. //分页数据
  955. List<Map<String, Object>> report = statisticalReportService.getSaleSteelReportNew(map);
  956. for (Map<String, Object> stringObjectMap : report) {
  957. String shippingAddressIds = (String) stringObjectMap.get("shippingAddressIds");
  958. String capacityNumbers= (String) stringObjectMap.get("capacityNumbers");
  959. //
  960. /*String priceIds = (String) stringObjectMap.get("priceIds");
  961. if (priceIds!=null&&!(priceIds.isEmpty())){
  962. String[] split = priceIds.split(",");
  963. int i=0;
  964. for (String s : split) {
  965. i++;
  966. if (i==1){
  967. stringObjectMap.put("priceValue",statisticalReportService.getHistoryPrice(DataChange.dataToBigDecimal(s)));
  968. }
  969. if (i==2){
  970. stringObjectMap.put("futurePriceValue",statisticalReportService.getHistoryPrice(DataChange.dataToBigDecimal(s)));
  971. }
  972. }
  973. }*/
  974. //确认是否有多个收货单位
  975. //确认是否有多个车牌号
  976. if (capacityNumbers!=null &&!("".equals(capacityNumbers))){
  977. String[] split = capacityNumbers.split(",");
  978. String capacityNumber="";
  979. int flag=0;
  980. for (String s : split) {
  981. flag++;
  982. String s1 = statisticalReportService.getcapacityNumber(DataChange.dataToBigDecimal(s));
  983. if (flag==1){
  984. capacityNumber+="旧车号:"+s1+",";
  985. }else if (flag==2){
  986. capacityNumber+="新车号:"+s1;
  987. break;
  988. }
  989. }
  990. stringObjectMap.put("capacityNo",capacityNumber);
  991. }
  992. /*try{
  993. BigDecimal orderId = (BigDecimal) stringObjectMap.get("orderId");
  994. if (orderId !=null){
  995. String status = statisticalReportService.getStatus(orderId);
  996. if (!(" ".equals(status))){
  997. stringObjectMap.put("orderStatus",status);
  998. }
  999. }
  1000. }catch (Exception e){
  1001. e.printStackTrace();
  1002. }*/
  1003. }
  1004. return success(report);
  1005. }
  1006. @ApiOperation(value="查询销售统计报表")
  1007. @ApiImplicitParams({
  1008. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  1009. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  1010. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  1011. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  1012. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  1013. })
  1014. @PostMapping("/getSettledSaleSteelReportNew")
  1015. public RESTfulResult getSettledSaleSteelReportNew(@RequestBody(required=false) Map<String,Object> map,
  1016. String startTime,
  1017. String endTime,
  1018. String carrierSsoId,
  1019. String receiveName,
  1020. String materialName,
  1021. String specification,
  1022. String remark,
  1023. String capacityNo,
  1024. String carrierName,
  1025. String consigneeName,
  1026. String saler,
  1027. String easPrimaryId
  1028. ){
  1029. if(map.get("saleMakeDate")!=null){
  1030. DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1031. }else{
  1032. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1033. }
  1034. if(carrierSsoId != null){
  1035. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  1036. map.put("carrierSsoId", carrierSsoId);
  1037. }
  1038. }
  1039. if (receiveName != null && !"null".equals(receiveName)) {
  1040. map.put("receivName","%" + receiveName + "%");
  1041. }
  1042. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  1043. map.put("remark","%" + remark + "%");
  1044. }
  1045. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  1046. map.put("capacityNum","%" + capacityNo + "%");
  1047. }
  1048. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  1049. map.put("carrierNames","%" + carrierName + "%");
  1050. }
  1051. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  1052. map.put("consigneeNames","%" + consigneeName + "%");
  1053. }
  1054. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  1055. //如果业务员登录进来,就去查询业务员所关联的片区
  1056. List<String> saleAreaRemark = statisticalReportService.getSaleAreaRemark(saler);
  1057. if(saleAreaRemark.size() > 0) {
  1058. map.put("saleAreaRemark",saleAreaRemark);
  1059. }
  1060. map.put("salers",saler);
  1061. }
  1062. if (easPrimaryId != null && !"".equals(easPrimaryId) && !"null".equals(easPrimaryId)) {
  1063. map.put("easPrimaryId","%" +easPrimaryId+ "%");
  1064. }
  1065. //分页数据
  1066. List<Map<String, Object>> report = statisticalReportService.getSettledSaleSteelReportNew(map);
  1067. for (Map<String, Object> stringObjectMap : report) {
  1068. String shippingAddressIds = (String) stringObjectMap.get("shippingAddressIds");
  1069. String capacityNumbers= (String) stringObjectMap.get("capacityNumbers");
  1070. //确认是否有多个收货单位
  1071. //确认是否有多个车牌号
  1072. if (capacityNumbers!=null &&!("".equals(capacityNumbers))){
  1073. String[] split = capacityNumbers.split(",");
  1074. String capacityNumber="";
  1075. int flag=0;
  1076. for (String s : split) {
  1077. flag++;
  1078. String s1 = statisticalReportService.getcapacityNumber(DataChange.dataToBigDecimal(s));
  1079. if (flag==1){
  1080. capacityNumber+="旧车号:"+s1+",";
  1081. }else if (flag==2){
  1082. capacityNumber+="新车号:"+s1;
  1083. break;
  1084. }
  1085. }
  1086. stringObjectMap.put("capacityNo",capacityNumber);
  1087. }
  1088. /*try{
  1089. BigDecimal orderId = (BigDecimal) stringObjectMap.get("orderId");
  1090. if (orderId !=null){
  1091. String status = statisticalReportService.getStatus(orderId);
  1092. if (!(" ".equals(status))){
  1093. stringObjectMap.put("orderStatus",status);
  1094. }
  1095. }
  1096. }catch (Exception e){
  1097. e.printStackTrace();
  1098. }*/
  1099. }
  1100. return success(report);
  1101. }
  1102. @ApiOperation(value="查询销售统计报表")
  1103. @ApiImplicitParams({
  1104. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  1105. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  1106. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  1107. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  1108. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  1109. })
  1110. @PostMapping("/getInwardSaleSteelReport")
  1111. public RESTfulResult getInwardSaleSteelReport(@RequestBody(required=false) Map<String,Object> map,
  1112. String startTime,
  1113. String endTime,
  1114. String carrierSsoId,
  1115. String receiveName,
  1116. String materialName,
  1117. String specification,
  1118. String remark,
  1119. String capacityNo,
  1120. String carrierName,
  1121. String consigneeName,
  1122. String saler
  1123. ){
  1124. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1125. if(carrierSsoId != null){
  1126. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  1127. map.put("carrierSsoId", carrierSsoId);
  1128. }
  1129. }
  1130. if (receiveName != null && !"null".equals(receiveName)) {
  1131. map.put("receivName","%" + receiveName + "%");
  1132. }
  1133. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  1134. map.put("remark","%" + remark + "%");
  1135. }
  1136. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  1137. map.put("capacityNum","%" + capacityNo + "%");
  1138. }
  1139. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  1140. map.put("carrierNames","%" + carrierName + "%");
  1141. }
  1142. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  1143. map.put("consigneeNames","%" + consigneeName + "%");
  1144. }
  1145. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  1146. map.put("salers",saler);
  1147. }
  1148. //分页数据
  1149. List<Map<String, Object>> report = statisticalReportService.getInwardSaleSteelReport(map);
  1150. return success(report);
  1151. }
  1152. @ApiOperation(value="查询销售钢材派单报表")
  1153. @ApiImplicitParams({
  1154. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  1155. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  1156. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  1157. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  1158. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  1159. })
  1160. @PostMapping("/getInwardSaleSteelOrder")
  1161. public RESTfulResult getInwardSaleSteelOrder(@RequestBody(required=false) Map<String,Object> map,
  1162. String startTime,
  1163. String endTime,
  1164. String remark,
  1165. String capacityNo,
  1166. String consigneeName
  1167. ){
  1168. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1169. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  1170. map.put("remark","%" + remark + "%");
  1171. }
  1172. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  1173. map.put("capacityNum","%" + capacityNo + "%");
  1174. }
  1175. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  1176. map.put("consigneeNames","%" + consigneeName + "%");
  1177. }
  1178. //分页数据
  1179. List<Map<String, Object>> report = statisticalReportService.getInwardSaleSteelOrder(map);
  1180. return success(report);
  1181. }
  1182. @ApiOperation(value="根据车序号查询销售订单状态")
  1183. @PostMapping("/getSteelReportDetailsBySmId")
  1184. public RESTfulResult getSteelReportDetailsBySmId(@RequestParam BigDecimal saleOrderMaterialId){
  1185. return success(statisticalReportService.getSteelReportDetailsBySmId(saleOrderMaterialId));
  1186. }
  1187. @ApiOperation(value = "待装钢材报表数据")
  1188. @PostMapping("loadingSaleSteelReport")
  1189. public RESTfulResult loadingSaleSteelReport(@RequestBody(required=false) Map<String,Object> map,
  1190. String startTime,
  1191. String endTime,
  1192. String carrierSsoId,
  1193. String receiveName,
  1194. String remark,
  1195. String capacityNo,
  1196. String carrierName,
  1197. String consigneeName,
  1198. String saler,
  1199. String easPrimaryId){
  1200. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1201. if(carrierSsoId != null){
  1202. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  1203. map.put("carrierSsoId", carrierSsoId);
  1204. }
  1205. }
  1206. if (receiveName != null && !"null".equals(receiveName)) {
  1207. map.put("receivName","%" + receiveName + "%");
  1208. }
  1209. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  1210. map.put("remark","%" + remark + "%");
  1211. }
  1212. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  1213. map.put("capacityNum","%" + capacityNo + "%");
  1214. }
  1215. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  1216. map.put("carrierNames","%" + carrierName + "%");
  1217. }
  1218. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  1219. map.put("consigneeNames","%" + consigneeName + "%");
  1220. }
  1221. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  1222. map.put("salers",saler);
  1223. }
  1224. if (easPrimaryId != null && !"".equals(easPrimaryId) && !"null".equals(easPrimaryId)) {
  1225. map.put("easPrimaryId",easPrimaryId);
  1226. }
  1227. //分页数据
  1228. List<Map<String, Object>> report = statisticalReportService.loadingSaleSteelReport(map);
  1229. return success(report);
  1230. }
  1231. @ApiOperation(value="查询销售统计报表(财务)")
  1232. @ApiImplicitParams({
  1233. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  1234. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  1235. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  1236. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  1237. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  1238. })
  1239. @PostMapping("/getSaleSteelReportForFinance")
  1240. public RESTfulResult getSaleSteelReportForFinance(@RequestBody(required=false) Map<String,Object> map,
  1241. String startTime,
  1242. String endTime
  1243. ){
  1244. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1245. //分页数据
  1246. List<Map<String, Object>> report = statisticalReportService.getSaleSteelReportForFinance(map);
  1247. for (Map<String, Object> stringObjectMap : report) {
  1248. String shippingAddressIds = (String) stringObjectMap.get("shippingAddressIds");
  1249. //确认是否有多个收货单位
  1250. if (shippingAddressIds !=null && !("".equals(shippingAddressIds))){
  1251. String[] split = shippingAddressIds.split(",");
  1252. String address="";
  1253. int i=0;
  1254. for (String s : split) {
  1255. i++;
  1256. String getaddress = statisticalReportService.getaddress(DataChange.dataToBigDecimal(s));
  1257. if (i==1){
  1258. address+="旧地址:"+getaddress+",";
  1259. }else if (i==2){
  1260. address+="新地址:"+getaddress;
  1261. }
  1262. }
  1263. stringObjectMap.put("addressPlace",address);
  1264. }
  1265. }
  1266. return success(report);
  1267. }
  1268. @PostMapping("steelTransportReport")
  1269. @ApiOperation(value="销售钢材报表每日运输情况查询")
  1270. public RESTfulResult steelTransportReport(@RequestBody(required = false) Map<String,Object> map,
  1271. String startTime,
  1272. String endTime){
  1273. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1274. List<Map<String, Object>> report = statisticalReportService.steelTransportReport(map);
  1275. return success(report);
  1276. }
  1277. @ApiOperation("同步saleMaterialId至tmstruck和oom中")
  1278. @PostMapping("testTb")
  1279. public RESTfulResult testTb() {
  1280. return success(statisticalReportService.testTb());
  1281. }
  1282. @ApiOperation("欠运力统计表")
  1283. @PostMapping("yawnReport")
  1284. public synchronized RESTfulResult yawnReport(@RequestBody(required = false) Map<String,Object> map) {
  1285. String startTime = map.get("startTime").toString();
  1286. String endTime = map.get("startTime").toString();
  1287. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1288. System.out.println(map.get("startDate"));
  1289. return success(statisticalReportService.yawnReport(map));
  1290. }
  1291. @ApiOperation(value="查询销售统计报表修改")
  1292. @ApiImplicitParams({
  1293. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  1294. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  1295. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  1296. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  1297. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  1298. })
  1299. @PostMapping("/getAllSaleReportByLb")
  1300. public RESTfulResult getAllSaleReportByLb(@RequestBody(required=false) Map<String,Object> mapValue,
  1301. Integer apiId,
  1302. Integer pageNum,
  1303. Integer pageSize,
  1304. String startTime,
  1305. String endTime,
  1306. String carrierSsoId,
  1307. Integer orderType,
  1308. Integer shipperId,
  1309. String receiveName,
  1310. String materialName,
  1311. String wareHouse
  1312. ){
  1313. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  1314. if(carrierSsoId != null){
  1315. if(!"null".equals(carrierSsoId)){
  1316. mapValue.put("carrierSsoId", carrierSsoId);
  1317. }
  1318. }
  1319. if (receiveName != null && !"null".equals(receiveName)) {
  1320. mapValue.put("receivName", receiveName);
  1321. }
  1322. if (materialName != null && !"".equals(materialName) && !"null".equals(materialName)) {
  1323. mapValue.put("remark",materialName);
  1324. }
  1325. if (wareHouse != null && !"".equals(wareHouse) && !"null".equals(wareHouse)) {
  1326. mapValue.put("wareHouse",wareHouse);
  1327. }
  1328. if (mapValue.get("transportStatus") != null) {
  1329. mapValue.put("transportStatusList",mapValue.get("transportStatus"));
  1330. mapValue.remove("transportStatus");
  1331. }
  1332. mapValue.put("orderTypee",orderType);
  1333. mapValue.put("shipperId",shipperId);
  1334. if(orderType==1 && mapValue.get("orderField")==null){
  1335. //如果没有使用排序且查询的表格类型为销售钢材内部专用表格,默认规格排序
  1336. mapValue.put("orderField","materialCode");
  1337. mapValue.put("orderType","desc");
  1338. }
  1339. Map<String,Object> preMap = statisticalReportService.getPreMap(mapValue);
  1340. if(mapValue.get("isExcel")==null){
  1341. PageHelper.startPage(pageNum, pageSize);
  1342. }
  1343. //分页数据
  1344. List<Map<String, Object>> report = statisticalReportService.getAllSaleReportByLb(mapValue);
  1345. if(report.size() > 0 && report.get(0) != null && preMap != null ) {
  1346. report.get(0).putAll(preMap);
  1347. }
  1348. PageListAdd pageList = columnDataUtil.tableColumnData5(apiId, null, report);
  1349. return success(pageList);
  1350. }
  1351. @ApiOperation(value="查询销售统计报表")
  1352. @ApiImplicitParams({
  1353. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  1354. @ApiImplicitParam(name = "apiId(423)", value = "动态表头", required = false, dataType = "Integer"),
  1355. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  1356. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  1357. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  1358. })
  1359. @PostMapping("/getOyeSteelReport")
  1360. public RESTfulResult getOyeSteelReport(@RequestBody(required=false) Map<String,Object> map,
  1361. String startTime,
  1362. String endTime,
  1363. String carrierSsoId,
  1364. String receiveName,
  1365. String materialName,
  1366. String specification,
  1367. String remark,
  1368. String capacityNo,
  1369. String carrierName,
  1370. String consigneeName,
  1371. String saler,
  1372. String easPrimaryId
  1373. ){
  1374. DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
  1375. if(carrierSsoId != null){
  1376. if(!"null".equals(carrierSsoId) && carrierSsoId != null){
  1377. map.put("carrierSsoId", carrierSsoId);
  1378. }
  1379. }
  1380. if (receiveName != null && !"null".equals(receiveName)) {
  1381. map.put("receivName","%" + receiveName + "%");
  1382. }
  1383. if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
  1384. map.put("remark","%" + remark + "%");
  1385. }
  1386. if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
  1387. map.put("capacityNum","%" + capacityNo + "%");
  1388. }
  1389. if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
  1390. map.put("carrierNames","%" + carrierName + "%");
  1391. }
  1392. if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
  1393. map.put("consigneeNames","%" + consigneeName + "%");
  1394. }
  1395. if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
  1396. //如果业务员登录进来,就去查询业务员所关联的片区
  1397. List<String> saleAreaRemark = statisticalReportService.getSaleAreaRemark(saler);
  1398. if(saleAreaRemark.size() > 0) {
  1399. map.put("saleAreaRemark",saleAreaRemark);
  1400. }
  1401. map.put("salers",saler);
  1402. }
  1403. if (easPrimaryId != null && !"".equals(easPrimaryId) && !"null".equals(easPrimaryId)) {
  1404. map.put("easPrimaryId",easPrimaryId);
  1405. }
  1406. //分页数据
  1407. List<Map<String, Object>> report = statisticalReportService.getOyeSteelReport(map);
  1408. return success(report);
  1409. }
  1410. @ApiOperation(value="根据车序号查询欧冶转运计划状态")
  1411. @PostMapping("/getOyeSteelReportDetailsBySmId")
  1412. public RESTfulResult getOyeSteelReportDetailsBySmId(@RequestParam BigDecimal saleOrderMaterialId){
  1413. return success(statisticalReportService.getOyeSteelReportDetailsBySmId(saleOrderMaterialId));
  1414. }
  1415. }