#
lsh
2023-01-08 6cdbb7c1b75a897d5917d36fcde5de8fd94863e3
#
3个文件已修改
90 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/MatDto.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/LedThread.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -119,7 +119,7 @@
                    log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
                        if (inSta.getStaNo()==101 || inSta.getStaNo()==109 || inSta.getStaNo()==117){
                            staProtocol.setWorkNo((short)9999);
                            staProtocol.setWorkNo((short)9998);
                            staProtocol.setStaNo((short)100);
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -127,7 +127,7 @@
                                throw new CoolException("更新plc站点信息失败");
                            }
                        }else if (inSta.getStaNo()==201 || inSta.getStaNo()==207 || inSta.getStaNo()==213){
                            staProtocol.setWorkNo((short)9999);
                            staProtocol.setWorkNo((short)9998);
                            if (inSta.getStaNo()==201){
                                staProtocol.setStaNo((short)200);
                            }else if (inSta.getStaNo()==207){
@@ -143,7 +143,32 @@
                        }
                        continue;
                    }
                } else {
                } else if (staProtocol.getWorkNo()==9999 && staProtocol.isLoading() && !staProtocol.isEmptyMk()){
                    if (inSta.getStaNo()==101 || inSta.getStaNo()==109 || inSta.getStaNo()==117){
                        staProtocol.setWorkNo((short)9998);
                        staProtocol.setStaNo((short)100);
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        if (!result) {
                            throw new CoolException("更新plc站点信息失败");
                        }
                    }else if (inSta.getStaNo()==201 || inSta.getStaNo()==207 || inSta.getStaNo()==213){
                        staProtocol.setWorkNo((short)9998);
                        if (inSta.getStaNo()==201){
                            staProtocol.setStaNo((short)200);
                        }else if (inSta.getStaNo()==207){
                            staProtocol.setStaNo((short)206);
                        }else if (inSta.getStaNo()==213){
                            staProtocol.setStaNo((short)212);
                        }
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        if (!result) {
                            throw new CoolException("更新plc站点信息失败");
                        }
                    }
                    continue;
                }else {
                    continue;
                }
@@ -265,6 +290,8 @@
                                if (!result) {
                                    throw new CoolException("更新plc站点信息失败");
                                }
                            }
                        }
@@ -1502,20 +1529,11 @@
            }
            // 命令下发 -------------------------------------------------------------------------------
            if (!commands.isEmpty()) {
                if (led.getId() == 7) {
                    if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
                        log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                        continue;
                    } else {
                        ledThread.setLedMk(false);
                    }
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
                    log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                    continue;
                } else {
                    if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) {
                        log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                        continue;
                    } else {
                        ledThread.setLedMk(false);
                    }
                    ledThread.setLedMk(false);
                }
            }
@@ -1592,20 +1610,11 @@
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            // led显示默认内容
            if (reset && !ledThread.isLedMk()) {
                if (led.getId() == 7) {
                    ledThread.setLedMk(true);
                    if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
                        log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                    } else {
                    }
                ledThread.setLedMk(true);
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
                    log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                } else {
                    ledThread.setLedMk(true);
                    if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
                        log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                    } else {
                    }
                }
            }
        }
src/main/java/com/zy/common/model/MatDto.java
@@ -9,20 +9,39 @@
public class MatDto {
    // 物料编号
    private String matNo;
    private String matnr;
    // 物料名称
    private String maknx;
    // 库位规格
    private String specs;
    // 物料数量
    private Double count;
    // 库位数量
    private Double total;
    public MatDto() {
    }
    public MatDto(String matNo, String maknx, Double count) {
        this.matNo = matNo;
        this.matnr = matNo;
        this.maknx = maknx;
        this.count = count;
    }
    public MatDto(String matNo, String maknx, Double count,String specs) {
        this.specs = specs;
        this.matnr = matNo;
        this.maknx = maknx;
        this.count = count;
    }
    public MatDto(String matNo, String maknx, Double count,Double total,String specs) {
        this.specs = specs;
        this.matnr = matNo;
        this.maknx = maknx;
        this.count = count;
        this.total = total;
    }
}
src/main/java/com/zy/core/thread/LedThread.java
@@ -212,7 +212,7 @@
            sb.append("目标站:").append(command.getStaNo()).append("\n");
            if (!command.isEmptyMk()) {
                for (MatDto matDto : command.getMatDtos()) {
                    sb.append("物料编码:").append(matDto.getMatNo()).append("\n");
                    sb.append("物料编码:").append(matDto.getMatnr()).append("\n");
                    sb.append("数量:").append(matDto.getCount()).append("\n");
                }
            }