From 077eb25c553022a74ce26c689628d750e3f51c2b Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期五, 19 七月 2024 13:39:26 +0800 Subject: [PATCH] Merge branch 'master' of http://183.134.244.158:8442/r/Jcdm042-Mes-Module-One --- jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) 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 9377594..1fd42d9 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 @@ -802,9 +802,11 @@ List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() .eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") - .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); + .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode) + .orderByDesc(DaTestDeviceInterfaceTemp::getCreateTime) + ); if (CollUtil.isNotEmpty(list)){ - DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); + DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(0); if (Constants.ONE.equals(daTestDeviceInterfaceTemp.getTotalResult())){ flag = true; }else { @@ -857,9 +859,11 @@ String cellCode = value2.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") - .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); + .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode) + .orderByDesc(DaTestDeviceInterfaceTemp::getCreateTime) + ); if (CollUtil.isNotEmpty(list)){ - DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); + DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(0); if (Constants.ONE.equals(daTestDeviceInterfaceTemp.getTotalResult())){ miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_2").value(1).build()); }else { @@ -883,9 +887,11 @@ String cellCode = value3.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") - .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); + .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode) + .orderByDesc(DaTestDeviceInterfaceTemp::getCreateTime) + ); if (CollUtil.isNotEmpty(list)){ - DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); + DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(0); if (Constants.ONE.equals(daTestDeviceInterfaceTemp.getTotalResult())){ miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_3").value(1).build()); }else { @@ -909,9 +915,11 @@ String cellCode = value4.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") - .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); + .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode) + .orderByDesc(DaTestDeviceInterfaceTemp::getCreateTime) + ); if (CollUtil.isNotEmpty(list)){ - DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); + DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(0); if (Constants.ONE.equals(daTestDeviceInterfaceTemp.getTotalResult())){ miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_4").value(1).build()); }else { -- Gitblit v1.9.3