From 43be81738ea7a041bd78dabbbb580e688a0d6804 Mon Sep 17 00:00:00 2001 From: ytfl <ytfl@qq.com> Date: 星期六, 16 八月 2025 13:57:54 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 95 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 74 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 3eee41e..61d6d09 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -233,6 +233,12 @@ .eq("loc_no", dto.getLocNo())); short staNo = dto.getStaNo().shortValue(); + + int sourceStaNo = dto.getSourceStaNo(); + if (sourceStaNo == 1007) { + staNo = 2002; + } + if (inSta.getStaNo() == 1002) { staNo = 2002; } @@ -742,6 +748,12 @@ // continue; // } + //鍫嗗灈鏈哄洖鍘熺偣浠诲姟涓� + Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK); + if (object != null) { + continue; + } + // 鍙湁褰撳爢鍨涙満绌洪棽 骞朵笖 鏃犱换鍔℃椂鎵嶇户缁墽琛� if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO && crnProtocol.getLoaded() == 0 && crnProtocol.getForkPos() == 0) { @@ -841,7 +853,7 @@ News.error("鍫嗗灈鏈虹Щ鍔ㄥ懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); } crnThread.setBackHpFlag(true); - redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 60); + redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 10); try { Thread.sleep(500); } catch (Exception e) { @@ -913,7 +925,7 @@ News.error("鍫嗗灈鏈虹Щ鍔ㄥ懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); } crnThread.setBackHpFlag(true); - redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 60); + redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 10); try { Thread.sleep(500); } catch (Exception e) { @@ -1201,8 +1213,7 @@ // continue; } // 鍒ゆ柇鍫嗗灈鏈哄嚭搴撶珯鐘舵�� - if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") - && staProtocol.getWorkNo() == 0) { + if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")) { //鏍规嵁鍙傛暟鍒ゆ柇鏄惁鏍¢獙鍙嚭淇″彿 String crnOutVerifyOut = "Y"; @@ -1214,6 +1225,10 @@ if (crnOutVerifyOut.equals("Y")) { if (!staProtocol.isOutEnable()) { + continue; + } + + if (staProtocol.getWorkNo() > 0) { continue; } } @@ -1529,7 +1544,7 @@ if (wrkMastMapper.updateById(wrkMast) == 0) { News.error("" + mark + " - 3" + " - 5" + " - 銆愬簱浣嶇Щ杞�� 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } - crnProtocol.setLastIo("O"); + crnProtocol.setLastIo("I"); } News.infoNoLog("" + mark + " - 3" + " - 0" + " - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂锛氬簱浣嶇Щ杞畬鎴�"); @@ -2124,22 +2139,60 @@ // }catch (Exception e){ // log.error("宸ヤ綔妗f鏄庣粏杈撳叆鐢佃鏈哄け璐�1锛氬紓甯镐俊鎭�==銆�"+e); // } - wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto( - wrkDetl.getMatnr() - , wrkDetl.getMaktx() - , wrkDetl.getAnfme() - , wrkDetl.getWeight() - , wrkDetl.getStockNum() - , wrkDetl.getStockNum2() - , wrkDetl.getSpecs() - , wrkDetl.getSku() - , wrkDetl.getZpallet() - , wrkDetl.getModel() - , wrkDetl.getSupp() - , wrkDetl.getKpCstmrName() - , wrkDetl.getOrderNo() - , wrkDetl.getCstateid$() - ))); + + if (!wrkDetls.isEmpty()) { + WrkDetl wrkDetl = wrkDetls.get(0); + for (WrkDetl detl : wrkDetls) { + double anfme = wrkDetl.getAnfme() + detl.getAnfme(); + double weight = wrkDetl.getWeight() + detl.getWeight(); + if (wrkDetl.getStockNum() != null) { + double stockNum = wrkDetl.getStockNum() + detl.getStockNum(); + wrkDetl.setStockNum(stockNum); + } + + if (wrkDetl.getStockNum2() != null) { + double stockNum2 = wrkDetl.getStockNum2() + detl.getStockNum2(); + wrkDetl.setStockNum2(stockNum2); + } + wrkDetl.setAnfme(anfme); + wrkDetl.setWeight(weight); + } + + ledCommand.getMatDtos().add(new MatDto( + wrkDetl.getMatnr() + , wrkDetl.getMaktx() + , wrkDetl.getAnfme() + , wrkDetl.getWeight() + , wrkDetl.getStockNum() + , wrkDetl.getStockNum2() + , wrkDetl.getSpecs() + , wrkDetl.getSku() + , wrkDetl.getZpallet() + , wrkDetl.getModel() + , wrkDetl.getSupp() + , wrkDetl.getKpCstmrName() + , wrkDetl.getOrderNo() + , wrkDetl.getCstateid$() + )); + +// wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto( +// wrkDetl.getMatnr() +// , wrkDetl.getMaktx() +// , wrkDetl.getAnfme() +// , wrkDetl.getWeight() +// , wrkDetl.getStockNum() +// , wrkDetl.getStockNum2() +// , wrkDetl.getSpecs() +// , wrkDetl.getSku() +// , wrkDetl.getZpallet() +// , wrkDetl.getModel() +// , wrkDetl.getSupp() +// , wrkDetl.getKpCstmrName() +// , wrkDetl.getOrderNo() +// , wrkDetl.getCstateid$() +// ))); + } + } commands.add(ledCommand); } -- Gitblit v1.9.1