| | |
| | | public void handle(NodeId id, Variant value){ |
| | | if (b == null || 0 > b.size()) { |
| | | DaOpcuaConfig opcuaConfParam=new DaOpcuaConfig(); |
| | | opcuaConfParam.setSubscribe(1L); |
| | | opcuaConfParam.setSubscribe("Y"); |
| | | b=daOpcuaConfigService.selectDaOpcuaConfigList(opcuaConfParam); |
| | | } |
| | | //使用Stream API在List<T>中查找元素 |
| | |
| | | * 交互信号配置Controller |
| | | * |
| | | * @author yyt |
| | | * @date 2024-01-22 |
| | | * @date 2024-01-23 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/da/opcuaconfig") |
| | |
| | | * 交互信号配置对象 da_opcua_config |
| | | * |
| | | * @author yyt |
| | | * @date 2024-01-22 |
| | | * @date 2024-01-23 |
| | | */ |
| | | public class DaOpcuaConfig extends BaseEntity |
| | | { |
| | |
| | | /** ID */ |
| | | private Long id; |
| | | |
| | | /** $column.columnComment */ |
| | | |
| | | /** 节点 */ |
| | | @Excel(name = "节点") |
| | | private String node; |
| | | |
| | | /** $column.columnComment */ |
| | | private Long length; |
| | | |
| | | /** 数据类型 */ |
| | | @Excel(name = "数据类型") |
| | | private String sysTypes; |
| | | |
| | | /** $column.columnComment */ |
| | | private String functionality; |
| | | |
| | | /** 是否订阅 */ |
| | | @Excel(name = "是否订阅") |
| | | private Long subscribe; |
| | | |
| | | private String subscribe; |
| | | |
| | | /** 订阅类型 */ |
| | | @Excel(name = "订阅类型") |
| | |
| | | @Excel(name = "备注") |
| | | private String remarks; |
| | | |
| | | /** 工序编码 */ |
| | | @Excel(name = "工序编码") |
| | | private String process; |
| | | |
| | | /** 工序名称 */ |
| | | @Excel(name = "工序名称") |
| | | private String processName; |
| | | |
| | | /** 工序编码 */ |
| | | @Excel(name = "工序编码") |
| | | private String process; |
| | | |
| | | /** 状态 */ |
| | | @Excel(name = "状态") |
| | |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setNode(String node) |
| | | { |
| | | this.node = node; |
| | |
| | | { |
| | | return node; |
| | | } |
| | | public void setSysTypes(String sysTypes) |
| | | { |
| | | this.sysTypes = sysTypes; |
| | | } |
| | | |
| | | public String getSysTypes() |
| | | { |
| | | return sysTypes; |
| | | } |
| | | |
| | | public void setSubscribe(Long subscribe) |
| | | public void setSubscribe(String subscribe) |
| | | { |
| | | this.subscribe = subscribe; |
| | | } |
| | | |
| | | public Long getSubscribe() |
| | | public String getSubscribe() |
| | | { |
| | | return subscribe; |
| | | } |
| | | public void setrFunction(String rFunction) |
| | | { |
| | | this.rFunction = rFunction; |
| | | } |
| | | |
| | | public String getrFunction() |
| | |
| | | { |
| | | return remarks; |
| | | } |
| | | public void setProcess(String process) |
| | | { |
| | | this.process = process; |
| | | } |
| | | |
| | | public String getProcess() |
| | | { |
| | | return process; |
| | | } |
| | | 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) |
| | | { |
| | |
| | | .append("subscribe", getSubscribe()) |
| | | .append("rFunction", getrFunction()) |
| | | .append("remarks", getRemarks()) |
| | | .append("process", getProcess()) |
| | | .append("processName", getProcessName()) |
| | | .append("process", getProcess()) |
| | | .append("state", getState()) |
| | | .toString(); |
| | | } |
| | |
| | | public void run(String... args) throws Exception { |
| | | try { |
| | | DaOpcuaConfig daOpcuaConfig=new DaOpcuaConfig(); |
| | | daOpcuaConfig.setSubscribe(1L); //设置查询条件,是否订阅状态为1的所有数据. |
| | | daOpcuaConfig.setSubscribe("Y"); //设置查询条件,是否订阅状态为Y的所有数据. |
| | | List<DaOpcuaConfig> nodeslist=daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); |
| | | clientHandler.connect(); |
| | | if (nodeslist != null && nodeslist.size() > 0) { |
| | |
| | | * 交互信号配置Mapper接口 |
| | | * |
| | | * @author yyt |
| | | * @date 2024-01-22 |
| | | * @date 2024-01-23 |
| | | */ |
| | | public interface DaOpcuaConfigMapper |
| | | { |
| | |
| | | * 交互信号配置Service接口 |
| | | * |
| | | * @author yyt |
| | | * @date 2024-01-22 |
| | | * @date 2024-01-23 |
| | | */ |
| | | public interface IDaOpcuaConfigService |
| | | { |
| | |
| | | * 交互信号配置Service业务层处理 |
| | | * |
| | | * @author yyt |
| | | * @date 2024-01-22 |
| | | * @date 2024-01-23 |
| | | */ |
| | | @Service |
| | | public class DaOpcuaConfigServiceImpl implements IDaOpcuaConfigService |
| | |
| | | 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="subscribe" column="subscribe" /> |
| | | <result property="rFunction" column="r_function" /> |
| | | <result property="remarks" column="remarks" /> |
| | | <result property="process" column="process" /> |
| | | <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, process_name, state from da_opcua_config |
| | | 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="sysTypes != null and sysTypes != ''"> and sys_types = #{sysTypes}</if> |
| | | <if test="rFunction != null and rFunction != ''"> and r_function = #{rFunction}</if> |
| | | <if test="process != null and process != ''"> and process = #{process}</if> |
| | | <if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if> |
| | | <if test="state != null "> and state = #{state}</if> |
| | | </where> |
| | | </select> |
| | |
| | | <insert id="insertDaOpcuaConfig" parameterType="DaOpcuaConfig" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into da_opcua_config |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="node != null and node != ''">node,</if> |
| | | <if test="sysTypes != null and sysTypes != ''">sys_types,</if> |
| | | <if test="node != null">node,</if> |
| | | <if test="sysTypes != null">sys_types,</if> |
| | | <if test="subscribe != null">subscribe,</if> |
| | | <if test="rFunction != null and rFunction != ''">r_function,</if> |
| | | <if test="rFunction != null">r_function,</if> |
| | | <if test="remarks != null">remarks,</if> |
| | | <if test="process != null">process,</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 and node != ''">#{node},</if> |
| | | <if test="sysTypes != null and sysTypes != ''">#{sysTypes},</if> |
| | | <if test="node != null">#{node},</if> |
| | | <if test="sysTypes != null">#{sysTypes},</if> |
| | | <if test="subscribe != null">#{subscribe},</if> |
| | | <if test="rFunction != null and rFunction != ''">#{rFunction},</if> |
| | | <if test="rFunction != null">#{rFunction},</if> |
| | | <if test="remarks != null">#{remarks},</if> |
| | | <if test="process != null">#{process},</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 and node != ''">node = #{node},</if> |
| | | <if test="sysTypes != null and sysTypes != ''">sys_types = #{sysTypes},</if> |
| | | <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 and rFunction != ''">r_function = #{rFunction},</if> |
| | | <if test="rFunction != null">r_function = #{rFunction},</if> |
| | | <if test="remarks != null">remarks = #{remarks},</if> |
| | | <if test="process != null">process = #{process},</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} |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工序编码" prop="process"> |
| | | <el-select v-model="queryParams.process" 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-item label="工序名称" prop="processName"> |
| | | <el-input |
| | | v-model="queryParams.processName" |
| | | placeholder="请输入工序名称" |
| | | v-model="queryParams.process" |
| | | placeholder="请输入工序编码" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['main:opcuaconfig:add']" |
| | | v-hasPermi="['da:opcuaconfig:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['main:opcuaconfig:edit']" |
| | | v-hasPermi="['da:opcuaconfig:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['main:opcuaconfig:remove']" |
| | | v-hasPermi="['da:opcuaconfig:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | <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="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="processName"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <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>--> |
| | |
| | | <dict-tag :options="dict.type.subscription_type" :value="scope.row.rFunction"/> |
| | | </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 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" width="200" label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | |
| | | 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" |
| | |
| | | {{titleName}} |
| | | </span> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <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="sysTypes"> |
| | |
| | | v-for="dict in dict.type.sys_yes_no" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="parseInt(dict.value)" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input v-model="form.remarks" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | <!-- <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-radio-group v-model="form.process"> |
| | | <!-- <el-radio--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.value"--> |
| | | <!-- >{{dict.label}}</el-radio>--> |
| | | </el-radio-group> |
| | | <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 v-model="form.processName" placeholder="请输入工序名称" /> |
| | | <el-input disabled v-model="form.processName" placeholder="请输入工序名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="state"> |
| | | <el-select v-model="form.state" placeholder="请选择状态"> |
| | |
| | | :value="parseInt(dict.value)" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input v-model="form.remarks" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | |
| | | <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', 'sys_normal_disable', 'data_type'], |
| | | dicts: ['subscription_type', 'sys_yes_no', 'data_type','sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | options: [], |
| | | // 遮罩层 |
| | | loading: true, |
| | | titleName: "", |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | node: null, |
| | | sysTypes: null, |
| | | rFunction: null, |
| | | process: null, |
| | | processName: null, |
| | | state: null |
| | | }, |
| | | ProcessesqueryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | process: null, |
| | | processName: null, |
| | | keyProcessesFlag: null, |
| | | routeCode: undefined, |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | |
| | | id: [ |
| | | { required: true, message: "ID不能为空", trigger: "blur" } |
| | | ], |
| | | node: [ |
| | | { required: true, message: "节点不能为空", trigger: "blur" } |
| | | ], |
| | | sysTypes: [ |
| | | { required: true, message: "数据类型不能为空", trigger: "change" } |
| | | ], |
| | | subscribe: [ |
| | | { required: true, message: "是否订阅不能为空", trigger: "change" } |
| | | ], |
| | | rFunction: [ |
| | | { required: true, message: "订阅类型不能为空", trigger: "change" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | handleSelectChange(selectedOption) { |
| | | this.ProcessesqueryParams.process = selectedOption; |
| | | listProcesses(this.ProcessesqueryParams).then(response => { |
| | | this.form.processName = response.rows[0].processesName; |
| | | }); |
| | | }, |
| | | /** 查询交互信号配置列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | module: null, |
| | | node: null, |
| | | length: null, |
| | | sysTypes: null, |
| | | functionality: null, |
| | | subscribe: null, |
| | | rModule: null, |
| | | rFunction: null, |
| | | remarks: null, |
| | | process: null, |
| | | processName: null, |
| | | process: null, |
| | | state: null |
| | | }; |
| | | this.resetForm("form"); |