package com.billion.main.plcServer; import com.billion.main.da.service.IDaParamCollectionService; import com.billion.main.plcServer.sub.OPCUaSubscription; import com.kangaroohy.milo.service.MiloService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import java.util.ArrayList; import java.util.List; public class CustomRunner implements ApplicationRunner { @Autowired private MiloService miloService; @Autowired public IDaParamCollectionService daParamCollectionService; @Override public void run(ApplicationArguments args) throws Exception { OPCUaSubscription OPCUaSubscription = new OPCUaSubscription(miloService, daParamCollectionService); List lists = getList(); System.out.println("订阅内容:"+lists); miloService.subscriptionFromOpcUa(lists,OPCUaSubscription); } public List getList(){ List lists = new ArrayList<>(); lists.add("CFL4CVT.BCOP010.RecordData");//请求保存 lists.add("CFL4CVT.BCOP040.RecordData");//请求保存 lists.add("CFL4CVT.BCOP060.RecordData");//请求保存 lists.add("CFL4CVT.BCOP100.RecordData");//请求保存 lists.add("CFL4CVT.BP020.RecordData");//请求保存 lists.add("CFL4CVT.OP220.RecordData");//请求保存 lists.add("CFL4CVT.BCOP010.MesRecordDataDone");//请求保存 lists.add("CFL4CVT.BCOP040.MesRecordDataDone");//请求保存 lists.add("CFL4CVT.BCOP060.MesRecordDataDone");//请求保存 lists.add("CFL4CVT.BCOP100.MesRecordDataDone");//请求保存 lists.add("CFL4CVT.BP020.MesRecordDataDone");//请求保存 lists.add("CFL4CVT.OP220.MesRecordDataDone");//请求保存 return lists; } }