ly 7 місяців тому
батько
коміт
c3108ef5ad

+ 14 - 1
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrPipeController.java

@@ -2,6 +2,7 @@ package com.ruoyi.project.pssr.controller;
 
 import java.util.List;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.project.pssr.domain.TPssrSubcontent;
 import com.ruoyi.project.pssr.mapper.TPssrPipeMapper;
 import com.ruoyi.project.pssr.mapper.TPssrSubcontentMapper;
@@ -44,7 +45,7 @@ public class TPssrPipeController extends BaseController
     private TSpecdevYlgdMapper tSpecdevYlgdMapper;
     @Resource
     private TPssrSubcontentMapper tPssrSubcontentMapper;
-    @Autowired
+    @Resource
     private TPssrPipeMapper tPssrPipeMapper;
     /**
      * 查询管道列表
@@ -135,6 +136,18 @@ public class TPssrPipeController extends BaseController
         return toAjax(tPssrPipeService.updateTPssrPipe(tPssrPipe));
     }
 
+    /**
+     * 修改管道
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:pipe:edit')")
+    @Log(title = "管道批量修改", businessType = BusinessType.UPDATE)
+    @PutMapping("/editBatch")
+    public AjaxResult editBatch(@RequestBody TPssrPipe tPssrPipe)
+    {
+        logger.info(JSON.toJSONString(tPssrPipe));
+        return toAjax(tPssrPipeMapper.updateTPssrPipeByIds(tPssrPipe));
+    }
+
     /**
      * 删除管道
      */

+ 10 - 1
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrPipe.java

@@ -20,6 +20,7 @@ public class TPssrPipe extends BaseEntity
     /** 唯一标识ID */
     private Long id;
 
+    private Long[] ids;
     /** 从表id */
     @Excel(name = "从表id")
     private Long subId;
@@ -89,7 +90,7 @@ public class TPssrPipe extends BaseEntity
     /** 部门编号 */
     @Excel(name = "部门编号")
     private Long deptId;
-    
+
     private String deptName;
 
     public String getDeptName() {
@@ -289,6 +290,14 @@ public class TPssrPipe extends BaseEntity
         return approveStatus;
     }
 
+    public Long[] getIds() {
+        return ids;
+    }
+
+    public void setIds(Long[] ids) {
+        this.ids = ids;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 10 - 8
master/src/main/java/com/ruoyi/project/pssr/mapper/TPssrPipeMapper.java

@@ -6,15 +6,15 @@ import com.ruoyi.project.pssr.domain.TPssrPipe;
 
 /**
  * 管道Mapper接口
- * 
+ *
  * @author ssy
  * @date 2024-09-18
  */
-public interface TPssrPipeMapper 
+public interface TPssrPipeMapper
 {
     /**
      * 查询管道
-     * 
+     *
      * @param id 管道ID
      * @return 管道
      */
@@ -22,7 +22,7 @@ public interface TPssrPipeMapper
 
     /**
      * 查询管道列表
-     * 
+     *
      * @param tPssrPipe 管道
      * @return 管道集合
      */
@@ -31,7 +31,7 @@ public interface TPssrPipeMapper
 
     /**
      * 新增管道
-     * 
+     *
      * @param tPssrPipe 管道
      * @return 结果
      */
@@ -39,7 +39,7 @@ public interface TPssrPipeMapper
 
     /**
      * 修改管道
-     * 
+     *
      * @param tPssrPipe 管道
      * @return 结果
      */
@@ -47,7 +47,7 @@ public interface TPssrPipeMapper
 
     /**
      * 删除管道
-     * 
+     *
      * @param id 管道ID
      * @return 结果
      */
@@ -55,11 +55,13 @@ public interface TPssrPipeMapper
 
     /**
      * 批量删除管道
-     * 
+     *
      * @param ids 需要删除的数据ID
      * @return 结果
      */
     public int deleteTPssrPipeByIds(Long[] ids);
 
     void deleteTPssrPipeBySubId(Long subId);
+
+    int updateTPssrPipeByIds(TPssrPipe tPssrPipe);
 }

+ 11 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevYlrqController.java

@@ -220,6 +220,17 @@ public class TSpecdevYlrqController extends BaseController {
         return AjaxResult.success();
     }
 
+    /**
+     * 修改特种设备压力容器台账
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specYlrq:edit')")
+    @Log(title = "特种设备压力容器台账", businessType = BusinessType.UPDATE)
+    @PutMapping("/editBatch")
+    public AjaxResult editBatch(@RequestBody TSpecdevYlrq tSpecdevYlrq) {
+        tSpecdevYlrqMapper.updateTSpecdevYlrqByIds(tSpecdevYlrq);
+        return AjaxResult.success();
+    }
+
     /**
      * 修改特种设备压力容器台账
      */

+ 10 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TSpecdevYlrq.java

@@ -24,6 +24,8 @@ public class TSpecdevYlrq extends BaseEntity
     /** 唯一标识ID */
     private Long id;
 
+    @TableField(exist = false)
+    private Long[] ids;
     /** 装置名称 */
     @Excel(name = "装置名称")
     private String plantCode;
@@ -741,6 +743,14 @@ public class TSpecdevYlrq extends BaseEntity
         this.remarks2 = remarks2;
     }
 
