| | |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.CrnModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.properties.SystemProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.CrnThread; |
| | | import com.zy.core.thread.DevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * 主控图接口 |
| | |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | |
| | | public static AtomicInteger integer = new AtomicInteger(); |
| | | |
| | | @PostMapping("/system/running/status") |
| | | @ManagerAuth(memo = "系统运行状态") |
| | |
| | | @PostMapping("/latest/data/barcode") |
| | | @ManagerAuth(memo = "条码扫描仪实时数据") |
| | | public R barcodeLatestData(){ |
| | | integer.getAndIncrement(); |
| | | List<BarcodeDataVo> list = new ArrayList<>(); |
| | | for (int i=1;i<=1;i++){ |
| | | for (Slave barcode : slaveProperties.getBarcode()) { |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, barcode.getId()); |
| | | BarcodeDataVo vo = new BarcodeDataVo(); |
| | | vo.setBarcodeId("1"); |
| | | if (integer.get()%5 != 0) { |
| | | vo.setCodeValue("0"); |
| | | } else { |
| | | vo.setCodeValue(String.valueOf(new Random().nextInt(5000))); |
| | | } |
| | | vo.setBarcodeId(barcode.getId()); |
| | | vo.setCodeValue(barcodeThread.getBarcode()); |
| | | list.add(vo); |
| | | } |
| | | return R.ok().add(list); |
| | |
| | | vo.setLocNo(wrkMast.getLocNo$()); |
| | | vo.setCrnStatus(crnProtocol.getStatusType().desc); |
| | | vo.setError(""); // todo |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok().add(vo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.error(); |
| | | } |
| | | |
| | | @Deprecated |
| | | @PostMapping("/site/update") |