UniversalController.java 36 KB

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