| | |
| | | label="目标站" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | /> |
| | | <ProFormSelect |
| | | name="barcodeId" |
| | | label="条码器ID" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | fieldProps={{ precision: 0 }} |
| | | showSearch |
| | | debounceTime={300} |
| | | request={async ({ keyWords }) => { |
| | | const resp = await Http.doPostForm('api/deviceBarcode/query', { condition: keyWords }); |
| | | return resp.data; |
| | | }} |
| | | /> |
| | | </ProForm.Group> |
| | | |
| | | </ProForm> |
| | |
| | | setSearchParam={setSearchParam} |
| | | />, |
| | | }, |
| | | { |
| | | title: '条码器ID', |
| | | dataIndex: 'barcodeId', |
| | | valueType: 'text', |
| | | hidden: false, |
| | | width: 140, |
| | | filterDropdown: (props) => <TextFilter |
| | | name='staNo' |
| | | {...props} |
| | | actionRef={actionRef} |
| | | setSearchParam={setSearchParam} |
| | | />, |
| | | }, |
| | | |
| | | { |
| | | title: '操作', |
| | |
| | | @ApiModelProperty(value= "目标站") |
| | | private Integer staNo; |
| | | |
| | | /** |
| | | * 条码器ID |
| | | */ |
| | | @ApiModelProperty(value= "条码器ID") |
| | | private Long barcodeId; |
| | | |
| | | public BasConveyorSta() {} |
| | | |
| | | public BasConveyorSta(Long conveyorId,Integer conveyorNo,Long updateBy,Long createBy,Date createTime,Date updateTime,String memo,Integer deleted,Long hostId,Integer siteNo,String inEnable,String outEnable,String autoing,String loading,String canining,String canouting,Integer locType1,Integer locType2,Integer locType3,String locNo,String qrCodeValue) { |
| | |
| | | private BasConveyorPathService basConveyorPathService; |
| | | @Autowired |
| | | private BasLedService basLedService; |
| | | @Autowired |
| | | private DeviceBarcodeService deviceBarcodeService; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | // 解析入库工作档 |
| | | public synchronized void analyzeInBoundTask() { |
| | | for (Task task : taskService.selectWaitAnalyzeInBoundTask()) { |
| | | // BasConveyorSta basConveyorSta = basConveyorStaService.getOne(new LambdaQueryWrapper<BasConveyorSta>().eq(BasConveyorSta::getSiteNo, task.getDestSite())); |
| | | // if (basConveyorSta == null) { |
| | | // continue; |
| | | // } |
| | | // DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId()); |
| | | // if (deviceBarcode == null) { |
| | | // continue; |
| | | // } |
| | | // BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId())); |
| | | // if (barcodeThread == null) { |
| | | // continue; |
| | | // } |
| | | |
| | | |
| | | if (Cools.isEmpty(task.getShuttleNo())) { |
| | | //分配小车 |
| | | //搜索空闲车 |
| | |
| | | |
| | | String getBarcode(); |
| | | |
| | | boolean setBarcode(String barcode); |
| | | |
| | | } |
| | |
| | | return String.valueOf(barcode); |
| | | } |
| | | |
| | | public void setBarcode(String barcode) { |
| | | @Override |
| | | public boolean setBarcode(String barcode) { |
| | | this.lastBarcode = String.valueOf(this.barcode); |
| | | this.barcode.delete(0, this.barcode.length()); |
| | | this.barcode.append(barcode); |
| | |
| | | OutputQueue.BARCODE.poll(); |
| | | } |
| | | OutputQueue.BARCODE.offer(jsonObject); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void run() { |
| | | this.connect(); |
| | | while (true) { |
| | | try { |
| | | DeviceBarcodeService deviceBarcodeService = SpringUtils.getBean(DeviceBarcodeService.class); |
| | | if (deviceBarcodeService == null) { |
| | | continue; |
| | | } |
| | | |
| | | DeviceBarcode deviceBarcode = deviceBarcodeService.getOne(new LambdaQueryWrapper<DeviceBarcode>() |
| | | .eq(DeviceBarcode::getDeviceId, device.getId()) |
| | | .eq(DeviceBarcode::getHostId, device.getHostId()) |
| | | .eq(DeviceBarcode::getStatus, 1)); |
| | | if (deviceBarcode == null) { |
| | | continue; |
| | | } |
| | | |
| | | JSONObject connect = JSON.parseObject(deviceBarcode.getConnect()); |
| | | String address = connect.getString("address"); |
| | | Short length = connect.getShort("length"); |
| | | |
| | | // 条码扫描器 |
| | | OperateResultExOne<byte[]> result = null; |
| | | result = siemensS7Net.Read(address, length); |
| | | if (result.IsSuccess) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result.Content, 0, length, "UTF-8"); |
| | | setBarcode(barcode); |
| | | } |
| | | } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | } |
| | | } |
| | | // this.connect(); |
| | | // while (true) { |
| | | // try { |
| | | // DeviceBarcodeService deviceBarcodeService = SpringUtils.getBean(DeviceBarcodeService.class); |
| | | // if (deviceBarcodeService == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // DeviceBarcode deviceBarcode = deviceBarcodeService.getOne(new LambdaQueryWrapper<DeviceBarcode>() |
| | | // .eq(DeviceBarcode::getDeviceId, device.getId()) |
| | | // .eq(DeviceBarcode::getHostId, device.getHostId()) |
| | | // .eq(DeviceBarcode::getStatus, 1)); |
| | | // if (deviceBarcode == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // JSONObject connect = JSON.parseObject(deviceBarcode.getConnect()); |
| | | // String address = connect.getString("address"); |
| | | // Short length = connect.getShort("length"); |
| | | // |
| | | // // 条码扫描器 |
| | | // OperateResultExOne<byte[]> result = null; |
| | | // result = siemensS7Net.Read(address, length); |
| | | // if (result.IsSuccess) { |
| | | // String barcode = siemensS7Net.getByteTransform().TransString(result.Content, 0, length, "UTF-8"); |
| | | // setBarcode(barcode); |
| | | // } |
| | | // } catch (Exception e) { |
| | | //// e.printStackTrace(); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.wcs.core.entity.BasConveyor; |
| | | import com.zy.asrs.wcs.core.entity.BasConveyorSta; |
| | | import com.zy.asrs.wcs.core.entity.DeviceBarcode; |
| | | import com.zy.asrs.wcs.core.service.BasConveyorService; |
| | | import com.zy.asrs.wcs.core.service.BasConveyorStaService; |
| | | import com.zy.asrs.wcs.core.service.DeviceBarcodeService; |
| | | import com.zy.asrs.wcs.core.utils.RedisUtil; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.cache.OutputQueue; |
| | | import com.zy.asrs.wcs.rcs.cache.SlaveConnection; |
| | | import com.zy.asrs.wcs.rcs.entity.Device; |
| | | import com.zy.asrs.wcs.rcs.model.dto.WorkModeTypeDto; |
| | | import com.zy.asrs.wcs.rcs.model.enums.SlaveType; |
| | | import com.zy.asrs.wcs.rcs.model.enums.WorkModeType; |
| | | import com.zy.asrs.wcs.rcs.model.protocol.StaProtocol; |
| | | import com.zy.asrs.wcs.rcs.thread.BarcodeThread; |
| | | import com.zy.asrs.wcs.rcs.thread.DevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | staProtocol.setInEnable(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 14) == 1); // 可入 |
| | | staProtocol.setOutEnable(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 14) == 2);// 可出 |
| | | staProtocol.setWorkMode((int) siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 8));// 工作模式 |
| | | |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result.Content,56,10, "UTF-8");// 条码 |
| | | BasConveyorStaService basConveyorStaService = SpringUtils.getBean(BasConveyorStaService.class); |
| | | DeviceBarcodeService deviceBarcodeService = SpringUtils.getBean(DeviceBarcodeService.class); |
| | | BasConveyorSta basConveyorSta = basConveyorStaService.getOne(new LambdaQueryWrapper<BasConveyorSta>().eq(BasConveyorSta::getSiteNo, siteId)); |
| | | if (basConveyorSta != null) { |
| | | DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId()); |
| | | if (deviceBarcode != null) { |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId())); |
| | | if (barcodeThread != null) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // staProtocol.setEmptyMk(status[4]); // 空板信号 |
| | | // staProtocol.setFullPlt(status[5]); // 满托盘 |
| | | // staProtocol.setHigh(status[6]); // 高库位 |