| | |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.LiftCommand; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.DevpThread; |
| | |
| | | Map<Integer, StaProtocol> station = devpThread.getStation(); |
| | | for (Map.Entry<Integer, StaProtocol> entry : station.entrySet()) { |
| | | if (siteId.equals(entry.getKey())) { |
| | | StaProtocol staProtocol = entry.getValue(); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (workNo != null) { |
| | | staProtocol.setWorkNo(workNo); |
| | | } |
| | | if (staNo != null) { |
| | | staProtocol.setStaNo(staNo); |
| | | } |
| | | if (pakMk != null) { |
| | | staProtocol.setPakMk(pakMk.equals("Y")); |
| | | } |
| | | // StaProtocol staProtocol = entry.getValue(); |
| | | // if (staProtocol == null) { |
| | | // continue; |
| | | // } else { |
| | | // staProtocol = staProtocol.clone(); |
| | | // } |
| | | // if (workNo != null) { |
| | | // staProtocol.setWorkNo(workNo); |
| | | // } |
| | | // if (staNo != null) { |
| | | // staProtocol.setStaNo(staNo); |
| | | // } |
| | | // if (pakMk != null) { |
| | | // staProtocol.setPakMk(pakMk.equals("Y")); |
| | | // } |
| | | LiftCommand command = new LiftCommand(); |
| | | command.setWorkNo(Integer.valueOf(workNo)); |
| | | command.setSourceStaNo(siteId); |
| | | command.setTargetStaNo(Integer.valueOf(staNo)); |
| | | |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, command)); |
| | | if (result) { |
| | | return R.ok(); |
| | | } else { |