chen.llin
15 小时以前 d3eb689e3755207f69817a5f581ee80b0f102339
条码有则读
2个文件已修改
30 ■■■■ 已修改文件
src/main/java/com/rfid/uhf288/Device.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/service/impl/MainServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/rfid/uhf288/Device.java
@@ -48,9 +48,9 @@
            // 方法1: 使用绝对路径直接加载DLL
            try {
            // 使用真实路径加载DLL
            String projectBaseDir = "D:\\apache-tomcat-8.5.57";
            String mainDllPath = projectBaseDir + "\\webapps\\" + mainDllName;
            String depDllPath = projectBaseDir + "\\webapps\\" + depDllName;
            String projectBaseDir = "D:\\apache-tomcat-8.5.57\\lib";
            String mainDllPath = projectBaseDir + "\\" + mainDllName;
            String depDllPath = projectBaseDir + "\\" + depDllName;
            
            File mainDllFile = new File(mainDllPath);
            File depDllFile = new File(depDllPath);
src/main/java/com/zy/service/impl/MainServiceImpl.java
@@ -1044,6 +1044,12 @@
        for (DevpSlave devp : slaveProperties.getDevp()) {
            // 遍历空板入库口
            for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = null;
                if (!Cools.isEmpty(emptyInSta.getBarcode())) {
                    barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, emptyInSta.getBarcode());
                }
                // 获取空板入库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo());
@@ -1062,6 +1068,16 @@
                    continue;
                }
                // 检查条码扫描:如果扫描到条码,则存入,扫描不到,则不存
                String barcode = null;
                if (barcodeThread != null) {
                    barcode = barcodeThread.getBarcode();
                    // 如果条码为空、NG、NoRead或00000000
                    if (Cools.isEmpty(barcode) || barcode.endsWith("NG") || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
                        barcode=null;
                    }
                }
                // 站点条件判断
                if (staProtocol.isAutoing()  //自动
                        && staProtocol.isLoading() //有物
@@ -1070,7 +1086,7 @@
                        && staProtocol.isPakMk() //防止重复下发信号 站点无物 无任务号会自动变成true
                ) {
                    News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货");
                    News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货,条码:{}", barcode);
                    try {
                        LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
@@ -1079,6 +1095,7 @@
                        param.setIoType(10);
                        param.setSourceStaNo(emptyInSta.getStaNo());
                        param.setLocType1(locTypeDto.getLocType1());
                        param.setBarcode(barcode); // 设置扫描到的条码
                        String response = new HttpHandler.Builder()
                                .setUri(wmsUrl)
                                .setPath("/rpc/pakin/loc/v1")
@@ -1088,6 +1105,11 @@
                        JSONObject jsonObject = JSON.parseObject(response);
                        if (jsonObject.getInteger("code").equals(200)) {
                            StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                            // 清空条码
                            if (barcodeThread != null) {
                                barcodeThread.setBarcode("");
                            }
                            // 更新站点信息 且 下发plc命令
                            staProtocol.setWorkNo(dto.getWorkNo());