From bbc5784cc34d65e64d639d949e75b978fe07bdb3 Mon Sep 17 00:00:00 2001 From: yyt <306727702@qq.com> Date: 星期一, 06 五月 2024 12:30:48 +0800 Subject: [PATCH] 更新首页 --- jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java | 59 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 48 insertions(+), 11 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java index bbb8144..65fc450 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java @@ -1,18 +1,24 @@ package com.jcdm.main.plcserver; +import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; +import com.jcdm.main.bs.technologyRouteChild.service.IBsTechnologyRouteChildInfoService; import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; +import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; +import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; -import com.jcdm.main.plcserver.conf.OPCElement; +import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl; import com.jcdm.main.plcserver.sub.OPCUaSubscription; +import com.jcdm.main.rm.repairRecord.service.IRmRepairRecordService; import com.kangaroohy.milo.service.MiloService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Component; -import java.util.ArrayList; +import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; @Component public class CustomRunner implements ApplicationRunner { @@ -26,28 +32,59 @@ @Autowired public IDaParamCollectionService daParamCollectionService; + @Resource + private DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl; + + @Resource + private IDaOpcuaConfigService iDaOpcuaConfigService; + + @Resource + private IBsOrderSchedulingService bsOrderSchedulingService; + + @Resource + private IRmRepairRecordService rmRepairRecordService; + + @Resource + private IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService; + @Override public void run(ApplicationArguments args) throws Exception { + List<DaOpcuaConfig> lists = getSubList(); + List<String> collect = lists.stream().map(DaOpcuaConfig::getNode).collect(Collectors.toList()); OPCUaSubscription opcUaSubscription = new OPCUaSubscription( miloService, collectionParamConfService, - daParamCollectionService); + daParamCollectionService, + passingStationCollectionServiceImpl, + bsOrderSchedulingService, + lists, + rmRepairRecordService, + bsTechnologyRouteChildInfoService); - List<String> lists = getSubList(); - miloService.subscriptionFromOpcUa(lists,opcUaSubscription); + + miloService.subscriptionFromOpcUa(collect,opcUaSubscription); } /** * 璁㈤槄鍐呭 */ - public List<String> getSubList(){ - List<String> lists = new ArrayList<>(); - lists.add(OPCElement.OP010_SaveRequest);//璇锋眰淇濆瓨 - lists.add(OPCElement.OP010_CodeCheck);//璇锋眰妫�绱㈡潯鐮� - lists.add(OPCElement.OP020_SaveRequest);//璇锋眰淇濆瓨 - return lists; + public List<DaOpcuaConfig> getSubList(){ + DaOpcuaConfig config = new DaOpcuaConfig(); + config.setState(0); + List<DaOpcuaConfig> list = iDaOpcuaConfigService.selectDaOpcuaConfigList(config); +// List<String> lists = new ArrayList<>(); +// if (CollUtil.isNotEmpty(list)){ +// lists = list.stream().map(DaOpcuaConfig::getNode).distinct().collect(Collectors.toList()); +// } +// List<String> lists = new ArrayList<>(); +//// lists.add(OPCElement.OP010_SaveRequest);//璇锋眰淇濆瓨 +//// lists.add(OPCElement.OP010_CodeCheck);//璇锋眰妫�绱㈡潯鐮� +//// lists.add(OPCElement.OP020_SaveRequest);//璇锋眰淇濆瓨 +// lists.add(OPCElement.OP120_SaveRequestLast);//璇锋眰淇濆瓨 +// lists.add(OPCElement.OP120_ZZ_CODE_CHECK);//璇锋眰淇濆瓨 + return list; } } -- Gitblit v1.9.3