UniversalController.java 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  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="查询运力类型")
  161. @ApiImplicitParams({
  162. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  163. @ApiImplicitParam(name = "apiId(248)", 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("/getCapacityType")
  168. public RESTfulResult getCapacityType(@RequestBody(required=false) Map<String,Object> mapValue,
  169. Integer apiId,
  170. Integer pageNum,
  171. Integer pageSize,
  172. String index
  173. ){
  174. if(mapValue == null){
  175. mapValue = new HashMap<>();
  176. }
  177. if(index != null&&!index.equals("null")){
  178. mapValue.put("index", index);
  179. }
  180. //不分页筛选数据
  181. PageHelper.startPage(pageNum,pageSize);
  182. //分页数据
  183. List<Map<String, Object>> capacity = universalMapper.getCapacityType(mapValue);
  184. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  185. return success(pageList);
  186. }
  187. @ApiOperation(value="通过订单ID查询订单下所有物资")
  188. @ApiImplicitParams({
  189. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  190. @ApiImplicitParam(name = "apiId(395)", value = "动态表头", required = false, dataType = "Integer"),
  191. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  192. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  193. })
  194. @PostMapping("/getMaterialMesByOrderId")
  195. public RESTfulResult getMaterialMesByOrderId(@RequestBody(required=false) Map<String,Object> mapValue,
  196. Integer apiId,
  197. Integer pageNum,
  198. Integer pageSize,
  199. String orderId
  200. ){
  201. if(mapValue == null){
  202. mapValue = new HashMap<>();
  203. }
  204. if(orderId != null){
  205. mapValue.put("orderId", orderId);
  206. }
  207. //不分页筛选数据
  208. PageHelper.startPage(pageNum,pageSize);
  209. //分页数据
  210. List<Map<String, Object>> capacity = universalMapper.getMaterialMesByOrderId(mapValue);
  211. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, capacity);
  212. return success(pageList);
  213. }
  214. @ApiModelProperty(value = "边输边查发货单位")
  215. @PostMapping("/getSupplierMesByLike")
  216. public RESTfulResult getSupplierMesByLike(@RequestParam("index") String index) {
  217. List<Map<String, Object>> list = universalMapper.getSupplierMesByLike(index == null ? "" : index);
  218. return success(list);
  219. }
  220. @ApiModelProperty(value = "边输边查用车单位")
  221. @PostMapping("/getRequireUnitName")
  222. public RESTfulResult getRequireUnitName(@RequestParam("index") String index) {
  223. List<Map<String,Object>>list = universalMapper.getRequireUnitName(index == null ? "" : "%" + index + "%");
  224. return success(list);
  225. }
  226. @ApiModelProperty(value = "边输边查收货单位")
  227. @PostMapping("/getConsigneeByLike")
  228. public RESTfulResult getConsigneeByLike(@RequestParam("index") String index) {
  229. List<Map<String, Object>> list = universalMapper.getConsigneeByLike(index == null ? "" : index);
  230. return success(list);
  231. }
  232. @ApiModelProperty(value = "通过订单ID查询订单下物资信息")
  233. @PostMapping("/getOrderMaterialMesByOrderId/{orderId}")
  234. public RESTfulResult getMaterialMesByOrderId(@PathVariable("orderId") Integer orderId){
  235. List<Map<String, Object>> mes = universalMapper.getOrderMaterialMesByOrderId(new BigDecimal(orderId));
  236. return success(mes);
  237. }
  238. @ApiModelProperty(value = "模糊查询物资")
  239. @ApiImplicitParams({
  240. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  241. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  242. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  243. })
  244. @PostMapping("/queryAPOMaterialByLike")
  245. public RESTfulResult queryAPOMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  246. Integer pageNum,
  247. Integer pageSize,
  248. Integer apiId,
  249. String index,
  250. Integer supplierId) {
  251. if(mapValue == null) {
  252. mapValue = new HashMap<>();
  253. }
  254. if(index != null && !"".equals(index) &&!"null".equals(index)){
  255. mapValue.put("index", index);
  256. }
  257. if(supplierId != null){
  258. mapValue.put("supplierId", supplierId);
  259. }
  260. PageHelper.startPage(pageNum, pageSize);
  261. //分页查询数据
  262. List<Map<String, Object>> columnList = universalMapper.queryAPOMaterialByLike(mapValue);
  263. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  264. return success(data);
  265. }
  266. @ApiModelProperty(value = "模糊查询卸货点")
  267. @ApiImplicitParams({
  268. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  269. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  270. @ApiImplicitParam(name = "apiId", value = "374", required = false, dataType = "BigDecimal")
  271. })
  272. @PostMapping("/getUnloadingMesByLike")
  273. public RESTfulResult getUnloadingMesByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  274. Integer pageNum,
  275. Integer pageSize,
  276. Integer apiId,
  277. Integer type,
  278. String index) {
  279. if(mapValue == null) {
  280. mapValue = new HashMap<>();
  281. }
  282. if(type != null){
  283. mapValue.put("type", type);
  284. }
  285. if(index != null){
  286. mapValue.put("index", index);
  287. }
  288. PageHelper.startPage(pageNum, pageSize);
  289. //分页查询数据
  290. List<Map<String, Object>> columnList = universalMapper.getUnloadingMesByLike(mapValue);
  291. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  292. return success(data);
  293. }
  294. @ApiModelProperty(value = "模糊查询物资")
  295. @ApiImplicitParams({
  296. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  297. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  298. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  299. })
  300. @PostMapping("/queryMaterialByLike")
  301. public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  302. Integer pageNum,
  303. Integer pageSize,
  304. Integer apiId,
  305. String index) {
  306. if(mapValue == null) {
  307. mapValue = new HashMap<>();
  308. }
  309. if(index != null){
  310. mapValue.put("index", index);
  311. }
  312. PageHelper.startPage(pageNum, pageSize);
  313. //分页查询数据
  314. List<Map<String, Object>> columnList = universalMapper.queryMaterialByLike(mapValue);
  315. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  316. return success(data);
  317. }
  318. @ApiModelProperty(value = "模糊查询批次")
  319. @ApiImplicitParams({
  320. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  321. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  322. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  323. })
  324. @PostMapping("/queryBatchByLike")
  325. public RESTfulResult queryBatchByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  326. Integer pageNum,
  327. Integer pageSize,
  328. Integer apiId,
  329. String index) {
  330. if(mapValue == null) {
  331. mapValue = new HashMap<>();
  332. }
  333. if(index != null){
  334. mapValue.put("index", index);
  335. }
  336. PageHelper.startPage(pageNum, pageSize);
  337. //分页查询数据
  338. List<Map<String, Object>> columnList = universalMapper.getBatchAndOrderMes(mapValue);
  339. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  340. return success(data);
  341. }
  342. @ApiModelProperty(value = "边输边查承运商")
  343. @PostMapping("/getCarrierMesByLike")
  344. public RESTfulResult getCarrierMesByLike(@RequestParam("index") String index) {
  345. List<Map<String, Object>> list = universalMapper.getCarrierMesByLike(index == null ? "" : index);
  346. return success(list);
  347. }
  348. @ApiModelProperty(value = "模糊查询收货单位")
  349. @ApiImplicitParams({
  350. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  351. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  352. @ApiImplicitParam(name = "apiId", value = "396", required = false, dataType = "BigDecimal")
  353. })
  354. @PostMapping("/queryConsigneeByLike")
  355. public RESTfulResult queryConsigneeByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  356. Integer pageNum,
  357. Integer pageSize,
  358. Integer apiId,
  359. String index) {
  360. if(mapValue == null) {
  361. mapValue = new HashMap<>();
  362. }
  363. if(index != null){
  364. mapValue.put("index", index);
  365. }
  366. PageHelper.startPage(pageNum, pageSize);
  367. //分页查询数据
  368. List<Map<String, Object>> columnList = universalMapper.queryConsigneeByLike(mapValue);
  369. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  370. return success(data);
  371. }
  372. @ApiModelProperty(value = "模糊查询物资信息")
  373. @ApiImplicitParams({
  374. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  375. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  376. @ApiImplicitParam(name = "apiId", value = "395", required = false, dataType = "BigDecimal")
  377. })
  378. @PostMapping("/selectAllMaterialName")
  379. public RESTfulResult selectAllMaterialName(@RequestBody(required = false) Map<String,Object> mapValue,
  380. Integer pageNum,
  381. Integer pageSize,
  382. Integer apiId,
  383. String index) {
  384. if(mapValue == null) {
  385. mapValue = new HashMap<>();
  386. }
  387. if(index != null){
  388. mapValue.put("index", index);
  389. }
  390. PageHelper.startPage(pageNum, pageSize);
  391. //分页查询数据
  392. List<Map<String, Object>> columnList = universalMapper.selectAllMaterialName(mapValue);
  393. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  394. return success(data);
  395. }
  396. @ApiModelProperty(value = "返回sha1加密字符串")
  397. @RequestMapping(value = "/sha1DigestUtils", method = {RequestMethod.GET,RequestMethod.POST})
  398. public String sha1DigestUtils(String text){
  399. return universalService.sha1DigestUtils(text);
  400. }
  401. @ApiModelProperty(value = "查装货卸货点")
  402. @PostMapping("/selectUnloadingPoint")
  403. public List<Map<String, Object>> selectUnloadingPoint() {
  404. return universalMapper.selectUnloadingPoint();
  405. }
  406. @ApiModelProperty(value = "模糊查询承运商")
  407. @ApiImplicitParams({
  408. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  409. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  410. @ApiImplicitParam(name = "apiId", value = "412", required = false, dataType = "BigDecimal")
  411. })
  412. @PostMapping("/getCarrierListByLike")
  413. public RESTfulResult getCarrierListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  414. Integer apiId,
  415. Integer pageNum,
  416. Integer pageSize,
  417. String index) {
  418. if(index != null){
  419. if(index.length() == 0){
  420. index = null;
  421. }else {
  422. index = "%" + index + "%";
  423. }
  424. }
  425. if (mapValue == null) {
  426. mapValue = new HashMap<>();
  427. }
  428. mapValue.put("index",index);
  429. PageHelper.startPage(pageNum, pageSize);
  430. //分页查询数据
  431. List<Map<String, Object>> columnList = universalMapper.getCarrierListByLike(mapValue);
  432. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  433. return success(data);
  434. }
  435. @ApiModelProperty(value = "所有门岗下拉框")
  436. @GetMapping("/getAllGatepost")
  437. public List<Map<String,Object>> getAllGatepost(){
  438. return universalMapper.getAllGatepost();
  439. }
  440. //通过承运商id获取userId
  441. @PostMapping("/getUserIdByCarrierId")
  442. public String getUserIdByCarrierId(@RequestBody Map<String,Object> map){
  443. //获取承运商id
  444. Integer carrierId =(Integer) map.get("carrierId");
  445. return universalMapper.getUserIdbyCarrierId(carrierId);
  446. }
  447. @ApiModelProperty(value = "已经在sso权限模块承运商下拉框")
  448. @GetMapping("/getAllCarrierIdForSso")
  449. public List<Map<String,Object>> getAllCarrierIdForSso(){
  450. return universalMapper.getAllCarrierIdForSso();
  451. }
  452. @ApiModelProperty(value = "模糊查询收货单位")
  453. @ApiImplicitParams({
  454. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  455. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  456. @ApiImplicitParam(name = "apiId", value = "418", required = false, dataType = "BigDecimal")
  457. })
  458. @PostMapping("/getConsigneeListByLike")
  459. public RESTfulResult getConsigneeListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  460. Integer apiId,
  461. Integer pageNum,
  462. Integer pageSize,
  463. String index) {
  464. if(index != null){
  465. if(index.length() == 0){
  466. index = null;
  467. }else {
  468. index = "%" + index + "%";
  469. }
  470. }
  471. if (mapValue == null) {
  472. mapValue = new HashMap<>();
  473. }
  474. mapValue.put("index",index);
  475. PageHelper.startPage(pageNum, pageSize);
  476. //分页查询数据
  477. List<Map<String, Object>> columnList = universalMapper.getConsigneeListByLike(mapValue);
  478. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  479. return success(data);
  480. }
  481. @ApiOperation("通过运输订单id查询销售订单审核状态")
  482. @PostMapping("/getSaleOrderStatus")
  483. public Integer getSaleOrderStatus(@RequestParam Integer orderId) {
  484. Integer saleStatus = universalMapper.getSaleOrderStatus(new BigDecimal(orderId));
  485. return saleStatus;
  486. }
  487. @ApiOperation("查询所有的汽车衡")
  488. @GetMapping("/getAllCalculateMes")
  489. public List<Map<String, Object>> getAllCalculateMes() {
  490. return universalMapper.getAllCalculateMes();
  491. }
  492. @ApiOperation("查询所有的焦炭子类")
  493. @GetMapping("/getAllMaterialCoke")
  494. public List<Map<String, Object>> getAllMaterialCoke() {
  495. return universalMapper.getAllMaterialCoke();
  496. }
  497. @ApiModelProperty(value = "边输边查车牌号")
  498. @PostMapping("/getCapacityByLike")
  499. public RESTfulResult getCapacityByLike(@RequestParam("index") String index) {
  500. List<Map<String, Object>> list = universalMapper.getCapacityByLike(index == null ? "" : index);
  501. return success(list);
  502. }
  503. @ApiModelProperty(value = "边输边查批次")
  504. @GetMapping("/getBatchByLike")
  505. public RESTfulResult getBatchByLike(@RequestParam("index") String index) {
  506. List<Map<String, Object>> list = universalMapper.getBatchByLike(index == null ? "" : index);
  507. return success(list);
  508. }
  509. @ApiModelProperty(value = "根据运力id查询所有承运商(下拉框)")
  510. @GetMapping("/getCarrierByCapacityId")
  511. public RESTfulResult getCarrierByCapacityId(@RequestParam("capacityId") Integer capacityId) {
  512. List<Map<String, Object>> list = universalMapper.getCarrierByCapacityId(new BigDecimal(capacityId));
  513. return success(list);
  514. }
  515. @ApiModelProperty(value = "根据收货客户查询承运商")
  516. @PostMapping("/getCarrierByConsignee")
  517. public RESTfulResult getCarrierByConsignee(@RequestBody Map<String,Object> mapValue) {
  518. Map<String, Object> map = universalService.getCarrierByConsignee(mapValue);
  519. return success(map);
  520. }
  521. @ApiModelProperty(value = "确认车牌号与承运商关系是否存在")
  522. @PostMapping("/isInCapacityCarrier")
  523. public RESTfulResult isInCapacityCarrier(@RequestBody Map<String,Object> mapValue) {
  524. Map<String,Object> map = universalService.isInCapacityCarrier(mapValue);
  525. BigDecimal capacityId = (BigDecimal) map.get("capacityId");
  526. BigDecimal capacityCarrierId = (BigDecimal) map.get("capacityCarrierId");
  527. if (capacityId == null) {
  528. return failed();
  529. }
  530. if (capacityCarrierId == null) {
  531. return failed(capacityId);
  532. }
  533. return success(map);
  534. }
  535. @ApiModelProperty(value = "得到所有油价联动计费公式(apiId:444)")
  536. @PostMapping("/getOilFormula")
  537. public RESTfulResult getOilFormula(@RequestBody(required = false) Map<String,Object> mapValue,
  538. Integer apiId,
  539. Integer pageNum,
  540. Integer pageSize) {
  541. if (mapValue == null) {
  542. mapValue = new HashMap<>();
  543. }
  544. mapValue.put("con", "%执行运价公式");
  545. PageHelper.startPage(pageNum, pageSize);
  546. //分页查询数据
  547. List<Map<String, Object>> columnList = universalMapper.getOilFormula(mapValue);
  548. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  549. return success(data);
  550. }
  551. @ApiModelProperty(value = "获得港口下拉框")
  552. @GetMapping("/getPortId")
  553. public RESTfulResult getPortId() {
  554. return success(universalService.getPortId());
  555. }
  556. @ApiModelProperty(value = "获取车牌号边输边查")
  557. @GetMapping("/getCapacityNumber")
  558. public RESTfulResult getCapacityNumber(String index) {
  559. if(index.length() < 3){
  560. return failed();
  561. }
  562. return success(universalService.getCapacityNumber(index));
  563. }
  564. @ApiModelProperty(value = "获得订单号及订单号下面物资")
  565. @GetMapping("/getOrderNumber")
  566. public RESTfulResult getOrderNumber(String capacityId) {
  567. return success(universalService.getOrderNumber(capacityId));
  568. }
  569. @ApiModelProperty(value = "根据订单查询物资")
  570. @GetMapping("/getMaterialIdByOrderId")
  571. public RESTfulResult getMaterialIdByOrderId(Integer orderId) {
  572. return success(universalService.getMaterialIdByOrderId(orderId));
  573. }
  574. @ApiOperation(value = "修改路段顺序号")
  575. @PostMapping("/updateLineSqe")
  576. public RESTfulResult updateLineSqe(@RequestBody Map<String,Object> map) {
  577. int i = universalMapper.updateLineSqe(map);
  578. return success(i);
  579. }
  580. @ApiModelProperty(value = "边输边查物资")
  581. @GetMapping("/getMaterialByLike")
  582. public RESTfulResult getMaterialByLike(@RequestParam("index") String index) {
  583. List<Map<String, Object>> list = universalMapper.getMaterialByLike(index == null ? "" : index);
  584. return success(list);
  585. }
  586. @ApiOperation(value="通过一个carrierSsoId获得承运商对象")
  587. @GetMapping("/getRmsCarrierByCarrierSsoId")
  588. public RESTfulResult getRmsCarrierByCarrierSsoId(String carrierSsoId){
  589. Map<String,Object> carrier= universalMapper.getRmsCarrierByCarrierSsoId(carrierSsoId);
  590. if (carrier==null){
  591. failed();
  592. }
  593. return success(carrier);
  594. }
  595. @ApiModelProperty(value = "模糊查询钢材物资")
  596. @ApiImplicitParams({
  597. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  598. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  599. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  600. })
  601. @PostMapping("/getSteelMaterial")
  602. public RESTfulResult getSteelMaterial(@RequestBody(required = false) Map<String, Object> mapValue,
  603. Integer pageNum,
  604. Integer pageSize,
  605. Integer apiId,
  606. String materialNameText,
  607. String materialSpecificationText,
  608. String materialModelText) {
  609. if (mapValue == null) {
  610. mapValue = new HashMap<>();
  611. }
  612. if (materialNameText != null && !materialNameText.equals("undefined") && !materialNameText.equals("null")) {
  613. mapValue.put("materialNameText", materialNameText);
  614. }
  615. if (materialSpecificationText != null && !materialSpecificationText.equals("undefined") && !materialSpecificationText.equals("null")) {
  616. mapValue.put("materialSpecificationText", materialSpecificationText);
  617. }
  618. if (materialModelText != null && !materialModelText.equals("undefined") && !materialModelText.equals("null")) {
  619. mapValue.put("materialModelText", materialModelText);
  620. }
  621. PageHelper.startPage(pageNum, pageSize);
  622. //分页查询数据
  623. List<Map<String, Object>> columnList = universalMapper.getSteelMaterial(mapValue);
  624. PageListAdd data = columnDataUtil.tableColumnData(apiId, columnList);
  625. return success(data);
  626. }
  627. @ApiOperation(value="得到所有省份")
  628. @PostMapping("/getAllProvince")
  629. public RESTfulResult getAllProvince(){
  630. List<Map<String,Object>> provinceList = universalMapper.getAllProvince();
  631. return success(provinceList);
  632. }
  633. @ApiOperation(value="根据省份得到下面的地级市")
  634. @PostMapping("/getDistrictByProvince")
  635. public RESTfulResult getDistrictByProvince(@RequestParam String addressProvince){
  636. List<Map<String,Object>> districtList = universalMapper.getDistrictByProvince(addressProvince);
  637. return success(districtList);
  638. }
  639. @ApiOperation(value="根据地级市得到下面的区/县")
  640. @PostMapping("/getTownByDistrict")
  641. public RESTfulResult getTownByDistrict(@RequestParam String addressDistrict){
  642. List<Map<String,Object>> townList = universalMapper.getTownByDistrict(addressDistrict);
  643. return success(townList);
  644. }
  645. @ApiOperation(value="根据省市县得到下面的详细地址")
  646. @PostMapping("/getPlaceByAllAddress")
  647. public RESTfulResult getPlaceByAllAddress(@RequestBody Map<String,Object> mapValue){
  648. List<Map<String,Object>> townList = universalMapper.getPlaceByAllAddress(mapValue);
  649. return success(townList);
  650. }
  651. @ApiOperation(value="获得销售员下拉框")
  652. @GetMapping("/getSalerList")
  653. public RESTfulResult getSalerList(){
  654. List<Map<String,Object>> salerList= universalMapper.getSalerList();
  655. return success(salerList);
  656. }
  657. @ApiOperation(value="通过收货客户匹配销售组")
  658. @PostMapping("/getSaleArea")
  659. public RESTfulResult getSaleArea(@RequestParam Integer receiveId) {
  660. String saleArea = universalMapper.getSaleArea(new BigDecimal(receiveId));
  661. return success(saleArea);
  662. }
  663. @ApiOperation(value = "质保书前端展示")
  664. @PostMapping("/getWarranty")
  665. public RESTfulResult getWarranty(@RequestParam("orderNumber") String orderNumber) {
  666. //List<String> list = universalService.getWarrantyAndPrint(orderNumber);
  667. List<String> list= universalService.getWarranty(orderNumber);
  668. if(list.get(0).equals("-1")){
  669. return failed(-1,"质保书正在紧张制作中,请耐心等待!");
  670. }else if(list.get(0).equals("-2")){
  671. return failed(-2,"该车还未装货");
  672. }
  673. return success(list);
  674. }
  675. @ApiOperation(value = "查询待分解计划数量")
  676. @PostMapping("/getPlanCount")
  677. public Integer getPlanCount(){
  678. return universalMapper.getPlanCount();
  679. }
  680. @ApiOperation(value = "查询承运起止地点下拉框")
  681. @GetMapping("/getTransRange")
  682. public RESTfulResult getTransRange(){
  683. return success(universalMapper.getTransRange());
  684. }
  685. // //测试质保书回显
  686. // @PostMapping("/getTest")
  687. // public RESTfulResult getTest(@RequestBody Map<String,Object> map){
  688. // List<String> list = universalService.getTest(map);
  689. // if(list.get(0).equals("0")){
  690. // return failed("质保书正在紧张制作中,请耐心等待!");
  691. // }
  692. // return success(list);
  693. // }
  694. @ApiOperation(value = "收货地址下匹配不到任何承运商")
  695. @GetMapping("/getNoListCarrier")
  696. public RESTfulResult getNoListCarrier() {
  697. return success(universalMapper.getNoListCarrier());
  698. }
  699. @ApiOperation(value = "查询承运起止地点下拉框")
  700. @GetMapping("/getNotReceiveOrderQuantity")
  701. public Integer getNotReceiveOrderQuantity(@RequestParam("capacityNumber") String capacityNumber){
  702. return universalMapper.getNotReceiveOrderQuantity(capacityNumber);
  703. }
  704. }