春风项目四线(合箱线、总装线)
wujian
5 天以前 ea3c33c8561df39d4f123d1424fda99dd0f0c51d
提交 | 用户 | 时间
3e03af 1 package com.jcdm.main.plcserver;
C 2
3
9e6d86 4 import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
W 5 import com.jcdm.main.bs.technologyRouteChild.service.IBsTechnologyRouteChildInfoService;
3e03af 6 import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
059083 7 import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
W 8 import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
3e03af 9 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
59e228 10 import com.jcdm.main.da.passingStationCollection.service.ProductNewPassStationService;
059083 11 import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl;
3e03af 12 import com.jcdm.main.plcserver.sub.OPCUaSubscription;
9e6d86 13 import com.jcdm.main.rm.repairRecord.service.IRmRepairRecordService;
3e03af 14 import com.kangaroohy.milo.service.MiloService;
C 15 import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.boot.ApplicationArguments;
17 import org.springframework.boot.ApplicationRunner;
18 import org.springframework.stereotype.Component;
19
059083 20 import javax.annotation.Resource;
3e03af 21 import java.util.List;
059083 22 import java.util.stream.Collectors;
3e03af 23
C 24 @Component
25 public class CustomRunner implements ApplicationRunner {
26
27     @Autowired
28     public MiloService miloService;
29
30     @Autowired
31     public IDaCollectionParamConfService collectionParamConfService;
32
33     @Autowired
34     public IDaParamCollectionService daParamCollectionService;
35
059083 36     @Resource
W 37     private DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl;
38
39     @Resource
40     private IDaOpcuaConfigService iDaOpcuaConfigService;
41
9e6d86 42     @Resource
W 43     private IBsOrderSchedulingService bsOrderSchedulingService;
44
45     @Resource
46     private IRmRepairRecordService rmRepairRecordService;
47
48     @Resource
49     private IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService;
50
59e228 51     @Resource
W 52     private ProductNewPassStationService productNewPassStationService;
53
3e03af 54     @Override
C 55     public void run(ApplicationArguments args) throws Exception {
56
059083 57         List<DaOpcuaConfig> lists = getSubList();
W 58         List<String> collect = lists.stream().map(DaOpcuaConfig::getNode).collect(Collectors.toList());
3e03af 59         OPCUaSubscription opcUaSubscription = new OPCUaSubscription(
C 60                 miloService,
61                 collectionParamConfService,
9e6d86 62                 daParamCollectionService,
W 63                 passingStationCollectionServiceImpl,
64                 bsOrderSchedulingService,
65                 lists,
66                 rmRepairRecordService,
59e228 67                 bsTechnologyRouteChildInfoService,
W 68                 productNewPassStationService);
696fd5 69         miloService.subscriptionFromOpcUa(collect,100,opcUaSubscription);
3e03af 70     }
C 71
72     /**
73      * 订阅内容
74      */
059083 75     public List<DaOpcuaConfig> getSubList(){
W 76         DaOpcuaConfig config = new DaOpcuaConfig();
3946f8 77         config.setState(0);
059083 78         List<DaOpcuaConfig> list = iDaOpcuaConfigService.selectDaOpcuaConfigList(config);
W 79         return list;
3e03af 80     }
C 81 }
82