From 4df965ceb66f05f9e13d849003821e8eaac76e1f Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期日, 03 十一月 2024 09:49:13 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/jxgtasrs' into jxgtasrs --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 72 ++++++++++++++++++++++++++++++++---- 1 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java index 26be866..6981160 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -7,14 +7,11 @@ import com.core.common.*; import com.core.exception.CoolException; import com.zy.asrs.entity.*; -import com.zy.asrs.entity.param.CombParam; -import com.zy.asrs.entity.param.MobileAdjustParam; -import com.zy.asrs.entity.param.OffSaleParam; -import com.zy.asrs.entity.param.OpenOrderPakinParam; +import com.zy.asrs.entity.param.*; import com.zy.asrs.mapper.ManLocDetlMapper; import com.zy.asrs.service.*; import com.zy.asrs.utils.MatUtils; -import com.zy.common.CodeRes; +import com.zy.common.constant.ApiInterfaceConstant; import com.zy.common.constant.MesConstant; import com.zy.common.entity.Parameter; import com.zy.common.model.DetlDto; @@ -77,6 +74,64 @@ @Override + public R inLocCallAgv(String sta, String inSta) { + // 鍒ゆ柇鍏ュ簱绔欑偣鏈夋棤鍑哄簱浠诲姟 + int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", inSta)); + if (count > 0) { + return R.parse(inSta + "绔欑偣瀛樺湪鍑哄簱浠诲姟"); + } + + ForwardAGVTaskParam forwardAGVTaskParam = new ForwardAGVTaskParam(); + forwardAGVTaskParam.setReqCode(UUID.randomUUID().toString().replace("-", "")); + forwardAGVTaskParam.setTaskTyp("GT3"); + forwardAGVTaskParam.setCtnrTyp("2"); + forwardAGVTaskParam.setPriority("1"); + List<ForwardAGVTaskParam.PositionCodePaths> positionCodePathsList = new ArrayList<>(); + positionCodePathsList.add(new ForwardAGVTaskParam.PositionCodePaths(sta, "05")); + positionCodePathsList.add(new ForwardAGVTaskParam.PositionCodePaths(inSta, "05")); + forwardAGVTaskParam.setPositionCodePath(positionCodePathsList); + + String body = JSON.toJSONString(forwardAGVTaskParam); + String response = ""; + String message = ""; + boolean success = false; + try { + response = new HttpHandler.Builder() + .setUri(ApiInterfaceConstant.AGV_IP) + .setPath(ApiInterfaceConstant.AGV_CALL_IN_PATH) + .setJson(body) + .build() + .doPost(); + JSONObject jsonObject = JSON.parseObject(response); + jsonObject.getString("message"); + if (jsonObject.getInteger("code").equals(0)) { + success = true; + } else { + log.error("鍏ュ簱鍛煎彨agv澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_CALL_IN_PATH, body, response); + } + } catch (Exception e) { + log.error("鍏ュ簱鍛煎彨agv寮傚父", e); + } finally { + try { + // 淇濆瓨鎺ュ彛鏃ュ織 + apiLogService.save( + "鍏ュ簱鍛煎彨agv", + ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_CALL_IN_PATH, + null, + "127.0.0.1", + body, + response, + success + ); + } catch (Exception e) { + log.error("", e); + } + } + + return success ? R.ok("鍛煎彨agv鎴愬姛") : R.parse(message); + } + + @Override @Transactional public void comb(CombParam param, Long userId) { if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { @@ -91,8 +146,8 @@ throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱"); } - if(param.getBarcode().length()!=8){ - throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode()); + if(param.getBarcode().length()!=9){ + throw new CoolException("鏉$爜闀垮害涓嶆槸9浣�===>>" + param.getBarcode()); } if (param.getCombMats().size()>1){ throw new CoolException("涓嶅厑璁告贩鏂�===>>" + param.getBarcode()); @@ -171,7 +226,7 @@ throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触"); } - DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); + DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getManu()); if (DetlDto.has(detlDtos, detlDto)) { DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); assert one != null; @@ -198,6 +253,7 @@ waitPakin.setAppeTime(now); waitPakin.setModiUser(userId); waitPakin.setModiTime(now); + waitPakin.setManu(detlDto.getMark()); if (!waitPakinService.insert(waitPakin)) { throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�"); } -- Gitblit v1.9.1