From 052a065c54e17268d958f154e9d7bbc93db48697 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期三, 17 七月 2024 18:44:27 +0800 Subject: [PATCH] 修改OP020 --- jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 24 ++++++++++++++++-------- jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java b/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java index 0cd9456..56f7df0 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java +++ b/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java @@ -61,7 +61,7 @@ public static final Integer INT_ZERO= 0; public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/"; public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface/"; -/* public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/"; + /* public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/"; public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-group.geelycv.com/api/mom-open/restful/interface/";*/ public static final String FACTORY_EMS_SITE_CODE = "3983"; diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java index d25e886..55bb2ac 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java @@ -219,9 +219,17 @@ result = savePassingStation(thoroughfare, device,cellCodeList);//淇濆瓨杩囩珯 if(result == 21) { + if(Constants.OP030.contains(device)){ + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode1); + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode2); + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode3); + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode4); + } result = saveParamCollection(device,cellCodeList);//淇濆瓨鍙傛暟锛屽彂閫佸伐鍘侻ES } + } + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build()); log.info("鍐欏叆鍒板伐浣峽}鐨凴ecordDataDone鏁版嵁锛歿}",device,result); } else if (Constants.OP100_OP150.contains(device)){//浜哄伐宸ヤ綅 @@ -819,7 +827,7 @@ if (ObjectUtil.isNotNull(value1)){ String cellCode = value1.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -829,7 +837,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(5).build()); @@ -844,7 +852,7 @@ if (ObjectUtil.isNotNull(value2)){ String cellCode = value2.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, device) + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -854,7 +862,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_2").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_2").value(5).build()); @@ -870,7 +878,7 @@ if (ObjectUtil.isNotNull(value3)){ String cellCode = value3.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, device) + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -880,7 +888,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_3").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_3").value(5).build()); @@ -896,7 +904,7 @@ if (ObjectUtil.isNotNull(value4)){ String cellCode = value4.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, device) + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -906,7 +914,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_4").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_4").value(5).build()); -- Gitblit v1.9.3