cl
2024-07-19 077eb25c553022a74ce26c689628d750e3f51c2b
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 {