admin
2024-07-04 d8e6a522964374f72fab85a3f53fc7a8ffa56e04
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -770,14 +770,15 @@
                .eq(DaTestDeviceInterfaceTemp::getStationCode, device)
                .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode));
        if (CollUtil.isNotEmpty(list)){
            DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(0);
            DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1);
            if (Constants.ONE.equals(daTestDeviceInterfaceTemp.getTotalResult())){
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(1).build());
            }else {
                flag = false;
                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build());
            }
            daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempById(daTestDeviceInterfaceTemp.getId());
            daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode);
        }
        return flag;
    }