From 443d5e6717a4946a2d6aadec78b4c69c8a359c3d Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期三, 15 二月 2023 09:14:06 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 108 +++++++++++------------------------------------------- 1 files changed, 22 insertions(+), 86 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 e54a137..9a63749 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -951,72 +951,6 @@ wrkMast.setIoPri((double) 9998); wrkMastMapper.updateById(wrkMast); - // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞� - if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { - String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); - LocMast shallowLoc = locMastService.selectById(shallowLocNo); - // O.绌哄簱浣嶃�丵.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴撱�丼.鍏ュ簱棰勭害銆乆.绂佺敤 鐩存帴鎼紒 - if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { - WrkMast waitWrkMast = wrkMastMapper.selectBySourceLocNo(shallowLocNo); - if (null == waitWrkMast) { - News.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo); - } else { - if(waitWrkMast.getWrkSts() == 11) { - waitWrkMast.setIoPri(wrkMast.getIoPri() + 1); - waitWrkMast.setModiTime(new Date()); - if (wrkMastMapper.updateById(waitWrkMast) == 0) { - News.error("璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo()); - } - } - continue; - } - } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { - // 姝ゆ爣璁伴伩鍏嶅娆℃墽琛岀Щ搴撲换鍔� - if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { - wrkMast.setUpdMk("Y"); - wrkMastMapper.updateById(wrkMast); - // 鐢熸垚宸ヤ綔妗c�佹敼鍙樻祬搴撲綅鐨勬簮搴�/鐩爣搴� 搴撲綅鐘舵�併�佷笅鍙戝爢鍨涙満鍛戒护锛堢珛椹墽琛�) - moveLocForDeepLoc(slave, shallowLoc); - } - News.error("{}浠诲姟鍑哄簱澶辫触锛屾祬搴撲綅鍫靛锛�", wrkMast.getWrkNo()); - continue; - } - } - - // 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊� - if (wrkMastMapper.selectWorking(slave.getId()) != null) { - continue; - } - - // 1.鍫嗗灈鏈哄紑濮嬬Щ鍔� - CrnCommand crnCommand = new CrnCommand(); - crnCommand.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� - crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 宸ヤ綔鍙� - crnCommand.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� - crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 浠诲姟妯″紡: 搴撲綅绉昏浆 - crnCommand.setSourcePosX(sourceSta.getRow1().shortValue()); // 婧愬簱浣嶆帓 - crnCommand.setSourcePosY(sourceSta.getBay1().shortValue()); // 婧愬簱浣嶅垪 - crnCommand.setSourcePosZ(sourceSta.getLev1().shortValue()); // 婧愬簱浣嶅眰 - crnCommand.setDestinationPosX(crnStn.getRow().shortValue()); // 鐩爣搴撲綅鎺� - crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 鐩爣搴撲綅鍒� - crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 鐩爣搴撲綅灞� - if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { - News.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); - } else { - // 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 16.鍚婅溅鍑哄簱涓� - Date now = new Date(); - wrkMast.setWrkSts(16L); - wrkMast.setCrnStrTime(now); - wrkMast.setModiTime(now); - if (wrkMastMapper.updateById(wrkMast) == 0) { - News.error("淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 16.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); - } else { - return true; - } - } - - } else { - // 鏈�澶栧眰搴撲綅锛岀洿鎺ュ爢鍨涙満鍑哄簱 if (locMastService.isOutMost(wrkMast.getSourceLocNo(), false)) { // 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊� @@ -1050,7 +984,7 @@ return true; } } - // 涓嶆槸鏈�澶栧眰搴撲綅锛岄渶瑕佷娇鐢ㄧ┛姊溅鎼繍鍚庯紝鍐嶅爢鍨涙満鍑哄簱 + // 涓嶆槸鏈�澶栧眰搴撲綅锛岄渶瑕佷娇鐢ㄧ┛姊溅鎼繍鍚庯紝鍐嶅爢鍨涙満鍑哄簱 } else { // 褰撳墠缁勫簱浣嶆槸鍚︽湁绌挎杞� Integer steNo = this.hasCarOfIdle(wrkMast.getSourceLocNo()); @@ -1128,7 +1062,7 @@ } } - // 娌℃湁灏忚溅 + // 娌℃湁灏忚溅 } else { if (wrkMast.getWrkSts() == 11L && wrkMast.getSteNo() == null) { // 瀵绘壘鏈�杩戠殑灏忚溅 @@ -2561,24 +2495,24 @@ break; } } - if (!devpThread.charge1) { - SteChargeType second = SteChargeType.SECOND; - locNo = second.locNo; - if (basSteService.hasCarOfLocNo(locNo) == null - && wrkChargeService.selectWorkingOfCharge(second.ssbm) == null) { - steCharge = second; - break; - } - } - if (!devpThread.charge2) { - SteChargeType third = SteChargeType.THIRD; - locNo = third.locNo; - if (basSteService.hasCarOfLocNo(locNo) == null - && wrkChargeService.selectWorkingOfCharge(third.ssbm) == null) { - steCharge = third; - break; - } - } +// if (!devpThread.charge1) { +// SteChargeType second = SteChargeType.SECOND; +// locNo = second.locNo; +// if (basSteService.hasCarOfLocNo(locNo) == null +// && wrkChargeService.selectWorkingOfCharge(second.ssbm) == null) { +// steCharge = second; +// break; +// } +// } +// if (!devpThread.charge2) { +// SteChargeType third = SteChargeType.THIRD; +// locNo = third.locNo; +// if (basSteService.hasCarOfLocNo(locNo) == null +// && wrkChargeService.selectWorkingOfCharge(third.ssbm) == null) { +// steCharge = third; +// break; +// } +// } break; } while (false); @@ -2839,6 +2773,7 @@ /** * 杞鍏呯數妗╂槸鍚︽湁绌洪棽灏忚溅 */ + @Deprecated public synchronized void queryChargeLocOfComplete() { // 涓庡厖鐢典换鍔′笉鍚屾杩涜 if (null != wrkChargeService.selectWorking(null, WrkChargeType.charge)) { return; } @@ -2915,6 +2850,7 @@ /** * 灏忚溅浠庡厖鐢垫々 鑷� 寰呮満搴撲綅 */ + @Deprecated public synchronized void steFromChargeToIdleLoc() { WrkCharge wrkCharge = wrkChargeService.selectWorking(null, WrkChargeType.reset); if (wrkCharge == null) { return; } -- Gitblit v1.9.1