UniversalController.java 46 KB

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