UniversalController.java 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.config.ImageFileUtils;
  3. import com.steerinfo.dil.mapper.UniversalMapper;
  4. import com.steerinfo.dil.service.impl.UniversalServiceImpl;
  5. import com.steerinfo.dil.util.BaseRESTfulController;
  6. import com.steerinfo.dil.util.ColumnDataUtil;
  7. import com.steerinfo.dil.util.DataChange;
  8. import com.steerinfo.dil.util.PageListAdd;
  9. import com.steerinfo.framework.controller.RESTfulResult;
  10. import com.steerinfo.framework.service.pagehelper.PageHelper;
  11. import com.zaxxer.hikari.util.FastList;
  12. import io.swagger.annotations.*;
  13. import io.swagger.models.auth.In;
  14. import javassist.expr.NewArray;
  15. import oracle.jdbc.proxy.annotation.Post;
  16. import org.apache.commons.lang.time.FastDateFormat;
  17. import org.apache.ibatis.annotations.Param;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.scheduling.annotation.Scheduled;
  20. import org.springframework.web.bind.annotation.PostMapping;
  21. import org.springframework.web.bind.annotation.RequestBody;
  22. import org.springframework.web.bind.annotation.RequestMapping;
  23. import org.springframework.web.bind.annotation.RestController;
  24. import org.springframework.web.bind.annotation.*;
  25. import java.io.IOException;
  26. import java.math.BigDecimal;
  27. import java.util.ArrayList;
  28. import java.util.HashMap;
  29. import java.util.List;
  30. import java.util.Map;
  31. /**
  32. * @ author :TXF
  33. * @ time :2021/10/19 18:06
  34. * 通用接口
  35. */
  36. @RequestMapping("${api.version}/uc")
  37. @RestController
  38. public class UniversalController extends BaseRESTfulController {
  39. @Autowired
  40. UniversalServiceImpl universalService;
  41. @Autowired
  42. UniversalMapper universalMapper;
  43. @Autowired
  44. ColumnDataUtil columnDataUtil;
  45. @Autowired
  46. private ImageFileUtils imageFileUtils;
  47. @ApiOperation(value="查询数据打印提货单接口")
  48. @ApiImplicitParams({
  49. @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
  50. })
  51. @PostMapping("/printTHD")
  52. public RESTfulResult printTiHuoDan(@RequestBody(required=false) Map<String, Object> mapValue){
  53. Map<String, Object> tiHuoDan = universalService.printTiHuoDan((String) mapValue.get("orderNumber"));
  54. return success(tiHuoDan);
  55. }
  56. @ApiModelProperty(value = "模糊查询发货单位")
  57. @ApiImplicitParams({
  58. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  59. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  60. @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
  61. })
  62. @PostMapping("/querySupplierByLike")
  63. public RESTfulResult querySupplierByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  64. Integer pageNum,
  65. Integer pageSize,
  66. Integer apiId,
  67. String index) {
  68. if(mapValue == null) {
  69. mapValue = new HashMap<>();
  70. }
  71. if(index != null){
  72. mapValue.put("index","%" + index + "%");
  73. }
  74. PageHelper.startPage(pageNum, pageSize);
  75. //分页查询数据
  76. List<Map<String, Object>> columnList = universalMapper.querySupplierByLike(mapValue);
  77. PageListAdd data = columnDataUtil.tableColumnData(apiId,columnList);
  78. return success(data);
  79. }
  80. @ApiModelProperty(value = "查询所有发货单位")
  81. @ApiImplicitParams({
  82. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  83. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  84. @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
  85. })
  86. @PostMapping("/queryAllSupplierByLike")
  87. public RESTfulResult queryAllSupplierByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  88. Integer pageNum,
  89. Integer pageSize,
  90. Integer apiId,
  91. String index) {
  92. if(mapValue == null) {
  93. mapValue = new HashMap<>();
  94. }
  95. if(index != null){
  96. mapValue.put("index","%" + index + "%");
  97. }
  98. PageHelper.startPage(pageNum, pageSize);
  99. //分页查询数据
  100. List<Map<String, Object>> columnList = universalMapper.queryAllSupplierByLike(mapValue);
  101. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  102. return success(data);
  103. }
  104. @ApiModelProperty(value = "通过物资ID查询该物资的发货单位信息")
  105. @ApiImplicitParams({
  106. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  107. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  108. @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
  109. })
  110. @PostMapping("/getSupplierMesByMaterialId")
  111. public RESTfulResult getSupplierMesByMaterialId(@RequestBody(required = false) Map<String,Object> mapValue,
  112. Integer pageNum,
  113. Integer pageSize,
  114. Integer apiId,
  115. String index, String materialId) {
  116. if(mapValue == null)
  117. mapValue = new HashMap<>();
  118. if(!"null".equals(materialId))
  119. mapValue.put("materialId",materialId);
  120. if(index != null){
  121. mapValue.put("index","%" + index + "%");
  122. }
  123. PageHelper.startPage(pageNum, pageSize);
  124. //分页查询数据
  125. List<Map<String, Object>> columnList = universalMapper.getSupplierMesByMaterialId(mapValue);
  126. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  127. return success(data);
  128. }
  129. @ApiOperation(value="查询所有运力信息")
  130. @ApiImplicitParams({
  131. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  132. @ApiImplicitParam(name = "apiId(248)", value = "动态表头", required = false, dataType = "Integer"),
  133. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  134. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  135. })
  136. @PostMapping("/getAllCapacityByCarrierLike")
  137. public RESTfulResult getAllCapacityByCarrierLike(@RequestBody(required=false) Map<String,Object> mapValue,
  138. Integer apiId,
  139. Integer pageNum,
  140. Integer pageSize,
  141. String carrierSsoId,
  142. String index,
  143. String con,
  144. String indexText
  145. ){
  146. if(mapValue == null){
  147. mapValue = new HashMap<>();
  148. }
  149. if(index != null){
  150. mapValue.put("index", index);
  151. }
  152. if (con != null&& !con.equals("undefined")){
  153. mapValue.put("con",con);
  154. }
  155. if (indexText != null&& !indexText.equals("undefined")){
  156. mapValue.put("indexText",indexText);
  157. }
  158. if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
  159. carrierSsoId = null;
  160. }
  161. if (carrierSsoId != null) {
  162. BigDecimal carrierId = universalMapper.getCarrierIdBySSO(carrierSsoId);
  163. mapValue.put("carrierId",carrierId);
  164. }
  165. //不分页筛选数据
  166. PageHelper.startPage(pageNum,pageSize);
  167. //分页数据
  168. List<Map<String, Object>> capacity = universalMapper.getAllCapacityByCarrierLike(mapValue);
  169. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  170. return success(pageList);
  171. }
  172. @ApiOperation(value="查询运力类型")
  173. @ApiImplicitParams({
  174. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  175. @ApiImplicitParam(name = "apiId(248)", value = "动态表头", required = false, dataType = "Integer"),
  176. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  177. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  178. })
  179. @PostMapping("/getCapacityType")
  180. public RESTfulResult getCapacityType(@RequestBody(required=false) Map<String,Object> mapValue,
  181. Integer apiId,
  182. Integer pageNum,
  183. Integer pageSize,
  184. String index
  185. ){
  186. if(mapValue == null){
  187. mapValue = new HashMap<>();
  188. }
  189. if(index != null&&!index.equals("null")){
  190. mapValue.put("index", index);
  191. }
  192. //不分页筛选数据
  193. PageHelper.startPage(pageNum,pageSize);
  194. //分页数据
  195. List<Map<String, Object>> capacity = universalMapper.getCapacityType(mapValue);
  196. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  197. return success(pageList);
  198. }
  199. @ApiOperation(value="通过订单ID查询订单下所有物资")
  200. @ApiImplicitParams({
  201. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  202. @ApiImplicitParam(name = "apiId(395)", value = "动态表头", required = false, dataType = "Integer"),
  203. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  204. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  205. })
  206. @PostMapping("/getMaterialMesByOrderId")
  207. public RESTfulResult getMaterialMesByOrderId(@RequestBody(required=false) Map<String,Object> mapValue,
  208. Integer apiId,
  209. Integer pageNum,
  210. Integer pageSize,
  211. String orderId
  212. ){
  213. if(mapValue == null){
  214. mapValue = new HashMap<>();
  215. }
  216. if(orderId != null){
  217. mapValue.put("orderId", orderId);
  218. }
  219. //不分页筛选数据
  220. PageHelper.startPage(pageNum,pageSize);
  221. //分页数据
  222. List<Map<String, Object>> capacity = universalMapper.getMaterialMesByOrderId(mapValue);
  223. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  224. return success(pageList);
  225. }
  226. @ApiModelProperty(value = "边输边查发货单位")
  227. @PostMapping("/getSupplierMesByLike")
  228. public RESTfulResult getSupplierMesByLike(@RequestParam("index") String index) {
  229. List<Map<String, Object>> list = universalMapper.getSupplierMesByLike(index == null ? "" : index);
  230. return success(list);
  231. }
  232. @ApiModelProperty(value = "船名边输边查")
  233. @PostMapping("/getShipNameMesByLike")
  234. public RESTfulResult getShipNameMesByLike(@RequestParam("index") String index,Integer materialId) {
  235. Map<String, Object> map = new HashMap<>();
  236. if(materialId != null){
  237. map.put("materialId",materialId);
  238. }
  239. if(index != null){
  240. map.put("index","%" + index + "%");
  241. }
  242. List<Map<String,Object>>list = universalMapper.getShipNameMesByLike(map);
  243. return success(list);
  244. }
  245. @ApiModelProperty(value = "边输边查用车单位")
  246. @PostMapping("/getRequireUnitName")
  247. public RESTfulResult getRequireUnitName(@RequestParam("index") String index) {
  248. List<Map<String,Object>>list = universalMapper.getRequireUnitName(index == null ? "" : "%" + index + "%");
  249. return success(list);
  250. }
  251. @ApiModelProperty(value = "边输边查收货单位")
  252. @PostMapping("/getConsigneeByLike")
  253. public RESTfulResult getConsigneeByLike(@RequestParam("index") String index) {
  254. List<Map<String, Object>> list = universalMapper.getConsigneeByLike(index == null ? "" : index);
  255. return success(list);
  256. }
  257. @ApiModelProperty(value = "历史收货单位")
  258. @PostMapping("/getConsigneeHistory")
  259. public RESTfulResult getConsigneeHistory() {
  260. List<Map<String, Object>> list = universalMapper.getConsigneeHistory();
  261. return success(list);
  262. }
  263. @ApiModelProperty(value = "通过订单ID查询订单下物资信息")
  264. @PostMapping("/getOrderMaterialMesByOrderId/{orderId}")
  265. public RESTfulResult getMaterialMesByOrderId(@PathVariable("orderId") Integer orderId){
  266. List<Map<String, Object>> mes = universalMapper.getOrderMaterialMesByOrderId(new BigDecimal(orderId));
  267. return success(mes);
  268. }
  269. @ApiModelProperty(value = "模糊查询物资")
  270. @ApiImplicitParams({
  271. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  272. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  273. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  274. })
  275. @PostMapping("/queryAPOMaterialByLike")
  276. public RESTfulResult queryAPOMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  277. Integer pageNum,
  278. Integer pageSize,
  279. Integer apiId,
  280. String index,
  281. Integer supplierId) {
  282. if(mapValue == null) {
  283. mapValue = new HashMap<>();
  284. }
  285. if(index != null && !"".equals(index) &&!"null".equals(index)){
  286. mapValue.put("index", index);
  287. }
  288. if(supplierId != null){
  289. mapValue.put("supplierId", supplierId);
  290. }
  291. PageHelper.startPage(pageNum, pageSize);
  292. //分页查询数据
  293. List<Map<String, Object>> columnList = universalMapper.queryAPOMaterialByLike(mapValue);
  294. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  295. return success(data);
  296. }
  297. @ApiModelProperty(value = "模糊查询卸货点")
  298. @ApiImplicitParams({
  299. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  300. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  301. @ApiImplicitParam(name = "apiId", value = "374", required = false, dataType = "BigDecimal")
  302. })
  303. @PostMapping("/getUnloadingMesByLike")
  304. public RESTfulResult getUnloadingMesByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  305. Integer pageNum,
  306. Integer pageSize,
  307. Integer apiId,
  308. Integer type,
  309. String index) {
  310. if(mapValue == null) {
  311. mapValue = new HashMap<>();
  312. }
  313. if(type != null){
  314. mapValue.put("type", type);
  315. }
  316. if(index != null && !"".equals(index) && !"null".equals(index)){
  317. mapValue.put("index", index);
  318. }
  319. PageHelper.startPage(pageNum, pageSize);
  320. //分页查询数据
  321. List<Map<String, Object>> columnList = universalMapper.getUnloadingMesByLike(mapValue);
  322. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  323. return success(data);
  324. }
  325. @ApiModelProperty(value = "模糊查询物资")
  326. @ApiImplicitParams({
  327. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  328. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  329. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  330. })
  331. @PostMapping("/queryMaterialByLike")
  332. public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  333. Integer pageNum,
  334. Integer pageSize,
  335. Integer apiId,
  336. String index) {
  337. if(mapValue == null) {
  338. mapValue = new HashMap<>();
  339. }
  340. if(index != null){
  341. mapValue.put("index", index);
  342. }
  343. PageHelper.startPage(pageNum, pageSize);
  344. //分页查询数据
  345. List<Map<String, Object>> columnList = universalMapper.queryMaterialByLike(mapValue);
  346. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  347. return success(data);
  348. }
  349. @ApiModelProperty(value = "模糊查询批次")
  350. @ApiImplicitParams({
  351. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  352. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  353. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  354. })
  355. @PostMapping("/queryBatchByLike")
  356. public RESTfulResult queryBatchByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  357. Integer pageNum,
  358. Integer pageSize,
  359. Integer apiId,
  360. String index) {
  361. if(mapValue == null) {
  362. mapValue = new HashMap<>();
  363. }
  364. if(index != null){
  365. mapValue.put("index", index);
  366. }
  367. PageHelper.startPage(pageNum, pageSize);
  368. //分页查询数据
  369. List<Map<String, Object>> columnList = universalMapper.getBatchAndOrderMes(mapValue);
  370. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  371. return success(data);
  372. }
  373. @ApiModelProperty(value = "模糊查询批次")
  374. @ApiImplicitParams({
  375. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  376. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  377. @ApiImplicitParam(name = "apiId", value = "502", required = false, dataType = "BigDecimal")
  378. })
  379. @PostMapping("/selectPurchaseOrderForShip")
  380. public RESTfulResult selectPurchaseOrderForShip(@RequestBody(required = false) Map<String,Object> mapValue,
  381. Integer pageNum,
  382. Integer pageSize,
  383. Integer apiId,
  384. String index) {
  385. if(mapValue == null) {
  386. mapValue = new HashMap<>();
  387. }
  388. if(index != null){
  389. mapValue.put("index", index);
  390. }
  391. PageHelper.startPage(pageNum, pageSize);
  392. //分页查询数据
  393. List<Map<String, Object>> columnList = universalMapper.selectPurchaseOrderForShip(mapValue);
  394. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  395. return success(data);
  396. }
  397. @ApiModelProperty(value = "二程船结算用:查询发货通知的已下发批次")
  398. @ApiImplicitParams({
  399. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  400. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  401. @ApiImplicitParam(name = "apiId", value = "502", required = false, dataType = "BigDecimal")
  402. })
  403. @PostMapping("/getBatchOfNotice")
  404. public RESTfulResult getBatchOfNotice(@RequestBody(required = false) Map<String,Object> mapValue,
  405. Integer pageNum,
  406. Integer pageSize,
  407. Integer apiId,
  408. String index) {
  409. if(mapValue == null) {
  410. mapValue = new HashMap<>();
  411. }
  412. if(index != null){
  413. mapValue.put("index", index);
  414. }
  415. PageHelper.startPage(pageNum, pageSize);
  416. //分页查询数据
  417. List<Map<String, Object>> columnList = universalMapper.getBatchOfNotice(mapValue);
  418. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  419. return success(data);
  420. }
  421. @ApiModelProperty(value = "查询存在装船作业并且尚未计算水运费的批次")
  422. @ApiImplicitParams({
  423. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  424. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  425. @ApiImplicitParam(name = "apiId", value = "502", required = false, dataType = "BigDecimal")
  426. })
  427. @PostMapping("/findBatchHavingLoad")
  428. public RESTfulResult findBatchHavingLoad(@RequestBody(required = false) Map<String,Object> mapValue,
  429. Integer pageNum,
  430. Integer pageSize,
  431. Integer apiId,
  432. String index){
  433. if(mapValue == null) {
  434. mapValue = new HashMap<>();
  435. }
  436. if(index != null){
  437. mapValue.put("index", index);
  438. }
  439. PageHelper.startPage(pageNum, pageSize);
  440. //分页查询数据
  441. List<Map<String, Object>> columnList = universalMapper.findBatchHavingLoad(mapValue);
  442. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  443. return success(data);
  444. }
  445. @ApiModelProperty(value = "边输边查承运商")
  446. @PostMapping("/getCarrierMesByLike")
  447. public RESTfulResult getCarrierMesByLike(@RequestParam("index") String index) {
  448. List<Map<String, Object>> list = universalMapper.getCarrierMesByLike(index == null ? "" : index);
  449. return success(list);
  450. }
  451. @ApiModelProperty(value = "模糊查询收货单位")
  452. @ApiImplicitParams({
  453. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  454. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  455. @ApiImplicitParam(name = "apiId", value = "396", required = false, dataType = "BigDecimal")
  456. })
  457. @PostMapping("/queryConsigneeByLike")
  458. public RESTfulResult queryConsigneeByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  459. Integer pageNum,
  460. Integer pageSize,
  461. Integer apiId,
  462. String index) {
  463. if(mapValue == null) {
  464. mapValue = new HashMap<>();
  465. }
  466. if(index != null){
  467. mapValue.put("index", index);
  468. }
  469. PageHelper.startPage(pageNum, pageSize);
  470. //分页查询数据
  471. List<Map<String, Object>> columnList = universalMapper.queryConsigneeByLike(mapValue);
  472. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  473. return success(data);
  474. }
  475. @ApiModelProperty(value = "模糊查询物资信息")
  476. @ApiImplicitParams({
  477. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  478. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  479. @ApiImplicitParam(name = "apiId", value = "395", required = false, dataType = "BigDecimal")
  480. })
  481. @PostMapping("/selectAllMaterialName")
  482. public RESTfulResult selectAllMaterialName(@RequestBody(required = false) Map<String,Object> mapValue,
  483. Integer pageNum,
  484. Integer pageSize,
  485. Integer apiId,
  486. String index) {
  487. if(mapValue == null) {
  488. mapValue = new HashMap<>();
  489. }
  490. if(index != null && !"".equals(index) && !"null".equals(index)){
  491. mapValue.put("index", index);
  492. }
  493. PageHelper.startPage(pageNum, pageSize);
  494. //分页查询数据
  495. List<Map<String, Object>> columnList = universalMapper.selectAllMaterialName(mapValue);
  496. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  497. return success(data);
  498. }
  499. @ApiModelProperty(value = "返回sha1加密字符串")
  500. @RequestMapping(value = "/sha1DigestUtils", method = {RequestMethod.GET,RequestMethod.POST})
  501. public String sha1DigestUtils(String text){
  502. return universalService.sha1DigestUtils(text);
  503. }
  504. @ApiModelProperty(value = "查装货卸货点")
  505. @PostMapping("/selectUnloadingPoint")
  506. public List<Map<String, Object>> selectUnloadingPoint(String index) {
  507. String index1 = null;
  508. if(index != null && !"null".equals(index) && !"".equals(index)){
  509. index1 = "%" + index + "%";
  510. }
  511. return universalMapper.selectUnloadingPoint(index1);
  512. }
  513. @ApiModelProperty(value = "模糊查询承运商")
  514. @ApiImplicitParams({
  515. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  516. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  517. @ApiImplicitParam(name = "apiId", value = "412", required = false, dataType = "BigDecimal")
  518. })
  519. @PostMapping("/getCarrierListByLike")
  520. public RESTfulResult getCarrierListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  521. Integer apiId,
  522. Integer pageNum,
  523. Integer pageSize,
  524. String index) {
  525. if(index != null){
  526. if(index.length() == 0){
  527. index = null;
  528. }else {
  529. index = "%" + index + "%";
  530. }
  531. }
  532. if (mapValue == null) {
  533. mapValue = new HashMap<>();
  534. }
  535. mapValue.put("index",index);
  536. PageHelper.startPage(pageNum, pageSize);
  537. //分页查询数据
  538. List<Map<String, Object>> columnList = universalMapper.getCarrierListByLike(mapValue);
  539. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  540. return success(data);
  541. }
  542. @ApiModelProperty(value = "所有门岗下拉框")
  543. @GetMapping("/getAllGatepost")
  544. public List<Map<String,Object>> getAllGatepost(){
  545. return universalMapper.getAllGatepost();
  546. }
  547. //通过承运商id获取userId
  548. @PostMapping("/getUserIdByCarrierId")
  549. public String getUserIdByCarrierId(@RequestBody Map<String,Object> map){
  550. //获取承运商id
  551. Integer carrierId =(Integer) map.get("carrierId");
  552. return universalMapper.getUserIdbyCarrierId(carrierId);
  553. }
  554. @ApiModelProperty(value = "已经在sso权限模块承运商下拉框")
  555. @GetMapping("/getAllCarrierIdForSso")
  556. public List<Map<String,Object>> getAllCarrierIdForSso(){
  557. return universalMapper.getAllCarrierIdForSso();
  558. }
  559. @ApiModelProperty(value = "模糊查询收货单位")
  560. @ApiImplicitParams({
  561. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  562. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  563. @ApiImplicitParam(name = "apiId", value = "418", required = false, dataType = "BigDecimal")
  564. })
  565. @PostMapping("/getConsigneeListByLike")
  566. public RESTfulResult getConsigneeListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  567. Integer apiId,
  568. Integer pageNum,
  569. Integer pageSize,
  570. String index) {
  571. if(index != null){
  572. if(index.length() == 0){
  573. index = null;
  574. }else {
  575. index = "%" + index + "%";
  576. }
  577. }
  578. if (mapValue == null) {
  579. mapValue = new HashMap<>();
  580. }
  581. mapValue.put("index",index);
  582. PageHelper.startPage(pageNum, pageSize);
  583. //分页查询数据
  584. List<Map<String, Object>> columnList = universalMapper.getConsigneeListByLike(mapValue);
  585. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  586. return success(data);
  587. }
  588. @ApiOperation("通过运输订单id查询销售订单审核状态")
  589. @PostMapping("/getSaleOrderStatus")
  590. public Integer getSaleOrderStatus(@RequestParam Integer orderId) {
  591. Integer saleStatus = universalMapper.getSaleOrderStatus(new BigDecimal(orderId));
  592. return saleStatus;
  593. }
  594. @ApiOperation("查询所有的汽车衡")
  595. @GetMapping("/getAllCalculateMes")
  596. public List<Map<String, Object>> getAllCalculateMes() {
  597. return universalMapper.getAllCalculateMes();
  598. }
  599. @ApiOperation("查询所有的焦炭子类")
  600. @GetMapping("/getAllMaterialCoke")
  601. public List<Map<String, Object>> getAllMaterialCoke() {
  602. return universalMapper.getAllMaterialCoke();
  603. }
  604. @ApiModelProperty(value = "边输边查车牌号")
  605. @PostMapping("/getCapacityByLike")
  606. public RESTfulResult getCapacityByLike(@RequestParam("index") String index) {
  607. List<Map<String, Object>> list = universalMapper.getCapacityByLike(index == null ? "" : index);
  608. return success(list);
  609. }
  610. @ApiModelProperty(value = "边输边查批次")
  611. @GetMapping("/getBatchByLike")
  612. public RESTfulResult getBatchByLike(@RequestParam("index") String index) {
  613. List<Map<String, Object>> list = universalMapper.getBatchByLike(index == null ? "" : index);
  614. return success(list);
  615. }
  616. @ApiModelProperty(value = "根据运力id查询所有承运商(下拉框)")
  617. @GetMapping("/getCarrierByCapacityId")
  618. public RESTfulResult getCarrierByCapacityId(@RequestParam("capacityId") Integer capacityId) {
  619. List<Map<String, Object>> list = universalMapper.getCarrierByCapacityId(new BigDecimal(capacityId));
  620. return success(list);
  621. }
  622. @ApiModelProperty(value = "根据收货客户查询承运商")
  623. @PostMapping("/getCarrierByConsignee")
  624. public RESTfulResult getCarrierByConsignee(@RequestBody Map<String,Object> mapValue) {
  625. Map<String, Object> map = universalService.getCarrierByConsignee(mapValue);
  626. return success(map);
  627. }
  628. @ApiModelProperty(value = "确认车牌号与承运商关系是否存在")
  629. @PostMapping("/isInCapacityCarrier")
  630. public RESTfulResult isInCapacityCarrier(@RequestBody Map<String,Object> mapValue) {
  631. Map<String,Object> map = universalService.isInCapacityCarrier(mapValue);
  632. BigDecimal capacityId = (BigDecimal) map.get("capacityId");
  633. BigDecimal capacityCarrierId = (BigDecimal) map.get("capacityCarrierId");
  634. if (capacityId == null) {
  635. return failed();
  636. }
  637. if (capacityCarrierId == null) {
  638. return failed(capacityId);
  639. }
  640. return success(map);
  641. }
  642. @ApiModelProperty(value = "得到所有油价联动计费公式(apiId:444)")
  643. @PostMapping("/getOilFormula")
  644. public RESTfulResult getOilFormula(@RequestBody(required = false) Map<String,Object> mapValue,
  645. Integer apiId,
  646. Integer pageNum,
  647. Integer pageSize,
  648. String con) {
  649. if (mapValue == null) {
  650. mapValue = new HashMap<>();
  651. }
  652. mapValue.put("con", con);
  653. PageHelper.startPage(pageNum, pageSize);
  654. //分页查询数据
  655. List<Map<String, Object>> columnList = universalMapper.getOilFormula(mapValue);
  656. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  657. return success(data);
  658. }
  659. @ApiModelProperty(value = "获得港口下拉框")
  660. @GetMapping("/getPortId")
  661. public RESTfulResult getPortId() {
  662. return success(universalService.getPortId());
  663. }
  664. @ApiModelProperty(value = "获取车牌号边输边查")
  665. @GetMapping("/getCapacityNumber")
  666. public RESTfulResult getCapacityNumber(String index) {
  667. if(index.length() < 3){
  668. return failed();
  669. }
  670. return success(universalService.getCapacityNumber(index));
  671. }
  672. @ApiModelProperty(value = "获得订单号及订单号下面物资")
  673. @GetMapping("/getOrderNumber")
  674. public RESTfulResult getOrderNumber(String capacityId) {
  675. return success(universalService.getOrderNumber(capacityId));
  676. }
  677. @ApiModelProperty(value = "根据订单查询物资")
  678. @GetMapping("/getMaterialIdByOrderId")
  679. public RESTfulResult getMaterialIdByOrderId(Integer orderId) {
  680. return success(universalService.getMaterialIdByOrderId(orderId));
  681. }
  682. @ApiOperation(value = "修改路段顺序号")
  683. @PostMapping("/updateLineSqe")
  684. public RESTfulResult updateLineSqe(@RequestBody Map<String,Object> map) {
  685. int i = universalMapper.updateLineSqe(map);
  686. return success(i);
  687. }
  688. @ApiModelProperty(value = "边输边查物资")
  689. @GetMapping("/getMaterialByLike")
  690. public RESTfulResult getMaterialByLike(@RequestParam("index") String index) {
  691. List<Map<String, Object>> list = universalMapper.getMaterialByLike(index == null ? "" : index);
  692. return success(list);
  693. }
  694. @ApiOperation(value="通过一个carrierSsoId获得承运商对象")
  695. @GetMapping("/getRmsCarrierByCarrierSsoId")
  696. public RESTfulResult getRmsCarrierByCarrierSsoId(String carrierSsoId){
  697. Map<String,Object> carrier= universalMapper.getRmsCarrierByCarrierSsoId(carrierSsoId);
  698. if (carrier==null){
  699. failed();
  700. }
  701. return success(carrier);
  702. }
  703. @ApiModelProperty(value = "模糊查询钢材物资")
  704. @ApiImplicitParams({
  705. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  706. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  707. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  708. })
  709. @PostMapping("/getSteelMaterial")
  710. public RESTfulResult getSteelMaterial(@RequestBody(required = false) Map<String, Object> mapValue,
  711. Integer pageNum,
  712. Integer pageSize,
  713. Integer apiId,
  714. String materialNameText,
  715. String materialSpecificationText,
  716. String materialModelText) {
  717. if (mapValue == null) {
  718. mapValue = new HashMap<>();
  719. }
  720. if (materialNameText != null && !materialNameText.equals("undefined") && !materialNameText.equals("null") && materialNameText != "" && !"".equals(materialNameText)) {
  721. mapValue.put("materialNameText", materialNameText);
  722. }
  723. if (materialSpecificationText != null && !materialSpecificationText.equals("undefined") && !materialSpecificationText.equals("null") && materialSpecificationText != "" && !"".equals(materialSpecificationText)) {
  724. mapValue.put("materialSpecificationText", materialSpecificationText);
  725. }
  726. PageHelper.startPage(pageNum, pageSize);
  727. //分页查询数据
  728. List<Map<String, Object>> columnList = universalMapper.getSteelMaterial(mapValue);
  729. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  730. return success(data);
  731. }
  732. @ApiOperation(value="得到所有省份")
  733. @PostMapping("/getAllProvince")
  734. public RESTfulResult getAllProvince(){
  735. List<Map<String,Object>> provinceList = universalMapper.getAllProvince();
  736. return success(provinceList);
  737. }
  738. @ApiOperation(value="根据省份得到下面的地级市")
  739. @PostMapping("/getDistrictByProvince")
  740. public RESTfulResult getDistrictByProvince(@RequestParam String addressProvince){
  741. List<Map<String,Object>> districtList = universalMapper.getDistrictByProvince(addressProvince);
  742. return success(districtList);
  743. }
  744. @ApiOperation(value="根据地级市得到下面的区/县")
  745. @PostMapping("/getTownByDistrict")
  746. public RESTfulResult getTownByDistrict(@RequestParam String addressDistrict){
  747. List<Map<String,Object>> townList = universalMapper.getTownByDistrict(addressDistrict);
  748. return success(townList);
  749. }
  750. @ApiOperation(value="根据省市县得到下面的详细地址")
  751. @PostMapping("/getPlaceByAllAddress")
  752. public RESTfulResult getPlaceByAllAddress(@RequestBody Map<String,Object> mapValue){
  753. List<Map<String,Object>> townList = universalMapper.getPlaceByAllAddress(mapValue);
  754. return success(townList);
  755. }
  756. @ApiOperation(value="获得销售员下拉框")
  757. @GetMapping("/getSalerList")
  758. public RESTfulResult getSalerList(){
  759. List<Map<String,Object>> salerList= universalMapper.getSalerList();
  760. return success(salerList);
  761. }
  762. @ApiOperation(value="通过收货客户匹配销售组")
  763. @PostMapping("/getSaleArea")
  764. public RESTfulResult getSaleArea(@RequestParam Integer receiveId) {
  765. String saleArea = universalMapper.getSaleArea(new BigDecimal(receiveId));
  766. return success(saleArea);
  767. }
  768. @ApiOperation(value = "质保书前端展示")
  769. @PostMapping("/getWarranty")
  770. public RESTfulResult getWarranty(@RequestParam("orderNumber") String orderNumber) {
  771. //List<String> list = universalService.getWarrantyAndPrint(orderNumber);
  772. List<String> list= universalService.getWarranty(orderNumber);
  773. if(list.get(0).equals("-1")){
  774. return failed(-1,"质保书正在紧张制作中,请耐心等待!");
  775. }else if(list.get(0).equals("-2")){
  776. return failed(-2,"该车还未装货");
  777. }
  778. return success(list);
  779. }
  780. @ApiOperation(value = "查询待分解计划数量")
  781. @PostMapping("/getPlanCount")
  782. public Integer getPlanCount(){
  783. return universalMapper.getPlanCount();
  784. }
  785. @ApiOperation(value = "查询承运起止地点下拉框")
  786. @GetMapping("/getTransRange")
  787. public RESTfulResult getTransRange(){
  788. return success(universalMapper.getTransRange());
  789. }
  790. // //测试质保书回显
  791. // @PostMapping("/getTest")
  792. // public RESTfulResult getTest(@RequestBody Map<String,Object> map){
  793. // List<String> list = universalService.getTest(map);
  794. // if(list.get(0).equals("0")){
  795. // return failed("质保书正在紧张制作中,请耐心等待!");
  796. // }
  797. // return success(list);
  798. // }
  799. @ApiOperation(value = "收货地址下匹配不到任何承运商")
  800. @GetMapping("/getNoListCarrier")
  801. public RESTfulResult getNoListCarrier() {
  802. return success(universalMapper.getNoListCarrier());
  803. }
  804. @ApiOperation(value = "查询承运起止地点下拉框")
  805. @GetMapping("/getNotReceiveOrderQuantity")
  806. public Integer getNotReceiveOrderQuantity(@RequestParam("capacityNumber") String capacityNumber){
  807. return universalMapper.getNotReceiveOrderQuantity(capacityNumber);
  808. }
  809. @ApiOperation(value = "西南水泥独用下拉框")
  810. @GetMapping("/getXiNanCarrier")
  811. public RESTfulResult getXiNanCarrier() {
  812. return success(universalMapper.getXiNanCarrier());
  813. }
  814. @ApiModelProperty(value = "边输边查发站到站")
  815. @GetMapping("/getArrivalByLike")
  816. public RESTfulResult getArrivalByLike(@RequestParam("index") String index){
  817. List <Map<String,Object>> list = universalMapper.getArrivalByLike(index == null ? "" : index);
  818. return success(list);
  819. }
  820. @ApiModelProperty(value = "司机APP订单小红点")
  821. @GetMapping("/getOrderNum")
  822. public int getOrderNum(@RequestParam("capacityNumber") String capacityNumber){
  823. return universalMapper.getOrderNum(capacityNumber);
  824. }
  825. @ApiModelProperty(value = "补录计量实绩")
  826. @PostMapping("/recordingWeightResult")
  827. public int recordingWeightResult(@RequestBody(required = false)List<Map<String,Object>>mapList){
  828. try {
  829. return universalService.recordingWeightResult(mapList);
  830. } catch (IOException e) {
  831. e.printStackTrace();
  832. }
  833. return 1;
  834. }
  835. @ApiOperation("删除计量实绩")
  836. @PostMapping("/linkageDeleteTransportOrder")
  837. public int linkageDeleteTransportOrder(@RequestBody(required = false)List<Map<String,Object>>mapList){
  838. try {
  839. return universalService.linkageDeleteTransportOrder(mapList);
  840. } catch (IOException e) {
  841. e.printStackTrace();
  842. }
  843. return 1;
  844. }
  845. @ApiOperation("删除计量实绩")
  846. @PostMapping("/linkageDeleteTransportOrder1")
  847. public int linkageDeleteTransportOrder1(
  848. @RequestBody(required = false)Map<String,Object> map){
  849. try {
  850. if( map != null) {
  851. List<Map<String,Object>> list = new ArrayList<>();
  852. list.add(map);
  853. return universalService.linkageDeleteTransportOrder(list);
  854. }
  855. //return universalService.linkageDeleteTransportOrder(mapList);
  856. } catch (IOException e) {
  857. e.printStackTrace();
  858. }
  859. return 1;
  860. }
  861. @ApiModelProperty(value = "获取仓库月台")
  862. @GetMapping("/getSteelWarehouse")
  863. public List<Map<String, Object>> getSteelWarehouse(){
  864. return universalMapper.getSteelWarehouse();
  865. }
  866. @ApiOperation(value = "查询运力联系方式")
  867. @GetMapping("/getCapacityTel")
  868. public Map<String,Object>getCapacityTel(BigDecimal capacityId){
  869. return universalMapper.getCapacityTel(capacityId);
  870. }
  871. @ApiModelProperty(value = "边输边查收货客户")
  872. @PostMapping("/getConsigneeMesByLike")
  873. public RESTfulResult getConsigneeMesByLike(@RequestParam("index") String index) {
  874. List<Map<String, Object>> list = universalMapper.getConsigneeMesByLike(index == null ? "" : index);
  875. return success(list);
  876. }
  877. //根据收货客户userId,查询收货客户信息
  878. @ApiOperation(value = "根据userId查询收货客户信息")
  879. @GetMapping("/getConsigneeByuserid")
  880. public Map<String,Object>getConsigneeByuserid(String userId){
  881. return universalMapper.getConsigneeByuserid(userId);
  882. }
  883. //根据销售订单ID修改销售订单状态为上报
  884. @PostMapping("/updateSaleOrderStatusById")
  885. @ApiOperation(value = "根据销售订单id修改状态为未上报")
  886. public RESTfulResult updateSaleOrderStatusById(BigDecimal saleOrderId){
  887. return success(universalMapper.updateSaleOrderStatusById(saleOrderId));
  888. }
  889. //根据销售订单ID修改销售订单状态为上报
  890. @PostMapping("/updateDriverTel")
  891. @ApiOperation(value = "修改司机电话号码")
  892. public RESTfulResult updateDriverTel(@RequestBody Map<String,Object> map){
  893. try {
  894. int orderId = (int) map.get("orderId");
  895. String driverTel = (String) map.get("driverTel");
  896. //根据运输id去查找出运力ID更新司机电话
  897. universalMapper.updateCapacityDriverTel(orderId,driverTel);
  898. }catch (Exception e){
  899. e.printStackTrace();
  900. }
  901. return success(universalMapper.updateDriverTel(map));
  902. }
  903. @GetMapping("/getQueueCount")
  904. public RESTfulResult getQueueCount(){
  905. return success(universalMapper.getQueueCount());
  906. }
  907. @ApiModelProperty(value = "下拉下单客户的历史使用过的地址")
  908. @PostMapping("/getReceiverAllPlaceUsed")
  909. public RESTfulResult getReceiverAllPlaceUsed(@RequestParam Integer receiveId) {
  910. List<Map<String, Object>> list = universalMapper.getReceiverAllPlaceUsed(receiveId);
  911. return success(list);
  912. }
  913. @ApiModelProperty(value = "边输边查片区")
  914. @PostMapping("/getSaleAreaByLike")
  915. public RESTfulResult getSaleAreaByLike(@RequestParam("index") String index) {
  916. List<Map<String, Object>> list = universalMapper.getSaleAreaByLike(index == null ? "" : "%" + index + "%");
  917. return success(list);
  918. }
  919. @ApiModelProperty(value = "判断收货客户是否绑定片区")
  920. @PostMapping("/isReceiveHaveArea")
  921. public RESTfulResult isReceiveHaveArea(@RequestParam Integer receiveId) {
  922. BigDecimal areaId = universalMapper.isReceiveHaveArea(receiveId);
  923. if (areaId == null) {
  924. return failed("该下单客户未绑定销售片区!!!");
  925. }
  926. return success(areaId);
  927. }
  928. @ApiModelProperty(value = "下单客户绑定片区")
  929. @PostMapping("/bandSaleArea")
  930. public RESTfulResult bandSaleArea(@RequestBody Map<String,Object> map) {
  931. int result = universalMapper.bandSaleArea(map);
  932. return success(result);
  933. }
  934. @ApiOperation(value = "查询厂内钢材车辆作业总数")
  935. @GetMapping("/getSteelOrderNum")
  936. public RESTfulResult getSteelOrderNum(){
  937. int i = universalMapper.getSteelOrderNum();
  938. return success(i);
  939. }
  940. @ApiModelProperty(value = "边输边查收货地址")
  941. @PostMapping("/getPlaceAndAddress")
  942. public RESTfulResult getPlaceAndAddress(@RequestParam("index") String index) {
  943. List<Map<String, Object>> list = universalMapper.getPlaceAndAddress(index == null ? "" : index);
  944. return success(list);
  945. }
  946. @ApiModelProperty(value = "边输边查物资名称")
  947. @PostMapping("/getMaterialNameLike")
  948. public RESTfulResult getMaterialNameLike(@RequestParam("index") String index) {
  949. List<Map<String, Object>> list = universalMapper.getMaterialNameLike(index == null ? null : "%" + index + "%");
  950. return success(list);
  951. }
  952. @ApiModelProperty(value = "边输边查仓库")
  953. @GetMapping("/getWareHouseNameLike")
  954. public RESTfulResult getWareHouseNameLike(@RequestParam("index") String index){
  955. List<Map<String, Object>> list = universalMapper.getWareHouseNameLike(index == null ? null : "%" + index + "%");
  956. return success(list);
  957. }
  958. @ApiModelProperty(value = "边输边查物资规格型号")
  959. @PostMapping("/getSpecificationModelLike")
  960. public RESTfulResult getSpecificationModelLike(@RequestBody Map<String,Object> map) {
  961. List<Map<String, Object>> list = universalMapper.getSpecificationModelLike(map);
  962. return success(list);
  963. }
  964. @ApiOperation(value = "内转计重承运合同物资")
  965. @PostMapping("/getInwardWeightMaterial")
  966. public RESTfulResult getInwardWeightMaterial(@RequestBody(required = false) Map<String,Object> mapValue,
  967. Integer pageNum,
  968. Integer pageSize,
  969. Integer apiId,
  970. String index) {
  971. if(mapValue == null) {
  972. mapValue = new HashMap<>();
  973. }
  974. if(index != null){
  975. mapValue.put("index", index);
  976. }
  977. PageHelper.startPage(pageNum, pageSize);
  978. //分页查询数据
  979. List<Map<String, Object>> columnList = universalMapper.getInwardWeightMaterial(mapValue);
  980. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  981. return success(data);
  982. }
  983. @ApiOperation(value = "内转异地库查询发站")
  984. @GetMapping("/getInwardSendStation")
  985. public RESTfulResult getInwardSendStation(){
  986. return success(universalMapper.getInwardSendStation());
  987. }
  988. @ApiOperation(value = "获取入库实绩")
  989. @PostMapping("/getInwardInboundResult")
  990. public RESTfulResult getInwardInboundResult(@RequestBody Map<String,Object> map){
  991. List<Map<String,Object>> mapList = universalMapper.getInwardInboundResult(map);
  992. //遍历数组去查物资数据
  993. for(Map<String,Object>map1:mapList){
  994. BigDecimal orderId = DataChange.dataToBigDecimal(map1.get("orderId"));
  995. List<Map<String,Object>> materialList = universalMapper.getMaterialList(map1);
  996. for (Map<String,Object>materialMap:materialList){
  997. BigDecimal materialId = DataChange.dataToBigDecimal(materialMap.get("materialId"));
  998. //根据运输订单ID和物资ID去查询炉号
  999. List<Map<String, Object>> luHaoNumberList = universalMapper.getLuhaoNum(orderId,materialId);
  1000. StringBuilder sb = new StringBuilder();
  1001. for (Map<String, Object> luHaoMap : luHaoNumberList) {
  1002. sb.append(luHaoMap.get("materialFurnaceNumber"));
  1003. sb.append("-");
  1004. sb.append(luHaoMap.get("materialNum"));
  1005. sb.append("/");
  1006. }
  1007. if(luHaoNumberList.size() > 0){
  1008. sb.deleteCharAt(sb.length() - 1);
  1009. materialMap.put("luhao",sb.toString());
  1010. }
  1011. }
  1012. map1.put("materialList",materialList);
  1013. }
  1014. return success(mapList);
  1015. }
  1016. @ApiOperation(value = "查询派车状态")
  1017. @PostMapping("/getDispachSwitch")
  1018. public RESTfulResult getDispachSwitch(){
  1019. return success(universalMapper.getDispachSwitch());
  1020. }
  1021. @ApiOperation(value = "修改派车开关")
  1022. @PostMapping("/updateDispachSwitch")
  1023. public RESTfulResult updateDispachSwitch(@RequestBody Map<String,Object> map){
  1024. return success(universalMapper.updateDispachSwitch(map));
  1025. }
  1026. @ApiOperation("动态调整放行限制")
  1027. @GetMapping("/getReleaseFlag")
  1028. public String getReleaseFlag() {
  1029. return universalMapper.getReleaseFlag();
  1030. }
  1031. @ApiOperation("根据名称查询收货客户")
  1032. @PostMapping("/getConsigneeInfo")
  1033. public Map<String,Object> getConsigneeInfo(String consigneeName){
  1034. return universalMapper.getConsigneeInfo(consigneeName);
  1035. }
  1036. @ApiOperation("收货客户查询")
  1037. @PostMapping("/getColumnNoRoutList")
  1038. public List<String> getColumnNoRoutList(@RequestBody(required = false) Map<String,Object> map) {
  1039. return universalMapper.getColumnNoRoutList(map);
  1040. }
  1041. @ApiOperation("获取图片通用方法")
  1042. @PostMapping("/getPicture")
  1043. public List<String> getPicture(@RequestBody(required = false) Map<String,Object> map) throws Exception {
  1044. List<String> results=new ArrayList<>();
  1045. String urls = map.get("urls").toString();
  1046. String files[]=urls.split(";");
  1047. for(int i=0;i<files.length && files[i].length()>5;i++){
  1048. results.add((String)imageFileUtils.downloadFile(files[i]));
  1049. }
  1050. return results;
  1051. }
  1052. @ApiOperation("销售钢材报表通用提交按钮")
  1053. @PostMapping("submitSteel")
  1054. public Map<String,Object> submitSteel(@RequestBody(required = false) Map<String,Object> map) {
  1055. Map<String,Object> responseMap = universalService.submitSteel(map);
  1056. return responseMap;
  1057. }
  1058. }