#
zjj
2024-06-25 36d6d945ad0664cc2adab24d65097d17f1ff663a
#
7个文件已修改
136 ■■■■ 已修改文件
zy-asrs-flow/src/pages/deviceConfig/basConveyorSta/components/edit.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/deviceConfig/basConveyorSta/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/BarcodeThread.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensBarcodeThread.java 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SuopaiSiemensDevpThread.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/deviceConfig/basConveyorSta/components/edit.jsx
@@ -229,6 +229,18 @@
                            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>
zy-asrs-flow/src/pages/deviceConfig/basConveyorSta/index.jsx
@@ -420,6 +420,19 @@
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '条码器ID',
            dataIndex: 'barcodeId',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='staNo'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '操作',
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java
@@ -185,6 +185,12 @@
    @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) {
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -82,6 +82,8 @@
    private BasConveyorPathService basConveyorPathService;
    @Autowired
    private BasLedService basLedService;
    @Autowired
    private DeviceBarcodeService deviceBarcodeService;
    /**
     * 组托
@@ -418,6 +420,20 @@
    // 解析入库工作档
    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())) {
                //分配小车
                //搜索空闲车
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/BarcodeThread.java
@@ -4,4 +4,6 @@
    String getBarcode();
    boolean setBarcode(String barcode);
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensBarcodeThread.java
@@ -39,7 +39,8 @@
        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);
@@ -52,7 +53,9 @@
                OutputQueue.BARCODE.poll();
            }
            OutputQueue.BARCODE.offer(jsonObject);
            return true;
        }
        return false;
    }
    @Override
@@ -81,37 +84,37 @@
    @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();
//            }
//        }
    }
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SuopaiSiemensDevpThread.java
@@ -11,15 +11,20 @@
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;
@@ -121,6 +126,21 @@
                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]);     // 高库位