懒羊羊
2024-01-25 d3409e53d656dff668c12a335bcb6f367ca63fdb
opcua迁移
已修改20个文件
已添加23个文件
3396 ■■■■ 文件已修改
jcdm-main/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/controller/DaCollectionParamConfController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/domain/DaCollectionParamConf.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/mapper/DaCollectionParamConfMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/service/IDaCollectionParamConfService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/service/impl/DaCollectionParamConfServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/KeyStoreLoader.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java 295 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientRunner.java 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/DaOpcuaConfig.java 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/NodeEntity.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/BeanUtils.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/Properties.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/mapper/DaOpcuaConfigMapper.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/IDaOpcuaConfigService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/impl/DaOpcuaConfigServiceImpl.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/common/Constants.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/controller/DaPassingStationCollectionController.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/IDaPassingStationCollectionService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/domain/DaTileMatchRules.java 235 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/mapper/DaTileMatchRulesMapper.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/IDaTileMatchRulesService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/impl/DaTileMatchRulesServiceImpl.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/opcuaconfig/DaOpcuaConfigMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/tileMatchRules/DaTileMatchRulesMapper.xml 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/dist.rar 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/collectionParamConf/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/opcuaconfig/index.vue 283 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/paramCollection/index.vue 151 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/passingStationCollection/index.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/tileMatchRules/index.vue 483 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/kb/stationTerminal/index.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/pom.xml
@@ -58,6 +58,38 @@
            <artifactId>gson</artifactId>
            <version>2.10.1</version>
        </dependency>
        <!--Server SDK依赖-->
        <dependency>
            <groupId>org.eclipse.milo</groupId>
            <artifactId>sdk-server</artifactId>
            <version>0.3.6</version>
        </dependency>
        <!--Client SDK依赖-->
        <dependency>
            <groupId>org.eclipse.milo</groupId>
            <artifactId>sdk-client</artifactId>
            <version>0.3.6</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.milo</groupId>
            <artifactId>stack-client</artifactId>
            <version>0.3.6</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.milo</groupId>
            <artifactId>stack-client</artifactId>
            <version>0.3.6</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.milo</groupId>
            <artifactId>stack-server</artifactId>
            <version>0.3.6</version>
        </dependency>
    </dependencies>
</project>
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/controller/DaCollectionParamConfController.java
@@ -1,25 +1,19 @@
package com.jcdm.main.da.collectionParamConf.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * é‡‡é›†å‚数配置Controller
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/domain/DaCollectionParamConf.java
@@ -1,9 +1,9 @@
package com.jcdm.main.da.collectionParamConf.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * é‡‡é›†å‚数配置对象 da_collection_param_conf
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/mapper/DaCollectionParamConfMapper.java
@@ -1,8 +1,9 @@
package com.jcdm.main.da.collectionParamConf.mapper;
import java.util.List;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import java.util.List;
/**
 * é‡‡é›†å‚数配置Mapper接口
 * 
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/service/IDaCollectionParamConfService.java
@@ -1,8 +1,9 @@
package com.jcdm.main.da.collectionParamConf.service;
import java.util.List;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import java.util.List;
/**
 * é‡‡é›†å‚数配置Service接口
 * 
jcdm-main/src/main/java/com/jcdm/main/da/collectionParamConf/service/impl/DaCollectionParamConfServiceImpl.java
@@ -1,12 +1,13 @@
package com.jcdm.main.da.collectionParamConf.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import com.jcdm.main.da.collectionParamConf.mapper.DaCollectionParamConfMapper;
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.da.collectionParamConf.mapper.DaCollectionParamConfMapper;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import java.util.List;
/**
 * é‡‡é›†å‚数配置Service业务层处理
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/KeyStoreLoader.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,127 @@
package com.jcdm.main.da.opcuaconfig.cert;
import org.eclipse.milo.opcua.sdk.server.util.HostnameUtil;
import org.eclipse.milo.opcua.stack.core.util.SelfSignedCertificateBuilder;
import org.eclipse.milo.opcua.stack.core.util.SelfSignedCertificateGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.*;
import java.security.cert.X509Certificate;
import java.util.regex.Pattern;
/**
 * @ClassName: KeyStoreLoader
 * @Description: KeyStoreLoader
 * @author yyt
 * @date 2023å¹´10月13日
 */
