From 4267b157278462ff6fd84bd0262fb50f641cdc83 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期三, 13 八月 2025 14:14:20 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 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 cda7462..11b6336 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -62,7 +62,6 @@ */ @Slf4j @Service("mainService") -@Transactional public class MainServiceImpl { public static final long COMMAND_TIMEOUT = 5 * 1000; @@ -684,7 +683,7 @@ staProtocol = staProtocol.clone(); } - if (staProtocol.isAutoing() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) { + if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) { CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, wrkMast.getCrnNo()); CrnProtocol crnProtocol = crnThread.getCrnProtocol(); @@ -1229,12 +1228,22 @@ } if (crnProtocol.getCrnNo() == 1) { - //鍒ゆ柇鍫嗗灈鏈哄拰褰撳墠浠诲姟鏄惁澶勪簬涓�涓贩閬� - if (Utils.getLaneByLocNo(wrkMast.getSourceLocNo()) != crnProtocol.getCrnLane()) { - //鍒ゆ柇鍫嗗灈鏈烘墍鍦ㄥ贩閬撴槸鍚﹀瓨鍦ㄥ叾浠栦换鍔★紝濡傚瓨鍦ㄥ垯浼樺厛鎵ц - List<WrkMast> currentWrkMasts = wrkMastService.selectLaneWrkMast(crnProtocol.getCrnLane(), false); - if (!currentWrkMasts.isEmpty()) { - continue;//褰撳墠鍫嗗灈鏈烘墍鍦ㄥ贩閬撳瓨鍦ㄤ换鍔� + String turnCrnExecuteCurrentChannel = "Y"; + Config turnCrnExecuteCurrentChannelConfig = configService.selectOne(new EntityWrapper<Config>() + .eq("code", "turnCrnExecuteCurrentChannel") + ); + if (turnCrnExecuteCurrentChannelConfig != null) { + turnCrnExecuteCurrentChannel = turnCrnExecuteCurrentChannelConfig.getValue(); + } + + if(turnCrnExecuteCurrentChannel.equals("Y")) { + //鍒ゆ柇鍫嗗灈鏈哄拰褰撳墠浠诲姟鏄惁澶勪簬涓�涓贩閬� + if (Utils.getLaneByLocNo(wrkMast.getSourceLocNo()) != crnProtocol.getCrnLane()) { + //鍒ゆ柇鍫嗗灈鏈烘墍鍦ㄥ贩閬撴槸鍚﹀瓨鍦ㄥ叾浠栦换鍔★紝濡傚瓨鍦ㄥ垯浼樺厛鎵ц + List<WrkMast> currentWrkMasts = wrkMastService.selectLaneWrkMast(crnProtocol.getCrnLane(), false); + if (!currentWrkMasts.isEmpty()) { + continue;//褰撳墠鍫嗗灈鏈烘墍鍦ㄥ贩閬撳瓨鍦ㄤ换鍔� + } } } } @@ -1520,6 +1529,7 @@ if (wrkMastMapper.updateById(wrkMast) == 0) { News.error("" + mark + " - 3" + " - 5" + " - 銆愬簱浣嶇Щ杞�� 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } + crnProtocol.setLastIo("O"); } News.infoNoLog("" + mark + " - 3" + " - 0" + " - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂锛氬簱浣嶇Щ杞畬鎴�"); @@ -1880,9 +1890,13 @@ if (jsonObject.getInteger("code").equals(200)) { StartupDto dto = jsonObject.getObject("data", StartupDto.class); + LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() + .eq("loc_no", dto.getLocNo())); + // 鏇存柊绔欑偣淇℃伅 涓� 涓嬪彂plc鍛戒护 staProtocol.setWorkNo(dto.getWorkNo().shortValue()); staProtocol.setStaNo(dto.getStaNo().shortValue()); + staProtocol.setPalletSize(locMast.getLocType2()); devpThread.setPakMk(staProtocol.getSiteId(), false); boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); if (!result) { @@ -2003,6 +2017,7 @@ // 鏇存柊绔欑偣淇℃伅 涓� 涓嬪彂plc鍛戒护 staProtocol.setWorkNo((short) workNo); staProtocol.setStaNo((short) 2003); + staProtocol.setPalletSize((short) 1); devpThread.setPakMk(staProtocol.getSiteId(), false); boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); if (!result) { -- Gitblit v1.9.1