干燥机配套车间生产管理系统/云平台服务端
bsw215583320
2024-04-09 ae2d52827d289dd985014a63c08b0913d083b215
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/listener/InitListener.java
@@ -1,26 +1,25 @@
package org.jeecg.modules.dry.listener;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.io.ByteStreams;
import org.jeecg.modules.dry.common.CacheConstants;
import org.jeecg.modules.dry.common.CommonDict;
import org.jeecg.modules.dry.vo.DryFault;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
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);