+    public Long[] getIds() {
+        return ids;
+    }
+
+    public void setIds(Long[] ids) {
+        this.ids = ids;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 0
master/src/main/java/com/ruoyi/project/sems/mapper/TSpecdevYlrqMapper.java

@@ -82,4 +82,5 @@ public interface TSpecdevYlrqMapper extends BaseMapper<TSpecdevYlrq> {
 
     List<TSpecdevYlrq> selectExpiredYlrq(Integer month);
 
+    void updateTSpecdevYlrqByIds(TSpecdevYlrq tSpecdevYlrq);
 }

+ 19 - 0
master/src/main/resources/mybatis/pssr/TPssrPipeMapper.xml

@@ -150,6 +150,25 @@
         update t_pssr_pipe set del_flag = 2 where sub_id = #{subId}
     </update>
 
+    <update id="updateTPssrPipeByIds" parameterType="TPssrPipe">
+        update t_pssr_pipe
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="confirmer1 != null">confirmer1 = #{confirmer1},</if>
+            <if test="confirmer2 != null">confirmer2 = #{confirmer2},</if>
+            <if test="confirmationDate != null">confirmation_date = #{confirmationDate},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+        </trim>
+        where id in
+            <foreach item="id" collection="ids" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+    </update>
+
+
 
     <update id="deleteTPssrPipeByIds" parameterType="String">
         update t_pssr_pipe set del_flag = 2 where id in

+ 13 - 1
master/src/main/resources/mybatis/sems/TSpecdevYlrqMapper.xml

@@ -148,7 +148,7 @@
                 or remarks2 like concat(concat('%', #{searchValue}), '%')
                 or report_no like concat(concat('%', #{searchValue}), '%')
                 or year_report_no like concat(concat('%', #{searchValue}), '%')
-
+                or engineer like concat(concat('%', #{searchValue}), '%')
                 )
             </if>
             <if test="isRepeat != null  and isRepeat != ''">
@@ -425,6 +425,18 @@
         where id = #{id}
     </update>
 
+    <update id="updateTSpecdevYlrqByIds" parameterType="TSpecdevYlrq">
+        update t_specdev_ylrq
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="engineer != null">engineer = #{engineer},</if>
+        </trim>
+        where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+
 
     <update id="updateTSpecdevYlrqByHi" parameterType="TSpechiYlrq">
         update t_specdev_ylrq

+ 10 - 0
ui/src/api/pssr/pipe.js

@@ -44,6 +44,16 @@ export function updatePipe(data) {
   })
 }
 
+// 修改管道
+export function updatePipeBatch(data) {
+  return request({
+    url: '/pssr/pipe/editBatch',
+    method: 'put',
+    data: data
+  })
+}
+
+
 // 删除管道
 export function delPipe(id) {
   return request({

+ 9 - 0
ui/src/api/sems/specYlrq.js

@@ -44,6 +44,15 @@ export function updateSpecYlrq(data) {
     data: data
   })
 }
+// 修改特种设备压力容器台账
+export function updateSpecYlrqBatch(data) {
+  return request({
+    url: '/sems/specYlrq/editBatch',
+    method: 'put',
+    data: data
+  })
+}
+
 
 // 修改特种设备压力容器台账(申请)
 export function updateSpecYlrqPre(data) {

+ 53 - 3
ui/src/views/pssr/pipe/index.vue

@@ -251,6 +251,37 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 添加或修改管道对话框 -->
+    <el-dialog :close-on-click-modal="false" title="批量修改" :visible.sync="openBatch" width="500px" append-to-body>
+      <el-form ref="form" :model="form"  label-width="80px">
+        <el-form-item>
+          <span>已选择 {{ ids.length }} 条数据</span>
+        </el-form-item>
+        <el-form-item label="确认人1" prop="confirmer1">
+          <el-input v-model="form.confirmer1" placeholder="请输入确认人1" />
+        </el-form-item>
+        <el-form-item label="确认人2" prop="confirmer2">
+          <el-input v-model="form.confirmer2" placeholder="请输入确认人2" />
+        </el-form-item>
+        <el-form-item label="时间确认" prop="confirmationDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.confirmationDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择时间">
+          </el-date-picker>
+        </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">
+        <el-button type="primary" @click="submitFormBatch">确 定</el-button>
+        <el-button @click="cancelBatch">取 消</el-button>
+
+      </div>
+    </el-dialog>
       <!-- 用户导入对话框 -->
       <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
           <el-upload
@@ -285,7 +316,7 @@
 </template>
 
 <script>
-import { listPipe,syncPipe, getPipe, delPipe, addPipe, updatePipe, exportPipe, importTemplate} from "@/api/pssr/pipe";
+import { listPipe,syncPipe, getPipe, delPipe, addPipe, updatePipe, exportPipe, importTemplate,updatePipeBatch} from "@/api/pssr/pipe";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -330,6 +361,7 @@ export default {
       clientHeight:300,
       // 是否显示弹出层
       open: false,
+      openBatch: false,
         // 用户导入参数
         upload: {
             // 是否显示弹出层(用户导入)
@@ -460,8 +492,26 @@ export default {
       this.title = "添加管道";
     },
     handleBatch(){
-
-
+      this.reset();
+      this.openBatch = true
+    },
+    // 取消按钮
+    cancelBatch() {
+      this.openBatch = false;
+      this.reset();
+    },
+    /** 提交按钮 */
+    submitFormBatch() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+            this.form.ids = this.ids
+            updatePipeBatch(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+        }
+      });
     },
     //同步特种设备数据
     handleSync(){

+ 61 - 1
ui/src/views/sems/specYlrq/index.vue

@@ -106,6 +106,17 @@
         >{{ $t('修改') }}
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatch"
+          v-hasPermi="['sems:specYlrq:edit']"
+        >{{ $t('批量') + $t('修改') }}
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"
@@ -597,6 +608,29 @@
         <el-button @click="cancel">{{ $t('取 消') }}</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="openBatch" width="50%" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="160px">
+        <el-form-item>
+          <h3>已选择 {{ ids.length }} 条数据 </h3> <span>(不填内容的字段不进行修改)</span>
+        </el-form-item>
+            <el-form-item :label="$t('装置维修工程师')" prop="engineer">
+              <el-input v-model="form.engineer" :placeholder="$t('请输入')+ $t('装置维修工程师')"/>
+            </el-form-item>
+            <el-form-item :label="$t('备注')" prop="remarks">
+              <el-input v-model="form.remarks" type="textarea" :placeholder="$t('请输入')+ $t('内容')"/>
+            </el-form-item>
+            <el-form-item :label="$t('备注2')" prop="remarks2">
+              <el-input v-model="form.remarks2" type="textarea" :placeholder="$t('请输入')+ $t('内容')"/>
+            </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormBatch">{{ $t('确 定') }}</el-button>
+        <el-button @click="cancelBatch">{{ $t('取 消') }}</el-button>
+      </div>
+    </el-dialog>
+
+
     <!-- 用户导入对话框 -->
     <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <div style="margin-bottom: 20px;">
@@ -715,7 +749,8 @@ import {
   updateSpecYlrqPre,
   updateSpecYlrq,
   exportSpecList,
-  duplicate
+  duplicate,
+  updateSpecYlrqBatch
 } from "@/api/sems/specYlrq";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
@@ -766,6 +801,7 @@ export default {
       specYlrqList: [],
       // 弹出层标题
       title: "",
+      openBatch: false,
       // 部门树选项
       deptOptions: undefined,
       clientHeight: 300,
@@ -996,6 +1032,16 @@ export default {
       this.open = true;
       this.title = this.$t('添加特种设备压力容器台账');
     },
+    handleBatch(){
+      this.reset();
+      this.title = this.$t('修改特种设备压力容器台账');
+      this.openBatch = true
+    },
+    // 取消按钮
+    cancelBatch() {
+      this.openBatch = false;
+      this.reset();
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
@@ -1052,6 +1098,20 @@ export default {
         }
       });
     },
+
+    submitFormBatch(){
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.ids = this.ids
+            updateSpecYlrqBatch(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+        }
+      });
+    },
+
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;