UniversalController.java 36 KB

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