BMSController.java 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.config.ImageFileUtils;
  3. import com.steerinfo.dil.feign.BmsshipFeign;
  4. import com.steerinfo.dil.feign.BmstrainFeign;
  5. import com.steerinfo.dil.feign.BmstruckFeign;
  6. import com.steerinfo.dil.util.BaseRESTfulController;
  7. import com.steerinfo.framework.controller.RESTfulResult;
  8. import io.swagger.annotations.ApiImplicitParam;
  9. import io.swagger.annotations.ApiImplicitParams;
  10. import io.swagger.annotations.ApiModelProperty;
  11. import io.swagger.annotations.ApiOperation;
  12. import io.swagger.models.auth.In;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.http.MediaType;
  15. import org.springframework.web.bind.annotation.*;
  16. import org.springframework.web.multipart.MultipartFile;
  17. import org.springframework.web.multipart.MultipartRequest;
  18. import java.math.BigDecimal;
  19. import java.text.SimpleDateFormat;
  20. import java.util.*;
  21. /**
  22. * @author hujianguo
  23. * @create 2021-09-22 17:10
  24. */
  25. @RestController
  26. @RequestMapping("${api.version}/bms")
  27. public class BMSController extends BaseRESTfulController {
  28. @Autowired
  29. BmsshipFeign bmsshipFeign;
  30. @Autowired
  31. BmstrainFeign bmstrainFeign;
  32. @Autowired
  33. BmstruckFeign bmstruckFeign;
  34. @Autowired
  35. private ImageFileUtils imageFileUtils;
  36. /**
  37. * 水运结算
  38. *
  39. * @param mapValue
  40. * @param apiId
  41. * @param pageNum
  42. * @param pageSize
  43. * @return
  44. */
  45. @PostMapping("getDetailsOrderList")
  46. @ApiOperation(value = "展示详单列表")
  47. public RESTfulResult getDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  48. Integer pageNum,
  49. Integer pageSize,
  50. Integer apiId,
  51. String con) {
  52. if (mapValue == null) {
  53. mapValue = new HashMap<>();
  54. }
  55. return bmsshipFeign.getDetailsOrderList(mapValue, pageNum, pageSize, apiId, con);
  56. }
  57. @PostMapping("getBatch")
  58. @ApiOperation(value = "展示批次信息")
  59. public RESTfulResult getBatch(@RequestBody(required = false) Map<String, Object> mapValue,
  60. Integer pageNum,
  61. Integer pageSize,
  62. Integer apiId,
  63. String con) {
  64. if (mapValue == null) {
  65. mapValue = new HashMap<>();
  66. }
  67. return bmsshipFeign.getBatch(mapValue, pageNum, pageSize, apiId,con);
  68. }
  69. @PostMapping("getPortHandlingFeeList")
  70. @ApiOperation(value = "展示批次信息")
  71. public RESTfulResult getPortHandlingFeeList(@RequestBody(required = false) Map<String, Object> mapValue,
  72. Integer pageNum,
  73. Integer pageSize,
  74. Integer apiId,
  75. String con) {
  76. if (mapValue == null) {
  77. mapValue = new HashMap<>();
  78. }
  79. return bmsshipFeign.getPortHandlingFeeList(mapValue, pageNum, pageSize, apiId, con);
  80. }
  81. @PostMapping("addPortHandlingFee")
  82. @ApiOperation(value = "生成港口装卸费")
  83. RESTfulResult addPortHandlingFee(@RequestBody Map<String, Object> portHandlingFee) throws Exception {
  84. return bmsshipFeign.addPortHandlingFee(portHandlingFee);
  85. }
  86. @PostMapping("updatePortHandlingFee")
  87. @ApiOperation(value = "修改港口装卸费信息")
  88. RESTfulResult updatePortHandlingFee(@RequestBody Map<String, Object> portHandlingFee) {
  89. return bmsshipFeign.updatePortHandlingFee(portHandlingFee);
  90. }
  91. @PostMapping("getFeeToUpdate/{feeId}")
  92. @ApiOperation(value = "查询修改港口装卸费数据渲染表单")
  93. RESTfulResult getFeeToUpdate(@PathVariable("feeId") BigDecimal feeId) {
  94. return bmsshipFeign.getFeeToUpdate(feeId);
  95. }
  96. @PostMapping("deletePortHandlingFee/{feeId}")
  97. @ApiOperation(value = "逻辑删除港口装卸费")
  98. RESTfulResult deletePortHandlingFee(@PathVariable("feeId") String feeId) {
  99. return bmsshipFeign.deletePortHandlingFee(feeId);
  100. }
  101. @PostMapping("deletePortHandlingFeeSecond/{feeId}")
  102. @ApiOperation(value = "逻辑删除二程港口装卸费")
  103. Map<String,Object> deletePortHandlingFeeSecond(@PathVariable("feeId") BigDecimal feeId) {
  104. return bmsshipFeign.deletePortHandlingFeeSecond(feeId);
  105. }
  106. @PostMapping("addwaterStatement")
  107. @ApiOperation(value = "修改港口装卸费信息")
  108. Map<String,Object> addwaterStatement(@RequestBody Map<String, Object> map) {
  109. return bmsshipFeign.addwaterStatement(map);
  110. }
  111. @PostMapping("getUncomplateDetailsOrderList")
  112. @ApiOperation(value = "展示未生成账单的详单信息")
  113. public RESTfulResult getUncomplateDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  114. Integer pageNum,
  115. Integer pageSize,
  116. Integer apiId,
  117. String con) {
  118. if (mapValue == null) {
  119. mapValue = new HashMap<>();
  120. }
  121. return bmsshipFeign.getUncomplateDetailsOrderList(mapValue, pageNum, pageSize, apiId, con);
  122. }
  123. @PostMapping("addDetailsOrder/{resultId}")
  124. @ApiOperation(value = "生成水运计费详单")
  125. RESTfulResult addDetailsOrder(@PathVariable("resultId") BigDecimal resultId) throws Exception {
  126. return bmsshipFeign.addDetailsOrder(resultId);
  127. }
  128. @PostMapping("getStatementList")
  129. @ApiOperation(value = "展示水运费和水分质检费账单信息")
  130. public RESTfulResult getStatementList(@RequestBody(required = false) Map<String, Object> mapValue,
  131. Integer pageNum,
  132. Integer pageSize,
  133. Integer apiId,
  134. String con) {
  135. if (mapValue == null) {
  136. mapValue = new HashMap<>();
  137. }
  138. return bmsshipFeign.getStatementList(mapValue, pageNum, pageSize, apiId, con);
  139. }
  140. @PostMapping("getLossStatementList")
  141. @ApiOperation(value = "展示途损费账单信息")
  142. public RESTfulResult getLossStatementList(@RequestBody(required = false) Map<String, Object> mapValue,
  143. Integer pageNum,
  144. Integer pageSize,
  145. Integer apiId,
  146. String con) {
  147. if (mapValue == null) {
  148. mapValue = new HashMap<>();
  149. }
  150. return bmsshipFeign.getLossStatementList(mapValue, pageNum, pageSize, apiId, con);
  151. }
  152. @PostMapping("getWaterResult")
  153. @ApiOperation(value = "展示水分质检实绩")
  154. public RESTfulResult getWaterResult(@RequestBody(required = false) Map<String, Object> mapValue,
  155. Integer pageNum,
  156. Integer pageSize,
  157. Integer apiId) {
  158. if (mapValue == null) {
  159. mapValue = new HashMap<>();
  160. }
  161. return bmsshipFeign.getWaterResult(mapValue, pageNum, pageSize, apiId);
  162. }
  163. @PostMapping("addStatement")
  164. @ApiOperation(value = "生成水运费账单")
  165. RESTfulResult addStatement(@RequestBody List<Map<String, Object>> mapList) throws Exception {
  166. return bmsshipFeign.addStatement(mapList);
  167. }
  168. @PostMapping("addWaterStatement")
  169. @ApiOperation(value = "生成水分质检账单")
  170. RESTfulResult addWaterStatement(@RequestBody List<Map<String, Object>> mapList) throws Exception {
  171. return bmsshipFeign.addWaterStatement(mapList);
  172. }
  173. @PostMapping("addLossStatement")
  174. @ApiOperation(value = "生成途损账单")
  175. RESTfulResult addLossStatement(@RequestBody Map<String, Object> map) throws Exception {
  176. return bmsshipFeign.addLossStatement(map);
  177. }
  178. @PostMapping("getStatementDetailsOrderList")
  179. @ApiOperation(value = "展示账单下的详单")
  180. public RESTfulResult getStatementDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  181. Integer batchId,
  182. Integer pageNum,
  183. Integer pageSize,
  184. Integer apiId,
  185. Integer statementId,
  186. String con) {
  187. if (mapValue == null) {
  188. mapValue = new HashMap<>();
  189. }
  190. return bmsshipFeign.getStatementDetailsOrderList(new BigDecimal(batchId), mapValue, pageNum, pageSize, apiId, new BigDecimal(statementId), con);
  191. }
  192. @PostMapping("getShipResult")
  193. @ApiOperation(value = "展示详单下的船运实绩")
  194. public RESTfulResult getShipResult(@RequestBody(required = false) Map<String, Object> mapValue,
  195. BigDecimal batchId,
  196. Integer pageNum,
  197. Integer pageSize,
  198. Integer apiId) {
  199. if (mapValue == null) {
  200. mapValue = new HashMap<>();
  201. }
  202. return bmsshipFeign.getShipResult(batchId, mapValue, pageNum, pageSize, apiId);
  203. }
  204. @PostMapping("getShipFeesFormula")
  205. @ApiOperation(value = "查询水运费计算公式")
  206. public RESTfulResult getShipFeesFormula() {
  207. return bmsshipFeign.getShipFeesFormula();
  208. }
  209. @PostMapping("getLossFeesFormula")
  210. @ApiOperation(value = "查询途损费计算公式")
  211. public RESTfulResult getLossFeesFormula() {
  212. return bmsshipFeign.getLossFeesFormula();
  213. }
  214. @PostMapping("getWaterFeesFormula")
  215. @ApiOperation(value = "查询水分质检计算公式")
  216. public RESTfulResult getWaterFeesFormula() {
  217. return bmsshipFeign.getWaterFeesFormula();
  218. }
  219. @PostMapping("getTrainDetailsOrderList")
  220. @ApiOperation(value = "展示火运详单")
  221. public RESTfulResult getTrainDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  222. Integer pageNum,
  223. Integer pageSize,
  224. Integer apiId,
  225. String con) {
  226. if (mapValue == null) {
  227. mapValue = new HashMap<>();
  228. }
  229. return bmstrainFeign.getTrainDetailsOrderList(mapValue, pageNum, pageSize, apiId, con);
  230. }
  231. @PostMapping("getUncomplateTrainDetailsList")
  232. @ApiOperation(value = "展示未转账单的火运详单")
  233. public RESTfulResult getUncomplateTrainDetailsList(@RequestBody(required = false) Map<String, Object> mapValue,
  234. Integer pageNum,
  235. Integer pageSize,
  236. Integer apiId,
  237. String con) {
  238. if (mapValue == null) {
  239. mapValue = new HashMap<>();
  240. }
  241. return bmstrainFeign.getUncomplateTrainDetailsList(mapValue, pageNum, pageSize, apiId, con);
  242. }
  243. @PostMapping("getTrainResultList")
  244. @ApiOperation(value = "展示火运实绩")
  245. public RESTfulResult getTrainResultList(@RequestBody(required = false) Map<String, Object> mapValue,
  246. Integer pageNum,
  247. Integer pageSize,
  248. Integer apiId) {
  249. if (mapValue == null) {
  250. mapValue = new HashMap<>();
  251. }
  252. return bmstrainFeign.getTrainResultList(mapValue, pageNum, pageSize, apiId);
  253. }
  254. @PostMapping("addTrainDetails")
  255. @ApiOperation(value = "生成火运详单")
  256. RESTfulResult addTrainDetails(@RequestBody Map<String, Object> map) {
  257. return bmstrainFeign.addTrainDetails(map);
  258. }
  259. @PostMapping("getTrainStatementList")
  260. @ApiOperation(value = "展示火运账单列表")
  261. public RESTfulResult getTrainStatementList(@RequestBody(required = false) Map<String, Object> mapValue,
  262. Integer pageNum,
  263. Integer pageSize,
  264. Integer apiId,
  265. String con) {
  266. if (mapValue == null) {
  267. mapValue = new HashMap<>();
  268. }
  269. return bmstrainFeign.getTrainStatementList(mapValue, pageNum, pageSize, apiId, con);
  270. }
  271. @PostMapping("getStatementTrainResultList")
  272. @ApiOperation(value = "展示未转账单的火运详单")
  273. public RESTfulResult getStatementTrainResultList(@RequestBody(required = false) Map<String, Object> mapValue,
  274. Integer pageNum,
  275. Integer pageSize,
  276. Integer apiId,
  277. Integer detailsId) {
  278. if (mapValue == null) {
  279. mapValue = new HashMap<>();
  280. }
  281. return bmstrainFeign.getStatementTrainResultList(mapValue, pageNum, pageSize, apiId, detailsId);
  282. }
  283. @PostMapping("getComplateTrainDetailsList")
  284. @ApiOperation(value = "展示账单下的详单")
  285. public RESTfulResult getComplateTrainDetailsList(Integer batchId,
  286. @RequestBody(required = false) Map<String, Object> mapValue,
  287. Integer pageNum,
  288. Integer pageSize,
  289. Integer apiId,
  290. Integer statementId,
  291. String con) {
  292. if (mapValue == null) {
  293. mapValue = new HashMap<>();
  294. }
  295. return bmstrainFeign.getComplateTrainDetailsList(new BigDecimal(batchId), mapValue, pageNum, pageSize, apiId, new BigDecimal(statementId), con);
  296. }
  297. @PostMapping("addTrainStatement")
  298. @ApiOperation(value = "生成火运费账单")
  299. RESTfulResult addTrainStatement(@RequestBody List<Map<String, Object>> mapList) {
  300. return bmstrainFeign.addTrainStatement(mapList);
  301. }
  302. @ApiModelProperty(value = "展示销售火运结算列表")
  303. @ApiImplicitParams({
  304. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  305. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  306. @ApiImplicitParam(name = "apiId", value = "180", required = false, dataType = "BigDecimal")
  307. })
  308. @PostMapping("/getSettlementList")
  309. public RESTfulResult getSettlementList(@RequestBody(required = false) Map<String, Object> mapValue,
  310. Integer pageNum,
  311. Integer pageSize,
  312. Integer apiId,
  313. String con) {
  314. if (mapValue == null) {
  315. mapValue = new HashMap<>();
  316. }
  317. return bmstrainFeign.getSettlementList(mapValue, pageNum, pageSize, apiId, con);
  318. }
  319. @ApiModelProperty(value = "新增销售火运结算")
  320. @ApiImplicitParams({
  321. @ApiImplicitParam(name = "bmstrainSettlement", value = "销售火运结算实体", required = false, dataType = "BmstrainSettlement"),
  322. })
  323. @PostMapping("/addTrainSettlement")
  324. public Map<String, Object> addTrainSettlement(@RequestBody Map<String, Object> bmstrainSettlement) {
  325. return bmstrainFeign.addTrainSettlement(bmstrainSettlement);
  326. }
  327. @ApiModelProperty(value = "修改销售火运结算")
  328. @ApiImplicitParams({
  329. @ApiImplicitParam(name = "bmstrainSettlement", value = "销售火运结算实体", required = false, dataType = "BmstrainSettlement"),
  330. })
  331. @PostMapping("/updateTrainSettlement")
  332. public Map<String, Object> updateTrainSettlement(@RequestBody Map<String, Object> bmstrainSettlement) {
  333. return bmstrainFeign.updateTrainSettlement(bmstrainSettlement);
  334. }
  335. @ApiModelProperty(value = "逻辑删除销售火运结算")
  336. @ApiImplicitParams({
  337. @ApiImplicitParam(name = "settlementId", value = "结算id", required = false, dataType = "BigDecimal"),
  338. })
  339. @PostMapping("/deleteTrainSettlement/{settlementId}")
  340. public Map<String, Object> deleteTrainSettlement(@PathVariable("settlementId") BigDecimal settlementId) {
  341. return bmstrainFeign.deleteTrainSettlement(settlementId);
  342. }
  343. @ApiModelProperty(value = "得到修改渲染")
  344. @ApiImplicitParams({
  345. @ApiImplicitParam(name = "settlementId", value = "结算id", required = false, dataType = "BigDecimal"),
  346. })
  347. @PostMapping("/selectTrainSettlement/{settlementId}")
  348. public Map<String, Object> selectTrainSettlement(@PathVariable("settlementId") Integer settlementId) {
  349. return bmstrainFeign.selectTrainSettlement(new BigDecimal(settlementId));
  350. }
  351. @PostMapping("getTruckDetailsOrderList")
  352. @ApiOperation(value = "展示汽运详单信息")
  353. public RESTfulResult getTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  354. Integer pageNum,
  355. Integer pageSize,
  356. Integer apiId,
  357. Integer orderType,
  358. String carrierSsoId) {
  359. if (mapValue == null) {
  360. mapValue = new HashMap<>();
  361. }
  362. return bmstruckFeign.getTruckDetailsOrderList(mapValue, pageNum, pageSize, apiId, orderType,carrierSsoId);
  363. }
  364. @PostMapping("getTruckResultList")
  365. @ApiOperation(value = "展示汽运详单信息")
  366. public RESTfulResult getTruckResultList(@RequestBody(required = false) Map<String, Object> mapValue,
  367. Integer pageNum,
  368. Integer pageSize,
  369. Integer apiId,
  370. Integer orderId) {
  371. if (mapValue == null) {
  372. mapValue = new HashMap<>();
  373. }
  374. return bmstruckFeign.getTruckResultList(mapValue, pageNum, pageSize, apiId, new BigDecimal(orderId));
  375. }
  376. @PostMapping("getTruckStatementList")
  377. @ApiOperation(value = "展示汽运账单信息")
  378. public RESTfulResult getTruckStatementList(@RequestBody(required = false) Map<String, Object> mapValue,
  379. Integer pageNum,
  380. Integer pageSize,
  381. Integer apiId,
  382. String userId,
  383. String startTime,
  384. String endTime,
  385. String con) {
  386. if (mapValue == null) {
  387. mapValue = new HashMap<>();
  388. }
  389. return bmstruckFeign.getTruckStatementList(mapValue, pageNum, pageSize, apiId,userId,startTime,endTime,con);
  390. }
  391. @PostMapping("getInvoiceList")
  392. @ApiOperation(value = "展示发票")
  393. public RESTfulResult getInvoiceList(@RequestBody(required = false) Map<String, Object> mapValue,
  394. Integer pageNum,
  395. Integer pageSize,
  396. Integer apiId,
  397. String con) {
  398. if (mapValue == null) {
  399. mapValue = new HashMap<>();
  400. }
  401. return bmstruckFeign.getInvoiceList(mapValue, pageNum, pageSize, apiId, con);
  402. }
  403. @PostMapping("getSaleTruckStatementDetailsOrderList")
  404. @ApiOperation(value = "展示账单下的详单")
  405. public RESTfulResult getSaleTruckStatementDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  406. Integer pageNum,
  407. Integer pageSize,
  408. Integer apiId,
  409. Integer statementId) {
  410. if (mapValue == null) {
  411. mapValue = new HashMap<>();
  412. }
  413. return bmstruckFeign.getSaleTruckStatementDetailsOrderList(mapValue, pageNum, pageSize, apiId, new BigDecimal(statementId));
  414. }
  415. @PostMapping("getUnFinishedTruckDetailsOrderList")
  416. @ApiOperation(value = "展示汽运未生成账单的详单信息")
  417. public RESTfulResult getUnFinishedTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  418. Integer pageNum,
  419. Integer pageSize,
  420. Integer apiId,
  421. Integer orderType,
  422. String carrierSsoId) {
  423. if (mapValue == null) {
  424. mapValue = new HashMap<>();
  425. }
  426. return bmstruckFeign.getUnFinishedTruckDetailsOrderList(mapValue, pageNum, pageSize, apiId, orderType,carrierSsoId);
  427. }
  428. @PostMapping("addBmstruckInvoice")
  429. @ApiOperation(value = "新增发票")
  430. RESTfulResult addBmstruckInvoice(@RequestBody Map<String, Object> mapVal) {
  431. return bmstruckFeign.addBmstruckInvoice(mapVal);
  432. }
  433. @PostMapping("updateBmstruckCheck")
  434. @ApiOperation(value = "修改审核状态")
  435. RESTfulResult updateBmstruckCheck(@RequestParam Integer statementId,
  436. @RequestParam Integer status,
  437. @RequestParam Integer person) {
  438. return bmstruckFeign.updateBmstruckCheck(new BigDecimal(statementId), status, person);
  439. }
  440. @PostMapping("getSmallTruckFormula")
  441. @ApiOperation(value = "查询销售汽运离100KM差距10KM内计费公式")
  442. RESTfulResult getSmallTruckFormula() {
  443. return bmstruckFeign.getSmallTruckFormula();
  444. }
  445. @PostMapping("getBigTruckFormula")
  446. @ApiOperation(value = "查询销售汽运离100KM差距10KM外计费公式")
  447. RESTfulResult getBigTruckFormula() {
  448. return bmstruckFeign.getBigTruckFormula();
  449. }
  450. @PostMapping("addTruckStatement")
  451. @ApiOperation(value = "新增汽运账单")
  452. RESTfulResult addTruckStatement(@RequestParam("excludeTax") BigDecimal excludeTax, @RequestParam("userId") String userId, @RequestParam("statementTime") String statementTime, @RequestParam("orderList")BigDecimal[] orderList, MultipartRequest request) {
  453. String url="";
  454. List<MultipartFile> files = new ArrayList<>();
  455. //获取图片
  456. for(int i=0;i<=10;i++){
  457. MultipartFile temp = request.getFile("file"+i);
  458. if(temp!=null){
  459. files.add(temp);
  460. }
  461. }
  462. if(files.size() < 1){
  463. return failed("没有上传图片!");
  464. }
  465. //上传图片
  466. try{
  467. for(int i=0;i<files.size();i++){
  468. url+=imageFileUtils.updateFile(files.get(i),i)+';';
  469. }
  470. }catch (Exception e){
  471. e.printStackTrace();
  472. return failed("上传图片失败!");
  473. }
  474. Map<String,Object> map=new HashMap<>();
  475. map.put("excludeTax",excludeTax);
  476. map.put("orderList",orderList);
  477. map.put("url",url);
  478. map.put("userId",userId);
  479. map.put("statementTime",statementTime);
  480. return bmstruckFeign.addTruckStatement(map);
  481. }
  482. @PostMapping("addTruckDetailsOrder/{orderId}")
  483. @ApiOperation(value = "新增汽运详单")
  484. RESTfulResult addTruckDetailsOrder(@PathVariable("orderId") BigDecimal orderId) {
  485. return bmstruckFeign.addTruckDetailsOrder(orderId);
  486. }
  487. /**
  488. * 展示汽运未生成账单的详单信息
  489. *
  490. * @param mapVal
  491. * @param pageNum
  492. * @param pageSize
  493. * @param apiId
  494. * @return
  495. */
  496. @ApiModelProperty(value = "展示内转汽运未生成账单的作业详单信息")
  497. @ApiImplicitParams({
  498. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  499. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  500. @ApiImplicitParam(name = "apiId", value = "还没定", required = false, dataType = "BigDecimal"),
  501. @ApiImplicitParam(name = "orderType", value = "1:计时,2:计数,3:计重,4:包月", required = false, dataType = "Integer")
  502. })
  503. @PostMapping("/getUnFinishedConvertedTruckDetailsOrderList")
  504. public RESTfulResult getUnFinishedConvertedTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapVal,
  505. Integer pageNum,
  506. Integer pageSize,
  507. Integer apiId,
  508. Integer orderType) {
  509. if (mapVal == null) {
  510. mapVal = new HashMap<>();
  511. }
  512. return bmstruckFeign.getUnFinishedConvertedTruckDetailsOrderList(mapVal, pageNum, pageSize, apiId, new BigDecimal(orderType));
  513. }
  514. @PostMapping("/addConvertedDetailsOrder/{orderId}")
  515. RESTfulResult addConvertedDetailsOrder(@PathVariable("orderId") BigDecimal orderId) {
  516. return bmstruckFeign.addConvertedDetailsOrder(orderId);
  517. }
  518. /**
  519. * 生成内转汽运账单
  520. *
  521. * @param mapList
  522. * @return
  523. */
  524. @ApiModelProperty(value = "生成内转汽运账单")
  525. @PostMapping("/addConvertedTruckStatement")
  526. public RESTfulResult addConvertedTruckStatement(@RequestBody List<Map<String, Object>> mapList) {
  527. return bmstruckFeign.addConvertedTruckStatement(mapList);
  528. }
  529. /**
  530. * 删除汽运账单
  531. */
  532. @PostMapping("/deleteConvertedTruckStatement/{statementId}")
  533. public RESTfulResult deleteConvertedTruckStatement(@PathVariable("statementId") BigDecimal statementId) {
  534. return bmstruckFeign.delete(statementId);
  535. }
  536. /**
  537. * 审批计费账单
  538. */
  539. @PostMapping("/updateConvertedTruckStatement/{statementId}")
  540. public RESTfulResult updateConvertedTruckStatement(@PathVariable("statementId") BigDecimal statementId) {
  541. return bmstruckFeign.update(statementId);
  542. }
  543. /**
  544. * 审批计费账单
  545. */
  546. @PostMapping("/getBmsshipFee/{id}")
  547. public Map<String,Object> updateConvertedTruckStatement(@PathVariable("id") Integer id) {
  548. return bmsshipFeign.getBmsshipFee(id);
  549. }
  550. @PostMapping("/updateDetailsOrder")
  551. @ApiOperation(value = "修改详单")
  552. public RESTfulResult updateDetailsOrder(@RequestBody Map<String, Object> mapValue) {
  553. return bmstruckFeign.updateDetailsOrder(mapValue);
  554. }
  555. @PostMapping("/addLossFeeOfCoke")
  556. @ApiOperation(value = "增加焦炭途损费")
  557. public RESTfulResult addLossFeeOfCoke(@RequestBody Map<String, Object> map) {
  558. return bmstruckFeign.addLossFeeOfCoke(map);
  559. }
  560. @PostMapping("/addPortHandlingFeeSecond")
  561. @ApiOperation(value = "新增二程船装卸费用")
  562. public Map<String,Object> addPortHandlingFeeSecond(@RequestBody(required = false) Map<String, Object> map) {
  563. return bmsshipFeign.addPortHandlingFeeSecond(map);
  564. }
  565. @PostMapping("/uploadBmsshipOrder")
  566. @ApiOperation(value = "上传水运单图片")
  567. public Map<String,Object> uploadBmsshipOrder(@RequestParam("file") MultipartFile multipartFile) throws Exception {
  568. return bmsshipFeign.uploadBmsshipOrder(multipartFile);
  569. }
  570. //获取水运单图片
  571. @ApiOperation(value = "获取水运单图片")
  572. @ApiImplicitParams({
  573. })
  574. @PostMapping(value = "/downloadBmsshipOrder")
  575. public Map<String, Object> downloadBmsshipOrder(@RequestParam Integer resultId) {
  576. return bmsshipFeign.downloadBmsshipOrder(resultId);
  577. }
  578. /**
  579. * 展示详单信息
  580. *
  581. * @param mapVal
  582. * @param pageNum
  583. * @param pageSize
  584. * @param apiId
  585. * @return
  586. */
  587. @ApiModelProperty(value = "展示内转汽运未生成账单的作业详单信息")
  588. @ApiImplicitParams({
  589. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  590. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  591. @ApiImplicitParam(name = "apiId", value = "还没定", required = false, dataType = "BigDecimal"),
  592. @ApiImplicitParam(name = "orderType", value = "1:计时,2:计数,3:计重,4:包月", required = false, dataType = "Integer")
  593. })
  594. @PostMapping("/getInwardWeightDetailsOrder")
  595. public Map<String, Object> getInwardWeightDetailsOrder(@RequestBody(required = false) Map<String, Object> mapVal,
  596. Integer pageNum,
  597. Integer pageSize,
  598. Integer apiId,
  599. String carrierSsoId,
  600. Integer detailStatus,
  601. Integer orderType,
  602. String userId,
  603. String startTime,
  604. String endTime,
  605. String capacityNo,
  606. String shipperNames,
  607. String transRangeValues,
  608. String materialTypeNames,
  609. String isPage) {
  610. if (mapVal == null) {
  611. mapVal = new HashMap<>();
  612. }
  613. return bmstruckFeign.getInwardWeightDetailsOrder(mapVal, pageNum, pageSize, apiId, carrierSsoId,detailStatus,orderType,userId, startTime,
  614. endTime,capacityNo,shipperNames,transRangeValues,materialTypeNames,isPage);
  615. }
  616. @PostMapping("/getNoInwardDetails")
  617. public Map<String,Object> getNoInwardDetails(@RequestBody(required = false) Map<String, Object> mapVal,
  618. Integer pageNum,
  619. Integer pageSize,
  620. Integer apiId,
  621. String carrierSsoId,
  622. String userId,
  623. String startTime,
  624. String endTime,
  625. String orgCode,
  626. String capacityNo,
  627. String transRangeValues,
  628. String materialTypeNames,
  629. String shipperNames,
  630. String isPage){
  631. if (mapVal == null) {
  632. mapVal = new HashMap<>();
  633. }
  634. return bmstruckFeign.getNoInwardDetails(mapVal, pageNum, pageSize, apiId, carrierSsoId,userId, startTime,
  635. endTime,orgCode,capacityNo,transRangeValues,materialTypeNames,shipperNames,isPage);
  636. }
  637. @PostMapping("/getInwardWeightTimeDetailsOrder")
  638. public Map<String, Object> getInwardWeightTimeDetailsOrder(@RequestBody(required = false) Map<String, Object> mapVal,
  639. Integer pageNum,
  640. Integer pageSize,
  641. Integer apiId,
  642. String carrierSsoId,
  643. Integer detailStatus,
  644. Integer orderType,
  645. String userId,
  646. String startTime,
  647. String endTime) {
  648. if (mapVal == null) {
  649. mapVal = new HashMap<>();
  650. }
  651. return bmstruckFeign.getInwardWeightTimeDetailsOrder(mapVal, pageNum, pageSize, apiId, carrierSsoId,detailStatus,orderType,userId, startTime,
  652. endTime);
  653. }
  654. @PostMapping("/selectPortFeeSecondList")
  655. public Map<String,Object> selectPortFeeSecondList(@RequestBody(required = false) Map<String, Object> mapVal,
  656. Integer pageNum,
  657. Integer pageSize,
  658. Integer apiId,
  659. String startTime,
  660. String endTime,
  661. Integer feeType,
  662. String con){
  663. if (mapVal == null) {
  664. mapVal = new HashMap<>();
  665. }
  666. return bmsshipFeign.selectPortFeeSecondList(mapVal, pageNum, pageSize, apiId, startTime, feeType,endTime,con);
  667. }
  668. /**
  669. * 根据批次查火运湿吨详情
  670. * @param batchId
  671. * @return
  672. */
  673. @PostMapping("/getTrainDetailsByBatch/{batchId}")
  674. public Map<String,Object> getTrainDetailsByBatch(@PathVariable("batchId")BigDecimal batchId){
  675. return bmsshipFeign.getTrainDetailsByBatch(batchId);
  676. }
  677. /**
  678. * 根据批次查汽运湿吨详情
  679. * @param batchId
  680. * @return
  681. */
  682. @PostMapping("/getTruckDetailsByBatch/{batchId}")
  683. public Map<String,Object> getTruckDetailsByBatch(@PathVariable("batchId")BigDecimal batchId){
  684. return bmsshipFeign.getTruckDetailsByBatch(batchId);
  685. }
  686. /**
  687. * 根据批次查询装船作业
  688. * @param
  689. * @return
  690. */
  691. @PostMapping("/findLoadByBatch")
  692. public Map<String,Object> findLoadByBatch(@RequestBody(required = false) Map<String, Object> mapVal,
  693. Integer pageNum,
  694. Integer pageSize,
  695. Integer apiId,
  696. BigDecimal batchId){
  697. if (mapVal == null) {
  698. mapVal = new HashMap<>();
  699. }
  700. return bmsshipFeign.findLoadByBatch(mapVal, pageNum, pageSize, apiId,batchId);
  701. }
  702. @PostMapping("getSteelTruckDetailsOrder")
  703. public Map<String,Object> getSteelTruckDetailsOrder(@RequestBody(required = false) Map<String,Object>map,
  704. Integer pageNum,
  705. Integer pageSize,
  706. Integer apiId,
  707. Integer orderType,
  708. String carrierSsoId,
  709. String startTime,
  710. String endTime,
  711. String con){
  712. if(map == null){
  713. map = new HashMap<>();
  714. }
  715. return bmstruckFeign.getSteelTruckDetailsOrder(map,pageNum,pageSize,apiId,orderType,carrierSsoId,startTime,endTime,con);
  716. }
  717. @PostMapping("/getShipFeeStatement")
  718. public Map<String,Object> getShipFeeStatement(@RequestBody(required = false) Map<String,Object> map){
  719. if(map == null){
  720. map = new HashMap<>();
  721. }
  722. return bmsshipFeign.getShipFeeStatement(map);
  723. }
  724. @PostMapping("/getShipFeeStatemented")
  725. public Map<String,Object> getShipFeeStatemented(@RequestBody(required = false) Map<String,Object> map){
  726. if(map == null){
  727. map = new HashMap<>();
  728. }
  729. return bmsshipFeign.getShipFeeStatemented(map);
  730. }
  731. @PostMapping("/addShipFeeStatement")
  732. public Map<String,Object> addShipFeeStatement(@RequestBody(required = false) Map<String,Object> map){
  733. if(map == null){
  734. map = new HashMap<>();
  735. }
  736. return bmsshipFeign.addShipFeeStatement(map);
  737. }
  738. @PostMapping("/editShipFeeStatement")
  739. public Map<String,Object> editShipFeeStatement(@RequestBody(required = false) Map<String,Object> map){
  740. if(map == null){
  741. map = new HashMap<>();
  742. }
  743. return bmsshipFeign.editShipFeeStatement(map);
  744. }
  745. //手动生成详单
  746. @PostMapping("/newInwardSettle")
  747. public Map<String,Object> newInwardSettle(@RequestBody Map<String,Object> map){
  748. return bmstruckFeign.newInwardSettle(map);
  749. }
  750. @PostMapping("/getWetDryDetails")
  751. public Map<String,Object> getWetDryDetails(@RequestBody Map<String,Object> map){
  752. return bmsshipFeign.getWetDryDetails(map);
  753. }
  754. @PostMapping("updateDetailsStatus")
  755. public Map<String,Object> updateDetailsStatus(@RequestBody Map<String,Object> map) {
  756. return bmstruckFeign.updateDetailsStatus(map);
  757. }
  758. @PostMapping("updateBatchDetailsOrder")
  759. public Map<String,Object> updateBatchDetailsOrder(@RequestBody Map<String,Object> map) {
  760. return bmstruckFeign.updateBatchDetailsOrder(map);
  761. }
  762. @PostMapping("findDetailsForStatement")
  763. public Map<String,Object> findDetailsForStatement(@RequestBody Map<String,Object> map) {
  764. return bmstruckFeign.findDetailsForStatement(map);
  765. }
  766. @ApiOperation("查询发票图片")
  767. @PostMapping("/getStatementPhoto")
  768. public List<String> getStatementPhoto(@RequestParam BigDecimal statementId) throws Exception{
  769. try{
  770. String statementPhoto=bmstruckFeign.getStatementPhoto(statementId);
  771. return getPhotoByUrl(statementPhoto);
  772. }catch (Exception e){
  773. return null;
  774. }
  775. }
  776. //切割字符串,下载图片并返回
  777. private List<String> getPhotoByUrl(String urls) throws Exception {
  778. List<String> results=new ArrayList<>();
  779. String files[]=urls.split(";");
  780. for(int i=0;i<files.length && files[i].length()>5;i++){
  781. results.add((String)imageFileUtils.downloadFile(files[i]));
  782. }
  783. return results;
  784. }
  785. }