@Component
public class KeyStoreLoader {
    private static final Pattern IP_ADDR_PATTERN = Pattern
            .compile("^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
    // è¯ä¹¦åˆ«å
    private static final String CLIENT_ALIAS = "jlclient-ai";
    // èŽ·å–私钥的密码
    private static final char[] PASSWORD = "yyt@8888888888".toCharArray();
    private final Logger logger = LoggerFactory.getLogger(getClass());
    // è¯ä¹¦å¯¹è±¡
    private X509Certificate clientCertificate;
    // å¯†é’¥å¯¹å¯¹è±¡
    private KeyPair clientKeyPair;
    /**
     * @MethodName: load
     * @Description: load
     * @param baseDir
     * @return
     * @throws Exception
     * @CreateTime 2023å¹´10月13日
     */
    public KeyStoreLoader load(Path baseDir) throws Exception {
        // åˆ›å»ºä¸€ä¸ªä½¿ç”¨`PKCS12`加密标准的KeyStore。KeyStore在后面将作为读取和生成证书的对象。
        KeyStore keyStore = KeyStore.getInstance("PKCS12");
        // PKCS12的加密标准的文件后缀是.pfx,其中包含了公钥和私钥。
        // è€Œå…¶ä»–如.der等的格式只包含公钥,私钥在另外的文件中。
        Path serverKeyStore = baseDir.resolve("OPCUA-client.pfx");
        logger.info("Loading KeyStore at {}", serverKeyStore);
        // å¦‚果文件不存在则创建.pfx证书文件。
        if (!Files.exists(serverKeyStore)) {
            keyStore.load(null, PASSWORD);
            // ç”¨2048位的RAS算法。`SelfSignedCertificateGenerator`为Milo库的对象。
            KeyPair keyPair = SelfSignedCertificateGenerator.generateRsaKeyPair(2048);
            // `SelfSignedCertificateBuilder`也是Milo库的对象,用来生成证书。
            // ä¸­é—´æ‰€è®¾ç½®çš„证书属性可以自行修改。
            SelfSignedCertificateBuilder builder = new SelfSignedCertificateBuilder(keyPair)
                    .setCommonName("UaClient@Jellyleo")
                    .setOrganization("JL")
                    .setOrganizationalUnit("per")
                    .setLocalityName("jl")
                    .setStateName("JiangSu")
                    .setCountryCode("CN")
                    .setApplicationUri("urn:Yyt_PC:UnifiedAutomation:UaExpert")
                    .addDnsName("Yyt_PC")
                    .addIpAddress("127.0.0.1");
            // Get as many hostnames and IP addresses as we can listed in the certificate.
            for (String hostname : HostnameUtil.getHostnames("0.0.0.0")) {
                if (IP_ADDR_PATTERN.matcher(hostname).matches()) {
                    builder.addIpAddress(hostname);
                } else {
                    builder.addDnsName(hostname);
                }
            }
            // åˆ›å»ºè¯ä¹¦
            X509Certificate certificate = builder.build();
            // è®¾ç½®å¯¹åº”私钥的别名,密码,证书链
            keyStore.setKeyEntry(CLIENT_ALIAS, keyPair.getPrivate(), PASSWORD, new X509Certificate[] { certificate });
            try (OutputStream out = Files.newOutputStream(serverKeyStore)) {
                // ä¿å­˜è¯ä¹¦åˆ°è¾“出流
                keyStore.store(out, PASSWORD);
            }
        } else {
            try (InputStream in = Files.newInputStream(serverKeyStore)) {
                // å¦‚果文件存在则读取
                keyStore.load(in, PASSWORD);
            }
        }
        // ç”¨å¯†ç èŽ·å–对应别名的私钥。
        Key serverPrivateKey = keyStore.getKey(CLIENT_ALIAS, PASSWORD);
        if (serverPrivateKey instanceof PrivateKey) {
            // èŽ·å–对应别名的证书对象。
            clientCertificate = (X509Certificate) keyStore.getCertificate(CLIENT_ALIAS);
            // èŽ·å–公钥
            PublicKey serverPublicKey = clientCertificate.getPublicKey();
            // åˆ›å»ºKeypair对象。
            clientKeyPair = new KeyPair(serverPublicKey, (PrivateKey) serverPrivateKey);
        }
        return this;
    }
    // è¿”回证书
    public X509Certificate getClientCertificate() {
        return clientCertificate;
    }
    // è¿”回密钥对
    public KeyPair getClientKeyPair() {
        return clientKeyPair;
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
package com.jcdm.main.da.opcuaconfig.cert;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import com.jcdm.main.da.opcuaconfig.client.ClientHandler;
import com.jcdm.main.da.opcuaconfig.domain.NodeEntity;
import com.jcdm.main.da.opcuaconfig.init.BeanUtils;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import static com.jcdm.main.da.opcuaconfig.client.ClientHandler.readValues;
@Slf4j
public class MethodName {
    private IDaCollectionParamConfService collectionParamConfService = BeanUtils.getBean(IDaCollectionParamConfService.class);
    private IDaParamCollectionService daParamCollectionService = BeanUtils.getBean(IDaParamCollectionService.class);
    private IDaPassingStationCollectionService daPassingStationCollectionService = BeanUtils.getBean(IDaPassingStationCollectionService.class);
    private List<DataValue> s=null;
    public void getSn(String Node, String value) throws Exception {
        log.info(Node+":"+value);
        String[] parts = Node.split("[.]");
        ClientHandler clientHandler=new ClientHandler();
        NodeEntity SN_node= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".SNCode").value("").type("").build();
        String SNCode=clientHandler.read(SN_node);
        log.info("读取节点:{},结果:{}", SN_node.getIdentifier(),SNCode);
        switch (value) {
            case "0":   //初始
                NodeEntity node= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordDataDone").value("0").type("short").build();
                Boolean out=clientHandler.write(node);
                log.info("节点:{},响应结果:{}", node.getIdentifier(),out);
                break;
            case "1":   //请求下发进站状态
                NodeEntity node1= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordDataDone").value("11").type("short").build();
                Boolean out1=clientHandler.write(node1);
                DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection();
                PassingStationCollection.setSfcCode(SNCode);
                PassingStationCollection.setLocationCode(parts[1]);
                PassingStationCollection.setInboundTime(new Date());
                daPassingStationCollectionService.insertDaPassingStationCollection(PassingStationCollection);
                log.info("节点:{},响应结果:{}", node1.getIdentifier(),out1);
                break;
            case "2":   //请求记录工位数据
                List<DaCollectionParamConf> b;
                DaCollectionParamConf daCollectionParamConf=new DaCollectionParamConf();
                daCollectionParamConf.setGatherAddress(parts[0]+"."+parts[1]);
                b=collectionParamConfService.selectDaCollectionParamConfList(daCollectionParamConf);
                List<NodeId> nodeId = b.stream().map(info -> {
                    NodeId nodeid = new NodeId(2,info.getGatherAddress());
                    return nodeid;
                }).collect(Collectors.toList());
                List<DataValue> s=readValues(nodeId);
                //保存PLC采集数据
                for(int i=0;i<nodeId.size();i++)
                {
                    DaParamCollection Config=new DaParamCollection();
                    Config.setParamCode(nodeId.get(i).getIdentifier().toString().split("[.]")[2]);
                    Config.setLocationCode(nodeId.get(i).getIdentifier().toString().split("[.]")[1]);
                    Config.setParamValue(s.get(i).getValue().getValue().toString());
                    Config.setSfcCode(SNCode);
                    Config.setParamName(b.get(i).getGatherAddress());
                    daParamCollectionService.insertDaParamCollection(Config);
                }
                //更新出站时间,计算节拍。
                DaPassingStationCollection PSC=new DaPassingStationCollection();
                PSC.setSfcCode(SNCode);
                List<DaPassingStationCollection> LPSC=daPassingStationCollectionService.selectDaPassingStationCollectionList(PSC);
                if(LPSC != null && LPSC.size() > 0){
                    LPSC.get(0).setOutboundTime(new Date());
                    LPSC.get(0).setCollectionTime(new Date());
                    LPSC.get(0).setBeatTime(Long.toString(Math.abs(new Date().getTime() - LPSC.get(0).getInboundTime().getTime())));
                    daPassingStationCollectionService.updateDaPassingStationCollection(LPSC.get(0));
                }
                //更新PLC节点状态
                NodeEntity node2= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordDataDone").value("21").type("short").build();
                Boolean out2=clientHandler.write(node2);
                log.info("节点:{},响应结果:{}", node2.getIdentifier(),out2);
                break;
            default:
                break;
        }
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,295 @@
package com.jcdm.main.da.opcuaconfig.client;
import com.google.common.collect.ImmutableList;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import com.jcdm.main.da.opcuaconfig.domain.NodeEntity;
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.eclipse.milo.opcua.sdk.client.api.nodes.VariableNode;
import org.eclipse.milo.opcua.sdk.client.api.subscriptions.UaSubscription;
import org.eclipse.milo.opcua.stack.core.AttributeId;
import org.eclipse.milo.opcua.stack.core.BuiltinDataType;
import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;
import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned;
import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode;
import org.eclipse.milo.opcua.stack.core.types.enumerated.TimestampsToReturn;
import org.eclipse.milo.opcua.stack.core.types.structured.MonitoredItemCreateRequest;
import org.eclipse.milo.opcua.stack.core.types.structured.MonitoringParameters;
import org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
/**
 * @ClassName: ClientHandler
 * @Description: å®¢æˆ·ç«¯å¤„理
 * @author Jellyleo
 * @date 2019å¹´12月12日
 */
@Slf4j
@Service
public class ClientHandler {
    // å®¢æˆ·ç«¯å®žä¾‹
    public static OpcUaClient client = null;
    public List<DaOpcuaConfig> b = null;
    @Autowired
    private ClientRunner clientRunner;
    @Autowired
    private IDaOpcuaConfigService daOpcuaConfigService;
    /**
     *
     * @MethodName: connect
     * @Description: connect
     * @throws Exception
     * @CreateTime 2019å¹´12月18日 ä¸Šåˆ10:41:09
     */
    public String connect() throws Exception {
        if (client != null) {
            return "客户端已创建";
        }
        client = clientRunner.run();
        if (client == null) {
            return "客户端配置实例化失败";
        }
        // åˆ›å»ºè¿žæŽ¥
        client.connect().get();
        return "创建连接成功";
    }
    /**
     * @MethodName: disconnect
     * @Description: æ–­å¼€è¿žæŽ¥
     * @return
     * @throws Exception
     * @CreateTime 2019å¹´12月18日 ä¸Šåˆ10:45:21
     */
    public String disconnect() throws Exception {
        if (client == null) {
            return "连接已断开";
        }
        // æ–­å¼€è¿žæŽ¥
        clientRunner.getFuture().complete(client);
        client = null;
        return "断开连接成功";
    }
    /**
     * @MethodName: subscribe
     * @Description: è®¢é˜…节点变量
     * @throws Exception
     * @CreateTime 2019å¹´12月18日 ä¸Šåˆ10:38:11
     */
    public String subscribe(List<NodeEntity> nodes) throws Exception {
        if (client == null) {
            return "找不到客户端,操作失败";
        }
        // æŸ¥è¯¢è®¢é˜…对象,没有则创建
        UaSubscription subscription = null;
        ImmutableList<UaSubscription> subscriptionList = client.getSubscriptionManager().getSubscriptions();
        if (CollectionUtils.isEmpty(subscriptionList)) {
            subscription = client.getSubscriptionManager().createSubscription(1000.0).get();
        } else {
            subscription = subscriptionList.get(0);
        }
        // ç›‘控项请求列表
        List<MonitoredItemCreateRequest> requests = new ArrayList<>();
        if (!CollectionUtils.isEmpty(nodes)) {
            for (NodeEntity node : nodes) {
                // åˆ›å»ºç›‘控的参数
                MonitoringParameters parameters = new MonitoringParameters(subscription.nextClientHandle(), 1000.0, // sampling
                        // interval
                        null, // filter, null means use default
                        Unsigned.uint(10), // queue size
                        true // discard oldest
                );
                // åˆ›å»ºè®¢é˜…的变量, åˆ›å»ºç›‘控项请 æ±‚
                MonitoredItemCreateRequest request = new MonitoredItemCreateRequest(
                        new ReadValueId(new NodeId(node.getIndex(), node.getIdentifier()), AttributeId.Value.uid(),
                                null, null),
                        MonitoringMode.Reporting, parameters);
                requests.add(request);
            }
        }
        // åˆ›å»ºç›‘控项,并且注册变量值改变时候的回调函数
        subscription.createMonitoredItems(TimestampsToReturn.Both, requests, (item, id) -> {
            item.setValueConsumer((i, v) -> {
                handle(i.getReadValueId().getNodeId(), v.getValue());
            });
        }).get();
        return "订阅成功";
    }
    /**
     * * @MethodName: write
     * @Description: å›žè°ƒå‡½æ•°
     * @CreateTime 2023å¹´10月13日
     */
    public void handle(NodeId id, Variant value){
        if (b == null || 0 > b.size()) {
            DaOpcuaConfig opcuaConfParam=new DaOpcuaConfig();
            opcuaConfParam.setSubscribe("Y");
            b=daOpcuaConfigService.selectDaOpcuaConfigList(opcuaConfParam);
        }
        //使用Stream API在List<T>中查找元素
        DaOpcuaConfig daOpcuaConfig = b.stream()
                .filter(customer ->id.getIdentifier().toString().equals(customer.getNode()))
                .findAny()
                .orElse(null);
        try {
            Class<?> clazz = Class.forName("com.jcdm.main.da.opcuaconfig.cert.MethodName");
            Method method = clazz.getMethod(daOpcuaConfig.getrFunction(), new Class[] { String.class, String.class });
            method.invoke(clazz.newInstance(),new Object[] {
                    new String(id.getIdentifier().toString()), new String(value.getValue().toString()) });
        } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException |
                 InvocationTargetException e) {
            e.printStackTrace();
        }
    }
    /**
     * @MethodName: write
     * @Description: å˜èŠ‚点量写入
     * @param node
     * @throws Exception
     * @CreateTime 2019å¹´12月18日 ä¸Šåˆ9:51:40
     */
    public static Boolean write(NodeEntity node) throws Exception {
        if (client == null) {
            log.info("找不到客户端,操作失败");
            return false;
        }
        NodeId nodeId = new NodeId(node.getIndex(), node.getIdentifier());
        Variant value = null;
        switch (node.getType()) {
        case "int":
            value = new Variant(Integer.parseInt(node.getValue().toString()));
            break;
        case "boolean":
            value = new Variant(Boolean.parseBoolean(node.getValue().toString()));
            break;
        case "short":
            value = new Variant(Short.parseShort(node.getValue().toString()));
            break;
        case "long":
            value = new Variant(Long.parseLong(node.getValue().toString()));
            break;
        case "string":
            value = new Variant(node.getValue().toString());
            break;
        case "char":
            value = new Variant(node.getValue().toString().charAt(0));
            break;
        }
        DataValue dataValue = new DataValue(value, null, null);
        StatusCode statusCode = client.writeValue(nodeId, dataValue).get();
        return statusCode.isGood();
    }
    /**
     * æ–¹æ³•æè¿°: è¯»å–多个点位的值
     *
     * @param nodeIdList ç‚¹ä½é›†åˆ
     * @return {@link List<DataValue>}
     * @throws
     */
    public static List<DataValue> readValues(List<NodeId> nodeIdList){
        try {
            List<DataValue> dataValues=client.readValues(0.0, TimestampsToReturn.Both,nodeIdList).get();
            return dataValues;
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * @MethodName: read
     * @Description: è¯»å–
     * @param node
     * @return
     * @throws Exception
     * @CreateTime 2019å¹´12月19日 ä¸‹åˆ2:40:34
     */
    public String read(NodeEntity node) throws Exception {
        if (client == null) {
            return "找不到客户端,操作失败";
        }
        NodeId nodeId = new NodeId(node.getIndex(), node.getIdentifier());
        VariableNode vnode = client.getAddressSpace().createVariableNode(nodeId);
        DataValue value = vnode.readValue().get();
        log.info("Value={}", value);
        Variant variant = value.getValue();
        log.info("Variant={}", variant.getValue());
        log.info("BackingClass={}", BuiltinDataType.getBackingClass(variant.getDataType().get()));
        return variant.getValue().toString();
    }
    /**
     * æ–¹æ³•æè¿°:  å†™å…¥å¤šä¸ªèŠ‚点的值
     *
     * @param keys  èŠ‚点集合
     * @param values  å€¼é›†åˆ
     * @param client  å®¢æˆ·ç«¯
     * @return {@link Object}
     * @throws
     */
    public static Object writeValues(Set<String> keys, List<Object> values, OpcUaClient client){
        List<NodeId> nodeIs=new ArrayList<>(keys.size());
        keys.forEach(e->{
            NodeId nodeId = new NodeId(2, e);
            nodeIs.add(nodeId);
        });
        List<DataValue> dataValues=new ArrayList<>(values.size());
        values.forEach(e->{
            Variant value=new Variant(Double.parseDouble(e.toString()));
            DataValue dataValue=new DataValue(value);
            dataValues.add(dataValue);
        });
        try {
            client.writeValues(nodeIs,dataValues).get();
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
        return null;
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientRunner.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,146 @@
package com.jcdm.main.da.opcuaconfig.client;
import com.jcdm.main.da.opcuaconfig.cert.KeyStoreLoader;
import com.jcdm.main.da.opcuaconfig.init.Properties;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfig;
import org.eclipse.milo.opcua.sdk.client.api.identity.AnonymousProvider;
import org.eclipse.milo.opcua.stack.client.DiscoveryClient;
import org.eclipse.milo.opcua.stack.core.Stack;
import org.eclipse.milo.opcua.stack.core.security.SecurityPolicy;
import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned;
import org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.function.Predicate;
/**
 * @ClassName: ClientRunner
 * @Description: å®¢æˆ·ç«¯å¯åŠ¨ç±»
 * @author yyt
 * @date 2023å¹´10月13日
 */
@Slf4j
@Component
public class ClientRunner {
    private final CompletableFuture<OpcUaClient> future = new CompletableFuture<>();
    @Autowired
    private Properties properties;
    @Autowired
    private KeyStoreLoader keyStoreLoader;
    /**
     * @MethodName: run
     * @Description: å¯åŠ¨
     * @return
     * @throws Exception
     * @CreateTime 2023å¹´10月13日
     */
    public OpcUaClient run() throws Exception {
        OpcUaClient client = createClient();
        future.whenCompleteAsync((c, ex) -> {
            if (ex != null) {
                log.error("Error running example: {}", ex.getMessage(), ex);
            }
            try {
                c.disconnect().get();
                Stack.releaseSharedResources();
            } catch (InterruptedException | ExecutionException e) {
                log.error("Error disconnecting:", e.getMessage(), e);
            }
        });
        return client;
    }
    /**
     * @MethodName: createClient
     * @Description: åˆ›å»ºå®¢æˆ·ç«¯
     * @return
     * @throws Exception
     * @CreateTime 2023å¹´10月13日
     */
    private OpcUaClient createClient() throws Exception {
        Path securityTempDir = Paths.get(properties.getCertPath(), "security");
        Files.createDirectories(securityTempDir);
        if (!Files.exists(securityTempDir)) {
            log.error("unable to create security dir: " + securityTempDir);
            return null;
        }
        KeyStoreLoader loader = keyStoreLoader.load(securityTempDir);
        // æœç´¢OPC节点
        List<EndpointDescription> endpoints = null;
        try {
            //获取安全策略
            endpoints = DiscoveryClient.getEndpoints(properties.getEndpointUrl()).get();
        } catch (Throwable e) {
            // try the explicit discovery endpoint as well
            String discoveryUrl = properties.getEndpointUrl();
            if (!discoveryUrl.endsWith("/")) {
                discoveryUrl += "/";
            }
            discoveryUrl += "discovery";
            log.info("Trying explicit discovery URL: {}", discoveryUrl);
            endpoints = DiscoveryClient.getEndpoints(discoveryUrl).get();
        }
        EndpointDescription endpoint = endpoints.stream()
                .filter(e -> e.getSecurityPolicyUri().equals(SecurityPolicy.None.getUri())).filter(endpointFilter())
                .findFirst().orElseThrow(() -> new Exception("no desired endpoints returned"));
        OpcUaClientConfig config = OpcUaClientConfig.builder()
                // opc ua自定义的名称
                .setApplicationName(LocalizedText.english("plc"))
                // åœ°å€
                .setApplicationUri(properties.getEndpointUrl())
                .setCertificate(loader.getClientCertificate()).setKeyPair(loader.getClientKeyPair())
                // å®‰å…¨ç­–略等配置
                //.setEndpoint(endpoint).setIdentityProvider(new UsernameProvider("OPCUA", "yyt@8888888888"))
                .setEndpoint(endpoint)
                // åŒ¿åéªŒè¯
                .setIdentityProvider(new AnonymousProvider())
                //等待时间
                .setRequestTimeout(Unsigned.uint(5000)).build();
        return OpcUaClient.create(config);
    }
    /**
     * @MethodName: endpointFilter
     * @Description: endpointFilter
     * @return
     * @CreateTime 2023å¹´10月13日
     */
    private Predicate<EndpointDescription> endpointFilter() {
        return e -> true;
    }
    /**
     * @return the future
     */
    public CompletableFuture<OpcUaClient> getFuture() {
        return future;
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
package com.jcdm.main.da.opcuaconfig.controller;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * äº¤äº’信号配置Controller
 *
 * @author yyt
 * @date 2024-01-23
 */
@RestController
@RequestMapping("/da/opcuaconfig")
public class DaOpcuaConfigController extends BaseController
{
    @Autowired
    private IDaOpcuaConfigService daOpcuaConfigService;
    /**
     * æŸ¥è¯¢äº¤äº’信号配置列表
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:list')")
    @GetMapping("/list")
    public TableDataInfo list(DaOpcuaConfig daOpcuaConfig)
    {
        startPage();
        List<DaOpcuaConfig> list = daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºäº¤äº’信号配置列表
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:export')")
    @Log(title = "交互信号配置", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DaOpcuaConfig daOpcuaConfig)
    {
        List<DaOpcuaConfig> list = daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig);
        ExcelUtil<DaOpcuaConfig> util = new ExcelUtil<DaOpcuaConfig>(DaOpcuaConfig.class);
        util.exportExcel(response, list, "交互信号配置数据");
    }
    /**
     * èŽ·å–交互信号配置详细信息
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(daOpcuaConfigService.selectDaOpcuaConfigById(id));
    }
    /**
     * æ–°å¢žäº¤äº’信号配置
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:add')")
    @Log(title = "交互信号配置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DaOpcuaConfig daOpcuaConfig)
    {
        return toAjax(daOpcuaConfigService.insertDaOpcuaConfig(daOpcuaConfig));
    }
    /**
     * ä¿®æ”¹äº¤äº’信号配置
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:edit')")
    @Log(title = "交互信号配置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DaOpcuaConfig daOpcuaConfig)
    {
        return toAjax(daOpcuaConfigService.updateDaOpcuaConfig(daOpcuaConfig));
    }
    /**
     * åˆ é™¤äº¤äº’信号配置
     */
    @PreAuthorize("@ss.hasPermi('da:opcuaconfig:remove')")
    @Log(title = "交互信号配置", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(daOpcuaConfigService.deleteDaOpcuaConfigByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/DaOpcuaConfig.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,149 @@
package com.jcdm.main.da.opcuaconfig.domain;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * äº¤äº’信号配置对象 da_opcua_config
 *
 * @author yyt
 * @date 2024-01-23
 */
public class DaOpcuaConfig extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** èŠ‚点 */
    @Excel(name = "节点")
    private String node;
    /** æ•°æ®ç±»åž‹ */
    @Excel(name = "数据类型")
    private String sysTypes;
    /** æ˜¯å¦è®¢é˜… */
    @Excel(name = "是否订阅")
    private String subscribe;
    /** è®¢é˜…类型 */
    @Excel(name = "订阅类型")
    private String rFunction;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
    /** å·¥åºåç§° */
    @Excel(name = "工序名称")
    private String processName;
    /** å·¥åºç¼–码 */
    @Excel(name = "工序编码")
    private String process;
    /** çŠ¶æ€ */
    @Excel(name = "状态")
    private Long state;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setNode(String node)
    {
        this.node = node;
    }
    public String getNode()
    {
        return node;
    }
    public void setSysTypes(String sysTypes)
    {
        this.sysTypes = sysTypes;
    }
    public String getSysTypes()
    {
        return sysTypes;
    }
    public void setSubscribe(String subscribe)
    {
        this.subscribe = subscribe;
    }
    public String getSubscribe()
    {
        return subscribe;
    }
    public void setrFunction(String rFunction)
    {
        this.rFunction = rFunction;
    }
    public String getrFunction()
    {
        return rFunction;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    public void setProcessName(String processName)
    {
        this.processName = processName;
    }
    public String getProcessName()
    {
        return processName;
    }
    public void setProcess(String process)
    {
        this.process = process;
    }
    public String getProcess()
    {
        return process;
    }
    public void setState(Long state)
    {
        this.state = state;
    }
    public Long getState()
    {
        return state;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("node", getNode())
            .append("sysTypes", getSysTypes())
            .append("subscribe", getSubscribe())
            .append("rFunction", getrFunction())
            .append("remarks", getRemarks())
            .append("processName", getProcessName())
            .append("process", getProcess())
            .append("state", getState())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/NodeEntity.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package com.jcdm.main.da.opcuaconfig.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
public class NodeEntity {
    private Integer index;
    private String identifier;
    private Object value;
    private String type;
    private Integer clientHandle;
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/BeanUtils.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package com.jcdm.main.da.opcuaconfig.init;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class BeanUtils implements ApplicationContextAware {
    protected static ApplicationContext applicationContext ;
    @Override
    public void setApplicationContext(ApplicationContext arg0) throws BeansException {
        if (applicationContext == null) {
            applicationContext = arg0;
        }
    }
    public static Object getBean(String name) {
        //name表示其他要注入的注解name名
        return applicationContext.getBean(name);
    }
    /**
     * æ‹¿åˆ°ApplicationContext对象实例后就可以手动获取Bean的注入实例对象
     */
    public static <T> T getBean(Class<T> clazz) {
        return applicationContext.getBean(clazz);
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
package com.jcdm.main.da.opcuaconfig.init;
import com.google.common.collect.Lists;
import com.jcdm.main.da.opcuaconfig.client.ClientHandler;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import com.jcdm.main.da.opcuaconfig.domain.NodeEntity;
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Slf4j
public class OpcusConfigInit implements CommandLineRunner {
    @Autowired
    private ClientHandler clientHandler;
    @Autowired
    private IDaOpcuaConfigService daOpcuaConfigService;
    @Override
    public void run(String... args) throws Exception {
        try {
            DaOpcuaConfig daOpcuaConfig=new DaOpcuaConfig();
            daOpcuaConfig.setSubscribe("Y"); //设置查询条件,是否订阅状态为Y的所有数据.
            List<DaOpcuaConfig> nodeslist=daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig);
            clientHandler.connect();
            if (nodeslist != null && nodeslist.size() > 0) {
                List<NodeEntity> NodeList = Lists.transform(nodeslist, (DaOpcuaConfig) -> {
                    NodeEntity nodeEntity = new NodeEntity();
                    nodeEntity.setIndex(2);
                    nodeEntity.setIdentifier(DaOpcuaConfig.getNode());
                    return nodeEntity;
                });
                clientHandler.subscribe(NodeList);
                log.info("初始化OPC订阅" + nodeslist.size() + "条!");
            }
            log.info("系统提示,OPCUA订阅成功!");
        } catch (Exception e) {
            e.printStackTrace();
            log.info("系统提示,OPCUA订阅失败!");
        }
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/Properties.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
/**
 * Created by Jellyleo on 2019å¹´12月19日
 * Copyright Â© 2019 jellyleo.com
 * All rights reserved.
 */
package com.jcdm.main.da.opcuaconfig.init;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
 * @ClassName: Properties
 * @Description: OpcUa参数
 * @author yyt
 * @date 2023å¹´10月13日
 */
@Getter
@Configuration
@PropertySource("classpath:opcua.properties")
public class Properties {
    @Value("${opcua.server.endpoint.url}")
    private String endpointUrl;
    @Value("${opcua.server.idp.username}")
    private String idpUsername;
    @Value("${opcua.server.idp.password}")
    private String idpPassword;
    @Value("${opcua.client.app.name}")
    private String appName;
    @Value("${opcua.client.app.uri}")
    private String appUri;
    @Value("${opcua.client.cert.path}")
    private String certPath;
    @Value("${opcua.client.cert.file}")
    private String certFile;
    @Value("${opcua.client.cert.alias}")
    private String certAlias;
    @Value("${opcua.client.cert.common.name}")
    private String commonName;
    @Value("${opcua.client.cert.organization}")
    private String organization;
    @Value("${opcua.client.cert.organization.unit}")
    private String orgUnit;
    @Value("${opcua.client.cert.locality.name}")
    private String localityName;
    @Value("${opcua.client.cert.state.name}")
    private String stateName;
    @Value("${opcua.client.cert.country.code}")
    private String countryCode;
    @Value("${opcua.client.cert.dns.name}")
    private String dnsName;
    @Value("${opcua.client.cert.ip.address}")
    private String ipAddress;
    @Value("${opcua.client.cert.keystore.password}")
    private String keyPassword;
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/mapper/DaOpcuaConfigMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.da.opcuaconfig.mapper;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import java.util.List;
/**
 * äº¤äº’信号配置Mapper接口
 *
 * @author yyt
 * @date 2024-01-23
 */
public interface DaOpcuaConfigMapper
{
    /**
     * æŸ¥è¯¢äº¤äº’信号配置
     *
     * @param id äº¤äº’信号配置主键
     * @return äº¤äº’信号配置
     */
    public DaOpcuaConfig selectDaOpcuaConfigById(Long id);
    /**
     * æŸ¥è¯¢äº¤äº’信号配置列表
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return äº¤äº’信号配置集合
     */
    public List<DaOpcuaConfig> selectDaOpcuaConfigList(DaOpcuaConfig daOpcuaConfig);
    /**
     * æ–°å¢žäº¤äº’信号配置
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return ç»“æžœ
     */
    public int insertDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig);
    /**
     * ä¿®æ”¹äº¤äº’信号配置
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return ç»“æžœ
     */
    public int updateDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig);
    /**
     * åˆ é™¤äº¤äº’信号配置
     *
     * @param id äº¤äº’信号配置主键
     * @return ç»“æžœ
     */
    public int deleteDaOpcuaConfigById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤äº¤äº’信号配置
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteDaOpcuaConfigByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/IDaOpcuaConfigService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.da.opcuaconfig.service;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import java.util.List;
/**
 * äº¤äº’信号配置Service接口
 *
 * @author yyt
 * @date 2024-01-23
 */
public interface IDaOpcuaConfigService
{
    /**
     * æŸ¥è¯¢äº¤äº’信号配置
     *
     * @param id äº¤äº’信号配置主键
     * @return äº¤äº’信号配置
     */
    public DaOpcuaConfig selectDaOpcuaConfigById(Long id);
    /**
     * æŸ¥è¯¢äº¤äº’信号配置列表
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return äº¤äº’信号配置集合
     */
    public List<DaOpcuaConfig> selectDaOpcuaConfigList(DaOpcuaConfig daOpcuaConfig);
    /**
     * æ–°å¢žäº¤äº’信号配置
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return ç»“æžœ
     */
    public int insertDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig);
    /**
     * ä¿®æ”¹äº¤äº’信号配置
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return ç»“æžœ
     */
    public int updateDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig);
    /**
     * æ‰¹é‡åˆ é™¤äº¤äº’信号配置
     *
     * @param ids éœ€è¦åˆ é™¤çš„交互信号配置主键集合
     * @return ç»“æžœ
     */
    public int deleteDaOpcuaConfigByIds(Long[] ids);
    /**
     * åˆ é™¤äº¤äº’信号配置信息
     *
     * @param id äº¤äº’信号配置主键
     * @return ç»“æžœ
     */
    public int deleteDaOpcuaConfigById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/impl/DaOpcuaConfigServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
package com.jcdm.main.da.opcuaconfig.service.impl;
import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
import com.jcdm.main.da.opcuaconfig.mapper.DaOpcuaConfigMapper;
import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * äº¤äº’信号配置Service业务层处理
 *
 * @author yyt
 * @date 2024-01-23
 */
@Service
public class DaOpcuaConfigServiceImpl implements IDaOpcuaConfigService
{
    @Autowired
    private DaOpcuaConfigMapper daOpcuaConfigMapper;
    /**
     * æŸ¥è¯¢äº¤äº’信号配置
     *
     * @param id äº¤äº’信号配置主键
     * @return äº¤äº’信号配置
     */
    @Override
    public DaOpcuaConfig selectDaOpcuaConfigById(Long id)
    {
        return daOpcuaConfigMapper.selectDaOpcuaConfigById(id);
    }
    /**
     * æŸ¥è¯¢äº¤äº’信号配置列表
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return äº¤äº’信号配置
     */
    @Override
    public List<DaOpcuaConfig> selectDaOpcuaConfigList(DaOpcuaConfig daOpcuaConfig)
    {
        return daOpcuaConfigMapper.selectDaOpcuaConfigList(daOpcuaConfig);
    }
    /**
     * æ–°å¢žäº¤äº’信号配置
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return ç»“æžœ
     */
    @Override
    public int insertDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig)
    {
        return daOpcuaConfigMapper.insertDaOpcuaConfig(daOpcuaConfig);
    }
    /**
     * ä¿®æ”¹äº¤äº’信号配置
     *
     * @param daOpcuaConfig äº¤äº’信号配置
     * @return ç»“æžœ
     */
    @Override
    public int updateDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig)
    {
        return daOpcuaConfigMapper.updateDaOpcuaConfig(daOpcuaConfig);
    }
    /**
     * æ‰¹é‡åˆ é™¤äº¤äº’信号配置
     *
     * @param ids éœ€è¦åˆ é™¤çš„交互信号配置主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaOpcuaConfigByIds(Long[] ids)
    {
        return daOpcuaConfigMapper.deleteDaOpcuaConfigByIds(ids);
    }
    /**
     * åˆ é™¤äº¤äº’信号配置信息
     *
     * @param id äº¤äº’信号配置主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaOpcuaConfigById(Long id)
    {
        return daOpcuaConfigMapper.deleteDaOpcuaConfigById(id);
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java
@@ -1,27 +1,20 @@
package com.jcdm.main.da.paramCollection.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集Controller
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java
@@ -1,11 +1,11 @@
package com.jcdm.main.da.paramCollection.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集对象 da_param_collection
@@ -65,8 +65,7 @@
    private String paramStandard;
    /** é‡‡é›†æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = "采集时间")
    private Date collectionTime;
    /** é¢„留字段1 */
@@ -96,15 +95,6 @@
    /** ç±»åž‹ */
    @Excel(name = "类型")
    private String type;
    @Excel(name = "参数集编码")
    private String parameterSetCode;
    @Excel(name = "参数集名称")
    private String parameterSetName;
    @Excel(name = "工序编号")
    private String processesCode;
    @Excel(name = "工序名称")
    private String processesName;
    public void setId(Long id) 
    {
@@ -295,42 +285,6 @@
    {
        return type;
    }
    public void setParameterSetCode(String parameterSetCode)
    {
        this.parameterSetCode = parameterSetCode;
    }
    public String getParameterSetCode()
    {
        return parameterSetCode;
    }
    public void setParameterSetName(String parameterSetName)
    {
        this.parameterSetName = parameterSetName;
    }
    public String getParameterSetName()
    {
        return parameterSetName;
    }
    public void setProcessesCode(String processesCode)
    {
        this.processesCode = processesCode;
    }
    public String getProcessesCode()
    {
        return processesCode;
    }
    public void setProcessesName(String processesName)
    {
        this.processesName = processesName;
    }
    public String getProcessesName()
    {
        return processesName;
    }
    @Override
    public String toString() {
@@ -358,10 +312,6 @@
            .append("paramName", getParamName())
            .append("unit", getUnit())
            .append("type", getType())
            .append("parameterSetCode", getParameterSetCode())
            .append("parameterSetName", getParameterSetName())
            .append("processesCode", getProcessesCode())
            .append("processesName", getProcessesName())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -1,6 +1,5 @@
package com.jcdm.main.da.paramCollection.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
@@ -8,6 +7,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集Service业务层处理
 * 
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/common/Constants.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
package com.jcdm.main.da.passingStationCollection.common;
public final class Constants {
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/controller/DaPassingStationCollectionController.java
@@ -1,27 +1,21 @@
package com.jcdm.main.da.passingStationCollection.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.domain.R;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * äº§å“è¿‡ç«™é‡‡é›†Controller
@@ -49,6 +43,35 @@
    }
    /**
     * æŸ¥è¯¢äº§å“è¿‡ç«™é‡‡é›†åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
    @GetMapping("/noPageList")
    public TableDataInfo noPageList(DaPassingStationCollection daPassingStationCollection)
    {
        List<DaPassingStationCollection> list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection);
        return getDataTable(list);
    }
//    @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')")
//    @GetMapping("/getProduceNumToday")
//    public R getProduceNumToday(String fieldName)
//    {
//        Integer num = daPassingStationCollectionService.getProduceNumToday(fieldName);
//        return R.ok(num);
//    }
    /**
     * æŸ¥è¯¢äº§å“è¿‡ç«™é‡‡é›†åˆ—表
     */
    @GetMapping("/insertRepairRecordByIds")
    public AjaxResult insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection)
    {
        daPassingStationCollectionService.insertRepairRecordByIds(daPassingStationCollection);
        return AjaxResult.success();
    }
    /**
     * å¯¼å‡ºäº§å“è¿‡ç«™é‡‡é›†åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('da:passingStationCollection:export')")
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/domain/DaPassingStationCollection.java
@@ -1,11 +1,11 @@
package com.jcdm.main.da.passingStationCollection.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
 * äº§å“è¿‡ç«™é‡‡é›†å¯¹è±¡ da_passing_station_collection
@@ -45,13 +45,13 @@
    private String equipmentNo;
    /** å…¥ç«™æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "入站时间", width = 30, dateFormat = "yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "入站时间")
    private Date inboundTime;
    /** å‡ºç«™æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出站时间", width = 30, dateFormat = "yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出站时间")
    private Date outboundTime;
    /** å…¥ç«™æ˜¯å¦åˆæ ¼ */
@@ -71,8 +71,8 @@
    private String outMsgSign;
    /** é‡‡é›†æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采集时间")
    private Date collectionTime;
    /** é¢„留字段1 */
@@ -91,6 +91,16 @@
    @Excel(name = "节拍时间")
    private String beatTime;
    private Long[] ids;
    public Long[] getIds() {
        return ids;
    }
    public void setIds(Long[] ids) {
        this.ids = ids;
    }
    public void setId(Long id) 
    {
        this.id = id;
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/IDaPassingStationCollectionService.java
@@ -28,6 +28,14 @@
     */
    public List<DaPassingStationCollection> selectDaPassingStationCollectionList(DaPassingStationCollection daPassingStationCollection);
//    /**
//     * èŽ·å–首页单日累计量产数据
//     * @param fieldName bs
//     * @return list
//     */
//    public Integer getProduceNumToday(String fieldName);
    /**
     * æ–°å¢žäº§å“è¿‡ç«™é‡‡é›†
     * 
@@ -59,4 +67,6 @@
     * @return ç»“æžœ
     */
    public int deleteDaPassingStationCollectionById(Long id);
    void insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection);
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -1,12 +1,21 @@
package com.jcdm.main.da.passingStationCollection.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
//import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
//import com.jcdm.main.bs.orderScheduling.mapper.BsOrderSchedulingMapper;
//import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord;
import com.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
 * äº§å“è¿‡ç«™é‡‡é›†Service业务层处理
@@ -19,6 +28,15 @@
{
    @Autowired
    private DaPassingStationCollectionMapper daPassingStationCollectionMapper;
    @Autowired
    private RmRepairRecordMapper rmRepairRecordMapper;
//    @Autowired
//    private BsOrderSchedulingMapper bsOrderSchedulingMapper;
//
//    @Autowired
//    private IBsOrderSchedulingService bsOrderSchedulingService;
    /**
     * æŸ¥è¯¢äº§å“è¿‡ç«™é‡‡é›†
@@ -43,6 +61,26 @@
    {
        return daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection);
    }
//    /**
//     * èŽ·å–首页单日累计量产数据
//     * @param fieldName bs
//     * @return list
//     */
//    @Override
//    public Integer getProduceNumToday(String fieldName) {
//
//        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
//        bsOrderScheduling.setQueryField(fieldName);
//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
//        LocalDateTime startTime = LocalDate.now().atStartOfDay();
//        LocalDateTime endTime = LocalDate.now().plusDays(1).atStartOfDay();
//        String s1 = startTime.format(formatter);
//        String s2 = endTime.format(formatter);
//        bsOrderScheduling.setStartTime(s1);
//        bsOrderScheduling.setEndTime(s2);
//        return bsOrderSchedulingMapper.getProduceNumToday(bsOrderScheduling);
//    }
    /**
     * æ–°å¢žäº§å“è¿‡ç«™é‡‡é›†
@@ -93,4 +131,17 @@
    {
        return daPassingStationCollectionMapper.deleteDaPassingStationCollectionById(id);
    }
    @Override
    public void insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection) {
        Long[] conditions = daPassingStationCollection.getIds();
        for (int i = 0; i < conditions.length; i++) {
            DaPassingStationCollection result = daPassingStationCollectionMapper.selectDaPassingStationCollectionById(conditions[i]);
            RmRepairRecord rmRepairRecord = new RmRepairRecord();
            rmRepairRecord.setBoxCode(result.getSfcCode());
            rmRepairRecord.setProcessesCode(result.getLocationCode());
            rmRepairRecord.setOriginalResult(result.getOutRsSign());
            rmRepairRecordMapper.insertRmRepairRecord(rmRepairRecord);
        }
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
package com.jcdm.main.da.tileMatchRules.controller;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * é…ç“¦è§„则Controller
 *
 * @author jiang
 * @date 2024-01-24
 */
@RestController
@RequestMapping("/da/tileMatchRules")
public class DaTileMatchRulesController extends BaseController
{
    @Autowired
    private IDaTileMatchRulesService daTileMatchRulesService;
    /**
     * æŸ¥è¯¢é…ç“¦è§„则列表
     */
    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:list')")
    @GetMapping("/list")
    public TableDataInfo list(DaTileMatchRules daTileMatchRules)
    {
        startPage();
        List<DaTileMatchRules> list = daTileMatchRulesService.selectDaTileMatchRulesList(daTileMatchRules);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºé…ç“¦è§„则列表
     */
    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:export')")
    @Log(title = "配瓦规则", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DaTileMatchRules daTileMatchRules)
    {
        List<DaTileMatchRules> list = daTileMatchRulesService.selectDaTileMatchRulesList(daTileMatchRules);
        ExcelUtil<DaTileMatchRules> util = new ExcelUtil<DaTileMatchRules>(DaTileMatchRules.class);
        util.exportExcel(response, list, "配瓦规则数据");
    }
    /**
     * èŽ·å–配瓦规则详细信息
     */
    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(daTileMatchRulesService.selectDaTileMatchRulesById(id));
    }
    /**
     * æ–°å¢žé…ç“¦è§„则
     */
    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:add')")
    @Log(title = "配瓦规则", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DaTileMatchRules daTileMatchRules)
    {
        return toAjax(daTileMatchRulesService.insertDaTileMatchRules(daTileMatchRules));
    }
    /**
     * ä¿®æ”¹é…ç“¦è§„则
     */
    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:edit')")
    @Log(title = "配瓦规则", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DaTileMatchRules daTileMatchRules)
    {
        return toAjax(daTileMatchRulesService.updateDaTileMatchRules(daTileMatchRules));
    }
    /**
     * åˆ é™¤é…ç“¦è§„则
     */
    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:remove')")
    @Log(title = "配瓦规则", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(daTileMatchRulesService.deleteDaTileMatchRulesByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/domain/DaTileMatchRules.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,235 @@
package com.jcdm.main.da.tileMatchRules.domain;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * é…ç“¦è§„则对象 da_tile_match_rules
 *
 * @author jiang
 * @date 2024-01-24
 */
public class DaTileMatchRules extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ä¸»é”®id */
    private Long id;
    /** äº§å“ç³»åˆ— */
    @Excel(name = "产品系列")
    private String productSeries;
    /** æ‰«ç å¯¹è±¡1 */
    @Excel(name = "扫码对象1")
    private String scanObject1;
    /** æ‰«ç å¯¹è±¡2 */
    @Excel(name = "扫码对象2")
    private String scanObject2;
    /** è½´åç§° */
    @Excel(name = "轴名称")
    private String axisName;
    /** é¢ˆåç§° */
    @Excel(name = "颈名称")
    private String neckName;
    /** ç“¦åç§° */
    @Excel(name = "瓦名称")
    private String tileName;
    /** è½´å‚数数位置 */
    @Excel(name = "轴参数数位置")
    private Long axisParameterNoPosition;
    /** é¢ˆå‚数数位置 */
    @Excel(name = "颈参数数位置")
    private Long neckParameterPosition;
    /** è½´å€¼ */
    @Excel(name = "轴值")
    private String axisValue;
    /** é¢ˆå€¼ */
    @Excel(name = "颈值")
    private String neckValue;
    /** ç“¦é¢œè‰² */
    @Excel(name = "瓦颜色")
    private String tileColor;
    /** åˆ›å»ºç”¨æˆ· */
    @Excel(name = "创建用户")
    private String createUser;
    /** æ›´æ”¹ç”¨æˆ· */
    @Excel(name = "更改用户")
    private String updateUser;
    /** çŠ¶æ€ï¼ˆ1合格、2不合格) */
    @Excel(name = "状态", readConverterExp = "1=合格、2不合格")
    private String state;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setProductSeries(String productSeries)
    {
        this.productSeries = productSeries;
    }
    public String getProductSeries()
    {
        return productSeries;
    }
    public void setScanObject1(String scanObject1)
    {
        this.scanObject1 = scanObject1;
    }
    public String getScanObject1()
    {
        return scanObject1;
    }
    public void setScanObject2(String scanObject2)
    {
        this.scanObject2 = scanObject2;
    }
    public String getScanObject2()
    {
        return scanObject2;
    }
    public void setAxisName(String axisName)
    {
        this.axisName = axisName;
    }
    public String getAxisName()
    {
        return axisName;
    }
    public void setNeckName(String neckName)
    {
        this.neckName = neckName;
    }
    public String getNeckName()
    {
        return neckName;
    }
    public void setTileName(String tileName)
    {
        this.tileName = tileName;
    }
    public String getTileName()
    {
        return tileName;
    }
    public void setAxisParameterNoPosition(Long axisParameterNoPosition)
    {
        this.axisParameterNoPosition = axisParameterNoPosition;
    }
    public Long getAxisParameterNoPosition()
    {
        return axisParameterNoPosition;
    }
    public void setNeckParameterPosition(Long neckParameterPosition)
    {
        this.neckParameterPosition = neckParameterPosition;
    }
    public Long getNeckParameterPosition()
    {
        return neckParameterPosition;
    }
    public void setAxisValue(String axisValue)
    {
        this.axisValue = axisValue;
    }
    public String getAxisValue()
    {
        return axisValue;
    }
    public void setNeckValue(String neckValue)
    {
        this.neckValue = neckValue;
    }
    public String getNeckValue()
    {
        return neckValue;
    }
    public void setTileColor(String tileColor)
    {
        this.tileColor = tileColor;
    }
    public String getTileColor()
    {
        return tileColor;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }
    public String getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser)
    {
        this.updateUser = updateUser;
    }
    public String getUpdateUser()
    {
        return updateUser;
    }
    public void setState(String state)
    {
        this.state = state;
    }
    public String getState()
    {
        return state;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("productSeries", getProductSeries())
            .append("scanObject1", getScanObject1())
            .append("scanObject2", getScanObject2())
            .append("axisName", getAxisName())
            .append("neckName", getNeckName())
            .append("tileName", getTileName())
            .append("axisParameterNoPosition", getAxisParameterNoPosition())
            .append("neckParameterPosition", getNeckParameterPosition())
            .append("axisValue", getAxisValue())
            .append("neckValue", getNeckValue())
            .append("tileColor", getTileColor())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("state", getState())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/mapper/DaTileMatchRulesMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.da.tileMatchRules.mapper;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import java.util.List;
/**
 * é…ç“¦è§„则Mapper接口
 *
 * @author jiang
 * @date 2024-01-24
 */
public interface DaTileMatchRulesMapper
{
    /**
     * æŸ¥è¯¢é…ç“¦è§„则
     *
     * @param id é…ç“¦è§„则主键
     * @return é…ç“¦è§„则
     */
    public DaTileMatchRules selectDaTileMatchRulesById(Long id);
    /**
     * æŸ¥è¯¢é…ç“¦è§„则列表
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return é…ç“¦è§„则集合
     */
    public List<DaTileMatchRules> selectDaTileMatchRulesList(DaTileMatchRules daTileMatchRules);
    /**
     * æ–°å¢žé…ç“¦è§„则
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return ç»“æžœ
     */
    public int insertDaTileMatchRules(DaTileMatchRules daTileMatchRules);
    /**
     * ä¿®æ”¹é…ç“¦è§„则
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return ç»“æžœ
     */
    public int updateDaTileMatchRules(DaTileMatchRules daTileMatchRules);
    /**
     * åˆ é™¤é…ç“¦è§„则
     *
     * @param id é…ç“¦è§„则主键
     * @return ç»“æžœ
     */
    public int deleteDaTileMatchRulesById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤é…ç“¦è§„则
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteDaTileMatchRulesByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/IDaTileMatchRulesService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.da.tileMatchRules.service;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import java.util.List;
/**
 * é…ç“¦è§„则Service接口
 *
 * @author jiang
 * @date 2024-01-24
 */
public interface IDaTileMatchRulesService
{
    /**
     * æŸ¥è¯¢é…ç“¦è§„则
     *
     * @param id é…ç“¦è§„则主键
     * @return é…ç“¦è§„则
     */
    public DaTileMatchRules selectDaTileMatchRulesById(Long id);
    /**
     * æŸ¥è¯¢é…ç“¦è§„则列表
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return é…ç“¦è§„则集合
     */
    public List<DaTileMatchRules> selectDaTileMatchRulesList(DaTileMatchRules daTileMatchRules);
    /**
     * æ–°å¢žé…ç“¦è§„则
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return ç»“æžœ
     */
    public int insertDaTileMatchRules(DaTileMatchRules daTileMatchRules);
    /**
     * ä¿®æ”¹é…ç“¦è§„则
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return ç»“æžœ
     */
    public int updateDaTileMatchRules(DaTileMatchRules daTileMatchRules);
    /**
     * æ‰¹é‡åˆ é™¤é…ç“¦è§„则
     *
     * @param ids éœ€è¦åˆ é™¤çš„配瓦规则主键集合
     * @return ç»“æžœ
     */
    public int deleteDaTileMatchRulesByIds(Long[] ids);
    /**
     * åˆ é™¤é…ç“¦è§„则信息
     *
     * @param id é…ç“¦è§„则主键
     * @return ç»“æžœ
     */
    public int deleteDaTileMatchRulesById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/service/impl/DaTileMatchRulesServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
package com.jcdm.main.da.tileMatchRules.service.impl;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules;
import com.jcdm.main.da.tileMatchRules.mapper.DaTileMatchRulesMapper;
import com.jcdm.main.da.tileMatchRules.service.IDaTileMatchRulesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * é…ç“¦è§„则Service业务层处理
 *
 * @author jiang
 * @date 2024-01-24
 */
@Service
public class DaTileMatchRulesServiceImpl implements IDaTileMatchRulesService
{
    @Autowired
    private DaTileMatchRulesMapper daTileMatchRulesMapper;
    /**
     * æŸ¥è¯¢é…ç“¦è§„则
     *
     * @param id é…ç“¦è§„则主键
     * @return é…ç“¦è§„则
     */
    @Override
    public DaTileMatchRules selectDaTileMatchRulesById(Long id)
    {
        return daTileMatchRulesMapper.selectDaTileMatchRulesById(id);
    }
    /**
     * æŸ¥è¯¢é…ç“¦è§„则列表
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return é…ç“¦è§„则
     */
    @Override
    public List<DaTileMatchRules> selectDaTileMatchRulesList(DaTileMatchRules daTileMatchRules)
    {
        return daTileMatchRulesMapper.selectDaTileMatchRulesList(daTileMatchRules);
    }
    /**
     * æ–°å¢žé…ç“¦è§„则
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return ç»“æžœ
     */
    @Override
    public int insertDaTileMatchRules(DaTileMatchRules daTileMatchRules)
    {
        daTileMatchRules.setCreateTime(DateUtils.getNowDate());
        return daTileMatchRulesMapper.insertDaTileMatchRules(daTileMatchRules);
    }
    /**
     * ä¿®æ”¹é…ç“¦è§„则
     *
     * @param daTileMatchRules é…ç“¦è§„则
     * @return ç»“æžœ
     */
    @Override
    public int updateDaTileMatchRules(DaTileMatchRules daTileMatchRules)
    {
        daTileMatchRules.setUpdateTime(DateUtils.getNowDate());
        return daTileMatchRulesMapper.updateDaTileMatchRules(daTileMatchRules);
    }
    /**
     * æ‰¹é‡åˆ é™¤é…ç“¦è§„则
     *
     * @param ids éœ€è¦åˆ é™¤çš„配瓦规则主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaTileMatchRulesByIds(Long[] ids)
    {
        return daTileMatchRulesMapper.deleteDaTileMatchRulesByIds(ids);
    }
    /**
     * åˆ é™¤é…ç“¦è§„则信息
     *
     * @param id é…ç“¦è§„则主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaTileMatchRulesById(Long id)
    {
        return daTileMatchRulesMapper.deleteDaTileMatchRulesById(id);
    }
}
jcdm-main/src/main/resources/mapper/da/opcuaconfig/DaOpcuaConfigMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jcdm.main.da.opcuaconfig.mapper.DaOpcuaConfigMapper">
    <resultMap type="DaOpcuaConfig" id="DaOpcuaConfigResult">
        <result property="id"    column="id"    />
        <result property="node"    column="node"    />
        <result property="sysTypes"    column="sys_types"    />
        <result property="subscribe"    column="subscribe"    />
        <result property="rFunction"    column="r_function"    />
        <result property="remarks"    column="remarks"    />
        <result property="processName"    column="process_name"    />
        <result property="process"    column="process"    />
        <result property="state"    column="state"    />
    </resultMap>
    <sql id="selectDaOpcuaConfigVo">
        select id, node, sys_types, subscribe, r_function, remarks, process_name, process, state from da_opcua_config
    </sql>
    <select id="selectDaOpcuaConfigList" parameterType="DaOpcuaConfig" resultMap="DaOpcuaConfigResult">
        <include refid="selectDaOpcuaConfigVo"/>
        <where>
            <if test="node != null  and node != ''"> and node = #{node}</if>
            <if test="rFunction != null  and rFunction != ''"> and r_function = #{rFunction}</if>
            <if test="process != null  and process != ''"> and process = #{process}</if>
            <if test="state != null "> and state = #{state}</if>
        </where>
    </select>
    <select id="selectDaOpcuaConfigById" parameterType="Long" resultMap="DaOpcuaConfigResult">
        <include refid="selectDaOpcuaConfigVo"/>
        where id = #{id}
    </select>
    <insert id="insertDaOpcuaConfig" parameterType="DaOpcuaConfig" useGeneratedKeys="true" keyProperty="id">
        insert into da_opcua_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="node != null">node,</if>
            <if test="sysTypes != null">sys_types,</if>
            <if test="subscribe != null">subscribe,</if>
            <if test="rFunction != null">r_function,</if>
            <if test="remarks != null">remarks,</if>
            <if test="processName != null">process_name,</if>
            <if test="process != null">process,</if>
            <if test="state != null">state,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="node != null">#{node},</if>
            <if test="sysTypes != null">#{sysTypes},</if>
            <if test="subscribe != null">#{subscribe},</if>
            <if test="rFunction != null">#{rFunction},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="processName != null">#{processName},</if>
            <if test="process != null">#{process},</if>
            <if test="state != null">#{state},</if>
         </trim>
    </insert>
    <update id="updateDaOpcuaConfig" parameterType="DaOpcuaConfig">
        update da_opcua_config
        <trim prefix="SET" suffixOverrides=",">
            <if test="node != null">node = #{node},</if>
            <if test="sysTypes != null">sys_types = #{sysTypes},</if>
            <if test="subscribe != null">subscribe = #{subscribe},</if>
            <if test="rFunction != null">r_function = #{rFunction},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="processName != null">process_name = #{processName},</if>
            <if test="process != null">process = #{process},</if>
            <if test="state != null">state = #{state},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteDaOpcuaConfigById" parameterType="Long">
        delete from da_opcua_config where id = #{id}
    </delete>
    <delete id="deleteDaOpcuaConfigByIds" parameterType="String">
        delete from da_opcua_config where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml
@@ -28,27 +28,19 @@
        <result property="paramName"    column="param_name"    />
        <result property="unit"    column="unit"    />
        <result property="type"    column="type"    />
        <result property="parameterSetCode"    column="parameter_set_code"    />
        <result property="parameterSetName"    column="parameter_set_name"    />
        <result property="processesCode"    column="processes_code"    />
        <result property="processesName"    column="processes_name"    />
    </resultMap>
    <sql id="selectDaParamCollectionVo">
        select id, work_order_no, sfc_code,processes_name,processes_code, parameter_set_code ,parameter_set_name, product_code, production_line, location_code, equipment_no, param_code, param_value, param_upper, param_lower, param_standard, collection_time, spare_field_1, spare_field_2, create_user, create_time, update_user, update_time, state, param_name, unit, type from da_param_collection
        select id, work_order_no, sfc_code, product_code, production_line, location_code, equipment_no, param_code, param_value, param_upper, param_lower, param_standard, collection_time, spare_field_1, spare_field_2, create_user, create_time, update_user, update_time, state, param_name, unit, type from da_param_collection
    </sql>
    <select id="selectDaParamCollectionList" parameterType="DaParamCollection" resultMap="DaParamCollectionResult">
        <include refid="selectDaParamCollectionVo"/>
        <where>  
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
            <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
            <if test="parameterSetCode != null  and parameterSetCode != ''"> and parameter_set_code = #{parameterSetCode}</if>
            <if test="parameterSetName != null  and parameterSetName != ''"> and parameter_set_name = #{parameterSetName}</if>
            <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
            <if test="processesName != null  and processesName != ''"> and processes_name = #{processesName}</if>
            <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
            <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
            <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
@@ -70,10 +62,6 @@
            <if test="productCode != null and productCode != ''">product_code,</if>
            <if test="productionLine != null and productionLine != ''">production_line,</if>
            <if test="locationCode != null and locationCode != ''">location_code,</if>
            <if test="parameterSetCode != null and parameterSetCode != ''">parameter_set_code,</if>
            <if test="parameterSetName != null and parameterSetName != ''">parameter_set_name,</if>
            <if test="processesCode != null and processesCode != ''">processes_code,</if>
            <if test="processesName != null and processesName != ''">processes_name,</if>
            <if test="equipmentNo != null">equipment_no,</if>
            <if test="paramCode != null and paramCode != ''">param_code,</if>
            <if test="paramValue != null and paramValue != ''">param_value,</if>
@@ -99,10 +87,6 @@
            <if test="productCode != null and productCode != ''">#{productCode},</if>
            <if test="productionLine != null and productionLine != ''">#{productionLine},</if>
            <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
            <if test="parameterSetCode != null and parameterSetCode != ''">#{parameter_set_code},</if>
            <if test="parameterSetName != null and parameterSetName != ''">#{parameter_set_name},</if>
            <if test="processesCode != null and processesCode != ''">#{processes_code},</if>
            <if test="processesName != null and processesName != ''">#{processes_name},</if>
            <if test="equipmentNo != null">#{equipmentNo},</if>
            <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">#{paramValue},</if>
@@ -131,10 +115,6 @@
            <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
            <if test="productionLine != null and productionLine != ''">production_line = #{productionLine},</if>
            <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
            <if test="parameterSetCode != null and parameterSetCode != ''">parameter_set_code = #{parameterSetCode},</if>
            <if test="parameterSetName != null and parameterSetName != ''">parameter_set_name = #{parameterSetName},</if>
            <if test="processesCode != null and processesCode != ''">processes_code = #{processesCode},</if>
            <if test="processesName != null and processesName != ''">processes_name = #{processesName},</if>
            <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
            <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml
@@ -43,6 +43,9 @@
            <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
            <if test="inboundTime != null "> and inbound_time = #{inboundTime}</if>
            <if test="outboundTime != null "> and outbound_time = #{outboundTime}</if>
            <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
            <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
        </where>
    </select>
    
jcdm-main/src/main/resources/mapper/da/tileMatchRules/DaTileMatchRulesMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jcdm.main.da.tileMatchRules.mapper.DaTileMatchRulesMapper">
    <resultMap type="DaTileMatchRules" id="DaTileMatchRulesResult">
        <result property="id"    column="id"    />
        <result property="productSeries"    column="product_series"    />
        <result property="scanObject1"    column="scan_object1"    />
        <result property="scanObject2"    column="scan_object2"    />
        <result property="axisName"    column="axis_name"    />
        <result property="neckName"    column="neck_name"    />
        <result property="tileName"    column="tile_name"    />
        <result property="axisParameterNoPosition"    column="axis_parameter_no_position"    />
        <result property="neckParameterPosition"    column="neck_parameter_position"    />
        <result property="axisValue"    column="axis_value"    />
        <result property="neckValue"    column="neck_value"    />
        <result property="tileColor"    column="tile_color"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="state"    column="state"    />
    </resultMap>
    <sql id="selectDaTileMatchRulesVo">
        select id, product_series, scan_object1, scan_object2, axis_name, neck_name, tile_name, axis_parameter_no_position, neck_parameter_position, axis_value, neck_value, tile_color, create_user, create_time, update_user, update_time, state from da_tile_match_rules
    </sql>
    <select id="selectDaTileMatchRulesList" parameterType="DaTileMatchRules" resultMap="DaTileMatchRulesResult">
        <include refid="selectDaTileMatchRulesVo"/>
        <where>
            <if test="productSeries != null  and productSeries != ''"> and product_series = #{productSeries}</if>
            <if test="scanObject1 != null  and scanObject1 != ''"> and scan_object1 = #{scanObject1}</if>
            <if test="scanObject2 != null  and scanObject2 != ''"> and scan_object2 = #{scanObject2}</if>
            <if test="axisName != null  and axisName != ''"> and axis_name like concat('%', #{axisName}, '%')</if>
            <if test="neckName != null  and neckName != ''"> and neck_name like concat('%', #{neckName}, '%')</if>
            <if test="tileName != null  and tileName != ''"> and tile_name like concat('%', #{tileName}, '%')</if>
            <if test="axisParameterNoPosition != null "> and axis_parameter_no_position = #{axisParameterNoPosition}</if>
            <if test="neckParameterPosition != null "> and neck_parameter_position = #{neckParameterPosition}</if>
            <if test="axisValue != null  and axisValue != ''"> and axis_value = #{axisValue}</if>
            <if test="neckValue != null  and neckValue != ''"> and neck_value = #{neckValue}</if>
            <if test="tileColor != null  and tileColor != ''"> and tile_color = #{tileColor}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
        </where>
    </select>
    <select id="selectDaTileMatchRulesById" parameterType="Long" resultMap="DaTileMatchRulesResult">
        <include refid="selectDaTileMatchRulesVo"/>
        where id = #{id}
    </select>
    <insert id="insertDaTileMatchRules" parameterType="DaTileMatchRules" useGeneratedKeys="true" keyProperty="id">
        insert into da_tile_match_rules
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="productSeries != null">product_series,</if>
            <if test="scanObject1 != null">scan_object1,</if>
            <if test="scanObject2 != null">scan_object2,</if>
            <if test="axisName != null">axis_name,</if>
            <if test="neckName != null">neck_name,</if>
            <if test="tileName != null">tile_name,</if>
            <if test="axisParameterNoPosition != null">axis_parameter_no_position,</if>
            <if test="neckParameterPosition != null">neck_parameter_position,</if>
            <if test="axisValue != null">axis_value,</if>
            <if test="neckValue != null">neck_value,</if>
            <if test="tileColor != null">tile_color,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="state != null">state,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="productSeries != null">#{productSeries},</if>
            <if test="scanObject1 != null">#{scanObject1},</if>
            <if test="scanObject2 != null">#{scanObject2},</if>
            <if test="axisName != null">#{axisName},</if>
            <if test="neckName != null">#{neckName},</if>
            <if test="tileName != null">#{tileName},</if>
            <if test="axisParameterNoPosition != null">#{axisParameterNoPosition},</if>
            <if test="neckParameterPosition != null">#{neckParameterPosition},</if>
            <if test="axisValue != null">#{axisValue},</if>
            <if test="neckValue != null">#{neckValue},</if>
            <if test="tileColor != null">#{tileColor},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="state != null">#{state},</if>
         </trim>
    </insert>
    <update id="updateDaTileMatchRules" parameterType="DaTileMatchRules">
        update da_tile_match_rules
        <trim prefix="SET" suffixOverrides=",">
            <if test="productSeries != null">product_series = #{productSeries},</if>
            <if test="scanObject1 != null">scan_object1 = #{scanObject1},</if>
            <if test="scanObject2 != null">scan_object2 = #{scanObject2},</if>
            <if test="axisName != null">axis_name = #{axisName},</if>
            <if test="neckName != null">neck_name = #{neckName},</if>
            <if test="tileName != null">tile_name = #{tileName},</if>
            <if test="axisParameterNoPosition != null">axis_parameter_no_position = #{axisParameterNoPosition},</if>
            <if test="neckParameterPosition != null">neck_parameter_position = #{neckParameterPosition},</if>
            <if test="axisValue != null">axis_value = #{axisValue},</if>
            <if test="neckValue != null">neck_value = #{neckValue},</if>
            <if test="tileColor != null">tile_color = #{tileColor},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="state != null">state = #{state},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteDaTileMatchRulesById" parameterType="Long">
        delete from da_tile_match_rules where id = #{id}
    </delete>
    <delete id="deleteDaTileMatchRulesByIds" parameterType="String">
        delete from da_tile_match_rules where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/dist.rar
Binary files differ
jcdm-ui/src/views/main/da/collectionParamConf/index.vue
@@ -202,12 +202,12 @@
    />
    <!-- æ·»åŠ æˆ–修改采集参数配置对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="700px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
      <el-form ref="form" inline :model="form" :rules="rules" label-width="120px">
        <el-form-item label="工序编号" prop="processesCode">
          <el-input v-model="form.processesCode" placeholder="请输入工序编号" />
        </el-form-item>
jcdm-ui/src/views/main/da/opcuaconfig/index.vue
@@ -2,14 +2,6 @@
  <div class="app-container">
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="所属模块" prop="module">
        <el-input
          v-model="queryParams.module"
          placeholder="请输入所属模块"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="节点" prop="node">
        <el-input
          v-model="queryParams.node"
@@ -18,64 +10,37 @@
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="长度" prop="length">
          <el-form-item label="订阅类型" prop="rFunction">
            <el-select v-model="queryParams.rFunction" placeholder="请选择订阅类型" clearable>
              <el-option
                v-for="dict in dict.type.subscription_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="工序编码" prop="process">
        <el-input
          v-model="queryParams.length"
          placeholder="请输入长度"
              v-model="queryParams.process"
              placeholder="请输入工序编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="类型" prop="sysTypes">
        <el-select v-model="queryParams.sysTypes" placeholder="请选择类型" clearable>
<!--          <el-option-->
<!--            v-for="dict in dict.type.${dictType}"-->
<!--            :key="dict.value"-->
<!--            :label="dict.label"-->
<!--            :value="dict.value"-->
<!--          />-->
          <el-form-item label="状态" prop="state">
            <el-select v-model="queryParams.state" placeholder="请选择状态" clearable>
              <el-option
                v-for="dict in dict.type.sys_normal_disable"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
        </el-select>
      </el-form-item>
      <el-form-item style="float: right">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button type="warning" icon="el-icon-copy-document" size="mini" @click="advancedQuery">高级查询</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px">
      <el-form-item label="订阅响应模块" prop="rModule">
        <el-input
          v-model="queryParams.rModule"
          placeholder="请输入订阅响应模块"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订阅响应函数" prop="rFunction">
        <el-input
          v-model="queryParams.rFunction"
          placeholder="请输入订阅响应函数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="功能说明" prop="functionality">
        <el-input
          v-model="queryParams.functionality"
          placeholder="请输入功能说明"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否订阅" prop="subscribe">
        <el-select v-model="queryParams.subscribe" placeholder="请选择是否订阅" clearable>
          <!--          <el-option-->
          <!--            v-for="dict in dict.type.${dictType}"-->
          <!--            :key="dict.value"-->
          <!--            :label="dict.label"-->
          <!--            :value="dict.value"-->
          <!--          />-->
        </el-select>
      </el-form-item>
    </el-form>
    </el-card>
@@ -121,61 +86,56 @@
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['da:opcuaconfig:export']"
              v-hasPermi="['main:opcuaconfig:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" border :data="opcuaconfigList" @selection-change="handleSelectionChange" v-if="opcuaconfigList.length > 0">
        <el-table border v-loading="loading" :data="opcuaconfigList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="ID" align="center" prop="id" />-->
      <el-table-column label="所属模块" align="center" prop="module">
          <el-table-column label="工序名称" align="center" prop="processName">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.module"/>-->
            <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.processName"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="节点" align="center" prop="node">
          <el-table-column label="工序编码" align="center" prop="process">
            <!--            <template slot-scope="scope">-->
            <!--              <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.process"/>-->
            <!--            </template>-->
          </el-table-column>
          <el-table-column label="交互节点" align="center" prop="node">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.node"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="长度" align="center" prop="length">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.length"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="类型" align="center" prop="sysTypes">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sysTypes"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="功能说明" align="center" prop="functionality">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.functionality"/>-->
<!--        </template>-->
          <el-table-column label="数据类型" align="center" prop="sysTypes">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.data_type" :value="scope.row.sysTypes"/>
            </template>
      </el-table-column>
      <el-table-column label="是否订阅" align="center" prop="subscribe">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.subscribe"/>-->
<!--        </template>-->
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.subscribe"/>
            </template>
      </el-table-column>
      <el-table-column label="订阅响应模块" align="center" prop="rModule">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.rModule"/>-->
<!--        </template>-->
          <el-table-column label="订阅类型" align="center" prop="rFunction">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.subscription_type" :value="scope.row.rFunction"/>
            </template>
      </el-table-column>
      <el-table-column label="订阅响应函数" align="center" prop="rFunction">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.rFunction"/>-->
<!--        </template>-->
          <el-table-column label="状态" align="center" prop="state">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.state"/>
            </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remarks">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.remarks"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="200" align="center" class-name="small-padding fixed-width">
          <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
@@ -184,7 +144,7 @@
            style="width: 72px"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['da:opcuaconfig:edit']"
                v-hasPermi="['main:opcuaconfig:edit']"
          >修改</el-button>
          <el-button
            size="mini"
@@ -193,14 +153,11 @@
            style="width: 72px"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['da:opcuaconfig:remove']"
                v-hasPermi="['main:opcuaconfig:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
      <el-empty v-else>
        <span slot="description">暂无数据</span>
      </el-empty>
    </el-card>
    <pagination
@@ -211,46 +168,74 @@
      @pagination="getList"
    />
    <!-- æ·»åŠ æˆ–修改OPCUA参数设置对话框 -->
    <!-- æ·»åŠ æˆ–修改交互信号配置对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="所属模块" prop="module">
          <el-input v-model="form.module" placeholder="请输入所属模块" />
        </el-form-item>
        <el-form-item label="节点" prop="node">
        <el-form-item label="交互节点" prop="node">
          <el-input v-model="form.node" placeholder="请输入节点" />
        </el-form-item>
        <el-form-item label="长度" prop="length">
          <el-input v-model="form.length" placeholder="请输入长度" />
        </el-form-item>
        <el-form-item label="类型" prop="sysTypes">
          <el-select v-model="form.sysTypes" placeholder="请选择类型">
<!--            <el-option-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.label"-->
<!--              :value="dict.value"-->
<!--            ></el-option>-->
        <el-form-item label="数据类型" prop="sysTypes">
          <el-select v-model="form.sysTypes" placeholder="请选择数据类型">
            <el-option
              v-for="dict in dict.type.data_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="功能说明" prop="functionality">
          <el-input v-model="form.functionality" placeholder="请输入功能说明" />
        </el-form-item>
        <el-form-item label="是否订阅" prop="subscribe">
          <el-select v-model="form.subscribe" placeholder="请选择是否订阅">
<!--            <el-option-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.label"-->
<!--              :value="parseInt(dict.value)"-->
<!--            ></el-option>-->
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="订阅响应模块" prop="rModule">
          <el-input v-model="form.rModule" placeholder="请输入订阅响应模块" />
        <el-form-item label="订阅类型" prop="rFunction">
          <el-select v-model="form.rFunction" placeholder="请选择订阅类型">
            <el-option
              v-for="dict in dict.type.subscription_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="订阅响应函数" prop="rFunction">
          <el-input v-model="form.rFunction" placeholder="请输入订阅响应函数" />
<!--        <el-form-item label="工序名称" prop="processName">-->
<!--          <el-input v-model="form.processName" placeholder="请输入工序名称" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="工序编码" prop="process">-->
<!--          <el-input v-model="form.process" placeholder="请输入工序编码" />-->
<!--        </el-form-item>-->
        <el-form-item label="工序编码" prop="process">
          <el-select style="width: 100%" @change="handleSelectChange(form.process)" v-model="form.process" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.processesCode"
              :label="item.processesCode"
              :value="item.processesCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="工序名称" prop="processName">
          <el-input disabled v-model="form.processName" placeholder="请输入工序名称" />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-select v-model="form.state" placeholder="请选择状态">
            <el-option
              v-for="dict in dict.type.sys_normal_disable"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" placeholder="请输入备注" />
@@ -266,13 +251,17 @@
<script>
import { listOpcuaconfig, getOpcuaconfig, delOpcuaconfig, addOpcuaconfig, updateOpcuaconfig } from "@/api/main/da/opcuaconfig/opcuaconfig";
import {listProcesses} from "@/api/main/bs/processes/processes";
export default {
  name: "Opcuaconfig",
  dicts: ['subscription_type', 'sys_yes_no', 'data_type','sys_normal_disable'],
  data() {
    return {
      options: [],
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
@@ -283,9 +272,8 @@
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // OPCUA参数设置表格数据
      // äº¤äº’信号配置表格数据
      opcuaconfigList: [],
      advancedShowSearch: false,
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
@@ -294,14 +282,18 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        module: null,
        node: null,
        length: null,
        sysTypes: null,
        functionality: null,
        subscribe: null,
        rModule: null,
        rFunction: null,
        process: null,
        state: null
      },
      ProcessesqueryParams: {
        pageNum: 1,
        pageSize: 10,
        process: null,
        processName: null,
        keyProcessesFlag: null,
        routeCode: undefined,
      },
      // è¡¨å•å‚æ•°
      form: {},
@@ -315,12 +307,24 @@
  },
  created() {
    this.getList();
    this.getProcessesList();
  },
  methods: {
    advancedQuery(){
      this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true;
    /** æŸ¥è¯¢å·¥åºä¿¡æ¯åˆ—表 */
    getProcessesList() {
      this.loading = true;
      listProcesses(this.queryParams).then(response => {
        this.options = response.rows;
      });
    },
    /** æŸ¥è¯¢OPCUA参数设置列表 */
    handleSelectChange(selectedOption) {
      this.ProcessesqueryParams.process = selectedOption;
      listProcesses(this.ProcessesqueryParams).then(response => {
        this.form.processName = response.rows[0].processesName;
      });
    },
    /** æŸ¥è¯¢äº¤äº’信号配置列表 */
    getList() {
      this.loading = true;
      listOpcuaconfig(this.queryParams).then(response => {
@@ -338,15 +342,14 @@
    reset() {
      this.form = {
        id: null,
        module: null,
        node: null,
        length: null,
        sysTypes: null,
        functionality: null,
        subscribe: null,
        rModule: null,
        rFunction: null,
        remarks: null
        remarks: null,
        processName: null,
        process: null,
        state: null
      };
      this.resetForm("form");
    },
@@ -370,7 +373,7 @@
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加OPCUA参数设置";
      this.titleName = "添加交互信号配置";
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
@@ -379,7 +382,7 @@
      getOpcuaconfig(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改OPCUA参数设置";
        this.titleName = "修改交互信号配置";
      });
    },
    /** æäº¤æŒ‰é’® */
@@ -405,7 +408,7 @@
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除OPCUA参数设置编号为"' + ids + '"的数据项?').then(function() {
      this.$modal.confirm('是否确认删除交互信号配置编号为"' + ids + '"的数据项?').then(function() {
        return delOpcuaconfig(ids);
      }).then(() => {
        this.getList();
jcdm-ui/src/views/main/da/paramCollection/index.vue
@@ -1,69 +1,26 @@
<template>
  <div class="app-container">
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="总成序列号" prop="sfcCode">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="产品编码" prop="productCode">
        <el-input
          v-model="queryParams.sfcCode"
          placeholder="请输入总成序列号"
          v-model="queryParams.productCode"
          placeholder="请输入产品编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工单编号" prop="workOrderNo">
      <el-form-item label="产品名称" prop="productName">
        <el-input
          v-model="queryParams.workOrderNo"
          placeholder="请输入工单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工序编号" prop="processesCode">
        <el-input
          v-model="queryParams.processesCode"
          placeholder="请输入工序编号"
          v-model="queryParams.productName"
          placeholder="请输入产品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item style="float: right">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button type="warning" icon="el-icon-copy-document" size="mini" @click="advancedQuery">高级查询</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
      <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="100px">
        <el-form-item label="参数集编码" prop="parameterSetCode">
          <el-input
            v-model="queryParams.parameterSetCode"
            placeholder="请输入参数集编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="参数编码" prop="paramCode">
          <el-input
            v-model="queryParams.paramCode"
            placeholder="请输入参数编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="参数类型" prop="type">
          <el-input
            v-model="queryParams.type"
            placeholder="请输入参数类型"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="采集时间" prop="collectionTime">
          <el-date-picker clearable
                          v-model="queryParams.collectionTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择采集时间">
          </el-date-picker>
        </el-form-item>
      </el-form>
    </el-card>
@@ -116,46 +73,31 @@
    <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="工单编号" align="center" prop="workOrderNo">
      </el-table-column>
      <el-table-column label="总成序列号" align="center" width="100" prop="sfcCode">
      </el-table-column>
      <el-table-column label="产品编号" align="center" prop="productCode">
      </el-table-column>
      <el-table-column label="产线编号" align="center" prop="productionLine">
      </el-table-column>
      <el-table-column label="工序编号" align="center" prop="processesCode">
      </el-table-column>
      <el-table-column label="设备编号" align="center" prop="equipmentNo">
      </el-table-column>
      <el-table-column label="参数编码" align="center" prop="paramCode">
      </el-table-column>
      <el-table-column label="参数值" align="center" prop="paramValue">
      </el-table-column>
      <el-table-column label="参数上限" align="center" prop="paramUpper">
      </el-table-column>
      <el-table-column label="参数下限" align="center" prop="paramLower">
      </el-table-column>
      <el-table-column label="标准值" align="center" prop="paramStandard">
      </el-table-column>
      <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
      <el-table-column label="工单编号" align="center" prop="workOrderNo"></el-table-column>
      <el-table-column label="总成序列号" align="center" width="140" prop="sfcCode" ></el-table-column>
      <el-table-column label="产品编号" align="center" prop="productCode"></el-table-column>
      <el-table-column label="产线编号" align="center" prop="productionLine"></el-table-column>
      <el-table-column label="工位编号" align="center" prop="locationCode"></el-table-column>
      <el-table-column label="设备编号" align="center" prop="equipmentNo"></el-table-column>
      <el-table-column label="参数编码" align="center" prop="paramCode"></el-table-column>
      <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column>
      <el-table-column label="参数上限" align="center" prop="paramUpper"></el-table-column>
      <el-table-column label="参数下限" align="center" prop="paramLower"></el-table-column>
      <el-table-column label="采集时间" align="center" prop="collectionTime" width="160">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span>
          <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="state">
      </el-table-column>
      <el-table-column label="参数名称" align="center" prop="paramName">
      </el-table-column>
      <el-table-column label="单位" align="center" prop="unit">
      </el-table-column>
      <el-table-column label="参数类型" align="center" prop="type">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="200" align="center" class-name="small-padding fixed-width">
      <el-table-column label="状态" align="center" prop="state"></el-table-column>
      <el-table-column label="参数名称" align="center" prop="paramName" width="150" ></el-table-column>
      <el-table-column label="单位" align="center" prop="unit"></el-table-column>
      <el-table-column label="类型" align="center" prop="type"></el-table-column>
      <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="success"
            plain
            style="width: 72px"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
@@ -164,6 +106,7 @@
          <el-button
            size="mini"
            type="danger"
            plain
            style="width: 72px"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
@@ -186,48 +129,40 @@
    />
    <!-- æ·»åŠ æˆ–修改设备产品过程参数采集对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="600px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="工单编号" prop="workOrderNo">
          <el-input v-model="form.workOrderNo"  placeholder="请输入工单编号" />
          <el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="总成序列号" prop="sfcCode">
          <el-input v-model="form.sfcCode"  placeholder="请输入总成序列号" />
          <el-input v-model="form.sfcCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品编号" prop="productCode">
          <el-input v-model="form.productCode"  placeholder="请输入产品编号" />
          <el-input v-model="form.productCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产线编号" prop="productionLine">
          <el-input v-model="form.productionLine"  placeholder="请输入产线编号" />
          <el-input v-model="form.productionLine" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="工序编号" prop="processesCode">
          <el-input v-model="form.processesCode"  placeholder="请输入工序编号" />
        <el-form-item label="工位编号" prop="locationCode">
          <el-input v-model="form.locationCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="设备编号" prop="equipmentNo">
          <el-input v-model="form.equipmentNo"  placeholder="请输入设备编号" />
          <el-input v-model="form.equipmentNo" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数编码" prop="paramCode">
          <el-input v-model="form.paramCode"  placeholder="请输入参数编码" />
          <el-input v-model="form.paramCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数值" prop="paramValue">
          <el-input v-model="form.paramValue"  placeholder="请输入参数值" />
          <el-input v-model="form.paramValue" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数上限" prop="paramUpper">
          <el-input v-model="form.paramUpper"  placeholder="请输入参数上限" />
          <el-input v-model="form.paramUpper" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数下限" prop="paramLower">
          <el-input v-model="form.paramLower"  placeholder="请输入参数下限" />
          <el-input v-model="form.paramLower" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="标准值" prop="paramStandard">
          <el-input v-model="form.paramStandard"  placeholder="请输入标准值" />
        </el-form-item>
        <el-form-item label="采集时间" prop="collectionTime">
          <el-date-picker clearable
            v-model="form.collectionTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择采集时间">
          </el-date-picker>
          <el-input v-model="form.paramStandard" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-input v-model="form.state" placeholder="请输入状态" />
@@ -238,7 +173,7 @@
        <el-form-item label="单位" prop="unit">
          <el-input v-model="form.unit" placeholder="请输入单位" />
        </el-form-item>
        <el-form-item label="参数类型" prop="type">
        <el-form-item label="类型" prop="type">
          <el-select v-model="form.type" placeholder="请选择类型">
          </el-select>
        </el-form-item>
@@ -272,7 +207,6 @@
      total: 0,
      // è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集表格数据
      paramCollectionList: [],
      advancedShowSearch: false,
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
@@ -324,9 +258,6 @@
    this.getList();
  },
  methods: {
    advancedQuery(){
      this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true;
    },
    /** æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表 */
    getList() {
      this.loading = true;
jcdm-ui/src/views/main/da/passingStationCollection/index.vue
@@ -83,29 +83,24 @@
      </el-table-column>
      <el-table-column label="工位编号" align="center" prop="locationCode">
      </el-table-column>
<!--      <el-table-column label="设备编号" align="center" prop="equipmentNo">
      </el-table-column>-->
      <el-table-column label="入站时间" align="center" prop="inboundTime" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d}') }}</span>
          <span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="出站时间" align="center" prop="outboundTime" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d}') }}</span>
          <span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="入站是否合格" align="center" prop="inRsSign">
      </el-table-column>
      <el-table-column label="入站NG原因" align="center" prop="inMsgSign">
      </el-table-column>-->
      <el-table-column label="是否合格" align="center" prop="outRsSign">
      </el-table-column>
      <el-table-column label="NG原因" align="center" prop="outMsgSign">
      </el-table-column>
      <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span>
          <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="节拍时间" align="center" prop="beatTime">
@@ -147,8 +142,8 @@
    />
    <!-- æ·»åŠ æˆ–修改产品过站采集对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" inline :model="form" :rules="rules" label-width="120px">
        <el-form-item label="工单编号" prop="workOrderNo">
          <el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" />
        </el-form-item>
@@ -183,12 +178,6 @@
            placeholder="请选择出站时间">
          </el-date-picker>
        </el-form-item>
<!--        <el-form-item label="入站是否合格" prop="inRsSign">
          <el-input v-model="form.inRsSign" placeholder="请输入入站是否合格" />
        </el-form-item>
        <el-form-item label="入站NG原因" prop="inMsgSign">
          <el-input v-model="form.inMsgSign" type="textarea" placeholder="请输入内容" />
        </el-form-item>-->
        <el-form-item label="是否合格" prop="outRsSign">
          <el-input v-model="form.outRsSign" placeholder="请输入出站是否合格" />
        </el-form-item>
@@ -203,18 +192,6 @@
            placeholder="请选择采集时间">
          </el-date-picker>
        </el-form-item>
<!--        <el-form-item label="预留字段1" prop="spareField1">-->
<!--          <el-input v-model="form.spareField1" type="textarea" placeholder="请输入内容" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="预留字段2" prop="spareField2">-->
<!--          <el-input v-model="form.spareField2" type="textarea" placeholder="请输入内容" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="创建用户" prop="createUser">-->
<!--          <el-input v-model="form.createUser" type="textarea" placeholder="请输入内容" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="更改用户" prop="updateUser">-->
<!--          <el-input v-model="form.updateUser" type="textarea" placeholder="请输入内容" />-->
<!--        </el-form-item>-->
        <el-form-item label="节拍时间" prop="beatTime">
          <el-input v-model="form.beatTime" placeholder="请输入节拍时间" />
        </el-form-item>
jcdm-ui/src/views/main/da/tileMatchRules/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,483 @@
<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
        <el-form-item label="产品系列" prop="productSeries">
          <el-input
            v-model="queryParams.productSeries"
            placeholder="请输入产品系列"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
<!--        <el-form-item label="扫码对象1" prop="scanObject1">-->
<!--          <el-input-->
<!--            v-model="queryParams.scanObject1"-->
<!--            placeholder="请输入扫码对象1"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="扫码对象2" prop="scanObject2">-->
<!--          <el-input-->
<!--            v-model="queryParams.scanObject2"-->
<!--            placeholder="请输入扫码对象2"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="轴名称" prop="axisName">-->
<!--          <el-input-->
<!--            v-model="queryParams.axisName"-->
<!--            placeholder="请输入轴名称"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="颈名称" prop="neckName">-->
<!--          <el-input-->
<!--            v-model="queryParams.neckName"-->
<!--            placeholder="请输入颈名称"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
        <el-form-item label="瓦名称" prop="tileName">
          <el-input
            v-model="queryParams.tileName"
            placeholder="请输入瓦名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
<!--        <el-form-item label="轴参数数位置" prop="axisParameterNoPosition">-->
<!--          <el-input-->
<!--            v-model="queryParams.axisParameterNoPosition"-->
<!--            placeholder="请输入轴参数数位置"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="颈参数数位置" prop="neckParameterPosition">-->
<!--          <el-input-->
<!--            v-model="queryParams.neckParameterPosition"-->
<!--            placeholder="请输入颈参数数位置"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="轴值" prop="axisValue">-->
<!--          <el-input-->
<!--            v-model="queryParams.axisValue"-->
<!--            placeholder="请输入轴值"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="颈值" prop="neckValue">-->
<!--          <el-input-->
<!--            v-model="queryParams.neckValue"-->
<!--            placeholder="请输入颈值"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="瓦颜色" prop="tileColor">-->
<!--          <el-input-->
<!--            v-model="queryParams.tileColor"-->
<!--            placeholder="请输入瓦颜色"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="创建用户" prop="createUser">-->
<!--          <el-input-->
<!--            v-model="queryParams.createUser"-->
<!--            placeholder="请输入创建用户"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="更改用户" prop="updateUser">-->
<!--          <el-input-->
<!--            v-model="queryParams.updateUser"-->
<!--            placeholder="请输入更改用户"-->
<!--            clearable-->
<!--            @keyup.enter.native="handleQuery"-->
<!--          />-->
<!--        </el-form-item>-->
        <el-form-item label="状态" prop="state">
          <el-input
            v-model="queryParams.state"
            placeholder="请输入状态"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <el-card style="margin-top: 10px" class="box-card">
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['da:tileMatchRules:add']"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            plain
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['da:tileMatchRules:edit']"
          >修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            plain
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['da:tileMatchRules:remove']"
          >删除</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            v-hasPermi="['da:tileMatchRules:export']"
          >导出</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
      <el-table border v-loading="loading" :data="tileMatchRulesList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
<!--        <el-table-column label="主键id" align="center" prop="id" />-->
        <el-table-column label="产品系列" align="center" prop="productSeries">
        </el-table-column>
        <el-table-column label="扫码对象1" align="center" prop="scanObject1" width="100">
        </el-table-column>
        <el-table-column label="扫码对象2" align="center" prop="scanObject2" width="100">
        </el-table-column>
        <el-table-column label="轴名称" align="center" prop="axisName">
        </el-table-column>
        <el-table-column label="颈名称" align="center" prop="neckName">
        </el-table-column>
        <el-table-column label="瓦名称" align="center" prop="tileName">
        </el-table-column>
        <el-table-column label="轴参数位置" align="center" prop="axisParameterNoPosition" width="100">
        </el-table-column>
        <el-table-column label="颈参数位置" align="center" prop="neckParameterPosition" width="100">
        </el-table-column>
        <el-table-column label="轴值" align="center" prop="axisValue">
        </el-table-column>
        <el-table-column label="颈值" align="center" prop="neckValue">
        </el-table-column>
        <el-table-column label="瓦颜色" align="center" prop="tileColor">
        </el-table-column>
<!--        <el-table-column label="创建用户" align="center" prop="createUser">-->
<!--        </el-table-column>-->
<!--        <el-table-column label="更改用户" align="center" prop="updateUser">-->
<!--        </el-table-column>-->
        <el-table-column label="状态" align="center" prop="state">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.state"/>
          </template>
        </el-table-column>
        <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="success"
              plain
              style="width: 72px"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['da:tileMatchRules:edit']"
            >修改</el-button>
            <el-button
              size="mini"
              type="danger"
              plain
              style="width: 72px"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['da:tileMatchRules:remove']"
            >删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- æ·»åŠ æˆ–修改配瓦规则对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1000px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form"  inline :model="form" :rules="rules" label-width="80px">
        <el-form-item label="产品系列" prop="productSeries">
          <el-input v-model="form.productSeries" placeholder="请输入产品系列" />
        </el-form-item>
        <el-form-item label="扫码对象1" prop="scanObject1">
          <el-input v-model="form.scanObject1" placeholder="请输入扫码对象1" />
        </el-form-item>
        <el-form-item label="扫码对象2" prop="scanObject2">
          <el-input v-model="form.scanObject2" placeholder="请输入扫码对象2" />
        </el-form-item>
        <el-form-item label="轴名称" prop="axisName">
          <el-input v-model="form.axisName" placeholder="请输入轴名称" />
        </el-form-item>
        <el-form-item label="颈名称" prop="neckName">
          <el-input v-model="form.neckName" placeholder="请输入颈名称" />
        </el-form-item>
        <el-form-item label="瓦名称" prop="tileName">
          <el-input v-model="form.tileName" placeholder="请输入瓦名称" />
        </el-form-item>
        <el-form-item label="轴参数位置" prop="axisParameterNoPosition">
          <el-input v-model="form.axisParameterNoPosition" placeholder="请输入轴参数位置" />
        </el-form-item>
        <el-form-item label="颈参数位置" prop="neckParameterPosition">
          <el-input v-model="form.neckParameterPosition" placeholder="请输入颈参数位置" />
        </el-form-item>
        <el-form-item label="轴值" prop="axisValue">
          <el-input v-model="form.axisValue" placeholder="请输入轴值" />
        </el-form-item>
        <el-form-item label="颈值" prop="neckValue">
          <el-input v-model="form.neckValue" placeholder="请输入颈值" />
        </el-form-item>
        <el-form-item label="瓦颜色" prop="tileColor">
          <el-input v-model="form.tileColor" placeholder="请输入瓦颜色" />
        </el-form-item>
        <el-form-item label="创建用户" prop="createUser">
          <el-input v-model="form.createUser" placeholder="请输入创建用户" />
        </el-form-item>
        <el-form-item label="更改用户" prop="updateUser">
          <el-input v-model="form.updateUser" placeholder="请输入更改用户" />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-select v-model="form.state"  placeholder="请选择状态" >
            <el-option
              v-for="dict in dict.type.sys_normal_disable"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
        <el-button @click="cancel">取 æ¶ˆ</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
export default {
  name: "TileMatchRules",
  dicts: ['subscription_type', 'sys_yes_no', 'data_type','sys_normal_disable'],
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // é…ç“¦è§„则表格数据
      tileMatchRulesList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        productSeries: null,
        scanObject1: null,
        scanObject2: null,
        axisName: null,
        neckName: null,
        tileName: null,
        axisParameterNoPosition: null,
        neckParameterPosition: null,
        axisValue: null,
        neckValue: null,
        tileColor: null,
        createUser: null,
        updateUser: null,
        state: null
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "主键id不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢é…ç“¦è§„则列表 */
    getList() {
      this.loading = true;
      listTileMatchRules(this.queryParams).then(response => {
        this.tileMatchRulesList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        productSeries: null,
        scanObject1: null,
        scanObject2: null,
        axisName: null,
        neckName: null,
        tileName: null,
        axisParameterNoPosition: null,
        neckParameterPosition: null,
        axisValue: null,
        neckValue: null,
        tileColor: null,
        createUser: null,
        createTime: null,
        updateUser: null,
        updateTime: null,
        state: null
      };
      this.resetForm("form");
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.reset();
      this.open = true;
      this.titleName = "添加配瓦规则";
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getTileMatchRules(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.titleName = "修改配瓦规则";
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateTileMatchRules(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addTileMatchRules(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除配瓦规则编号为"' + ids + '"的数据项?').then(function() {
        return delTileMatchRules(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('da/tileMatchRules/export', {
        ...this.queryParams
      }, `tileMatchRules_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -90,24 +90,14 @@
         <el-tab-pane name="first">
           <span slot="label"> <a class="el-icon-date"></a>首页</span>
           <el-col :span="8">
             <el-table>
               <el-table-column label="序号" align="center" prop="repairIdentification" width="50px"/>
               <el-table-column label="操作内容" align="center" prop="boxCode"  width="300px"/>
             <el-table :data="formulaChildList">
               <el-table-column label="排序" width="60" align="center" prop="stepSort">
               </el-table-column>
               <el-table-column label="操作内容" :show-overflow-tooltip='true' align="center" prop="operationSteps">
               </el-table-column>
             </el-table>
           </el-col>
           <el-col :span="16">
<!--             <el-input v-model="url" type="text" style="width: 20%" /> &nbsp; &nbsp;-->
<!--             <el-button @click="join" type="primary">连接</el-button>-->
<!--             <el-button @click="exit" type="danger">断开</el-button>-->
<!--             <br />-->
<!--             <el-input type="textarea" v-model="message" :rows="9" />-->
<!--             <el-button type="info" @click="send">发送消息</el-button>-->
<!--             <br />-->
<!--             <br />-->
<!--             <el-input type="textarea" v-model="text_content" :rows="9" /> è¿”回内容-->
<!--             <br />-->
<!--             <br />-->
             <el-image style="height: 520px;width: 100%" :src="imgSrc"></el-image>
           </el-col>
         </el-tab-pane>
@@ -143,11 +133,20 @@
<script>
import {listWorkReport} from "@/api/main/om/workReport/workReport";
import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
import {listFormulaChild} from "@/api/main/bs/formulaChild/formulaChild";
export default {
  name: "stationTerminal",
  data() {
    return {
      // æŸ¥è¯¢å‚æ•°
      formulaChildParams: {
        pageNum: 1,
        pageSize: 10,
        productCode: null,
      },
      // é…æ–¹é…ç½®å­ä¿¡æ¯è¡¨æ ¼æ•°æ®
      formulaChildList: [],
      ipAddress: '',
      imgSrc: '',
      headContent: {
@@ -188,16 +187,13 @@
      message: "",
      text_content: "",
      ws: null,
      inputValue: '9'
    }
  },
  beforeDestroy() {
    this.exit();
  },
  created() {
    this.getStationConfList();
    this.connectWebsocket();
    this.initStation();
    // this.getStationConfList();
    // setTimeout(() => {
@@ -208,6 +204,14 @@
  },
  methods: {
    /** æŸ¥è¯¢é…æ–¹é…ç½®å­ä¿¡æ¯åˆ—表 */
    getListFormulaChild() {
      this.formulaChildParams.productCode = this.workpieceInformation.productCode
      listFormulaChild(this.formulaChildParams).then(response => {
        console.log(this.formulaChildList)
        this.formulaChildList = response.rows;
      });
    },
    changeMenu(tab, event) {
      console.log(tab, event);
    },
@@ -220,6 +224,7 @@
      this.headContent.sfcCode = this.content
      this.queryParams.sfcCode = this.content
      this.getList()
      this.getListFormulaChild()
      this.cakeLamp.scanFinish = 1
    },
    /** æŸ¥è¯¢æŠ¥å·¥è®°å½• è¡¨åˆ—表 */