admin
2024-11-22 b1573930415903bcb9dc3a92d1482699de0f07cf
-数据采集优化
已修改5个文件
307 ■■■■ 文件已修改
billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-ui/src/views/main/da/paramCollection/index.vue 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-ui/src/views/main/da/tightenCollection/index.vue 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java
@@ -1,6 +1,8 @@
package com.billion.main.da.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -59,5 +61,13 @@
    @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date collectTime;
    @TableField(exist = false)
    private String[] timeQuery;
    @TableField(exist = false)
    private String startTime;
    @TableField(exist = false)
    private String stopTime;
}
billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java
@@ -1,7 +1,9 @@
package com.billion.main.da.service.impl;
import java.util.Date;
import java.util.List;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -42,6 +44,10 @@
    @Override
    public List<DaTightenCollection> selectDaTightenCollectionList(DaTightenCollection daTightenCollection)
    {
        if(ObjectUtil.isNotNull(daTightenCollection.getTimeQuery())){
            daTightenCollection.setStartTime(daTightenCollection.getTimeQuery()[0]);
            daTightenCollection.setStopTime(daTightenCollection.getTimeQuery()[1]);
        }
        return daTightenCollectionMapper.selectDaTightenCollectionList(daTightenCollection);
    }
@@ -54,6 +60,7 @@
    @Override
    public int insertDaTightenCollection(DaTightenCollection daTightenCollection)
    {
        daTightenCollection.setCollectTime(new Date());
        return daTightenCollectionMapper.insertDaTightenCollection(daTightenCollection);
    }
billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml
@@ -30,7 +30,7 @@
            <if test="paramSetName != null  and paramSetName != ''"> and param_set_name like concat('%', #{paramSetName}, '%')</if>
            <if test="torqueStatus != null  and torqueStatus != ''"> and torque_status = #{torqueStatus}</if>
            <if test="angleStatus != null  and angleStatus != ''"> and angle_status = #{angleStatus}</if>
            <if test="collectTime != null "> and collect_time = #{collectTime}</if>
            <if test="startTime != null"> and collect_time BETWEEN #{startTime} and #{stopTime}</if>
        </where>
    </select>
    
billion-ui/src/views/main/da/paramCollection/index.vue
@@ -50,14 +50,6 @@
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
<!--          <el-form-item label="采集时间" prop="collectTime">-->
<!--            <el-date-picker-->
<!--              v-model="queryParams.collectTime"-->
<!--              type="datetime"-->
<!--              placeholder="请选择采集时间"-->
<!--              value-format="yyyy-MM-dd HH:mm:ss"-->
<!--            />-->
<!--          </el-form-item>-->
          <!-- 可以继续添加其他高级查询条件 -->
          <el-row>
            <el-col :span="24" style="text-align: right;">
@@ -69,38 +61,38 @@
    </el-form>
    <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:paramCollection: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:paramCollection: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:paramCollection:remove']"
        >删除</el-button>
      </el-col>
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="primary"-->
<!--          plain-->
<!--          icon="el-icon-plus"-->
<!--          size="mini"-->
<!--          @click="handleAdd"-->
<!--          v-hasPermi="['da:paramCollection: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:paramCollection: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:paramCollection:remove']"-->
<!--        >删除</el-button>-->
<!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="warning"
@@ -123,24 +115,6 @@
      <el-table-column label="参数名称" align="center" prop="paramName" />
      <el-table-column label="参数值" align="center" prop="paramValue" />
      <el-table-column label="采集时间" align="center" prop="collectTime" width="180">
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['da:paramCollection:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['da:paramCollection:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -271,13 +245,10 @@
        paramValue: null,
        collectTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      console.log(this.value1)
      this.queryParams.pageNum = 1;
      this.getList();
      this.advancedSearchVisible = false
billion-ui/src/views/main/da/tightenCollection/index.vue
@@ -9,78 +9,89 @@
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工位编码" prop="locationCode">
        <el-input
          v-model="queryParams.locationCode"
          placeholder="请输入工位编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      <el-form-item label-width="120" label="采集时间" prop="timeQuery">
        <el-date-picker
          v-model="queryParams.timeQuery"
          type="datetimerange"
          range-separator="至"
          value-format="yyyy-MM-dd HH:mm:ss"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
<!--      <el-form-item label="参数集编码" prop="paramSetCode">-->
<!--        <el-input-->
<!--          v-model="queryParams.paramSetCode"-->
<!--          placeholder="请输入参数集编码"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="参数集名称" prop="paramSetName">-->
<!--        <el-input-->
<!--          v-model="queryParams.paramSetName"-->
<!--          placeholder="请输入参数集名称"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="采集时间" prop="collectTime">-->
<!--        <el-date-picker clearable-->
<!--          v-model="queryParams.collectTime"-->
<!--          type="date"-->
<!--          value-format="yyyy-MM-dd"-->
<!--          placeholder="请选择采集时间">-->
<!--        </el-date-picker>-->
<!--      </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-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button>-->
        <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button>
      </el-form-item>
      <transition name="fade">
        <div v-if="advancedSearchVisible" class="advanced-search">
          <el-form-item label-width="100" label="参数集编码" prop="paramSetCode">
            <el-input
              v-model="queryParams.paramSetCode"
              placeholder="请输入参数集编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label-width="100" label="参数集名称" prop="paramSetName">
            <el-input
              v-model="queryParams.paramSetName"
              placeholder="请输入参数集名称"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="工位编码" prop="locationCode">
            <el-input
              v-model="queryParams.locationCode"
              placeholder="请输入工位编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-row>
            <el-col :span="24" style="text-align: right;">
              <el-button type="primary" icon="el-icon-close" size="mini" @click="toggleAdvancedSearch">关闭</el-button>
            </el-col>
          </el-row>
        </div>
      </transition>
    </el-form>
    <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:tightenCollection: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:tightenCollection: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:tightenCollection:remove']"
        >删除</el-button>
      </el-col>
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="primary"-->
<!--          plain-->
<!--          icon="el-icon-plus"-->
<!--          size="mini"-->
<!--          @click="handleAdd"-->
<!--          v-hasPermi="['da:tightenCollection: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:tightenCollection: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:tightenCollection:remove']"-->
<!--        >删除</el-button>-->
<!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="warning"
@@ -91,7 +102,7 @@
          v-hasPermi="['da:tightenCollection:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
    </el-row>
    <el-table border v-loading="loading" :data="tightenCollectionList" @selection-change="handleSelectionChange">
@@ -106,24 +117,6 @@
      <el-table-column label="角度值" align="center" prop="angle" />
      <el-table-column label="角度状态" align="center" prop="angleStatus" />
      <el-table-column label="采集时间" align="center" prop="collectTime" width="180">
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['da:tightenCollection:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['da:tightenCollection:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -172,6 +165,7 @@
  name: "TightenCollection",
  data() {
    return {
      advancedSearchVisible: false,
      // 遮罩层
      loading: true,
      // 选中数组
@@ -200,7 +194,8 @@
        paramSetName: null,
        torqueStatus: null,
        angleStatus: null,
        collectTime: null
        collectTime: null,
        timeQuery: []
      },
      // 表单参数
      form: {},
@@ -250,9 +245,11 @@
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
      this.advancedSearchVisible = false
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.clearQueryParams()
      this.resetForm("queryForm");
      this.handleQuery();
    },
@@ -261,6 +258,11 @@
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    clearQueryParams(){
      this.queryParams.paramSetName = null
      this.queryParams.paramSetName = null
      this.queryParams.locationCode = null
    },
    /** 新增按钮操作 */
    handleAdd() {
@@ -317,3 +319,28 @@
  }
};
</script>
<style scoped>.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
  opacity: 0;
}
.advanced-search {
  position: absolute;
  background: #FFFFFF; /* 设置为与页面背景色相同或相近的颜色 */
  border-left: 1px solid #dcdfe6;
  border-right: 1px solid #dcdfe6;
  border-bottom: 1px solid #dcdfe6;
  /*border: none;*/
  box-shadow: none; /* 移除阴影 */
  padding: 10px;
  z-index: 1000; /* 确保浮动在其他元素之上 */
  top: 70px; /* 调整顶部位置,使其与页面其他元素更协调 */
  left: 20px; /* 调整左侧位置 */
  width: 97%; /* 调整宽度 */
  /*max-width: 1296px; !* 最大宽度 *!*/
  /*max-width: 1296px; !* 最大宽度 *!*/
  margin: 0 auto; /* 居中对齐 */
}
</style>