From 3c46e80f67fabd8afcc088720a88e0e02cee2049 Mon Sep 17 00:00:00 2001 From: cpT <1@123> Date: 星期二, 01 七月 2025 16:59:46 +0800 Subject: [PATCH] #改造 --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 37 ++++++++++++++++++++++++++++--------- 1 files changed, 28 insertions(+), 9 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 f9d8209..e20adc7 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -204,6 +204,7 @@ staProtocol.setWorkNo(9999); staProtocol.setStaNo(inSta.getBackSta()); devpThread.setPakMk(staProtocol.getSiteId(), false); + devpThread.setPakMkRun(staProtocol.getSiteId(), false); devpThread.setErrorDev(staProtocol.getSiteId(), errMsg); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); TaskWrk taskWrk = taskWrkMapper.selectByWrkNo(Integer.valueOf(workNo)); @@ -668,7 +669,7 @@ } CrnSlave crnSlave = new CrnSlave(crn); - if (Cools.isEmpty(crnProtocol.getLoaded()) || crnProtocol.getLoaded()==0){ + if (Cools.isEmpty(crnProtocol.getLaneNo()) || crnProtocol.getLaneNo()==0){ continue; } @@ -778,7 +779,7 @@ // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- CrnCommand crnCommand = new CrnCommand(); crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 鍫嗗灈鏈虹紪鍙� - crnCommand.setCrnNo(crnProtocol.getLaneNo()); // 鍫嗗灈鏈哄贩閬撶紪鍙� + crnCommand.setLaneNo(crnProtocol.getLaneNo()); // 鍫嗗灈鏈哄贩閬撶紪鍙� crnCommand.setTaskNo((short)999); // 宸ヤ綔鍙� crnCommand.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 浠诲姟妯″紡: 搴撲綅绉昏浆 @@ -831,7 +832,7 @@ } CrnSlave crn = new CrnSlave(crnSlave); - if (Cools.isEmpty(crnProtocol.getLoaded()) || crnProtocol.getLoaded()==0){ + if (Cools.isEmpty(crnProtocol.getLaneNo()) || crnProtocol.getLaneNo()==0){ continue; } @@ -1335,7 +1336,7 @@ } CrnSlave crn = new CrnSlave(crnSlave); - if (Cools.isEmpty(crnProtocol.getLoaded()) || crnProtocol.getLoaded()==0){ + if (Cools.isEmpty(crnProtocol.getLaneNo()) || crnProtocol.getLaneNo()==0){ continue; } @@ -1357,11 +1358,14 @@ } // Thread.sleep(300); //纭瀹屾垚淇″彿 - CrnOperatorParam crnOperatorParam = new CrnOperatorParam(); - crnOperatorParam.setCrnNo(crn.getId()); +// CrnOperatorParam crnOperatorParam = new CrnOperatorParam(); +// crnOperatorParam.setCrnNo(crn.getId()); Date now = new Date(); - crnController.crnTaskComplete(crnOperatorParam); +// crnController.crnTaskComplete(crnOperatorParam); +// MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(2, command)) + crnThread.setResetFlag(true); + if (!Cools.isEmpty(taskWrk)) { if (taskWrk.getIoType() == 1 && taskWrk.getWrkSts() == 3) { taskWrk.setWrkSts(4);//鍏ュ簱瀹屾垚 @@ -1532,8 +1536,8 @@ null, // 缁撴潫鏃堕棿 null, // 宸ヤ綔鐘舵�� null, // 鍏ュ嚭搴撶被鍨� - crn.getId(), // 鍫嗗灈鏈� - null, // plc + crnProtocol.getLaneNo(), // 鍫嗗灈鏈� + crn.getId(), // plc null, // 鐩爣搴撲綅 null, // 鐩爣绔� null, // 婧愮珯 @@ -1889,7 +1893,20 @@ Integer stano = staProtocol.getStaNo(); if (staProtocol.getSiteId() == 1004 || staProtocol.getSiteId()==1020){ // 鍒ゆ柇鏄惁婊¤冻鍙栬揣鏉′欢 + if (!staProtocol.isPakMkRun()) { + devpThread.setErrorDev(staProtocol.getSiteId(), "寮傚父鍥為��鏍囪锛岄渶瑕佸洖閫�"); + return null; + } if (!staProtocol.isLoading()) { + devpThread.setErrorDev(staProtocol.getSiteId(), "鏃犵墿"); + return null; + } + if (!staProtocol.isInEnable()) { + devpThread.setErrorDev(staProtocol.getSiteId(), "绛夊緟鍙叆淇″彿"); + return null; + } + if (!staProtocol.isStaOk()) { + devpThread.setErrorDev(staProtocol.getSiteId(), "绛夊緟閾炬潯灏辩华"); return null; } // 灏哄妫�娴嬪紓甯� @@ -1964,6 +1981,7 @@ staProtocol.setWorkNo(9999); staProtocol.setStaNo(staProtocol.getStaNo()+1); devpThread.setPakMk(staProtocol.getSiteId(), false); + devpThread.setPakMkRun(staProtocol.getSiteId(), false); devpThread.setErrorDev(staProtocol.getSiteId(), errMsg); MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); try{ @@ -1975,6 +1993,7 @@ } return null; } + return null; } return taskWrk; } -- Gitblit v1.9.1