| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | private void wcsOpenComplete() { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol305 = devpThread.getStation().get(305); |
| | | if (staProtocol305!= null && staProtocol305.getIfOpenDoor()) { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305)); |
| | | List<StaProtocol> staProtocols = new ArrayList<StaProtocol>() {{ |
| | | add(devpThread.getStation().get(305)); |
| | | add(devpThread.getStation().get(1202)); |
| | | }}; |
| | | // StaProtocol staProtocol305 = devpThread.getStation().get(305); |
| | | for (StaProtocol staProtocol : staProtocols) { |
| | | // if (staProtocol305 != null && staProtocol305.getIfOpenDoor()) { |
| | | if (staProtocol != null && staProtocol.getIfOpenDoor()) { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staProtocol.getSiteId())); |
| | | if (basDevp.getWrkNo() != 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo()); |
| | | if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() == 3){ |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 读已关门 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | private void wcsCloseComplete() { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(305); |
| | | List<StaProtocol> staProtocols = new ArrayList<StaProtocol>() {{ |
| | | add(devpThread.getStation().get(305)); |
| | | add(devpThread.getStation().get(1202)); |
| | | }}; |
| | | // StaProtocol staProtocol = devpThread.getStation().get(305); |
| | | for (StaProtocol staProtocol : staProtocols) { |
| | | if (staProtocol == null) { |
| | | return; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305)); |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staProtocol.getSiteId())); |
| | | if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) { |
| | | WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo()); |
| | | if (wrkMast == null || wrkMast.getWhsType() == null ||wrkMast.getWhsType() != 4) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |