UniversalController.java 45 KB

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