From 6e9d579cde59b29a06e481c7f0438c2a1fbaa882 Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期二, 22 四月 2025 10:48:32 +0800 Subject: [PATCH] - --- billion-main/src/main/java/com/billion/main/plc/sub/OPCUaSubscription.java | 23 +++++++++++++---------- billion-ui/src/views/main/wc/IGBTStationWork.vue | 4 ++-- billion-admin/src/main/resources/application.yml | 2 +- billion-main/src/main/java/com/billion/main/plc/controller/MesPlcControl.java | 2 +- billion-main/src/main/java/com/billion/main/api/domain/IGBT.java | 10 +++++----- billion-main/src/main/java/com/billion/main/plc/constant/Constants.java | 7 ++----- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/billion-admin/src/main/resources/application.yml b/billion-admin/src/main/resources/application.yml index 8798c35..57fa6ad 100644 --- a/billion-admin/src/main/resources/application.yml +++ b/billion-admin/src/main/resources/application.yml @@ -16,7 +16,7 @@ # 寮�鍙戠幆澧冮厤缃� server: # 鏈嶅姟鍣ㄧ殑HTTP绔彛锛岄粯璁や负8080 - port: 8080 + port: 8083 servlet: # 搴旂敤鐨勮闂矾寰� context-path: / diff --git a/billion-main/src/main/java/com/billion/main/api/domain/IGBT.java b/billion-main/src/main/java/com/billion/main/api/domain/IGBT.java index c645de2..5e00d4b 100644 --- a/billion-main/src/main/java/com/billion/main/api/domain/IGBT.java +++ b/billion-main/src/main/java/com/billion/main/api/domain/IGBT.java @@ -5,11 +5,11 @@ @Data public class IGBT extends SyDomanBase{ private String sfcCode; // IGBT鐗╂枡鐮� - private String SolderJointHeightResult_1; // 鐒婄偣楂樺害妫�娴嬬粨鏋�1 - private String TightenData_Angle_1; // 鎷х揣瑙掑害鏁版嵁1 - private String resistanceValue_1; // 鐢甸樆鍊�1 - private String TightenData_Status_1; // 鎷х揣鐘舵�佹暟鎹�1 - private String WeldingPointAdhesionResult_1; // WeldingPointAdhesionResult_1 + private Boolean SolderJointHeightResult_1; // 鐒婄偣楂樺害妫�娴嬬粨鏋�1 + private Integer TightenData_Angle_1; // 鎷х揣瑙掑害鏁版嵁1 + private Double resistanceValue_1; // 鐢甸樆鍊�1 + private Byte TightenData_Status_1; // 鎷х揣鐘舵�佹暟鎹�1 + private Boolean WeldingPointAdhesionResult_1; // WeldingPointAdhesionResult_1 } diff --git a/billion-main/src/main/java/com/billion/main/plc/constant/Constants.java b/billion-main/src/main/java/com/billion/main/plc/constant/Constants.java index c39d6da..c30e3f8 100644 --- a/billion-main/src/main/java/com/billion/main/plc/constant/Constants.java +++ b/billion-main/src/main/java/com/billion/main/plc/constant/Constants.java @@ -6,11 +6,8 @@ import java.util.Map; public class Constants { - - public static final String SY_MES_URL = "http://192.168.0.204:8610/v1/report"; - -// public static final String SY_MES_URL = "http://127.0.0.1:8085/bs/processesInfo/v1/report"; - + public static final String WC_TEST_MES_URL = "http://10.0.11.40:9000/open/saveTwoPlant"; //娴嬭瘯鐜鎺ュ彛鍦板潃 + public static final String SY_FORMAL_MES_URL = "http://mes4api.weichai.com/open/saveTwoPlant"; //姝e紡鐜鎺ュ彛鍦板潃锛� public static final String IN_BOUND_TIME_CODE = "PAT_INT"; public static final String OUT_BOUND_TIME_CODE = "PAT_INT"; diff --git a/billion-main/src/main/java/com/billion/main/plc/controller/MesPlcControl.java b/billion-main/src/main/java/com/billion/main/plc/controller/MesPlcControl.java index 8daf0c2..c359402 100644 --- a/billion-main/src/main/java/com/billion/main/plc/controller/MesPlcControl.java +++ b/billion-main/src/main/java/com/billion/main/plc/controller/MesPlcControl.java @@ -26,7 +26,7 @@ { Integer result = 21; try { - miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("wc.IGBT.mesAllowWork").value("21").build()); + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("wc.IGBT.mesAllowWork").value(result).build()); miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("wc.IGBT.sfcCode").value(mesToPlcVo.getIgbtMateral()).build()); } catch (Exception e) { throw new RuntimeException("鍐欏叆plc鍏佽宸ヤ綔閿欒锛佽妫�鏌�"); diff --git a/billion-main/src/main/java/com/billion/main/plc/sub/OPCUaSubscription.java b/billion-main/src/main/java/com/billion/main/plc/sub/OPCUaSubscription.java index f01ddcd..4d4090f 100644 --- a/billion-main/src/main/java/com/billion/main/plc/sub/OPCUaSubscription.java +++ b/billion-main/src/main/java/com/billion/main/plc/sub/OPCUaSubscription.java @@ -223,6 +223,8 @@ return Long.parseLong(value); } else if (type == Boolean.class || type == boolean.class) { return Boolean.parseBoolean(value); + } else if (type == Byte.class || type == byte.class) { + return Byte.parseByte(value); } else if (type == Date.class) { try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -240,22 +242,23 @@ WebSocketUsers.sendMessageToUserByText(map.get("IGBT"), "21"); // 鍙戦�丠TTP璇锋眰 -// HttpResponse response = HttpRequest.post(Constants.SY_MES_URL) +// HttpResponse response = HttpRequest.post(Constants.WC_TEST_MES_URL) +// .header("token", "XNY") // .body(JSONUtil.toJsonStr(stationObject)) // .timeout(5000) // 璁剧疆瓒呮椂鏃堕棿 // .execute(); // System.out.println("--------------------------"+response.body()); -// log.info("鍙戦�佹暟鐩奙ES缁撴灉{}", response.body()); +// log.info("鍙戦�佹綅鏌碝ES缁撴灉{}", response.body()); // // 瑙f瀽鍝嶅簲 // if (response.isOk()) { // 璇锋眰鎴愬姛 // JSONObject jsonResponse = JSONUtil.parseObj(response.body()); -// String message = jsonResponse.getStr("message"); +// Integer code = jsonResponse.getInt("code"); // -// if ("ok".equals(message)) { -// // 鍝嶅簲涓嶆槸ok锛屼繚瀛樺け璐ヨ褰� -// saveMesFailRecord(stationObject, device, "鍝嶅簲姝e父锛�" + message, "1"); +// if (code == 200) { +// // 鍝嶅簲涓嶆槸200锛屼繚瀛樺け璐ヨ褰� +// saveMesFailRecord(stationObject, device, "鍝嶅簲姝e父锛�" + code, "1"); // }else { -// saveMesFailRecord(stationObject, device, "鍝嶅簲寮傚父锛�" + message,Constants.ZERO); +// saveMesFailRecord(stationObject, device, "鍝嶅簲寮傚父锛�" + code,Constants.ZERO); // } // } else { // // HTTP璇锋眰澶辫触锛屼繚瀛樺け璐ヨ褰� @@ -306,15 +309,15 @@ // 娓呯悊宸插鐞嗙殑鍘嗗彶鏁版嵁 List<DaFailRecord> unHandledList = failRecordService.list(new LambdaQueryWrapper<DaFailRecord>().eq(DaFailRecord::getStatus, "0")); for (DaFailRecord daFailRecord : unHandledList) { - HttpResponse response = HttpRequest.post(Constants.SY_MES_URL) + HttpResponse response = HttpRequest.post(Constants.WC_TEST_MES_URL) .body(JSONUtil.toJsonStr(daFailRecord.getRequestData())) .timeout(5000) // 璁剧疆瓒呮椂鏃堕棿 .execute(); // 瑙f瀽鍝嶅簲 if (response.isOk()) { // 璇锋眰鎴愬姛 JSONObject jsonResponse = JSONUtil.parseObj(response.body()); - String message = jsonResponse.getStr("message"); - if ("ok".equals(message)) { + Integer code = jsonResponse.getInt("code"); + if (code == 200) { failRecordService.deleteDaFailRecordById(daFailRecord.getId()); }else { this.updateFailRecordRetryCount(daFailRecord); diff --git a/billion-ui/src/views/main/wc/IGBTStationWork.vue b/billion-ui/src/views/main/wc/IGBTStationWork.vue index 4275fa4..d53a1db 100644 --- a/billion-ui/src/views/main/wc/IGBTStationWork.vue +++ b/billion-ui/src/views/main/wc/IGBTStationWork.vue @@ -196,7 +196,7 @@ data() { return { operationProgress: '绛夊緟鎵弿鐗╂枡鐮�...', - url: "ws://192.168.10.105:8083/websocket/message/", + url: "ws://192.168.0.240:8083/websocket/message/", message: "", text_content: "", ws: null, @@ -205,7 +205,7 @@ open1: false, keepReading: true, form1: { - baudRate: "115200", + baudRate: "9600", dataBits: "8", stopBits: "1", parity: "none", -- Gitblit v1.9.3