From cf9fac40a8e39b25ee935a743224ae6c405bbddc Mon Sep 17 00:00:00 2001 From: lty <876263681@qq.com> Date: 星期一, 24 三月 2025 19:33:39 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/jxjdzwcs' into jxjdzwcs --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 40 ++++++++++++++++++++++++++++++++-------- 1 files changed, 32 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 b03a68a..5680365 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -39,6 +39,7 @@ import com.zy.core.thread.SiemensDevpThread; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; +import lombok.Synchronized; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -113,7 +114,8 @@ @Autowired private SiteController siteController; //鍑哄簱绔欑偣鑷�112寰幆绔欑偣 - public synchronized void shiftTargetToCyclePoint() throws IOException, InterruptedException{ + @Synchronized + public void shiftTargetToCyclePoint() throws IOException, InterruptedException{ try{ for (DevpSlave devp : slaveProperties.getDevp()) { for (DevpSlave.Sta outSta : devp.getOutSta()) { @@ -123,6 +125,7 @@ StaProtocol staProtocol2 = devpThread.getStation().get(1002); StaProtocol staProtocol3 = devpThread.getStation().get(1003); StaProtocol staProtocol4 = devpThread.getStation().get(1004); + StaProtocol staProtocol6 = devpThread.getStation().get(111); if (staProtocol == null) { continue; } else { @@ -148,9 +151,14 @@ } else { staProtocol4 = staProtocol4.clone(); } + if (staProtocol6 == null) { + continue; + } else { + staProtocol6 = staProtocol6.clone(); + } boolean result = false; switch(outSta.getStaNo()){ - case 105: if (staProtocol1.isLoading()){ + case 105: if (staProtocol1.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 105){ result = true; } case 107: if (staProtocol2.isLoading()){ @@ -159,15 +167,28 @@ case 109: if (staProtocol3.isLoading()){ result = true; } - case 110: if (staProtocol4.isLoading()){ + case 110: if ((staProtocol4.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 110) || ((staProtocol6.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 111))){ result = true; } default: break; } if(result){ - staProtocol.setStaNo((short) 112); - MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); + if(staProtocol.getSiteId() == 107 || staProtocol.getSiteId() == 109){ + StaProtocol staProtocol5 = devpThread.getStation().get(staProtocol.getSiteId() - 1); + if (staProtocol5== null) { + continue; + } else { + staProtocol5 = staProtocol5.clone(); + } + if((staProtocol5.isLoading() && staProtocol5.getStaNo() == 107) || ((staProtocol5.isLoading() && staProtocol5.getStaNo() == 109))){ + staProtocol5.setStaNo((short) 112); + MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol5)); + } + }else{ + staProtocol.setStaNo((short) 112); + MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); + } } } } @@ -188,9 +209,12 @@ } else { staProtocol = staProtocol.clone(); } - WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); - if(wrkMast != null && wrkMast.getWrkNo() < 9000 && wrkMast.getWrkNo() > 7000){ - staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); + if(staProtocol.getWorkNo() == 0){ + continue; + } + TaskWrk taskWrk = taskWrkMapper.selectStaWorking(Integer.valueOf(staProtocol.getWorkNo())); + if(taskWrk != null && taskWrk.getWrkNo() < 9001 && taskWrk.getWrkNo() > 6000){ + staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); } } -- Gitblit v1.9.1