懒羊羊
2024-01-26 49138a936668c30fbb4063e5d0bb518a400e6c39
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java
@@ -1,5 +1,7 @@
package com.jcdm.main.da.opcuaconfig.cert;
import com.jcdm.framework.websocket.WebSocketServer;
import com.jcdm.framework.websocket.WebSocketUsers;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import com.jcdm.main.da.opcuaconfig.client.ClientHandler;
@@ -13,14 +15,17 @@
import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
import javax.websocket.Session;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.jcdm.main.da.opcuaconfig.client.ClientHandler.readValues;
@Slf4j
public class MethodName {
    Map<String, Session> map = WebSocketUsers.getUsers();
    private IDaCollectionParamConfService collectionParamConfService = BeanUtils.getBean(IDaCollectionParamConfService.class);
    private IDaParamCollectionService daParamCollectionService = BeanUtils.getBean(IDaParamCollectionService.class);
    private IDaPassingStationCollectionService daPassingStationCollectionService = BeanUtils.getBean(IDaPassingStationCollectionService.class);
@@ -47,6 +52,7 @@
                PassingStationCollection.setInboundTime(new Date());
                daPassingStationCollectionService.insertDaPassingStationCollection(PassingStationCollection);
                log.info("节点:{},响应结果:{}", node1.getIdentifier(),out1);
                WebSocketUsers.sendMessageToUserByText(map.get(parts[1]), "IN");
                break;
            case "2":   //请求记录工位数据
                List<DaCollectionParamConf> b;
@@ -83,6 +89,7 @@
                //更新PLC节点状态
                NodeEntity node2= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordDataDone").value("21").type("short").build();
                Boolean out2=clientHandler.write(node2);
                WebSocketUsers.sendMessageToUserByText(map.get(parts[1]), "OUT");
                log.info("节点:{},响应结果:{}", node2.getIdentifier(),out2);
                break;
            default: