UniversalController.java 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  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.PageListAdd;
  7. import com.steerinfo.framework.controller.RESTfulResult;
  8. import com.steerinfo.framework.service.pagehelper.PageHelper;
  9. import io.swagger.annotations.ApiImplicitParam;
  10. import io.swagger.annotations.ApiImplicitParams;
  11. import io.swagger.annotations.ApiModelProperty;
  12. import io.swagger.annotations.ApiOperation;
  13. import io.swagger.models.auth.In;
  14. import org.apache.ibatis.annotations.Param;
  15. import org.springframework.beans.factory.annotation.Autowired;
  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.math.BigDecimal;
  22. import java.util.HashMap;
  23. import java.util.List;
  24. import java.util.Map;
  25. /**
  26. * @ author :TXF
  27. * @ time :2021/10/19 18:06
  28. * 通用接口
  29. */
  30. @RequestMapping("${api.version}/uc")
  31. @RestController
  32. public class UniversalController extends BaseRESTfulController {
  33. @Autowired
  34. UniversalServiceImpl universalService;
  35. @Autowired
  36. UniversalMapper universalMapper;
  37. @Autowired
  38. ColumnDataUtil columnDataUtil;
  39. @ApiOperation(value="查询数据打印提货单接口")
  40. @ApiImplicitParams({
  41. @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
  42. })
  43. @PostMapping("/printTHD")
  44. public RESTfulResult printTiHuoDan(@RequestBody(required=false) Map<String, Object> mapValue){
  45. Map<String, Object> tiHuoDan = universalService.printTiHuoDan((String) mapValue.get("orderNumber"));
  46. return success(tiHuoDan);
  47. }
  48. @ApiModelProperty(value = "模糊查询发货单位")
  49. @ApiImplicitParams({
  50. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  51. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  52. @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
  53. })
  54. @PostMapping("/querySupplierByLike")
  55. public RESTfulResult querySupplierByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  56. Integer pageNum,
  57. Integer pageSize,
  58. Integer apiId,
  59. String index) {
  60. if(mapValue == null) {
  61. mapValue = new HashMap<>();
  62. }
  63. if(index != null){
  64. mapValue.put("index","%" + index + "%");
  65. }
  66. PageHelper.startPage(pageNum, pageSize);
  67. //分页查询数据
  68. List<Map<String, Object>> columnList = universalMapper.querySupplierByLike(mapValue);
  69. PageListAdd data = columnDataUtil.tableColumnData(apiId,columnList);
  70. return success(data);
  71. }
  72. @ApiModelProperty(value = "查询所有发货单位")
  73. @ApiImplicitParams({
  74. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  75. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  76. @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
  77. })
  78. @PostMapping("/queryAllSupplierByLike")
  79. public RESTfulResult queryAllSupplierByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  80. Integer pageNum,
  81. Integer pageSize,
  82. Integer apiId,
  83. String index) {
  84. if(mapValue == null) {
  85. mapValue = new HashMap<>();
  86. }
  87. if(index != null){
  88. mapValue.put("index","%" + index + "%");
  89. }
  90. PageHelper.startPage(pageNum, pageSize);
  91. //分页查询数据
  92. List<Map<String, Object>> columnList = universalMapper.queryAllSupplierByLike(mapValue);
  93. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  94. return success(data);
  95. }
  96. @ApiModelProperty(value = "通过物资ID查询该物资的发货单位信息")
  97. @ApiImplicitParams({
  98. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  99. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  100. @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
  101. })
  102. @PostMapping("/getSupplierMesByMaterialId")
  103. public RESTfulResult getSupplierMesByMaterialId(@RequestBody(required = false) Map<String,Object> mapValue,
  104. Integer pageNum,
  105. Integer pageSize,
  106. Integer apiId,
  107. String index, String materialId) {
  108. if(mapValue == null)
  109. mapValue = new HashMap<>();
  110. if(!"null".equals(materialId))
  111. mapValue.put("materialId",materialId);
  112. if(index != null){
  113. mapValue.put("index","%" + index + "%");
  114. }
  115. PageHelper.startPage(pageNum, pageSize);
  116. //分页查询数据
  117. List<Map<String, Object>> columnList = universalMapper.getSupplierMesByMaterialId(mapValue);
  118. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  119. return success(data);
  120. }
  121. @ApiOperation(value="查询所有运力信息")
  122. @ApiImplicitParams({
  123. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  124. @ApiImplicitParam(name = "apiId(248)", value = "动态表头", required = false, dataType = "Integer"),
  125. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  126. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  127. })
  128. @PostMapping("/getAllCapacityByCarrierLike")
  129. public RESTfulResult getAllCapacityByCarrierLike(@RequestBody(required=false) Map<String,Object> mapValue,
  130. Integer apiId,
  131. Integer pageNum,
  132. Integer pageSize,
  133. String carrierSsoId,
  134. String index,
  135. String con
  136. ){
  137. if(mapValue == null){
  138. mapValue = new HashMap<>();
  139. }
  140. if(index != null){
  141. mapValue.put("index", index);
  142. }
  143. if (con != null&& !con.equals("undefined")){
  144. mapValue.put("con",con);
  145. }
  146. if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
  147. carrierSsoId = null;
  148. }
  149. if (carrierSsoId != null) {
  150. BigDecimal carrierId = universalMapper.getCarrierIdBySSO(carrierSsoId);
  151. mapValue.put("carrierId",carrierId);
  152. }
  153. //不分页筛选数据
  154. PageHelper.startPage(pageNum,pageSize);
  155. //分页数据
  156. List<Map<String, Object>> capacity = universalMapper.getAllCapacityByCarrierLike(mapValue);
  157. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  158. return success(pageList);
  159. }
  160. @ApiOperation(value="通过订单ID查询订单下所有物资")
  161. @ApiImplicitParams({
  162. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  163. @ApiImplicitParam(name = "apiId(395)", value = "动态表头", required = false, dataType = "Integer"),
  164. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  165. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  166. })
  167. @PostMapping("/getMaterialMesByOrderId")
  168. public RESTfulResult getMaterialMesByOrderId(@RequestBody(required=false) Map<String,Object> mapValue,
  169. Integer apiId,
  170. Integer pageNum,
  171. Integer pageSize,
  172. String orderId
  173. ){
  174. if(mapValue == null){
  175. mapValue = new HashMap<>();
  176. }
  177. if(orderId != null){
  178. mapValue.put("orderId", orderId);
  179. }
  180. //不分页筛选数据
  181. PageHelper.startPage(pageNum,pageSize);
  182. //分页数据
  183. List<Map<String, Object>> capacity = universalMapper.getMaterialMesByOrderId(mapValue);
  184. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  185. return success(pageList);
  186. }
  187. @ApiModelProperty(value = "边输边查发货单位")
  188. @PostMapping("/getSupplierMesByLike")
  189. public RESTfulResult getSupplierMesByLike(@RequestParam("index") String index) {
  190. List<Map<String, Object>> list = universalMapper.getSupplierMesByLike(index == null ? "" : index);
  191. return success(list);
  192. }
  193. @ApiModelProperty(value = "边输边查用车单位")
  194. @PostMapping("/getRequireUnitName")
  195. public RESTfulResult getRequireUnitName(@RequestParam("index") String index) {
  196. List<Map<String,Object>>list = universalMapper.getRequireUnitName(index == null ? "" : "%" + index + "%");
  197. return success(list);
  198. }
  199. @ApiModelProperty(value = "边输边查收货单位")
  200. @PostMapping("/getConsigneeByLike")
  201. public RESTfulResult getConsigneeByLike(@RequestParam("index") String index) {
  202. List<Map<String, Object>> list = universalMapper.getConsigneeByLike(index == null ? "" : index);
  203. return success(list);
  204. }
  205. @ApiModelProperty(value = "通过订单ID查询订单下物资信息")
  206. @PostMapping("/getOrderMaterialMesByOrderId/{orderId}")
  207. public RESTfulResult getMaterialMesByOrderId(@PathVariable("orderId") Integer orderId){
  208. List<Map<String, Object>> mes = universalMapper.getOrderMaterialMesByOrderId(new BigDecimal(orderId));
  209. return success(mes);
  210. }
  211. @ApiModelProperty(value = "模糊查询物资")
  212. @ApiImplicitParams({
  213. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  214. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  215. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  216. })
  217. @PostMapping("/queryAPOMaterialByLike")
  218. public RESTfulResult queryAPOMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  219. Integer pageNum,
  220. Integer pageSize,
  221. Integer apiId,
  222. String index,
  223. Integer supplierId) {
  224. if(mapValue == null) {
  225. mapValue = new HashMap<>();
  226. }
  227. if(index != null && !"".equals(index) &&!"null".equals(index)){
  228. mapValue.put("index", index);
  229. }
  230. if(supplierId != null){
  231. mapValue.put("supplierId", supplierId);
  232. }
  233. PageHelper.startPage(pageNum, pageSize);
  234. //分页查询数据
  235. List<Map<String, Object>> columnList = universalMapper.queryAPOMaterialByLike(mapValue);
  236. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  237. return success(data);
  238. }
  239. @ApiModelProperty(value = "模糊查询卸货点")
  240. @ApiImplicitParams({
  241. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  242. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  243. @ApiImplicitParam(name = "apiId", value = "374", required = false, dataType = "BigDecimal")
  244. })
  245. @PostMapping("/getUnloadingMesByLike")
  246. public RESTfulResult getUnloadingMesByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  247. Integer pageNum,
  248. Integer pageSize,
  249. Integer apiId,
  250. Integer type,
  251. String index) {
  252. if(mapValue == null) {
  253. mapValue = new HashMap<>();
  254. }
  255. if(type != null){
  256. mapValue.put("type", type);
  257. }
  258. if(index != null){
  259. mapValue.put("index", index);
  260. }
  261. PageHelper.startPage(pageNum, pageSize);
  262. //分页查询数据
  263. List<Map<String, Object>> columnList = universalMapper.getUnloadingMesByLike(mapValue);
  264. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  265. return success(data);
  266. }
  267. @ApiModelProperty(value = "模糊查询物资")
  268. @ApiImplicitParams({
  269. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  270. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  271. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  272. })
  273. @PostMapping("/queryMaterialByLike")
  274. public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  275. Integer pageNum,
  276. Integer pageSize,
  277. Integer apiId,
  278. String index) {
  279. if(mapValue == null) {
  280. mapValue = new HashMap<>();
  281. }
  282. if(index != null){
  283. mapValue.put("index", index);
  284. }
  285. PageHelper.startPage(pageNum, pageSize);
  286. //分页查询数据
  287. List<Map<String, Object>> columnList = universalMapper.queryMaterialByLike(mapValue);
  288. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  289. return success(data);
  290. }
  291. @ApiModelProperty(value = "模糊查询批次")
  292. @ApiImplicitParams({
  293. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  294. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  295. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  296. })
  297. @PostMapping("/queryBatchByLike")
  298. public RESTfulResult queryBatchByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  299. Integer pageNum,
  300. Integer pageSize,
  301. Integer apiId,
  302. String index) {
  303. if(mapValue == null) {
  304. mapValue = new HashMap<>();
  305. }
  306. if(index != null){
  307. mapValue.put("index", index);
  308. }
  309. PageHelper.startPage(pageNum, pageSize);
  310. //分页查询数据
  311. List<Map<String, Object>> columnList = universalMapper.getBatchAndOrderMes(mapValue);
  312. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  313. return success(data);
  314. }
  315. @ApiModelProperty(value = "边输边查承运商")
  316. @PostMapping("/getCarrierMesByLike")
  317. public RESTfulResult getCarrierMesByLike(@RequestParam("index") String index) {
  318. List<Map<String, Object>> list = universalMapper.getCarrierMesByLike(index == null ? "" : index);
  319. return success(list);
  320. }
  321. @ApiModelProperty(value = "模糊查询收货单位")
  322. @ApiImplicitParams({
  323. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  324. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  325. @ApiImplicitParam(name = "apiId", value = "396", required = false, dataType = "BigDecimal")
  326. })
  327. @PostMapping("/queryConsigneeByLike")
  328. public RESTfulResult queryConsigneeByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  329. Integer pageNum,
  330. Integer pageSize,
  331. Integer apiId,
  332. String index) {
  333. if(mapValue == null) {
  334. mapValue = new HashMap<>();
  335. }
  336. if(index != null){
  337. mapValue.put("index", index);
  338. }
  339. PageHelper.startPage(pageNum, pageSize);
  340. //分页查询数据
  341. List<Map<String, Object>> columnList = universalMapper.queryConsigneeByLike(mapValue);
  342. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  343. return success(data);
  344. }
  345. @ApiModelProperty(value = "模糊查询物资信息")
  346. @ApiImplicitParams({
  347. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  348. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  349. @ApiImplicitParam(name = "apiId", value = "395", required = false, dataType = "BigDecimal")
  350. })
  351. @PostMapping("/selectAllMaterialName")
  352. public RESTfulResult selectAllMaterialName(@RequestBody(required = false) Map<String,Object> mapValue,
  353. Integer pageNum,
  354. Integer pageSize,
  355. Integer apiId,
  356. String index) {
  357. if(mapValue == null) {
  358. mapValue = new HashMap<>();
  359. }
  360. if(index != null){
  361. mapValue.put("index", index);
  362. }
  363. PageHelper.startPage(pageNum, pageSize);
  364. //分页查询数据
  365. List<Map<String, Object>> columnList = universalMapper.selectAllMaterialName(mapValue);
  366. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  367. return success(data);
  368. }
  369. @ApiModelProperty(value = "返回sha1加密字符串")
  370. @RequestMapping(value = "/sha1DigestUtils", method = {RequestMethod.GET,RequestMethod.POST})
  371. public String sha1DigestUtils(String text){
  372. return universalService.sha1DigestUtils(text);
  373. }
  374. @ApiModelProperty(value = "查装货卸货点")
  375. @PostMapping("/selectUnloadingPoint")
  376. public List<Map<String, Object>> selectUnloadingPoint() {
  377. return universalMapper.selectUnloadingPoint();
  378. }
  379. @ApiModelProperty(value = "模糊查询承运商")
  380. @ApiImplicitParams({
  381. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  382. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  383. @ApiImplicitParam(name = "apiId", value = "412", required = false, dataType = "BigDecimal")
  384. })
  385. @PostMapping("/getCarrierListByLike")
  386. public RESTfulResult getCarrierListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  387. Integer apiId,
  388. Integer pageNum,
  389. Integer pageSize,
  390. String index) {
  391. if(index != null){
  392. if(index.length() == 0){
  393. index = null;
  394. }else {
  395. index = "%" + index + "%";
  396. }
  397. }
  398. if (mapValue == null) {
  399. mapValue = new HashMap<>();
  400. }
  401. mapValue.put("index",index);
  402. PageHelper.startPage(pageNum, pageSize);
  403. //分页查询数据
  404. List<Map<String, Object>> columnList = universalMapper.getCarrierListByLike(mapValue);
  405. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  406. return success(data);
  407. }
  408. @ApiModelProperty(value = "所有门岗下拉框")
  409. @GetMapping("/getAllGatepost")
  410. public List<Map<String,Object>> getAllGatepost(){
  411. return universalMapper.getAllGatepost();
  412. }
  413. //通过承运商id获取userId
  414. @PostMapping("/getUserIdByCarrierId")
  415. public String getUserIdByCarrierId(@RequestBody Map<String,Object> map){
  416. //获取承运商id
  417. Integer carrierId =(Integer) map.get("carrierId");
  418. return universalMapper.getUserIdbyCarrierId(carrierId);
  419. }
  420. @ApiModelProperty(value = "已经在sso权限模块承运商下拉框")
  421. @GetMapping("/getAllCarrierIdForSso")
  422. public List<Map<String,Object>> getAllCarrierIdForSso(){
  423. return universalMapper.getAllCarrierIdForSso();
  424. }
  425. @ApiModelProperty(value = "模糊查询收货单位")
  426. @ApiImplicitParams({
  427. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  428. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  429. @ApiImplicitParam(name = "apiId", value = "418", required = false, dataType = "BigDecimal")
  430. })
  431. @PostMapping("/getConsigneeListByLike")
  432. public RESTfulResult getConsigneeListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  433. Integer apiId,
  434. Integer pageNum,
  435. Integer pageSize,
  436. String index) {
  437. if(index != null){
  438. if(index.length() == 0){
  439. index = null;
  440. }else {
  441. index = "%" + index + "%";
  442. }
  443. }
  444. if (mapValue == null) {
  445. mapValue = new HashMap<>();
  446. }
  447. mapValue.put("index",index);
  448. PageHelper.startPage(pageNum, pageSize);
  449. //分页查询数据
  450. List<Map<String, Object>> columnList = universalMapper.getConsigneeListByLike(mapValue);
  451. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  452. return success(data);
  453. }
  454. @ApiOperation("通过运输订单id查询销售订单审核状态")
  455. @PostMapping("/getSaleOrderStatus")
  456. public Integer getSaleOrderStatus(@RequestParam Integer orderId) {
  457. Integer saleStatus = universalMapper.getSaleOrderStatus(new BigDecimal(orderId));
  458. return saleStatus;
  459. }
  460. @ApiOperation("查询所有的汽车衡")
  461. @GetMapping("/getAllCalculateMes")
  462. public List<Map<String, Object>> getAllCalculateMes() {
  463. return universalMapper.getAllCalculateMes();
  464. }
  465. @ApiOperation("查询所有的焦炭子类")
  466. @GetMapping("/getAllMaterialCoke")
  467. public List<Map<String, Object>> getAllMaterialCoke() {
  468. return universalMapper.getAllMaterialCoke();
  469. }
  470. @ApiModelProperty(value = "边输边查车牌号")
  471. @PostMapping("/getCapacityByLike")
  472. public RESTfulResult getCapacityByLike(@RequestParam("index") String index) {
  473. List<Map<String, Object>> list = universalMapper.getCapacityByLike(index == null ? "" : index);
  474. return success(list);
  475. }
  476. @ApiModelProperty(value = "边输边查批次")
  477. @GetMapping("/getBatchByLike")
  478. public RESTfulResult getBatchByLike(@RequestParam("index") String index) {
  479. List<Map<String, Object>> list = universalMapper.getBatchByLike(index == null ? "" : index);
  480. return success(list);
  481. }
  482. @ApiModelProperty(value = "根据运力id查询所有承运商(下拉框)")
  483. @GetMapping("/getCarrierByCapacityId")
  484. public RESTfulResult getCarrierByCapacityId(@RequestParam("capacityId") Integer capacityId) {
  485. List<Map<String, Object>> list = universalMapper.getCarrierByCapacityId(new BigDecimal(capacityId));
  486. return success(list);
  487. }
  488. @ApiModelProperty(value = "根据收货客户查询承运商")
  489. @PostMapping("/getCarrierByConsignee")
  490. public RESTfulResult getCarrierByConsignee(@RequestBody Map<String,Object> mapValue) {
  491. Map<String, Object> map = universalService.getCarrierByConsignee(mapValue);
  492. return success(map);
  493. }
  494. @ApiModelProperty(value = "确认车牌号与承运商关系是否存在")
  495. @PostMapping("/isInCapacityCarrier")
  496. public RESTfulResult isInCapacityCarrier(@RequestBody Map<String,Object> mapValue) {
  497. Map<String,Object> map = universalService.isInCapacityCarrier(mapValue);
  498. BigDecimal capacityId = (BigDecimal) map.get("capacityId");
  499. BigDecimal capacityCarrierId = (BigDecimal) map.get("capacityCarrierId");
  500. if (capacityId == null) {
  501. return failed();
  502. }
  503. if (capacityCarrierId == null) {
  504. return failed(capacityId);
  505. }
  506. return success(map);
  507. }
  508. @ApiModelProperty(value = "得到所有油价联动计费公式(apiId:444)")
  509. @PostMapping("/getOilFormula")
  510. public RESTfulResult getOilFormula(@RequestBody(required = false) Map<String,Object> mapValue,
  511. Integer apiId,
  512. Integer pageNum,
  513. Integer pageSize) {
  514. if (mapValue == null) {
  515. mapValue = new HashMap<>();
  516. }
  517. mapValue.put("con", "%执行运价公式");
  518. PageHelper.startPage(pageNum, pageSize);
  519. //分页查询数据
  520. List<Map<String, Object>> columnList = universalMapper.getOilFormula(mapValue);
  521. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  522. return success(data);
  523. }
  524. @ApiModelProperty(value = "获得港口下拉框")
  525. @GetMapping("/getPortId")
  526. public RESTfulResult getPortId() {
  527. return success(universalService.getPortId());
  528. }
  529. @ApiModelProperty(value = "获取车牌号边输边查")
  530. @GetMapping("/getCapacityNumber")
  531. public RESTfulResult getCapacityNumber(String index) {
  532. if(index.length() < 3){
  533. return failed();
  534. }
  535. return success(universalService.getCapacityNumber(index));
  536. }
  537. @ApiModelProperty(value = "获得订单号及订单号下面物资")
  538. @GetMapping("/getOrderNumber")
  539. public RESTfulResult getOrderNumber(String capacityId) {
  540. return success(universalService.getOrderNumber(capacityId));
  541. }
  542. @ApiModelProperty(value = "根据订单查询物资")
  543. @GetMapping("/getMaterialIdByOrderId")
  544. public RESTfulResult getMaterialIdByOrderId(Integer orderId) {
  545. return success(universalService.getMaterialIdByOrderId(orderId));
  546. }
  547. @ApiOperation(value = "修改路段顺序号")
  548. @PostMapping("/updateLineSqe")
  549. public RESTfulResult updateLineSqe(@RequestBody Map<String,Object> map) {
  550. int i = universalMapper.updateLineSqe(map);
  551. return success(i);
  552. }
  553. @ApiModelProperty(value = "边输边查物资")
  554. @GetMapping("/getMaterialByLike")
  555. public RESTfulResult getMaterialByLike(@RequestParam("index") String index) {
  556. List<Map<String, Object>> list = universalMapper.getMaterialByLike(index == null ? "" : index);
  557. return success(list);
  558. }
  559. }