干燥机配套车间生产管理系统/云平台服务端
baoshiwei
2023-12-06 cbc10fe4a6d385de784bd5ee276f84361382810b
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/listener/InitListener.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.io.ByteStreams;
import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.jeecg.modules.dry.common.CacheConstants;
import org.jeecg.modules.dry.common.CommonDict;
import org.jeecg.modules.dry.vo.DryFault;
@@ -17,10 +18,17 @@
import java.util.List;
import java.util.Map;
@Component
//@Component
public class InitListener implements ApplicationListener<ApplicationStartedEvent> {
    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
//        try {
//            OpcUaClient client = OPCUA.createClient();
//            client.connect().get();
//            OPCUA.managedSubscriptionEvent(client);
//        } catch (Exception e) {
//            throw new RuntimeException(e);
//        }
        InputStream fault = getClass().getResourceAsStream("/fault.json");
        try {
            JSONObject jsonObject = JSONObject.parseObject(fault, JSONObject.class);