| | |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.DevpThread; |
| | | import com.zy.core.DevpThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @ManagerAuth(memo = "修改站点数据") |
| | | public R siteDetlUpdate(@RequestParam Integer siteId, |
| | | @RequestParam Short workNo, |
| | | @RequestParam Short staNo){ |
| | | @RequestParam Short staNo, |
| | | @RequestParam String pakMk){ |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | Map<Integer, StaProtocol> station = devpThread.getStation(); |
| | | for (Map.Entry<Integer, StaProtocol> entry : station.entrySet()) { |
| | | if (siteId.equals(entry.getKey())) { |
| | | StaProtocol staProtocol = entry.getValue(); |
| | | staProtocol = staProtocol.clone(); |
| | | if (workNo != null) { |
| | | staProtocol.setWorkNo(workNo); |
| | | } |
| | | if (staNo != null) { |
| | | staProtocol.setStaNo(staNo); |
| | | } |
| | | if (pakMk != null) { |
| | | staProtocol.setPakMk(pakMk.equals("Y")); |
| | | } |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (result) { |
| | | return R.ok(); |