Parcourir la source

-修改选择锁为多选
-修改破锁管理看板

jiangbiao il y a 2 ans
Parent
commit
7baafd0b74

+ 3 - 2
master/src/main/java/com/ruoyi/project/apply/controller/TApplyLockController.java

@@ -81,8 +81,9 @@ public class TApplyLockController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('apply:lock:list')")
     @GetMapping("/listLockBranch")
-    public AjaxResult listLockBranch(TApplyLock tApplyLock) {
+    public TableDataInfo listLockBranch(TApplyLock tApplyLock) {
         //查询所有锁数据
+        startPage();
         List<TApplyLock> list = tApplyLockService.selectTApplyLockList(tApplyLock);
         List<List<TApplyLock>> result = new ArrayList<>();//行元素
         List<TApplyLock> item = new ArrayList<>();//列元素
@@ -103,7 +104,7 @@ public class TApplyLockController extends BaseController {
             }
             count++;
         }
-        return AjaxResult.success(result);
+        return getDataTable(result);
     }
 
     @GetMapping("/listAllLock")

+ 19 - 13
master/src/main/java/com/ruoyi/project/apply/controller/TApplyOfflinevalveController.java

@@ -223,9 +223,11 @@ public class TApplyOfflinevalveController extends BaseController {
                 form.setConfirmer(getUserId().toString());
                 form.setConfirmerName(getNickName());
                 if (StringUtils.isNotEmpty(form.getLockNo())) {
-                    TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(form.getLockNo());
-                    if (tApplyLock != null && (tApplyLock.getStatus() == 1 || tApplyLock.getStatus() == 2)) {
-                        return AjaxResult.error("该锁不可用。");
+                    for (String lockNo : form.getLockNo().split(",")) {
+                        TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo);
+                        if (tApplyLock != null && (tApplyLock.getStatus() == 1 || tApplyLock.getStatus() == 2)) {
+                            return AjaxResult.error("该锁不可用。");
+                        }
                     }
                 }
                 break;
@@ -258,13 +260,15 @@ public class TApplyOfflinevalveController extends BaseController {
                     form.setApproveStatus("2");
                     //修改锁状态
                     if (StringUtils.isNotEmpty(tApplyOfflinevalve.getLockNo())) {
-                        TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(tApplyOfflinevalve.getLockNo());
-                        if (tApplyLock != null) {
-                            if (tApplyLock.getStatus() == 1 || tApplyLock.getStatus() == 2) {
-                                return AjaxResult.error("该锁已被使用。");
+                        for (String lockNo : tApplyOfflinevalve.getLockNo().split(",")) {
+                            TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo);
+                            if (tApplyLock != null) {
+                                if (tApplyLock.getStatus() == 1 || tApplyLock.getStatus() == 2) {
+                                    return AjaxResult.error("该锁已被使用。");
+                                }
+                                tApplyLock.setStatus(1L);//将锁状态改为已拆锁
+                                tApplyLockService.updateTApplyLock(tApplyLock);
                             }
-                            tApplyLock.setStatus(1L);//将锁状态改为已拆锁
-                            tApplyLockService.updateTApplyLock(tApplyLock);
                         }
                     }
                 }
@@ -296,10 +300,12 @@ public class TApplyOfflinevalveController extends BaseController {
                 }
                 //修改锁状态
                 if (StringUtils.isNotEmpty(tApplyOfflinevalve.getLockNo())) {
-                    TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(tApplyOfflinevalve.getLockNo());
-                    if (tApplyLock != null) {
-                        tApplyLock.setStatus(0L);//将锁状态改为挂锁
-                        tApplyLockService.updateTApplyLock(tApplyLock);
+                    for (String lockNo : tApplyOfflinevalve.getLockNo().split(",")) {
+                        TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo);
+                        if (tApplyLock != null) {
+                            tApplyLock.setStatus(0L);//将锁状态改为挂锁
+                            tApplyLockService.updateTApplyLock(tApplyLock);
+                        }
                     }
                 }
                 break;

+ 17 - 10
master/src/main/java/com/ruoyi/project/apply/controller/TApplySafetychangeController.java

@@ -121,9 +121,11 @@ public class TApplySafetychangeController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody TApplySafetychange tApplySafetychange) {
         String userId = getUserId().toString();
-        TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(tApplySafetychange.getLockNo());
-        if (tApplyLock.getStatus()==1||tApplyLock.getStatus()==2){
-            return AjaxResult.error("该锁不可用。");
+        for (String s : tApplySafetychange.getLockNo().split(",")) {
+            TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(s);
+            if (tApplyLock.getStatus()==1||tApplyLock.getStatus()==2){
+                return AjaxResult.error("该锁不可用。");
+            }
         }
         tApplySafetychange.setApplicant(userId);
         tApplySafetychange.setApplicantName(getNickName());
@@ -214,7 +216,6 @@ public class TApplySafetychangeController extends BaseController {
         //利用任务对象,获取流程实例id
         String processInstancesId = task.getProcessInstanceId();
         TApplySafetychange tApplySafetychange = tApplySafetychangeService.selectTApplySafetychangeById(form.getId());
-        TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(tApplySafetychange.getLockNo());
         String taskName = task.getName();//实例名
         // 添加备注
         String remarks = StringUtils.isEmpty(tApplySafetychange.getRemarks()) ? "" : tApplySafetychange.getRemarks();
@@ -268,9 +269,12 @@ public class TApplySafetychangeController extends BaseController {
                 form.setChangeExecutorName(getNickName());
                 form.setChangeExecutorTime(new Date());
                 //修改锁状态
-                if (tApplyLock != null) {
-                    tApplyLock.setStatus(1L);//将锁状态改为已拆锁
-                    tApplyLockService.updateTApplyLock(tApplyLock);
+                for (String lockNo : tApplySafetychange.getLockNo().split(",")) {
+                    TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo);
+                    if (tApplyLock != null) {
+                        tApplyLock.setStatus(1L);//将锁状态改为已拆锁
+                        tApplyLockService.updateTApplyLock(tApplyLock);
+                    }
                 }
                 break;
             case "安全评估人2":
@@ -296,9 +300,12 @@ public class TApplySafetychangeController extends BaseController {
                 form.setResetConfirmerName2(getNickName());
                 form.setStatus(1L);
                 //修改锁状态
-                if (tApplyLock != null) {
-                    tApplyLock.setStatus(0L);//将锁状态改为已拆锁
-                    tApplyLockService.updateTApplyLock(tApplyLock);
+                for (String lockNo : tApplySafetychange.getLockNo().split(",")) {
+                    TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo);
+                    if (tApplyLock != null) {
+                        tApplyLock.setStatus(0L);//将锁状态改为已拆锁
+                        tApplyLockService.updateTApplyLock(tApplyLock);
+                    }
                 }
                 break;
         }

+ 1 - 1
master/src/main/resources/application.yml

@@ -152,7 +152,7 @@ mybatis-plus:
 # PageHelper分页插件
 pagehelper:
   helperDialect: oracle
-  reasonable: true
+  reasonable: false
   supportMethodsArguments: true
   params: count=countSql
 

+ 2 - 2
master/src/main/resources/mybatis/apply/TApplyOfflinevalveMapper.xml

@@ -59,7 +59,7 @@
         <where>
             <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
-            <if test="lockNo != null  and lockNo != ''"> and lock_no = #{lockNo}</if>
+            <if test="lockNo != null  and lockNo != ''"> and lock_no like concat(concat('%', #{lockNo}), '%')</if>
             <if test="offlineReason != null  and offlineReason != ''"> and offline_reason like concat(concat('%', #{offlineReason}), '%')</if>
             <if test="safa != null  and safa != ''"> and safa = #{safa}</if>
             <if test="disassembly != null "> and disassembly = #{disassembly}</if>
@@ -253,7 +253,7 @@
 
     <select id="selectTApplyOfflinevalveByLock" parameterType="string" resultMap="TApplyOfflinevalveResult">
         <include refid="selectTApplyOfflinevalveVo"/>
-        where lock_no = #{lockNo} and d.status=0 and d.approve_status=2
+        where lock_no like concat(concat('%',#{lockNo}),'%') and d.status=0 and d.approve_status=2
     </select>
 
 </mapper>

+ 2 - 2
master/src/main/resources/mybatis/apply/TApplySafetychangeMapper.xml

@@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="changeDescribe != null  and changeDescribe != ''"> and change_describe like concat(concat('%', #{changeDescribe}), '%')</if>
             <if test="changeReason != null  and changeReason != ''"> and change_reason = #{changeReason}</if>
-            <if test="lockNo != null  and lockNo != ''"> and lock_no = #{lockNo}</if>
+            <if test="lockNo != null  and lockNo != ''"> and lock_no like concat(concat('%', #{lockNo}), '%')</if>
             <if test="applicant != null  and applicant != ''"> and applicant = #{applicant}</if>
             <if test="applicantName != null  and applicantName != ''"> and applicant_name like concat(concat('%', #{applicantName}), '%')</if>
             <if test="applicationTime != null "> and application_time = #{applicationTime}</if>
@@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTApplySafetychangeByLock" parameterType="String" resultMap="TApplySafetychangeResult">
         <include refid="selectTApplySafetychangeVo"/>
-        where lock_no = #{lockNo} and d.status=0 and d.approve_status=2
+        where lock_no like concat(concat('%',#{lockNo}),'%') and d.status=0 and d.approve_status=2
     </select>
 
     <insert id="insertTApplySafetychange" parameterType="TApplySafetychange">

+ 57 - 22
ui/src/views/apply/lock/lock-dashboard.vue

@@ -1,23 +1,29 @@
 <template>
-    <div class="app-container" style="padding: 0 0 0 0">
-      <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
-        <el-tab-pane label="EU" name="first">
-          <lock-eu item="1" typename="" v-if="isFirst"></lock-eu>
-        </el-tab-pane>
-        <el-tab-pane label="AEU" name="second">
-          <lock-aeu item="2" typename="" v-if="isSecond"></lock-aeu>
-        </el-tab-pane>
-        <el-tab-pane label="PGU" name="third">
-          <lock-pgu item="3" typename="" v-if="isThird"></lock-pgu>
-        </el-tab-pane>
-        <el-tab-pane label="SCTU" name="fourth">
-          <lock-sctu item="4" typename="" v-if="isFourth"></lock-sctu>
-        </el-tab-pane>
-        <el-tab-pane label="SUB" name="fifth">
-          <lock-sub item="5" typename="" v-if="isFifth"></lock-sub>
-        </el-tab-pane>
-      </el-tabs>
-    </div>
+  <div class="app-container" style="padding: 0 0 0 0">
+    <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="1" name="first">
+        <lock-eu item="1" typename="" v-if="isFirst" page-number="1"></lock-eu>
+      </el-tab-pane>
+      <el-tab-pane label="2" name="second">
+        <lock-eu item="2" typename="" v-if="isSecond" page-number="2"></lock-eu>
+      </el-tab-pane>
+      <el-tab-pane label="3" name="third">
+        <lock-eu item="3" typename="" v-if="isThird" page-number="3"></lock-eu>
+      </el-tab-pane>
+      <el-tab-pane label="4" name="fourth">
+        <lock-eu item="4" typename="" v-if="isFourth" page-number="4"></lock-eu>
+      </el-tab-pane>
+      <el-tab-pane label="5" name="fifth">
+        <lock-eu item="5" typename="" v-if="isFifth" page-number="5"></lock-eu>
+      </el-tab-pane>
+      <el-tab-pane label="6" name="sixth">
+        <lock-eu item="6" typename="" v-if="isSixth" page-number="6"></lock-eu>
+      </el-tab-pane>
+      <el-tab-pane label="7" name="seventh">
+        <lock-eu item="7" typename="" v-if="isSeventh" page-number="7"></lock-eu>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
 </template>
 
 <script>
@@ -26,6 +32,7 @@ import LockAeu from "@/views/apply/lock/lock-aeu";
 import LockPgu from "@/views/apply/lock/lock-pgu";
 import LockSctu from "@/views/apply/lock/lock-sctu";
 import LockSub from "@/views/apply/lock/lock-sub";
+
 export default {
   name: "lock-dashboard",
   components: {LockSub, LockSctu, LockPgu, LockAeu, LockEu},
@@ -38,6 +45,8 @@ export default {
       isThird: false,
       isFourth: false,
       isFifth: false,
+      isSixth: false,
+      isSeventh: false,
     }
   },
   methods: {
@@ -48,30 +57,56 @@ export default {
         this.isThird = false
         this.isFourth = false
         this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = false
       } else if (tab.name === 'second') {
         this.isFirst = false
         this.isSecond = true
         this.isThird = false
         this.isFourth = false
         this.isFifth = false
-      }else if (tab.name === 'third') {
+        this.isSixth = false
+        this.isSeventh = false
+      } else if (tab.name === 'third') {
         this.isFirst = false
         this.isSecond = false
         this.isThird = true
         this.isFourth = false
         this.isFifth = false
-      }else if (tab.name === 'fourth') {
+        this.isSixth = false
+        this.isSeventh = false
+      } else if (tab.name === 'fourth') {
         this.isFirst = false
         this.isSecond = false
         this.isThird = false
         this.isFourth = true
         this.isFifth = false
-      }else if (tab.name === 'fifth') {
+        this.isSixth = false
+        this.isSeventh = false
+      } else if (tab.name === 'fifth') {
         this.isFirst = false
         this.isSecond = false
         this.isThird = false
         this.isFourth = false
         this.isFifth = true
+        this.isSixth = false
+        this.isSeventh = false
+      } else if (tab.name === 'sixth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = true
+        this.isSeventh = false
+      } else if (tab.name === 'seventh') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = true
       }
     }
   }

+ 8 - 5
ui/src/views/apply/lock/lock-eu.vue

@@ -13,7 +13,7 @@
             <th colspan="5">
             </th>
             <th colspan="25">
-              <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(EU)</span><br/>
+              <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板</span><br/>
             </th>
             <th colspan="5">
               <el-tag type="success" style="font-size: 20px;margin: 0px 10px;background-color: #67C23A" size="medium"
@@ -244,6 +244,9 @@ import {getLock, listLockBranch, updateLock, getInfoByLock} from "@/api/apply/lo
 import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
 
 export default {
+  props: {
+    pageNumber: {default:1}
+  },
   components: {OfflinevalveDetail, VueDraggableResizable},
   name: "lock-eu",
   directives: {
@@ -304,10 +307,10 @@ export default {
       height: document.body.clientHeight - 155,
       clickFlag: true,// 查询参数
       queryParams: {
-        pageNum: 1,
-        pageSize: 20,
+        pageNum: this.pageNumber,
+        pageSize: 350,
         unit: null,
-        lockPost: 'EU',
+        lockPost: null,
         pidNo: null,
         lockCode: null,
         medium: null,
@@ -350,7 +353,7 @@ export default {
     getList() {
       this.loading = true;
       listLockBranch(this.queryParams).then(response => {
-        this.data = response.data;
+        this.data = response.rows;
         this.loading = false;
       });
     },

+ 0 - 1
ui/src/views/apply/offlinevalve/index.vue

@@ -601,7 +601,6 @@ export default {
       for (const valve of this.safetyvavleList) {
         if (this.form.devNo == valve.tagno) {
           this.form.unit = valve.unit;
-          this.getLocks(this.form.unit);
         }
       }
     },

+ 18 - 16
ui/src/views/apply/safetychange/index.vue

@@ -66,17 +66,17 @@
         >新增
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['apply:safetychange:edit']"
-        >修改
-        </el-button>
-      </el-col>-->
+      <!--      <el-col :span="1.5">
+              <el-button
+                type="success"
+                icon="el-icon-edit"
+                size="mini"
+                :disabled="single"
+                @click="handleUpdate"
+                v-hasPermi="['apply:safetychange:edit']"
+              >修改
+              </el-button>
+            </el-col>-->
       <!--      <el-col :span="1.5">
               <el-button
                 type="danger"
@@ -220,7 +220,7 @@
           <el-input type="textarea" v-model="form.changeReason" placeholder="请输入状态变更的原因"/>
         </el-form-item>
         <el-form-item label="破锁编号" prop="lockNo">
-          <el-select v-model="form.lockNo" placeholder="请选择锁编号" clearable size="small" filterable
+          <el-select v-model="form.lockNo" placeholder="请选择锁编号" multiple clearable size="small" filterable
                      style="width: 100%">
             <el-option
               v-for="item in lockList"
@@ -535,7 +535,7 @@ export default {
         updaterCode: null,
         updatedate: null,
         deptId: null,
-        lockNo:null,
+        lockNo: null,
         approveStatus: null
       },
       pdf: {
@@ -577,7 +577,7 @@ export default {
   },
   created() {
     this.queryParams.lockNo = this.$route.query.lockNo;
-    listAllLock({status:0}).then(res => {
+    listAllLock({status: 0}).then(res => {
       this.lockList = res.data;
     })
     //设置表格高度对应屏幕高度
@@ -670,7 +670,7 @@ export default {
     openApproveDetail(row) {
       this.safetychangeDetailVisible = true
       this.$nextTick(() => {
-        this.$refs.safetychangeDetail.init(row.id, '', row.processId, '','',true)
+        this.$refs.safetychangeDetail.init(row.id, '', row.processId, '', '', true)
       })
     },
     /** 查询组织保护措施状态变更申请列表 */
@@ -739,7 +739,7 @@ export default {
         updaterCode: null,
         updatedate: null,
         deptId: null,
-        lockNo:null,
+        lockNo: null,
         approveStatus: "1"
       };
       this.resetForm("form");
@@ -789,6 +789,8 @@ export default {
               this.getList();
             });
           } else {
+            this.form.lockNo = this.form.lockNo.join(',');
+            console.log(this.form.lockNo)
             addSafetychange(this.form).then(response => {
               this.msgSuccess("新增成功");
               this.open = false;

+ 7 - 4
ui/src/views/approve/approveDetail/offlinevalve-detail.vue

@@ -97,7 +97,7 @@
             </el-radio-group>
           </el-form-item>
           <el-form-item label="破锁编号" prop="lockNo" v-if="form.disassembly=='是'">
-            <el-select v-model="form.lockNo" placeholder="请选择锁编号" clearable size="small" filterable
+            <el-select v-model="form.lockNo" placeholder="请选择锁编号" multiple clearable size="small" filterable
                        style="width: 100%">
               <el-option
                 v-for="item in lockList"
@@ -369,8 +369,8 @@ export default {
         } else if (this.dataForm.approveStatus === '3') {
           this.approveStatusFlag = 'danger';
         }
+        this.getLocks(this.dataForm.devNo);
       });
-      this.getLocks(this.dataForm.unit);
       this.getDicts("apply_status").then(response => {
         this.statusList = response.data;
       });
@@ -393,8 +393,8 @@ export default {
         this.unitOptions = response.data;
       });
     },
-    getLocks(unit) {
-      listAllLock({lockPost: unit, status: 0}).then(res => {
+    getLocks(devNo) {
+      listAllLock({position: devNo, status: 0}).then(res => {
         this.lockList = res.data;
       })
     },
@@ -402,6 +402,9 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid || val != 1) {
           this.submitDisabled = true;
+          if (this.form.lockNo) {
+            this.form.lockNo = this.form.lockNo.join(',');
+          }
           this.taskForm.offlinevalve = this.form;
           this.taskForm.condition = val;
           handle(this.taskForm).then(res => {