| | |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/latest/inSta/data/barcode") |
| | | @ManagerAuth(memo = "条码扫描仪实时数据") |
| | | public R barcodeData(Integer barcodeId){ |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, barcodeId); |
| | | if (null == barcodeThread) { |
| | | return R.ok(); |
| | | } |
| | | BarcodeDataVo vo = new BarcodeDataVo(); |
| | | vo.setBarcodeId(barcodeId); |
| | | vo.setCodeValue(barcodeThread.getBarcode()); |
| | | return R.ok().add(vo); |
| | | } |
| | | |
| | | @PostMapping("/latest/data/scale") |
| | | @ManagerAuth(memo = "磅秤实时数据") |
| | |
| | | getSystemRunningStatus(); |
| | | getBarcodeInfo(); |
| | | getScaleInfo(); |
| | | getInStaBarcodeInfo(1); |
| | | }, 1000); |
| | | setInterval(function () { |
| | | getSitesInfo(); |
| | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | // 入库站扫码器数据实时获取 |
| | | function getInStaBarcodeInfo(barcodeId) { |
| | | $.ajax({ |
| | | url: baseUrl + "/latest/inSta/data/barcode", |
| | | data: {barcodeId:barcodeId}, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | console.log(res) |
| | | if (res.code === 200){ |
| | | |
| | | } else if (res.code === 403){ |
| | | parent.location.href = baseUrl+"/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 扫码器实时数据获取 |