TMSController.java 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.annotaion.LogAround;
  3. import com.steerinfo.dil.annotaion.RequestLimit;
  4. import com.steerinfo.dil.feign.AmsFeign;
  5. import com.steerinfo.dil.feign.RmsFeign;
  6. import com.steerinfo.dil.feign.TmsFeign;
  7. import com.steerinfo.dil.mapper.UniversalMapper;
  8. import com.steerinfo.dil.util.BaseRESTfulController;
  9. import com.steerinfo.dil.util.ExcelToolUtils;
  10. import com.steerinfo.dil.util.Util;
  11. import com.steerinfo.framework.controller.RESTfulResult;
  12. import io.swagger.annotations.Api;
  13. import io.swagger.annotations.ApiImplicitParam;
  14. import io.swagger.annotations.ApiImplicitParams;
  15. import io.swagger.annotations.ApiOperation;
  16. import oracle.jdbc.proxy.annotation.Post;
  17. import org.apache.commons.io.FilenameUtils;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.web.bind.annotation.*;
  20. import org.springframework.web.multipart.MultipartFile;
  21. import java.io.File;
  22. import java.io.FileInputStream;
  23. import java.io.FileOutputStream;
  24. import java.io.OutputStreamWriter;
  25. import java.math.BigDecimal;
  26. import java.text.DateFormat;
  27. import java.text.ParseException;
  28. import java.text.SimpleDateFormat;
  29. import java.util.*;
  30. import java.util.stream.Collectors;
  31. import com.steerinfo.dil.util.DataChange;
  32. import org.springframework.web.multipart.MultipartRequest;
  33. /**
  34. * @author luobang
  35. * @create 2021-09-17 14:11
  36. */
  37. @RestController
  38. @RequestMapping("${api.version}/tms")
  39. public class TMSController extends BaseRESTfulController {
  40. @Autowired
  41. private TmsFeign tmsFeign;
  42. @Autowired
  43. private AmsFeign amsFeign;
  44. @Autowired
  45. private RmsFeign rmsFeign;
  46. @Autowired
  47. private UniversalMapper universalMapper;
  48. @ApiOperation(value = "车辆实绩")
  49. @ApiImplicitParams({
  50. @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"),
  51. @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
  52. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  53. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  54. })
  55. @PostMapping(value = "/getcomprehensiveresults")
  56. public Map<String, Object> getecomprehensiveresultslist(@RequestBody(required = false) Map<String, Object> map, Integer apiId,
  57. Integer pageNum,
  58. Integer pageSize) {
  59. return tmsFeign.getAmsSalaryContracList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  60. }
  61. @ApiOperation(value = "新增车辆实绩")
  62. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  63. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计算公式"})
  64. @PostMapping("/addcomprehensiveresults")
  65. public Map<String, Object> insertcomprehensiveresults(@RequestBody(required = false) Map<String, Object> map) {
  66. return tmsFeign.addComprehensiveResult(map);
  67. }
  68. @ApiOperation(value = "车辆实绩删除")
  69. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  70. @PutMapping(value = "/comprehensiveresultslogicdelete")
  71. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计算公式"})
  72. public Map<String, Object> comprehensiveresultsLogicDelete(@RequestBody(required = false) Map<String, Object> map) {
  73. return tmsFeign.logicdeleteAmsSaalryContrac(map);
  74. }
  75. @ApiOperation(value = "修改车辆实绩")
  76. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  77. @PostMapping(value = "/comprehensiveresultsupadete")
  78. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计算公式"})
  79. public Map<String, Object> comprehensiveresultsUpdate(@RequestBody(required = false) Map<String, Object> map) {
  80. return tmsFeign.updateAmsSalaryContrac(map);
  81. }
  82. @ApiOperation(value = "修改车辆实绩")
  83. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  84. @PostMapping(value = "/tmscomprehensiveresults/batchUpdate")
  85. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计算公式"})
  86. public Map<String, Object> tmscomprehensiveresultsBatchUpdate(@RequestBody(required = false) Map<String, Object> map) {
  87. return tmsFeign.tmscomprehensiveresultsBatchUpdate((List)map.get("list"));
  88. }
  89. @ApiOperation(value = "派发运输订单")
  90. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  91. @PostMapping(value = "/dispatchOrder")
  92. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  93. public Map<String, Object> dispatchOrder(@RequestBody(required = false) Map<String, Object> map) {
  94. return tmsFeign.dispatchOrder(map);
  95. }
  96. @ApiOperation(value = "批量派发运输订单")
  97. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  98. @PostMapping(value = "/batchDispatch")
  99. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  100. public Map<String, Object> batchDispatch(@RequestBody(required = false) Map<String, Object> map) {
  101. return tmsFeign.batchDispatch(map);
  102. }
  103. @ApiOperation(value = "批量派发运输订单")
  104. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  105. @PostMapping(value = "/batchDispatchSc")
  106. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  107. public Map<String, Object> batchDispatchSc(@RequestBody(required = false) Map<String, Object> map) {
  108. return tmsFeign.batchDispatchSc(map);
  109. }
  110. @ApiOperation(value = "修改运输订单")
  111. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  112. @PostMapping(value = "/updateTransOrder")
  113. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  114. public Map<String, Object> updateTransOrder(@RequestBody(required = false) Map<String, Object> map) {
  115. return tmsFeign.updateTransOrder(map);
  116. }
  117. @ApiOperation(value = "合并运输订单")
  118. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  119. @PostMapping(value = "/mergeTransOrder")
  120. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  121. public Map<String, Object> mergeTransOrder(@RequestBody(required = false) Map<String, Object> map) {
  122. return tmsFeign.mergeTransOrder(map);
  123. }
  124. @ApiOperation(value = "更改运输订单状态")
  125. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  126. @PostMapping(value = "/changeTransOrder")
  127. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  128. public Map<String, Object> changeTransOrder(@RequestBody(required = false) Map<String, Object> map) {
  129. return tmsFeign.changeTransOrder(map);
  130. }
  131. @ApiOperation(value = "司机接收运单")
  132. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  133. @PostMapping(value = "/receiptOrder")
  134. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  135. public Map<String, Object> receiptOrder(@RequestBody(required = false) Map<String, Object> map) {
  136. return tmsFeign.receiptOrder(map);
  137. }
  138. @ApiOperation(value = "查询运输订单")
  139. @PostMapping("/getTransOrderList")
  140. public Map<String, Object> getTransOrderList(@RequestBody(required = false) Map<String, Object> map,
  141. Integer apiId,
  142. Integer pageNum,
  143. Integer pageSize) {
  144. return tmsFeign.getTransOrderList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  145. }
  146. @ApiOperation(value = "查询运输订单所有运输实绩")
  147. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  148. @PostMapping(value = "/getTransResult")
  149. public Map<String, Object> getTransResult(@RequestBody(required = false) Map<String, Object> map) {
  150. return tmsFeign.getTransResult(map);
  151. }
  152. @ApiOperation(value = "同步进厂")
  153. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  154. @PostMapping(value = "/syncEnfactoryResult")
  155. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"进厂实绩"})
  156. public Map<String, Object> syncEnfactoryResult(@RequestBody(required = false) Map<String, Object> map) {
  157. return tmsFeign.syncEnfactoryResult(map);
  158. }
  159. @ApiOperation(value = "同步出厂")
  160. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  161. @PostMapping(value = "/syncOutfactoryResult")
  162. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"出厂实绩"})
  163. public Map<String, Object> syncOutfactoryResult(@RequestBody(required = false) Map<String, Object> map) {
  164. return tmsFeign.syncOutfactoryResult(map);
  165. }
  166. @ApiOperation(value = "同步计量")
  167. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  168. @PostMapping(value = "/syncWeightResult")
  169. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计量实绩"})
  170. public Map<String, Object> syncWeightResult(@RequestBody(required = false) Map<String, Object> map) {
  171. return tmsFeign.syncWeightResult(map);
  172. }
  173. @ApiOperation(value="计时")
  174. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  175. @PostMapping(value = "/startend")
  176. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计时"})
  177. public Map<String, Object> start(@RequestBody(required = false) Map<String, Object> map) {
  178. return tmsFeign.startend(map);
  179. }
  180. @ApiOperation(value="计时")
  181. @PostMapping(value = "/updCountResult")
  182. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"计次"})
  183. public Map<String, Object> updCountResult(@RequestBody(required = false) Map<String, Object> map) {
  184. return tmsFeign.updCountResult(map);
  185. }
  186. @ApiOperation(value="审批计时")
  187. @PostMapping(value = "/approveTimeResult")
  188. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"计次"})
  189. public Map<String, Object> approveTimeResult(@RequestBody(required = false) Map<String, Object> map) {
  190. return tmsFeign.approveTimeResult(map);
  191. }
  192. @ApiOperation(value="计时复报")
  193. @PostMapping(value = "/resendTimeResult")
  194. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"计次"})
  195. public Map<String, Object> resendTimeResult(@RequestBody(required = false) Map<String, Object> map) {
  196. return tmsFeign.resendTimeResult(map);
  197. }
  198. @ApiOperation(value = "查询计时")
  199. @PostMapping("/tmstimingresultsList")
  200. public Map<String, Object> tmstimingresultsList(@RequestBody(required = false) Map<String, Object> map,
  201. Integer apiId,
  202. Integer pageNum,
  203. Integer pageSize) {
  204. return tmsFeign.tmstimingresultsList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  205. }
  206. @ApiOperation(value = "查询计时")
  207. @PostMapping("/getOrderTimeList")
  208. public Map<String, Object> getOrderTimeList(@RequestBody(required = false) Map<String, Object> map,
  209. Integer apiId,
  210. Integer pageNum,
  211. Integer pageSize) {
  212. return tmsFeign.getOrderTimeList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  213. }
  214. @ApiOperation(value = "查询计时")
  215. @PostMapping("/getTimeList")
  216. public Map<String, Object> getOrderTimeList(@RequestBody(required = false) Map<String, Object> map) {
  217. return tmsFeign.getTimeList(map);
  218. }
  219. @ApiOperation(value = "修改计时")
  220. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  221. @PostMapping(value = "/tmstimingresultsUpdate")
  222. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"修改计时"})
  223. public Map<String, Object> tmstimingresultsUpdate(@RequestBody(required = false) Map<String, Object> map) {
  224. return tmsFeign.tmstimingresultsUpdate(map);
  225. }
  226. @ApiOperation(value = "销售派发运输订单")
  227. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  228. @PostMapping(value = "/saleDispatchOrder")
  229. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  230. public Map<String, Object> saleDispatchOrder(@RequestBody(required = false) Map<String, Object> map) {
  231. return tmsFeign.saleDispatchOrder(map);
  232. }
  233. @ApiOperation(value = "批量销售派发运输订单")
  234. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  235. @PostMapping(value = "/saleDispatchOrderList")
  236. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  237. public Map<String, Object> saleDispatchOrderList(@RequestBody(required = false) Map<String, Object> map) {
  238. return tmsFeign.saleDispatchOrderList(map);
  239. }
  240. @ApiOperation(value = "查询销售运输订单")
  241. @PostMapping("/getSaleTransOrderList")
  242. public Map<String, Object> getSaleTransOrderList(@RequestBody(required = false) Map<String, Object> map,
  243. Integer apiId,
  244. Integer pageNum,
  245. Integer pageSize) {
  246. return tmsFeign.getSaleTransOrderList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  247. }
  248. @ApiOperation(value = "同步质检")
  249. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  250. @PostMapping(value = "/syncQualityResult")
  251. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"质检实绩"})
  252. public Map<String, Object> syncQualityResult(@RequestBody(required = false) Map<String, Object> map) {
  253. return tmsFeign.syncQualityResult(map);
  254. }
  255. @ApiOperation(value = "签到")
  256. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  257. @PostMapping(value = "/signIn")
  258. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"签到实绩"})
  259. public Map<String, Object> signIn(@RequestBody(required = false) Map<String, Object> map) {
  260. return tmsFeign.signIn(map);
  261. }
  262. @ApiOperation(value = "换车头")
  263. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  264. @PostMapping(value = "/replaceFront")
  265. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"换车头实绩"})
  266. public Map<String, Object> replaceFront(@RequestBody(required = false) Map<String, Object> map) {
  267. return tmsFeign.replaceFront(map);
  268. }
  269. @ApiOperation(value = "装货")
  270. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  271. @PostMapping(value = "/load")
  272. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"装货实绩"})
  273. public Map<String, Object> load(@RequestBody(required = false) Map<String, Object> map) {
  274. return tmsFeign.load(map);
  275. }
  276. @ApiOperation(value = "装货修改")
  277. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  278. @PostMapping(value = "/loadUpd")
  279. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"装货实绩"})
  280. public Map<String, Object> loadUpd(@RequestBody(required = false) Map<String, Object> map) {
  281. return tmsFeign.loadUpd(map);
  282. }
  283. @ApiOperation(value = "卸货")
  284. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  285. @PostMapping(value = "/unload")
  286. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"卸货实绩"})
  287. public Map<String, Object> unload(@RequestBody(required = false) Map<String, Object> map) {
  288. return tmsFeign.unload(map);
  289. }
  290. @ApiOperation(value = "卸货修改")
  291. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  292. @PostMapping(value = "/unloadUpd")
  293. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"卸货实绩"})
  294. public Map<String, Object> unloadUpd(@RequestBody(required = false) Map<String, Object> map) {
  295. return tmsFeign.unloadUpd(map);
  296. }
  297. @ApiOperation(value = "抵达")
  298. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  299. @PostMapping(value = "/arrival")
  300. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"抵达实绩"})
  301. public Map<String, Object> arrival(@RequestBody(required = false) Map<String, Object> map) {
  302. return tmsFeign.arrival(map);
  303. }
  304. @ApiOperation(value = "签收")
  305. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  306. @PostMapping(value = "/receipt")
  307. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"签收实绩"})
  308. public Map<String, Object> receipt(@RequestBody(required = false) Map<String, Object> map) {
  309. return tmsFeign.receipt(map);
  310. }
  311. @ApiOperation(value = "查询厂内车辆数")
  312. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  313. @PostMapping(value = "/getCountEnfactory")
  314. public Map<String, Object> getCountEnfactory(@RequestBody(required = false) Map<String, Object> map) {
  315. return tmsFeign.getCountEnfactory(map == null ? new HashMap<>() : map);
  316. }
  317. @ApiOperation(value = "查询签到")
  318. @PostMapping("/getSignInResultList")
  319. public Map<String, Object> getSignInResultList(@RequestBody(required = false) Map<String, Object> map,
  320. Integer apiId,
  321. Integer pageNum,
  322. Integer pageSize) {
  323. return tmsFeign.getSignInResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  324. }
  325. @ApiOperation(value = "查询换车头")
  326. @PostMapping("/getReplaceFrontResultList")
  327. public Map<String, Object> getReplaceFrontResultList(@RequestBody(required = false) Map<String, Object> map,
  328. Integer apiId,
  329. Integer pageNum,
  330. Integer pageSize) {
  331. return tmsFeign.getReplaceFrontResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  332. }
  333. @ApiOperation(value = "查询进厂")
  334. @PostMapping("/getEnfactoryResultList")
  335. public Map<String, Object> getEnfactoryResultList(@RequestBody(required = false) Map<String, Object> map,
  336. Integer apiId,
  337. Integer pageNum,
  338. Integer pageSize) {
  339. return tmsFeign.getEnfactoryResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  340. }
  341. @ApiOperation(value = "查询出厂")
  342. @PostMapping("/getOutfactoryResultList")
  343. public Map<String, Object> getTmsOutfactoryResultList
  344. (@RequestBody(required = false) Map<String, Object> map,
  345. Integer apiId,
  346. Integer pageNum,
  347. Integer pageSize) {
  348. return tmsFeign.getOutfactoryResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  349. }
  350. @ApiOperation(value = "查询装货")
  351. @PostMapping("/getLoadResultList")
  352. public Map<String, Object> getLoadResultList(@RequestBody(required = false) Map<String, Object> map,
  353. Integer apiId,
  354. Integer pageNum,
  355. Integer pageSize) {
  356. return tmsFeign.getLoadResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  357. }
  358. @ApiOperation(value = "查询卸货")
  359. @PostMapping("/getUnloadResultList")
  360. public Map<String, Object> getUnloadResultList(@RequestBody(required = false) Map<String, Object> map,
  361. Integer apiId,
  362. Integer pageNum,
  363. Integer pageSize) {
  364. return tmsFeign.getUnloadResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  365. }
  366. @ApiOperation(value = "查询计量")
  367. @PostMapping("/getWeightResultList")
  368. public Map<String, Object> getWeightResultList(@RequestBody(required = false) Map<String, Object> map,
  369. Integer apiId,
  370. Integer pageNum,
  371. Integer pageSize) {
  372. return tmsFeign.getWeightResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  373. }
  374. @ApiOperation(value = "查询质检")
  375. @PostMapping("/getQualityResultList")
  376. public Map<String, Object> getQualityResult(@RequestBody(required = false) Map<String, Object> map,
  377. Integer apiId,
  378. Integer pageNum,
  379. Integer pageSize) {
  380. return tmsFeign.getQualityResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  381. }
  382. @ApiOperation(value = "查询抵达")
  383. @PostMapping("/getArrivalResultList")
  384. public Map<String, Object> getArrivalResultList(@RequestBody(required = false) Map<String, Object> map,
  385. Integer apiId,
  386. Integer pageNum,
  387. Integer pageSize) {
  388. return tmsFeign.getArrivalResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  389. }
  390. @ApiOperation(value = "查询签收")
  391. @PostMapping("/getReceiptResultList")
  392. public Map<String, Object> getReceiptResultList(@RequestBody(required = false) Map<String, Object> map,
  393. Integer apiId,
  394. Integer pageNum,
  395. Integer pageSize) {
  396. return tmsFeign.getReceiptResultList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  397. }
  398. @ApiOperation(value = "采购火运装货作业")
  399. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  400. @PostMapping(value = "/purchaseTrainLoad")
  401. // @LogAround(foreignKeys = {"resultId"},foreignKeyTypes = {"装货实绩"})
  402. public Map<String, Object> purchaseTrainLoad(@RequestBody MultipartFile file,
  403. String businessType,
  404. String userId,
  405. String userName) throws Exception {
  406. Map<String, Object> map = new HashMap<>();
  407. //获取Excel中包含的对象数组
  408. List<Map<String, Object>> list = ExcelToolUtils.getExcelList(file, 0);
  409. map.put("list", list);
  410. //统计通知单的重量车数和车牌号
  411. Set<String> capacitySet = new HashSet<>();//车牌号
  412. List<String> requirementList = new ArrayList<>();
  413. String loadDate = null;
  414. for (Map<String, Object> item : list) {
  415. //校验行
  416. if(item.get("通知单号")==null || item.get("通知单号").equals("")
  417. || item.get("车号")==null || item.get("车号").equals("")
  418. || item.get("发站")==null || item.get("发站").equals("")
  419. || item.get("到站")==null || item.get("到站").equals("")
  420. || item.get("装车日期")==null || item.get("装车日期").equals("")){
  421. throw new Exception("单元格数据异常(通知单号/车号/装车日期/发站/到站),请检查模板或数据是否正确!");
  422. }
  423. BigDecimal tareWeight = DataChange.dataToBigDecimal(item.get("皮重"));
  424. BigDecimal grossWeight = DataChange.dataToBigDecimal(item.get("毛重"));
  425. BigDecimal netWeight = DataChange.dataToBigDecimal(item.get("净重"));
  426. if(tareWeight.compareTo(BigDecimal.ZERO) > 0 && grossWeight.compareTo(BigDecimal.ZERO) > 0){
  427. item.put("净重", grossWeight.subtract(tareWeight));
  428. }else if(netWeight.compareTo(BigDecimal.ZERO) > 0){
  429. item.put("净重", netWeight);
  430. }else {
  431. throw new Exception("单元格数据异常:净重/皮重/毛重,请检查模板或数据是否正确!");
  432. }
  433. //通知单统计
  434. String requirementNumber = item.get("通知单号").toString();
  435. if (map.get(requirementNumber) != null) {
  436. //已存在,修改
  437. Map<String,Object> requirementMap =(Map<String, Object>) map.get(requirementNumber);
  438. BigDecimal weight = DataChange.dataToBigDecimal(requirementMap.get("weight"));
  439. BigDecimal truckNumber = DataChange.dataToBigDecimal(requirementMap.get("truckNumber"));
  440. String loadTime = requirementMap.get("loadTime").toString();
  441. List<Map<String,Object>> trainList = (ArrayList) requirementMap.get("trainList");
  442. weight = weight.add(DataChange.dataToBigDecimal(item.get("净重")));
  443. truckNumber = truckNumber.add(new BigDecimal(1));
  444. trainList.add(item);
  445. requirementMap.put("weight", weight);
  446. requirementMap.put("truckNumber", truckNumber);
  447. requirementMap.put("trainList",trainList);
  448. if(!loadTime.equals(item.get("装车日期").toString())){
  449. throw new Exception("同一个Excel只允许一批车辆,请检查装车日期!");
  450. }
  451. } else {
  452. //不存在,新增
  453. Map<String,Object> requirementMap = new HashMap<>();
  454. List<Map<String,Object>> trainList = new ArrayList<>();
  455. trainList.add(item);
  456. BigDecimal weight = DataChange.dataToBigDecimal(item.get("净重"));
  457. BigDecimal truckNumber = new BigDecimal(1);
  458. String loadTime = item.get("装车日期").toString();
  459. if(loadDate == null){
  460. loadDate = loadTime;
  461. map.put("loadDate",loadDate);
  462. }else if(!loadDate.equals(loadTime)){
  463. throw new Exception("同一个Excel只允许一批车辆,请检查装车日期!");
  464. }
  465. requirementMap.put("requirementNumber", requirementNumber);
  466. requirementMap.put("weight", weight);
  467. requirementMap.put("truckNumber", truckNumber);
  468. requirementMap.put("loadTime",loadTime);
  469. requirementMap.put("trainList",trainList);
  470. requirementMap.put("userId",userId);
  471. requirementMap.put("userName",userName);
  472. requirementMap.put("businessType",businessType);
  473. requirementList.add(requirementNumber);
  474. map.put(requirementNumber, requirementMap);
  475. }
  476. //车牌号去重
  477. capacitySet.add(item.get("车号").toString());
  478. }
  479. //校验当前excel是否已经导入过
  480. if (universalMapper.countTrainLoad(map) > 0) {
  481. throw new Exception("存在重复的装车信息!不允许重复导入!");
  482. }
  483. //新增火车运力资源
  484. String[] capacities = capacitySet.toArray(new String[0]);//车牌号
  485. try{
  486. new Runnable() {
  487. @Override
  488. public void run() {
  489. Map<String, Object> capacityMap = new HashMap<>();
  490. capacityMap.put("capacities", capacities);
  491. capacityMap.put("userId", userId);
  492. capacityMap.put("userName", userName);
  493. rmsFeign.batchInsertCapacityTrain(capacityMap);
  494. }
  495. }.run();
  496. }catch (Exception e){e.printStackTrace();}
  497. //新增AMS及TMS
  498. map.put("userId",userId);
  499. map.put("userName",userName);
  500. map.put("businessType",businessType);
  501. map.put("requirementList",requirementList);
  502. return tmsFeign.purchaseTrainLoad(map);
  503. }
  504. @ApiOperation(value = "查询采购火运装货")
  505. @PostMapping("/purchaseTrainLoadList")
  506. public Map<String, Object> purchaseTrainLoadList(@RequestBody(required = false) Map<String, Object> map,
  507. Integer apiId,
  508. Integer pageNum,
  509. Integer pageSize) {
  510. return tmsFeign.purchaseTrainLoadList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  511. }
  512. @ApiOperation(value = "查询采购火运装货报表")
  513. @PostMapping("/purchaseTrainLoadReport")
  514. public Map<String, Object> purchaseTrainLoadReport(@RequestBody(required = false) Map<String, Object> map,
  515. Integer apiId,
  516. Integer pageNum,
  517. Integer pageSize) {
  518. return tmsFeign.purchaseTrainLoadReport(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  519. }
  520. @ApiOperation(value = "修改火运装车")
  521. @PostMapping("/updateTrainLoad")
  522. public Map<String, Object> updateTrainLoad(@RequestBody(required = false) Map<String, Object> map){
  523. return tmsFeign.updateTrainLoad(map);
  524. }
  525. @ApiOperation(value = "删除火运装车", notes = "删除火运装车")
  526. @PostMapping(value = "/deleteTrainLoad")
  527. @LogAround(foreignKeys = {"transOrderId"},foreignKeyTypes = {"运输订单"})
  528. public Map<String, Object> deleteTrainLoad(@RequestBody(required = false) Map<String ,Object> map) {
  529. return tmsFeign.deleteTrainLoad(map);
  530. }
  531. @ApiOperation(value = "修改火运装车序号")
  532. @PostMapping("/updateTrainLoadSeq")
  533. public Map<String, Object> updateTrainLoadSeq(@RequestBody(required = false) Map<String, Object> map){
  534. return tmsFeign.updateTrainLoadSeq(map);
  535. }
  536. @ApiOperation(value = "采购火运计量作业")
  537. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  538. @PostMapping(value = "/purchaseTrainWeight")
  539. // @LogAround(foreignKeys = {"resultId"},foreignKeyTypes = {"计量实绩"})
  540. public Map<String, Object> purchaseTrainWeight(@RequestBody MultipartFile file,
  541. String businessType,
  542. String userId,
  543. String userName) throws Exception {
  544. Map<String, Object> map = new HashMap<>();
  545. //获取Excel中包含的对象数组
  546. List<Map<String, Object>> list = ExcelToolUtils.getExcelList(file, 0);
  547. map.put("list", list);
  548. Set<String> capacitySet = new HashSet<>();//车牌号
  549. String weightTime = null;
  550. for (Map<String, Object> item : list) {
  551. //校验行
  552. if(item.get("通知单号")==null || item.get("通知单号").equals("")
  553. || item.get("车号")==null || item.get("车号").equals("")
  554. || item.get("计量日期")==null || item.get("计量日期").equals("")
  555. || item.get("皮重")==null || item.get("皮重").equals("")
  556. || item.get("毛重")==null || item.get("毛重").equals("")
  557. || item.get("磅单号")==null || item.get("磅单号").equals("")){
  558. throw new Exception("单元格数据异常(通知单号/车号/计量日期/净重/皮重/毛重/磅单号),请检查模板或数据是否正确!");
  559. }
  560. item.put("净重", DataChange.dataToBigDecimal(item.get("毛重")).subtract(DataChange.dataToBigDecimal(item.get("皮重"))));
  561. //校验数据
  562. // if(weightTime == null){
  563. // weightTime = item.get("计量日期").toString();
  564. // }else if(!weightTime.equals(item.get("计量日期").toString())){
  565. // throw new Exception("同一个Excel只允许一批车辆,请检查计量日期!");
  566. // }
  567. //车牌号去重
  568. capacitySet.add(item.get("车号").toString());
  569. }
  570. String[] capacities = capacitySet.toArray(new String[0]);//车牌号
  571. if (capacities.length != list.size()) {
  572. throw new Exception("车号不允许重复!");
  573. }
  574. map.put("userId",userId);
  575. map.put("userName",userName);
  576. map.put("businessType",businessType);
  577. //获取火车运单及计量详情
  578. List<Map<String,Object>> orderListAll = universalMapper.findTrainWeight(map);
  579. if (orderListAll.size() <= 0) {
  580. throw new Exception("未查询到装车信息,请先上传装车作业!");
  581. }
  582. List<String> requireList = new ArrayList<>();
  583. for(Map<String,Object> order : orderListAll){
  584. if(order.get("unloadResultId") != null){
  585. throw new Exception(order.get("capacityId")+"已卸车,不允许再上传计量!");
  586. }
  587. String requireNumber = order.get("requireNumber").toString();
  588. Map<String,Object> requirementMap =(Map<String, Object>) map.get(requireNumber);
  589. if(requirementMap!=null){
  590. List<Map<String,Object>> orderList = (ArrayList) requirementMap.get("orderList");
  591. orderList.add(order);
  592. BigDecimal weight = DataChange.dataToBigDecimal(requirementMap.get("weight"));
  593. requirementMap.put("weight",weight.add(DataChange.dataToBigDecimal(order.get("netWeight"))));
  594. requirementMap.put("orderList",orderList);
  595. }else{
  596. requirementMap = new HashMap<>();
  597. List<Map<String,Object>> orderList = new ArrayList<>();
  598. orderList.add(order);
  599. BigDecimal weight = DataChange.dataToBigDecimal(order.get("netWeight"));
  600. requirementMap.put("transPlanId",order.get("transPlanId"));
  601. requirementMap.put("materialId",order.get("materialId"));
  602. requirementMap.put("weight",weight);
  603. requirementMap.put("weightTime",weightTime);
  604. requirementMap.put("userId",userId);
  605. requirementMap.put("userName",userName);
  606. requirementMap.put("orderList",orderList);
  607. requireList.add(requireNumber);
  608. }
  609. map.put(requireNumber,requirementMap);
  610. }
  611. Map<String,Object> result = null;
  612. for(String requireNumber : requireList){
  613. Map<String,Object> requirementMap =(Map<String, Object>) map.get(requireNumber);
  614. List<Map<String,Object>> orderList = (ArrayList) requirementMap.get("orderList");
  615. if(universalMapper.countTransOrder(requirementMap) != orderList.size()){
  616. throw new Exception("计量车数与装车车数不一致!");
  617. }
  618. result = tmsFeign.purchaseTrainWeight(requirementMap);
  619. if (!"succeed".equals(result.get("status"))) {
  620. throw new Exception("计量上传失败:" + result.get("message"));
  621. }
  622. }
  623. return result;
  624. }
  625. @ApiOperation(value = "查询采购火运计量")
  626. @PostMapping("/purchaseTrainWeightList")
  627. public Map<String, Object> purchaseTrainWeightList(@RequestBody(required = false) Map<String, Object> map,
  628. Integer apiId,
  629. Integer pageNum,
  630. Integer pageSize) {
  631. return tmsFeign.purchaseTrainWeightList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  632. }
  633. @ApiOperation(value = "采购火运卸车作业")
  634. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  635. @PostMapping(value = "/purchaseTrainUnload")
  636. // @LogAround(foreignKeys = {"resultId"},foreignKeyTypes = {"计量实绩"})
  637. public Map<String, Object> purchaseTrainUnload(@RequestBody MultipartFile file,
  638. String businessType,
  639. String userId,
  640. String userName) throws Exception {
  641. Map<String, Object> map = new HashMap<>();
  642. //获取Excel中包含的对象数组
  643. List<Map<String, Object>> list = ExcelToolUtils.getExcelList(file, 0);
  644. map.put("list", list);
  645. Set<String> capacitySet = new HashSet<>();//车牌号
  646. String unloadTime = null;
  647. for (Map<String, Object> item : list) {
  648. //校验行
  649. if(item.get("通知单号")==null || item.get("通知单号").equals("")
  650. || item.get("车号")==null || item.get("车号").equals("")
  651. || item.get("卸车日期")==null || item.get("卸车日期").equals("")){
  652. throw new Exception("单元格数据异常(通知单号/车号/卸车日期),请检查模板或数据是否正确!");
  653. }
  654. if(item.get("净重") == null || item.get("净重").equals("")){
  655. //净重为空
  656. if(item.get("毛重") != null && !item.get("毛重").equals("")
  657. && item.get("皮重") != null && !item.get("皮重").equals("")){
  658. item.put("净重", DataChange.dataToBigDecimal(item.get("毛重")).subtract(DataChange.dataToBigDecimal(item.get("皮重"))));
  659. }else{
  660. throw new Exception("单元格数据异常(净重),请检查模板或数据是否正确!");
  661. }
  662. }
  663. if(item.get("毛重") == null || item.get("毛重").equals("")){
  664. //毛重为空
  665. if(item.get("净重") != null && !item.get("净重").equals("")
  666. && item.get("皮重") != null && !item.get("皮重").equals("")){
  667. item.put("毛重", DataChange.dataToBigDecimal(item.get("净重")).add(DataChange.dataToBigDecimal(item.get("皮重"))));
  668. }else{
  669. throw new Exception("单元格数据异常(毛重),请检查模板或数据是否正确!");
  670. }
  671. }
  672. if(item.get("皮重") == null || item.get("皮重").equals("")){
  673. //毛重为空
  674. if(item.get("净重") != null && !item.get("净重").equals("")
  675. && item.get("毛重") != null && !item.get("毛重").equals("")){
  676. item.put("皮重", DataChange.dataToBigDecimal(item.get("毛重")).subtract(DataChange.dataToBigDecimal(item.get("净重"))));
  677. }else{
  678. throw new Exception("单元格数据异常(皮重),请检查模板或数据是否正确!");
  679. }
  680. }
  681. //校验数据
  682. // if(unloadTime == null){
  683. // unloadTime = item.get("卸车日期").toString();
  684. // }else if(!unloadTime.equals(item.get("卸车日期").toString())){
  685. // throw new Exception("同一个Excel只允许一批车辆,请检查卸车日期!");
  686. // }
  687. //车牌号去重
  688. System.out.println(item.get("车号").toString());
  689. Boolean b = capacitySet.add(item.get("车号").toString());
  690. System.out.println(b);
  691. }
  692. String[] capacities = capacitySet.toArray(new String[0]);//车牌号
  693. if (capacities.length != list.size()) {
  694. throw new Exception("车号不允许重复!");
  695. }
  696. map.put("userId",userId);
  697. map.put("userName",userName);
  698. map.put("businessType",businessType);
  699. //获取火车运单及计量详情
  700. List<Map<String,Object>> orderListAll = universalMapper.findTrainUnload(map);
  701. if (orderListAll.size() <= 0) {
  702. throw new Exception("未查询到装车信息,请先上传装车作业!");
  703. }
  704. List<String> requireList = new ArrayList<>();
  705. for(Map<String,Object> order : orderListAll){
  706. if(order.get("unloadResultId") != null){
  707. throw new Exception(order.get("capacityId")+"已卸车,不允许再上传!");
  708. }
  709. String requireNumber = order.get("requireNumber").toString();
  710. Map<String,Object> requirementMap =(Map<String, Object>) map.get(requireNumber);
  711. if(requirementMap!=null){
  712. List<Map<String,Object>> orderList = (ArrayList) requirementMap.get("orderList");
  713. orderList.add(order);
  714. requirementMap.put("orderList",orderList);
  715. }else{
  716. requirementMap = new HashMap<>();
  717. List<Map<String,Object>> orderList = new ArrayList<>();
  718. orderList.add(order);
  719. requirementMap.put("transPlanId",order.get("transPlanId"));
  720. requirementMap.put("materialId",order.get("materialId"));
  721. requirementMap.put("unloadPointId",order.get("unloadPointId"));
  722. requirementMap.put("unloadTime",unloadTime);
  723. requirementMap.put("userId",userId);
  724. requirementMap.put("userName",userName);
  725. requirementMap.put("orderList",orderList);
  726. requirementMap.put("requirementSerialNumber",requireNumber);
  727. requireList.add(requireNumber);
  728. }
  729. map.put(requireNumber,requirementMap);
  730. }
  731. Map<String,Object> result = null;
  732. for(String requireNumber : requireList){
  733. Map<String,Object> requirementMap =(Map<String, Object>) map.get(requireNumber);
  734. List<Map<String,Object>> orderList = (ArrayList) requirementMap.get("orderList");
  735. // if(universalMapper.countTransOrder(requirementMap) != orderList.size()){
  736. // throw new Exception("卸车车数与装车车数不一致!");
  737. // }
  738. result = tmsFeign.purchaseTrainUnload(requirementMap);
  739. if (!"succeed".equals(result.get("status"))) {
  740. throw new Exception("上传失败:" + result.get("message"));
  741. }
  742. }
  743. return result;
  744. }
  745. @ApiOperation(value = "查询采购火运卸车")
  746. @PostMapping("/purchaseTrainUnloadList")
  747. public Map<String, Object> purchaseTrainUnloadList(@RequestBody(required = false) Map<String, Object> map,
  748. Integer apiId,
  749. Integer pageNum,
  750. Integer pageSize) {
  751. return tmsFeign.purchaseTrainUnloadList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  752. }
  753. @ApiOperation(value = "更改销售运输订单状态")
  754. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  755. @PostMapping(value = "/changeSaleTransOrder")
  756. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"销售运输订单"})
  757. public Map<String, Object> changeSaleTransOrder(@RequestBody(required = false) Map<String, Object> map) {
  758. return tmsFeign.changeSaleTransOrder(map);
  759. }
  760. @ApiOperation(value = "查询司机运输汇总")
  761. @PostMapping("/getDriverTotalResult")
  762. public Map<String, Object> getDriverTotalResult(@RequestBody(required = false) Map<String, Object> map,
  763. Integer apiId,
  764. Integer pageNum,
  765. Integer pageSize) {
  766. return tmsFeign.getDriverTotalResult(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  767. }
  768. @ApiOperation(value = "查询车辆运输汇总")
  769. @PostMapping("/getCapacityTotalResult")
  770. public Map<String, Object> getCapacityTotalResult(@RequestBody(required = false) Map<String, Object> map,
  771. Integer apiId,
  772. Integer pageNum,
  773. Integer pageSize) {
  774. return tmsFeign.getCapacityTotalResult(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  775. }
  776. @ApiOperation("生产物流-调度任务新增")
  777. @PostMapping("/dispatchTask")
  778. Map<String,Object> dispatchTask(@RequestBody Map<String,Object> map) {
  779. return tmsFeign.dispatchTask(map);
  780. }
  781. @ApiOperation("获取销售派车单信息")
  782. @PostMapping("/getDlivDirnoSeqList/{id}")
  783. public RESTfulResult getDlivDirnoSeqList(@PathVariable("id") String id) {
  784. return tmsFeign.getDlivDirnoSeqList(id);
  785. }
  786. @ApiOperation("修改销售派车单信息")
  787. @PostMapping("/updateDlivDirnoSeq")
  788. @LogAround(foreignKeys = {"planChildId"}, foreignKeyTypes = {"修改销售运单"})
  789. public RESTfulResult updateDlivDirnoSeq(@RequestBody Map<String,Object> map) {
  790. return tmsFeign.updateDlivDirnoSeq(map);
  791. }
  792. @ApiOperation("查询销售派车单装车信息")
  793. @PostMapping("/selectDlivDirnoSeqDetails")
  794. public RESTfulResult selectDlivDirnoSeqDetails(@RequestBody Map<String,Object> map) {
  795. return tmsFeign.selectDlivDirnoSeqDetails(map);
  796. }
  797. @ApiOperation("查询订单厂内轨迹")
  798. @PostMapping("/getPathByOrder")
  799. public RESTfulResult getPathByOrder(@RequestBody Map<String,Object> map) {
  800. return tmsFeign.getPathByOrder(map);
  801. }
  802. @ApiOperation("上传定位,更新路径")
  803. @PostMapping("/uploadLocation")
  804. public RESTfulResult uploadLocation(@RequestBody Map<String,Object> map) {
  805. return tmsFeign.uploadLocation(map);
  806. }
  807. @ApiOperation("实收吨数")
  808. @PostMapping("/updateWeight")
  809. public RESTfulResult updateWeight(@RequestBody Map<String,Object> map) {
  810. return tmsFeign.updateWeight(map);
  811. }
  812. @ApiOperation("checkWeightResult")
  813. @PostMapping("/checkWeightResult")
  814. @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计量实绩"})
  815. public Map<String,Object> checkWeightResult(@RequestBody Map<String,Object> map) {
  816. return tmsFeign.checkWeightResult(map);
  817. }
  818. @ApiOperation(value = "发运通知单直接派车", notes = "发运通知单直接派车")
  819. @ApiImplicitParams({
  820. @ApiImplicitParam(name = "map", value = "json格式具体参数", required = true, dataType = "Map<String,Object>")
  821. })
  822. @PostMapping(value = "/saleDispatchList")
  823. public RESTfulResult saleDispatchList(@RequestBody Map<String, Object> map) {
  824. return tmsFeign.saleDispatchList(map);
  825. }
  826. @ApiOperation("多拼派车")
  827. @PostMapping("/saleDispatchDuoPin")
  828. RESTfulResult saleDispatchDuoPin(@RequestBody Map<String,Object> map) {return tmsFeign.saleDispatchDuoPin(map);}
  829. @ApiOperation("同步生产实绩")
  830. @PostMapping("/syncProductionResult")
  831. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"调拨实绩"})
  832. RESTfulResult syncProductionResult(@RequestBody Map<String,Object> map) {
  833. return tmsFeign.syncProductionResult(map);
  834. }
  835. @ApiOperation("获取司机日工作量")
  836. @PostMapping("/getDriverDayJobForApp")
  837. RESTfulResult getDriverDayJobForApp(@RequestBody Map<String,Object> map,Integer apiId) {
  838. return tmsFeign.getDriverDayJobForApp(map,apiId);
  839. }
  840. @ApiOperation(value = "确认出库", notes = "确认出库")
  841. @ApiImplicitParams({
  842. @ApiImplicitParam(name = "map", value = "json格式具体参数", required = true, dataType = "Map<String,Object>")
  843. })
  844. @PostMapping(value = "/outBound")
  845. public RESTfulResult outBound(@RequestBody Map<String, Object> map) {
  846. return tmsFeign.outBound(map);
  847. }
  848. @ApiOperation(value = "撤销出库", notes = "撤销出库")
  849. @ApiImplicitParams({
  850. @ApiImplicitParam(name = "map", value = "json格式具体参数", required = true, dataType = "Map<String,Object>")
  851. })
  852. @PostMapping(value = "/revokeOutBound")
  853. public RESTfulResult revokeOutBound(@RequestBody Map<String, Object> map) {
  854. return tmsFeign.revokeOutBound(map);
  855. }
  856. @ApiOperation(value = "查询车辆登记单信息")
  857. @PostMapping("/likeTransitOrders")
  858. public Map<String, Object> likeTransitOrders(@RequestBody(required = false) Map<String, Object> map,
  859. Integer apiId,
  860. Integer pageNum,
  861. Integer pageSize) {
  862. return tmsFeign.likeTransitOrders(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  863. }
  864. @ApiOperation(value = "新增车辆登记单信息")
  865. @PostMapping("/insertTmsTransitOrder")
  866. public Map<String,Object> insertTmsTransitOrder(@RequestBody Map<String,Object> map) {
  867. return tmsFeign.insertTmsTransitOrder(map);
  868. }
  869. @ApiOperation("导入通行登记单")
  870. @PostMapping("/importTrasitOrder")
  871. public Map<String, Object> importTrasitOrder(@RequestBody MultipartFile file,
  872. String userId,
  873. String userName) throws Exception {
  874. Map<String, Object> map = new HashMap<>();
  875. //获取Excel中包含的对象数组
  876. List<Map<String, Object>> list = ExcelToolUtils.getExcelList(file, 0);
  877. map.put("list", list);
  878. for (Map<String, Object> item : list) {
  879. //校验行
  880. if (item.get("车牌号") == null || item.get("通行卡类型") == null || item.get("开始时间") == null || item.get("结束时间") == null) {
  881. throw new Exception("单元格数据异常,请检查模板或数据是否正确!");
  882. }
  883. }
  884. map.put("userId", userId);
  885. map.put("userName", userName);
  886. return tmsFeign.importTrasitOrder(map);
  887. }
  888. @ApiOperation(value = "查询请车批车")
  889. @PostMapping("/getPleaseApproveList")
  890. public Map<String, Object> getPleaseApproveList(@RequestBody(required = false) Map<String, Object> map,
  891. Integer apiId,
  892. Integer pageNum,
  893. Integer pageSize) {
  894. return tmsFeign.getPleaseApproveList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  895. }
  896. @PostMapping("/addPleaseApprove")
  897. public Map<String,Object> addPleaseApprove(@RequestBody Map<String,Object> map) {
  898. return tmsFeign.addPleaseApprove(map);
  899. }
  900. @PostMapping("/updPleaseApprove")
  901. public Map<String,Object> updPleaseApprove(@RequestBody Map<String,Object> map) {
  902. return tmsFeign.updPleaseApprove(map);
  903. }
  904. @PostMapping("/delPleaseApprove")
  905. public Map<String,Object> delPleaseApprove(@RequestBody Map<String,Object> map) {
  906. return tmsFeign.delPleaseApprove(map);
  907. }
  908. @PostMapping("/gatepostTransitManager")
  909. public Map<String,Object> gatepostTransitManager(@RequestBody Map<String,Object> map) {
  910. return tmsFeign.gatepostTransitManager(map);
  911. }
  912. @ApiOperation("导入宏瑞综合实绩")
  913. @PostMapping("/importComprehensiveResult")
  914. public Map<String, Object> importComprehensiveResult(@RequestBody MultipartFile file,
  915. String userId,
  916. String userName,
  917. String resultType) throws Exception {
  918. Map<String, Object> map = new HashMap<>();
  919. if (file.isEmpty()) {
  920. return new HashMap<>();
  921. }
  922. // 获取源文件名称
  923. String originalFilename = file.getOriginalFilename();
  924. // 获取源文件后缀名
  925. String extension = "." + FilenameUtils.getExtension(originalFilename);
  926. // 定义新路径
  927. String newPath = "/data/file/result/";
  928. String newName = userName + "-" + originalFilename+ Util.RandomCreate(8) + ".xlsx";
  929. File dataFile = new File(newPath);
  930. if (!dataFile.exists()) {
  931. dataFile.mkdirs();
  932. }
  933. FileOutputStream fileOutputStream = new FileOutputStream(newPath + newName);
  934. fileOutputStream.write(file.getBytes());
  935. fileOutputStream.flush();
  936. fileOutputStream.close();
  937. List<Map<String, Object>> list = new ArrayList<>();
  938. //获取Excel中包含的对象数组
  939. if ("维保".equals(resultType)) {
  940. List<String> excelHeads = Arrays.asList("车属单位","车型","车号","大号","维修时间","维修内容","维修","电器","钣焊","补胎","其它","工时合计","配件费用","外修费用","总合计");
  941. list = ExcelToolUtils.getExcelList(file,2,excelHeads);
  942. }else{
  943. list = ExcelToolUtils.getExcelList(file, 0);
  944. }
  945. map.put("list", list);
  946. map.put("userId", userId);
  947. map.put("userName", userName);
  948. map.put("resultType", resultType);
  949. map.put("filePath",newPath + newName);
  950. return tmsFeign.importComprehensiveResult(map);
  951. }
  952. @ApiOperation(value = "火运大宗销售订单 删除销售运输订单")
  953. @PostMapping("/changeTransOrderH")
  954. public Map<String,Object> changeTransOrderH(@RequestBody Map<String,Object> map) {
  955. return tmsFeign.changeTransOrderH(map);
  956. }
  957. @ApiOperation(value = "火运出库后修改车号")
  958. @PostMapping("/updateCarNo")
  959. public Map<String,Object> updateCarNo(@RequestBody Map<String,Object> map) {
  960. return tmsFeign.updateCarNo(map);
  961. }
  962. @ApiOperation(value = "查询排队网格信息")
  963. @PostMapping("/likeQueueGrid")
  964. public Map<String, Object> likeQueueGrid(@RequestBody(required = false) Map<String, Object> map,
  965. Integer apiId,
  966. Integer pageNum,
  967. Integer pageSize) {
  968. return tmsFeign.likeQueueGrid(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  969. }
  970. @ApiOperation(value = "查询排队实绩信息")
  971. @PostMapping("/likeQueueResult")
  972. public Map<String, Object> likeQueueResult(@RequestBody(required = false) Map<String, Object> map,
  973. Integer apiId,
  974. Integer pageNum,
  975. Integer pageSize) {
  976. return tmsFeign.likeQueueResult(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  977. }
  978. @ApiOperation(value = "处理排队网格数据")
  979. @PostMapping("/disposeQueueGrid")
  980. public Map<String,Object> disposeQueueGrid(@RequestBody Map<String,Object> map) {
  981. return tmsFeign.disposeQueueGrid(map);
  982. }
  983. @ApiOperation(value = "获取网格数据")
  984. @PostMapping("/getGridAllData")
  985. public Map<String,Object> getGridAllData(@RequestBody Map<String,Object> map) {
  986. return tmsFeign.getGridAllData(map);
  987. }
  988. @ApiOperation(value = "处理排队实绩数据")
  989. @PostMapping("/disposeQueueResult")
  990. public Map<String,Object> disposeQueueResult(@RequestBody Map<String,Object> map) {
  991. return tmsFeign.disposeQueueResult(map);
  992. }
  993. @ApiOperation(value = "禁用/启用运输订单")
  994. @PostMapping("/banTransOrder")
  995. @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
  996. public Map<String,Object> banTransOrder(@RequestBody Map<String,Object> map) {
  997. return tmsFeign.banTransOrder(map);
  998. }
  999. @ApiOperation(value = "查询销售火运装货报表")
  1000. @PostMapping("/loadingOperation")
  1001. public Map<String, Object> loadingOperation(@RequestBody(required = false) Map<String, Object> map,
  1002. Integer apiId,
  1003. Integer pageNum,
  1004. Integer pageSize) {
  1005. return tmsFeign.loadingOperation(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  1006. }
  1007. @ApiOperation(value = "修改火运装车列序号")
  1008. @PostMapping("/updateTrainOrderSeq")
  1009. public Map<String,Object> updateTrainOrderSeq(@RequestBody Map<String,Object> map) {
  1010. return tmsFeign.updateTrainOrderSeq(map);
  1011. }
  1012. @ApiOperation(value = "查询销售火运装货报表明细")
  1013. @PostMapping("/purchaseTrainsOrderList")
  1014. public Map<String, Object> purchaseTrainsOrderList(@RequestBody(required = false) Map<String, Object> map,
  1015. Integer apiId,
  1016. Integer pageNum,
  1017. Integer pageSize) {
  1018. return tmsFeign.purchaseTrainsOrderList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  1019. }
  1020. @ApiOperation("吊装信息")
  1021. @PostMapping("/disposeHandling")
  1022. public Map<String,Object> disposeHandling(@RequestBody Map<String,Object> map) {
  1023. return tmsFeign.disposeHandling(map);
  1024. }
  1025. @ApiOperation("同步报表数据")
  1026. @PostMapping("/getgenerateOperateDaily")
  1027. public Map<String,Object> generateOperateDaily(@RequestBody Map<String,Object> map) {
  1028. return tmsFeign.getgenerateOperateDaily(map);
  1029. }
  1030. @ApiOperation(value = "保存WMS传递的内转出库数据", notes = "保存WMS传递的内转出库数据")
  1031. @PostMapping(value = "/preserveMoveListIn")
  1032. public RESTfulResult preserveMoveListIn(@RequestBody Map<String, Object> mapList) {
  1033. return tmsFeign.preserveMoveListIn(mapList);
  1034. }
  1035. @ApiOperation(value = "保存WMS传递的内转入库数据", notes = "保存WMS传递的内转入库数据")
  1036. @PostMapping(value = "/preserveMoveListOut")
  1037. public RESTfulResult preserveMoveListOut(@RequestBody Map<String, Object> mapList) {
  1038. return tmsFeign.preserveMoveListOut(mapList);
  1039. }
  1040. @ApiOperation(value = "保存WMS传递的内转撤销入库数据", notes = "保存WMS传递的内转撤销入库数据")
  1041. @PostMapping(value = "/preserveMoveListRevokeOut")
  1042. public RESTfulResult preserveMoveListRevokeOut(@RequestBody Map<String, Object> mapList) {
  1043. return tmsFeign.preserveMoveListRevokeOut(mapList);
  1044. }
  1045. @ApiOperation(value = "保存WMS传递的内转撤销出库数据", notes = "保存WMS传递的内撤销转出库数据")
  1046. @PostMapping(value = "/preserveMoveListRevokeIn")
  1047. public RESTfulResult preserveMoveListRevokeIn(@RequestBody Map<String, Object> mapList) {
  1048. return tmsFeign.preserveMoveListRevokeIn(mapList);
  1049. }
  1050. @ApiOperation(value = "保存WMS传递的内转撤销出库数据", notes = "保存WMS传递的内撤销转出库数据")
  1051. @PostMapping(value = "/modifyChange")
  1052. public RESTfulResult modifyChange(@RequestBody Map<String, Object> params) {
  1053. return tmsFeign.modifyChange(params);
  1054. }
  1055. @ApiOperation(value = "针对签到过期的计时单子重新赋权", notes = "针对签到过期的计时单子重新赋权")
  1056. @PostMapping(value = "/resartStartTimming")
  1057. public RESTfulResult resartStartTimming(@RequestBody Map<String, Object> params) {
  1058. return tmsFeign.resartStartTimming(params);
  1059. }
  1060. }