WmspOutboundResultController.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.feign.ESFeign;
  3. import com.steerinfo.dil.mapper.CommonSeq;
  4. import com.steerinfo.dil.mapper.WmspInboundScanResultMapper;
  5. import com.steerinfo.dil.model.WmspOutboundResult;
  6. import com.steerinfo.dil.model.WmspOutboundScanResult;
  7. import com.steerinfo.dil.service.IWmspOutboundResultService;
  8. import com.steerinfo.dil.service.impl.WmspOutboundResultServiceImpl;
  9. import com.steerinfo.dil.util.BaseRESTfulController;
  10. import com.steerinfo.dil.util.ColumnDataUtil;
  11. import com.steerinfo.dil.util.DataChange;
  12. import com.steerinfo.dil.util.PageListAdd;
  13. import com.steerinfo.framework.controller.RESTfulResult;
  14. import com.steerinfo.framework.service.pagehelper.PageHelper;
  15. import io.swagger.annotations.ApiImplicitParam;
  16. import io.swagger.annotations.ApiImplicitParams;
  17. import io.swagger.annotations.ApiOperation;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.transaction.annotation.Transactional;
  20. import org.springframework.web.bind.annotation.*;
  21. import java.math.BigDecimal;
  22. import java.text.SimpleDateFormat;
  23. import java.util.*;
  24. /**
  25. * WmspOutboundResult RESTful接口:
  26. * @author generator
  27. * @version 1.0-SNAPSHORT 2021-09-08 10:35
  28. * 类描述
  29. * 修订历史:
  30. * 日期:2021-09-08
  31. * 作者:generator
  32. * 参考:
  33. * 描述:WmspOutboundResult RESTful接口
  34. * @see null
  35. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  36. */
  37. @RestController
  38. @RequestMapping("/${api.version}/wmspoutboundresults")
  39. public class WmspOutboundResultController extends BaseRESTfulController {
  40. @Autowired
  41. WmspOutboundResultServiceImpl wmspOutboundResultService;
  42. @Autowired
  43. WmspInboundScanResultMapper wmspInboundScanResultMapper;
  44. @Autowired
  45. CommonSeq commonSeq;
  46. @Autowired
  47. ESFeign esFeign;
  48. /**
  49. * 编写人:hukui
  50. * PC端查看钢材出库实绩
  51. * 参数:
  52. * apiId:表头id
  53. * pageSize:每页记录数
  54. * pageNum:查询页数
  55. * 返回值:
  56. * data:所有出库单实绩
  57. * */
  58. @Autowired
  59. ColumnDataUtil columnDataUtil;
  60. @ApiImplicitParams({
  61. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  62. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  63. @ApiImplicitParam(name = "apiId", value = "96", required = false, dataType = "BigDecimal"),
  64. })
  65. @PostMapping(value = "/getWmspOutboundResult")
  66. public RESTfulResult getWmspOutboundResult(@RequestBody(required = false) Map<String, Object> mapval,
  67. Integer pageNum,
  68. Integer pageSize,
  69. Integer apiId,
  70. String con
  71. ){
  72. if (con != null) {
  73. if (!"undefined".equals(con)) {
  74. String index = "get_wms_outResult";//设置要查询的索引名称
  75. return success(esFeign.getConResult(mapval, index, apiId, pageNum, pageSize, con));//获取查询结果
  76. }
  77. }
  78. List<Map<String, Object>> libaryOutBoundList = null;
  79. if (mapval.size() == 0) {
  80. //将查询结果存入索引中
  81. libaryOutBoundList = wmspOutboundResultService.selectResultNumber(mapval);
  82. Map<String, Object> map1 = new HashMap<>();
  83. //添加索引
  84. map1.put("index", "get_wms_outresult");
  85. //添加id
  86. map1.put("indexId", "outBoundResultId");
  87. libaryOutBoundList.add(map1);
  88. //新建索引
  89. esFeign.insertIndex(libaryOutBoundList);
  90. //删除
  91. libaryOutBoundList.remove(libaryOutBoundList.size() - 1);
  92. }
  93. if (libaryOutBoundList == null) {
  94. libaryOutBoundList = wmspOutboundResultService.selectResultNumber(mapval);
  95. }
  96. PageHelper.startPage(pageNum, pageSize);
  97. List<Map<String, Object>> columnList =wmspOutboundResultService.selectResultNumber(mapval);
  98. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, libaryOutBoundList, columnList);
  99. return success(pageList);
  100. }
  101. /**
  102. * 编写人:hukui
  103. * 通过前端扫描司机运单二维码,新增出单实绩并返回新增的出库单实绩
  104. * 参数:
  105. * mapval(运输订单号,订单类别)
  106. * 返回值:
  107. * list:出库单实绩
  108. * */
  109. @Transactional
  110. @PostMapping(value = "/insertWmspOutBoundResult")
  111. public Map<String, Object> insertWmspOutBoundResult(@RequestBody(required = false) Map<String, Object> mapval){
  112. /**拿到前端传递的运输订单号*/
  113. String orderNumber = mapval.get("orderNumber").toString();
  114. /**根据运输订单号,查询运输订单信息,*/
  115. Map<String, Object> order = wmspOutboundResultService.getOrder(orderNumber);
  116. /**拿运输订单信息中的运输订单Id*/
  117. BigDecimal orderId = (BigDecimal) order.get("orderId");
  118. // 根据该运输订单Id判断当前订单是否已经完成出厂,若完成直接返回null
  119. if (wmspOutboundResultService.getOutboundStatus(orderId)==0){
  120. /**根据运输订单号,查询出该订单还没有装货的物资*/
  121. List<Map<String,Object>> orderList = wmspOutboundResultService.getMaterial(orderId.intValue());
  122. //拿到还没装货的物资的物资编码
  123. String materialCode = (String) orderList.get(0).get("materialCode");
  124. //拿到还没装货的物资的物资名称
  125. String materialName = (String) orderList.get(0).get("materialName");
  126. //拿到还没装货的物资的规格
  127. String materialSpecification = (String) orderList.get(0).get("materialSpecification");
  128. //拿到还没装货的物资的型号
  129. String materialModel = (String) orderList.get(0).get("materialModel");
  130. //拿到还没装货的物资的物资理重
  131. BigDecimal materialTheoreticalWeight = (BigDecimal) orderList.get(0).get("materialTheoreticalWeight");
  132. //获取装卸工工号
  133. //String personnelJobNumber = mapval.get("personnelJobNumber").toString();
  134. //通过装卸工工号查询装卸工名称
  135. //String personnelName = wmspOutboundResultService.getPersonnelNameByJobnumber(personnelJobNumber);
  136. //拿到还没装货的物资id的第一条
  137. BigDecimal materialId = (BigDecimal) orderList.get(0).get("materialId");
  138. /**根据运输订单ID和物资id查询出库单(没有逻辑删除)
  139. * 若orderNum大于0,则不是第一次扫描,已经新增出库单,返回详情信息
  140. * 若orderNum等于0,则是第一次扫描,需要增加出库单,再返回详情信息
  141. * */
  142. Map<String,Object> map = new HashMap<>();
  143. map.put("orderId",orderId);
  144. map.put("materialId",materialId);
  145. //初始化出库单详情信息
  146. Map<String, Object> outBoundDetailedInfo=null;
  147. int orderNum = wmspOutboundResultService.ExistWmspOutboundResult(map);
  148. if(orderNum == 0){
  149. /**创建出库单实体*/
  150. WmspOutboundResult wmspOutboundResult = new WmspOutboundResult();
  151. /**使用序列号增加生成主键id*/
  152. int seq_wmspoutboundresult = commonSeq.getSeqNumber("seq__WMSP_OUTBOUND_RESULT");
  153. /**获取到当前时间*/
  154. SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
  155. /**生成出库单编号*/
  156. String resultNumber = "XSCK" + sdf.format(new Date());
  157. if(seq_wmspoutboundresult < 10){
  158. resultNumber += "0000000" + seq_wmspoutboundresult;
  159. }else if(seq_wmspoutboundresult < 100){
  160. resultNumber += "000000" + seq_wmspoutboundresult;
  161. }else if(seq_wmspoutboundresult < 1000){
  162. resultNumber += "00000" + seq_wmspoutboundresult;
  163. }else if(seq_wmspoutboundresult < 10000){
  164. resultNumber += "0000" + seq_wmspoutboundresult;
  165. }else if(seq_wmspoutboundresult < 100000){
  166. resultNumber += "000" + seq_wmspoutboundresult;
  167. }else if(seq_wmspoutboundresult < 1000000){
  168. resultNumber += "00" + seq_wmspoutboundresult;
  169. }else if(seq_wmspoutboundresult < 10000000){
  170. resultNumber += "0" + seq_wmspoutboundresult;
  171. }else{
  172. resultNumber += seq_wmspoutboundresult;
  173. }
  174. /**拿到运输订单类型*/
  175. BigDecimal orderType = (BigDecimal) order.get("orderType");
  176. /**运输订单类型判断
  177. * orderType : 1 为普通出库
  178. * orderType : 4 为调拨出库
  179. * */
  180. String resultOutboundType = "普通出库";
  181. if(orderType.intValue() == 4){
  182. resultOutboundType = "调拨出库";
  183. }
  184. /**把出库单主键id添加到出库单实体中*/
  185. wmspOutboundResult.setResultId(new BigDecimal(seq_wmspoutboundresult));
  186. /**把出库单编号添加到出库单实体中*/
  187. wmspOutboundResult.setResultNumber(resultNumber);
  188. /**把运输订单主键添加到出库单实体中*/
  189. wmspOutboundResult.setBillLadingId(orderId);
  190. /**把出库类型添加到出库单实体中*/
  191. wmspOutboundResult.setResultOutboundType(resultOutboundType);
  192. /**第一次添加为待出库*/
  193. wmspOutboundResult.setResultStatus(new BigDecimal(0));
  194. //常规字段
  195. wmspOutboundResult.setInsertUsername("admin");
  196. wmspOutboundResult.setInsertTime(new Date());
  197. wmspOutboundResult.setUpdateUsername("admin");
  198. wmspOutboundResult.setUpdateTime(new Date());
  199. wmspOutboundResult.setInsertUpdateRemark("无");
  200. wmspOutboundResult.setDeleted(new BigDecimal(0));
  201. //还没装货的物资id的第一条添加到出库单实体中
  202. wmspOutboundResult.setMaterialId(materialId);
  203. Integer res = wmspOutboundResultService.insertSelective(wmspOutboundResult);
  204. if(res == 1){
  205. //返回出库单详情信息
  206. outBoundDetailedInfo = wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
  207. outBoundDetailedInfo.put("orderNumber",orderNumber);
  208. // outBoundDetailedInfo.put("personnelName",personnelName);
  209. outBoundDetailedInfo.put("materialCode",materialCode);
  210. outBoundDetailedInfo.put("materialName",materialName);
  211. outBoundDetailedInfo.put("materialSpecification",materialSpecification);
  212. outBoundDetailedInfo.put("materialModel",materialModel);
  213. outBoundDetailedInfo.put("materialTheoreticalWeight",materialTheoreticalWeight);
  214. }
  215. }else{
  216. //返回出库单详情信息
  217. outBoundDetailedInfo = wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
  218. outBoundDetailedInfo.put("orderNumber",orderNumber);
  219. // outBoundDetailedInfo.put("personnelName",personnelName);
  220. outBoundDetailedInfo.put("materialCode",materialCode);
  221. outBoundDetailedInfo.put("materialName",materialName);
  222. outBoundDetailedInfo.put("materialSpecification",materialSpecification);
  223. outBoundDetailedInfo.put("materialModel",materialModel);
  224. outBoundDetailedInfo.put("materialTheoreticalWeight",materialTheoreticalWeight);
  225. }
  226. return outBoundDetailedInfo;
  227. }
  228. return null;
  229. }
  230. /**
  231. * 编写人:zouzhendon
  232. * PDA前端装卸工拒绝扫描出的运输订单,并逻辑删除出库单
  233. * 参数:
  234. * resultId(出库单Id)
  235. * 返回值:
  236. * int:是否逻辑删除出库单
  237. * */
  238. @PostMapping(value = "/deletewmspOutboundResult")
  239. public RESTfulResult deleteWmspOutboundResult(@RequestParam Integer resultId){
  240. //通过出库单Id逻辑删除出库单
  241. int i = wmspOutboundResultService.deleteWmspOutboundResult(new BigDecimal(resultId));
  242. return success(i);
  243. }
  244. /**
  245. * 编写人:zouzhendon
  246. * 装卸工PDA前端扫描钢材吊牌二维码,新增出库单扫描实绩并返回已扫描并稽核成功的物资信息
  247. * 参数:
  248. * map(resultNumber 出库单号,personnelJobNumber 装卸工工号 resultMaterial 装卸工扫描吊牌结果)
  249. * 返回值:
  250. * list:出库单实绩
  251. * */
  252. @Transactional
  253. @PostMapping(value = "/insertwmspOutboundScanResult")
  254. public synchronized RESTfulResult insertwmspOutboundScanResult(@RequestBody(required = false) Map<String, Object> map){
  255. ///获得前台传来得信息
  256. //获取装卸工扫描吊牌结果 HRB400-14-21706854-9-3049-280-20211001015115-7a63cd87a4095e7f-08010103010100003-4
  257. String resultMaterial = (String) map.get("resultMaterial");
  258. String subResultMaterial = resultMaterial.substring(0,resultMaterial.length() - 1);
  259. //获取出库单号
  260. Integer resultId1 = (Integer) map.get("resultId");
  261. //通过出库单号查询出库实绩ID
  262. BigDecimal resultId = new BigDecimal(resultId1);
  263. /**根据扫描结果查询扫描实绩、判断是否一件出库
  264. * 若scanCount大于0,则不是第一次扫描,已经新增出库扫描实绩,返回已扫描过
  265. * 若scanCount等于0,则是第一次扫描,需要增加出库扫描实绩,再返回已扫描并稽核成功的物资信息
  266. * */
  267. ///判断物质是否已经被扫描
  268. int scanCount = wmspOutboundResultService.ExistScanResult(subResultMaterial);
  269. ///如果没有被扫描
  270. if(scanCount==0){
  271. //wmspOutboundResultService.getOutBoundId(resultNumber);
  272. //获取装卸工工号
  273. String personnelJobNumber = (String) map.get("personnelJobNumber");
  274. //通过装卸工工号查询装卸工Id
  275. BigDecimal personnelId = wmspOutboundResultService.getPersonnelIdByJobnumber(personnelJobNumber);
  276. //通过出库实绩Id判断出库单已扫描的件数是否等于运输订单物资表的物资件数
  277. ///解析物质二维码信息
  278. //截取扫描结果,得到物资唯一编码
  279. String[] split = resultMaterial.split("-");
  280. //唯一编码
  281. String MaterialOnlyCode=split[7];
  282. //通过物资物资唯一编码查询钢材物资表的物资Id
  283. BigDecimal SteelMaterialId = wmspOutboundResultService.getSteelMaterialIdByMaterialOnlyCode(MaterialOnlyCode);
  284. //通过出库实绩Id查询物资Id
  285. BigDecimal OutboundMaterialId = wmspOutboundResultService.getOutboundMaterialByResultId(resultId);
  286. //初始化出库扫描实绩
  287. WmspOutboundScanResult wmspOutboundScanResult = new WmspOutboundScanResult();
  288. //使用序列号增加生成主键id
  289. int seq_wmspOutboundScanResult = commonSeq.getSeqNumber("seq__WMSP_OUTBOUND_SCAN_RESULT");
  290. //插入主键id
  291. wmspOutboundScanResult.setResultId(new BigDecimal(seq_wmspOutboundScanResult));
  292. //根据物资id查询相对应的入库实绩ID,并将其赋值给相对应的入库扫描实绩表
  293. List<Map<String, Object>> list= wmspInboundScanResultMapper.getInboundResultIdByMaterial(subResultMaterial);
  294. // 默认以获取到的第一个值作为入库实绩Id
  295. Map<String ,Object> map1 = list.get(0);
  296. wmspOutboundScanResult.setInboundResultId((BigDecimal) map1.get("inboundResultId"));
  297. //插入出库实绩ID
  298. wmspOutboundScanResult.setOutboundResultId(resultId);
  299. //插入装卸工Id
  300. wmspOutboundScanResult.setLoadId(personnelId);
  301. //插入装卸工扫描吊牌结果
  302. wmspOutboundScanResult.setResultMaterial(resultMaterial);
  303. //插入装卸工扫描吊牌时间
  304. wmspOutboundScanResult.setResultLoadTime(new Date());
  305. //插入出库物资数量
  306. wmspOutboundScanResult.setOutboundMaterialNumber(new BigDecimal(1));
  307. //常规字段
  308. wmspOutboundScanResult.setInsertUsername("admin");
  309. wmspOutboundScanResult.setInsertTime(new Date());
  310. wmspOutboundScanResult.setUpdateUsername("admin");
  311. wmspOutboundScanResult.setUpdateTime(new Date());
  312. wmspOutboundScanResult.setInsertUpdateRemark("无");
  313. if(SteelMaterialId.intValue()==OutboundMaterialId.intValue()){
  314. int EqualMaterialsNumber = wmspOutboundResultService.EqualMaterialsNumber(resultId);
  315. if(EqualMaterialsNumber==1){
  316. //相等返回装货数量已够
  317. wmspOutboundScanResult.setResultCheck(new BigDecimal(1));
  318. }else {
  319. //稽核成功,设定扫描实绩稽核结果为成功
  320. wmspOutboundScanResult.setResultCheck(new BigDecimal(0));
  321. }
  322. //插入扫描实绩
  323. wmspOutboundResultService.scanResultInsert(wmspOutboundScanResult);
  324. }else {
  325. //稽核失败,设定扫描实绩稽核结果为失败
  326. wmspOutboundScanResult.setResultCheck(new BigDecimal(1));
  327. //插入扫描实绩
  328. wmspOutboundResultService.scanResultInsert(wmspOutboundScanResult);
  329. }
  330. //返回已扫描并并稽核成功的物资信息
  331. //1、获取出库单统一信息
  332. //获取月台Id
  333. //BigDecimal platformId = wmspOutboundResultService.getPlatformIdByResultId(resultId);
  334. //通过月台Id获取仓库名
  335. //String warehouseName = wmspOutboundResultService.getWarehouseNameByPlatformId(platformId);
  336. //获取出库单统一部分信息
  337. Map<String,Object> theSameOutboundInfo = wmspOutboundResultService.theSameOutboundInfo(resultId);
  338. //theSameOutboundInfo.put("warehouseName",warehouseName);
  339. //2、获取出库扫描实绩数据
  340. List<Map<String,Object>> scanAuditSuccessInfo = wmspOutboundResultService.scanAuditSuccessInfo(resultId);
  341. //补全出库扫描实绩数据的信息,对扫描实绩进行去重
  342. for (Map<String, Object> stringObjectMap : scanAuditSuccessInfo) {
  343. String resultMaterial1 = (String) stringObjectMap.get("resultMaterial");
  344. //截取扫描结果,得到一件物资的详细信息
  345. String[] split1 = resultMaterial1.split("-");
  346. //规格
  347. String Specification="Φ"+split1[1];
  348. stringObjectMap.put("Specification",Specification);
  349. //型号
  350. String Model=split1[0];
  351. stringObjectMap.put("Model",Model);
  352. //炉号
  353. String FurnaceNumber=split1[2];
  354. stringObjectMap.put("FurnaceNumber",FurnaceNumber);
  355. //理重
  356. String TheoreticalWeight=split1[4];
  357. stringObjectMap.put("TheoreticalWeight",TheoreticalWeight);
  358. //唯一编码
  359. String MaterialOnlyCode1=split1[7];
  360. stringObjectMap.put("MaterialOnlyCode",MaterialOnlyCode1);
  361. //通过唯一编码获取物资名称、计量单位、垛位
  362. Map<String,Object> otherMap = wmspOutboundResultService.getOtherInfoByMaterialOnlyCode(MaterialOnlyCode1);
  363. //取出再放入物资名称
  364. String materialName = otherMap.get("materialName").toString();
  365. stringObjectMap.put("materialName",materialName);
  366. //取出再放入计量单位
  367. String unitOfMeasureName = otherMap.get("unitOfMeasureName").toString();
  368. stringObjectMap.put("unitOfMeasureName",unitOfMeasureName);
  369. //取出再放入垛位
  370. String stackingNo = otherMap.get("stackingNo").toString();
  371. stringObjectMap.put("stackingNo",stackingNo);
  372. //合并出库单统一信息map
  373. stringObjectMap.putAll(theSameOutboundInfo);
  374. }
  375. return success(scanAuditSuccessInfo);
  376. }else{
  377. //返回已扫描并并稽核成功的物资信息
  378. //1、获取出库单统一信息
  379. //获取月台Id
  380. //BigDecimal platformId = wmspOutboundResultService.getPlatformIdByResultId(resultId);
  381. //通过月台Id获取仓库名
  382. //String warehouseName = wmspOutboundResultService.getWarehouseNameByPlatformId(platformId);
  383. //获取出库单统一部分信息
  384. Map<String,Object> theSameOutboundInfo = wmspOutboundResultService.theSameOutboundInfo(resultId);
  385. //theSameOutboundInfo.put("warehouseName",warehouseName);
  386. //2、获取出库扫描实绩数据
  387. List<Map<String,Object>> scanAuditSuccessInfo = wmspOutboundResultService.scanAuditSuccessInfo(resultId);
  388. //补全出库扫描实绩数据的信息
  389. for (Map<String, Object> stringObjectMap : scanAuditSuccessInfo) {
  390. String resultMaterial1 = (String) stringObjectMap.get("resultMaterial");
  391. //截取扫描结果,得到一件物资的详细信息
  392. String[] split1 = resultMaterial1.split("-");
  393. //规格
  394. String Specification = "Φ" + split1[1];
  395. stringObjectMap.put("Specification", Specification);
  396. //型号
  397. String Model = split1[0];
  398. stringObjectMap.put("Model", Model);
  399. //炉号
  400. String FurnaceNumber = split1[2];
  401. stringObjectMap.put("FurnaceNumber", FurnaceNumber);
  402. //理重
  403. String TheoreticalWeight = split1[4];
  404. stringObjectMap.put("TheoreticalWeight", TheoreticalWeight);
  405. //唯一编码
  406. String MaterialOnlyCode1 = split1[7];
  407. stringObjectMap.put("MaterialOnlyCode", MaterialOnlyCode1);
  408. //通过唯一编码获取物资名称、计量单位、垛位
  409. Map<String, Object> otherMap = wmspOutboundResultService.getOtherInfoByMaterialOnlyCode(MaterialOnlyCode1);
  410. //取出再放入物资名称
  411. String materialName = otherMap.get("materialName").toString();
  412. stringObjectMap.put("materialName", materialName);
  413. //取出再放入计量单位
  414. String unitOfMeasureName = otherMap.get("unitOfMeasureName").toString();
  415. stringObjectMap.put("unitOfMeasureName", unitOfMeasureName);
  416. //取出再放入垛位
  417. String stackingNo = otherMap.get("stackingNo").toString();
  418. stringObjectMap.put("stackingNo", stackingNo);
  419. //合并出库单统一信息map
  420. stringObjectMap.putAll(theSameOutboundInfo);
  421. }
  422. return success(scanAuditSuccessInfo);
  423. }
  424. }
  425. /**
  426. * 编写人:hujianguo
  427. * 装卸工PDA前端点击出库
  428. * 参数:
  429. * resultId
  430. * 返回值:
  431. * result:出库成功标志
  432. * */
  433. @ApiOperation(value = "出库(非0:成功,0:失败)")
  434. @PostMapping("/outbountResultToSuccess")
  435. public RESTfulResult outbountResultToSuccess(@RequestParam Integer resultId) {
  436. int result = wmspOutboundResultService.outbountResultToSuccess(resultId);
  437. if (result == 0) {
  438. return failed("还未扫描完,请继续!");
  439. }
  440. else {
  441. return success(result);
  442. }
  443. }
  444. /**
  445. * 编写人:hukui
  446. * 通过前端扫描司机运单二维码,新增出单实绩并返回新增的出库单实绩
  447. * 参数:
  448. * mapval(运输订单号,订单类别)
  449. * 返回值:
  450. * list:出库单实绩
  451. * */
  452. @PostMapping(value = "/updataResultStatus")
  453. public RESTfulResult updataResultStatus(@RequestBody(required = false) Integer resultId){
  454. // 创建一个出库单实体
  455. WmspOutboundResult wmspOutboundResult = new WmspOutboundResult();
  456. // 把前端传递的出库单主键id赋值给实体
  457. wmspOutboundResult.setResultId(new BigDecimal(resultId));
  458. // 把出库单状态改为已出库
  459. wmspOutboundResult.setResultStatus(new BigDecimal(1));
  460. int i = wmspOutboundResultService.updateByPrimaryKeySelective(wmspOutboundResult);
  461. return success(i);
  462. }
  463. /**
  464. * 司机扫描订单二维码进行倒库,首先根据运输订单号查找运输订单,
  465. *
  466. */
  467. @PostMapping("/insertOutBoundResult")
  468. public RESTfulResult insertOutBoundResult(@RequestBody(required = false) Map<String, Object> map){
  469. return success();
  470. }
  471. }