春风项目四线(合箱线、总装线)
yyt
2024-01-23 28cd73a27061f684feda88d2d3e5f26794bbd591
更新OPCUA
已修改9个文件
215 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/DaOpcuaConfig.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/mapper/DaOpcuaConfigMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/IDaOpcuaConfigService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/impl/DaOpcuaConfigServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/opcuaconfig/DaOpcuaConfigMapper.xml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/opcuaconfig/index.vue 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java
@@ -157,7 +157,7 @@
    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>中查找元素
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java
@@ -26,7 +26,7 @@
 * 交互信号配置Controller
 * 
 * @author yyt
 * @date 2024-01-22
 * @date 2024-01-23
 */
@RestController
@RequestMapping("/da/opcuaconfig")
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/domain/DaOpcuaConfig.java
@@ -9,7 +9,7 @@
 * 交互信号配置对象 da_opcua_config
 * 
 * @author yyt
 * @date 2024-01-22
 * @date 2024-01-23
 */
public class DaOpcuaConfig extends BaseEntity
{
@@ -18,26 +18,17 @@
    /** 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 = "订阅类型")
@@ -47,13 +38,13 @@
    @Excel(name = "备注")
    private String remarks;
    /** 工序编码 */
    @Excel(name = "工序编码")
    private String process;
    /** 工序名称 */
    @Excel(name = "工序名称")
    private String processName;
    /** 工序编码 */
    @Excel(name = "工序编码")
    private String process;
    /** 状态 */
    @Excel(name = "状态")
@@ -68,7 +59,6 @@
    {
        return id;
    }
    public void setNode(String node) 
    {
        this.node = node;
@@ -78,20 +68,27 @@
    {
        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() 
@@ -107,15 +104,6 @@
    {
        return remarks;
    }
    public void setProcess(String process)
    {
        this.process = process;
    }
    public String getProcess()
    {
        return process;
    }
    public void setProcessName(String processName) 
    {
        this.processName = processName;
@@ -124,6 +112,15 @@
    public String getProcessName() 
    {
        return processName;
    }
    public void setProcess(String process)
    {
        this.process = process;
    }
    public String getProcess()
    {
        return process;
    }
    public void setState(Long state) 
    {
@@ -144,8 +141,8 @@
            .append("subscribe", getSubscribe())
            .append("rFunction", getrFunction())
            .append("remarks", getRemarks())
            .append("process", getProcess())
            .append("processName", getProcessName())
            .append("process", getProcess())
            .append("state", getState())
            .toString();
    }
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java
@@ -29,7 +29,7 @@
    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) {
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/mapper/DaOpcuaConfigMapper.java
@@ -8,7 +8,7 @@
 * 交互信号配置Mapper接口
 * 
 * @author yyt
 * @date 2024-01-22
 * @date 2024-01-23
 */
public interface DaOpcuaConfigMapper 
{
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/IDaOpcuaConfigService.java
@@ -8,7 +8,7 @@
 * 交互信号配置Service接口
 * 
 * @author yyt
 * @date 2024-01-22
 * @date 2024-01-23
 */
public interface IDaOpcuaConfigService 
{
jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/service/impl/DaOpcuaConfigServiceImpl.java
@@ -12,7 +12,7 @@
 * 交互信号配置Service业务层处理
 * 
 * @author yyt
 * @date 2024-01-22
 * @date 2024-01-23
 */
@Service
public class DaOpcuaConfigServiceImpl implements IDaOpcuaConfigService
jcdm-main/src/main/resources/mapper/da/opcuaconfig/DaOpcuaConfigMapper.xml
@@ -3,7 +3,6 @@
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"    />
@@ -11,23 +10,21 @@
        <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>
@@ -40,23 +37,23 @@
    <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>
@@ -64,13 +61,13 @@
    <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}
jcdm-ui/src/views/main/da/opcuaconfig/index.vue
@@ -21,25 +21,15 @@
            </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"
            />
          </el-form-item>
          <el-form-item label="状态" prop="state">
            <el-select v-model="queryParams.state"  placeholder="请选择状态" clearable>
            <el-select v-model="queryParams.state" placeholder="请选择状态" clearable>
              <el-option
                v-for="dict in dict.type.sys_normal_disable"
                :key="dict.value"
@@ -64,7 +54,7 @@
              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">
@@ -75,7 +65,7 @@
              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">
@@ -86,7 +76,7 @@
              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">
@@ -105,17 +95,17 @@
        <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>-->
@@ -135,15 +125,15 @@
              <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">
@@ -154,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"
@@ -185,7 +175,7 @@
        {{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">
@@ -204,7 +194,7 @@
              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>
@@ -218,20 +208,24 @@
            ></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="请选择状态">
@@ -242,6 +236,9 @@
              :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">
@@ -254,12 +251,14 @@
<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: "",
@@ -284,11 +283,17 @@
        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: {},
@@ -297,18 +302,6 @@
        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" }
        ],
      }
    };
  },
@@ -316,6 +309,12 @@
    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;
@@ -334,17 +333,13 @@
    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");