UniversalController.java 41 KB

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