| | |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/barcode/two") |
| | | public R barcodeTwo(@RequestParam Integer palletizingNo) { |
| | | Date now = new Date(); |
| | | |
| | | String barcode = ""; |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getDriveSta()) { |
| | | if (inSta.getStaNo().equals(palletizingNo)){ |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | if (!staProtocol.isAutoing() || !staProtocol.isLoading() || staProtocol.getWorkNo() != 0 || !staProtocol.isPakMk()){ |
| | | return R.error("未就绪!!!"); |
| | | } |
| | | |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Date now = new Date(); |
| | | // Calendar calendar = Calendar.getInstance(); |
| | | // calendar.setTime(now); |
| | | return R.ok( |