UniversalController.java 38 KB

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