Bladeren bron

ly 导入

ly 2 jaren geleden
bovenliggende
commit
8b9fd82e29

+ 72 - 1
master/src/main/java/com/ruoyi/project/check/controller/TCheckCheckpointsController.java

@@ -187,6 +187,77 @@ public class TCheckCheckpointsController extends BaseController {
         return AjaxResult.success();
     }
 
+    @PreAuthorize("@ss.hasPermi('check:checkpoints:edit')")
+    @Log(title = "审核检测结果", businessType = BusinessType.UPDATE)
+    @PutMapping("/approveAll")
+    public AjaxResult approveAll(@RequestBody TCheckCheckpoints tCheckCheckpoints) {
+        long status = tCheckCheckpoints.getApproveStatus();
+        tCheckCheckpoints.setApproveStatus(null);
+        List<TCheckCheckpoints> list = tCheckCheckpointsService.selectTCheckCheckpointsList(tCheckCheckpoints);
+        if (list.size() == 0) {
+            return AjaxResult.success();
+        }
+        List<Long> ids = new ArrayList<>();
+        for (TCheckCheckpoints t: list
+        ) {
+            ids.add(t.getCheckId());
+        }
+        TCheckCheckpoints newCheckpoints = new TCheckCheckpoints();
+        newCheckpoints.setApproveStatus(status);
+        newCheckpoints.setCheckIds(ids.toArray(new Long[ids.size()]));
+        int i = tCheckCheckpointsService.updateApproveStatusByIds(newCheckpoints);
+        List<TCheckRepairpoints> tCheckRepairpoints = new ArrayList<>();
+        if (i > 0) {
+            if (2 == status) {
+                TTaskInspection tTaskInspection = taskInspectionService.selectTTaskInspectionById(tCheckCheckpoints.getInspectionId());
+                List<TCheckCheckpoints> points = tCheckCheckpointsService.selectPointsByIds(newCheckpoints.getCheckIds());
+                tTaskInspection.setTaskDoneNum(new BigDecimal(StringUtils.isNotEmpty(tTaskInspection.getTaskDoneNum()) ? tTaskInspection.getTaskDoneNum() : "0").add(new BigDecimal(points.size())).toString());
+                tTaskInspection.setTaskUndoneNum(new BigDecimal(tTaskInspection.getTaskNum()).subtract(new BigDecimal(tTaskInspection.getTaskDoneNum())).toString());
+                taskInspectionService.updateTTaskInspection(tTaskInspection);
+                for (TCheckCheckpoints point : points) {
+                    if (!point.getLeakageDegree().equals("1")) {
+                        TCheckRepairpoints tCheckRepairpoint = new TCheckRepairpoints();
+                        tCheckRepairpoint.setPointId(point.getPointId());
+                        tCheckRepairpoint.setNetTestValue(point.getNetTestValue());
+                        tCheckRepairpoint.setPlantName(point.getPlantName());
+                        tCheckRepairpoint.setRegionName(point.getRegionName());
+                        tCheckRepairpoint.setLayer(point.getLayer());
+                        tCheckRepairpoint.setDevName(point.getDevName());
+                        tCheckRepairpoint.setDevCode(point.getDevCode());
+                        tCheckRepairpoint.setGroupCode(point.getGroupCode());
+                        tCheckRepairpoint.setExtendCode(point.getExtendCode());
+                        tCheckRepairpoint.setPointType(point.getPointType());
+                        tCheckRepairpoint.setInstrumentCode(point.getInstrumentCode());
+                        tCheckRepairpoint.setLeakagePosition(point.getLeakagePosition());
+                        tCheckRepairpoint.setLeakageDegree(point.getLeakageDegree());
+//                        tCheckRepairpoint.setApproveStatus(0L);
+                        tCheckRepairpoint.setCreaterCode(getUserId());
+                        tCheckRepairpoint.setCreatedate(new Date());
+                        tCheckRepairpoint.setUpdaterCode(getUserId());
+                        tCheckRepairpoint.setUpdatedate(new Date());
+                        tCheckRepairpoint.setPlantId(point.getPlantId());
+                        tCheckRepairpoint.setRegionId(point.getRegionId());
+                        tCheckRepairpoint.setDevId(point.getDevId());
+                        tCheckRepairpoint.setInstrumentId(point.getInstrumentId());
+                        tCheckRepairpoint.setPlantType(point.getPlantType());
+                        tCheckRepairpoint.setMediumType(point.getMediumType());
+                        tCheckRepairpoints.add(tCheckRepairpoint);
+                    }
+                    TBasePoint tBasePoint = new TBasePoint();
+                    tBasePoint.setPointId(point.getPointId());
+                    tBasePoint.setNetTestValue(point.getNetTestValue());
+                    tBasePoint.setLeakageDegree(point.getLeakageDegree());
+                    tBasePointService.updateTBasePoint(tBasePoint);// 更新密封点数据
+                }
+                if (CollectionUtils.isNotEmpty(tCheckRepairpoints)) {
+                    tCheckRepairpointsService.insertTCheckRepairpointsByList(tCheckRepairpoints);
+                }
+            }
+        } else
+            return AjaxResult.error();
+        return AjaxResult.success();
+    }
+
     /**
      * 删除检测点
      */
@@ -252,7 +323,7 @@ public class TCheckCheckpointsController extends BaseController {
                             entity.setChecker(cellValue);
                         } else if (j == 7) {
                             // 检测日期
-                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
                             entity.setCheckDate(sdf.parse(cellValue));
                         }
                     }

+ 1 - 0
master/src/main/java/com/ruoyi/project/check/domain/TCheckCheckpoints.java

@@ -133,6 +133,7 @@ public class TCheckCheckpoints extends BaseEntity {
      * 校准日期
      */
     @Excel(name = "校准日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date checkDate;
 
     /**

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

@@ -21,7 +21,7 @@ spring:
             # 最小连接池数量
             minIdle: 10
             # 最大连接池数量
-            maxActive: 20
+            maxActive: 100
             # 配置获取连接等待超时的时间
             maxWait: 60000
             # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒

+ 9 - 0
ui/src/api/check/checkpoints.js

@@ -51,3 +51,12 @@ export function approveCheckpoints(data) {
     data: data
   })
 }
+
+//送审审核
+export function approveCheckpointsAll(data) {
+  return request({
+    url: '/check/checkpoints/approveAll',
+    method: 'put',
+    data: data
+  })
+}

+ 40 - 3
ui/src/views/check/inspectionCheck/pointEnter.vue

@@ -1,6 +1,6 @@
 <template xmlns="http://www.w3.org/1999/html">
   <div class="checkTable">
-    <el-dialog :visible.sync="dialog.dialogFormVisible" width="1800px" :close-on-click-modal="false"
+    <el-dialog :visible.sync="dialog.dialogFormVisible" width="90%" :close-on-click-modal="false"
                title='检测点清单'>
       <el-row>
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
@@ -76,6 +76,17 @@
           >送审
           </el-button>
         </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="info"
+            plain
+            icon="el-icon-position"
+            size="mini"
+            @click="handleApproveAll(1)"
+            v-if="isEnter"
+          >全部送审
+          </el-button>
+        </el-col>
         <el-col :span="1.5">
           <el-button
             type="info"
@@ -83,11 +94,22 @@
             icon="el-icon-s-check"
             size="mini"
             :disabled="leftMultiple"
-            @click="handleApprove"
+            @click="handleApprove()"
             v-if="isEnter"
           >审核
           </el-button>
         </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="info"
+            plain
+            icon="el-icon-s-check"
+            size="mini"
+            @click="handleApproveAll(2)"
+            v-if="isEnter"
+          >全部审核
+          </el-button>
+        </el-col>
       </el-row>
       <el-row>
         <el-table :data="leftData" style="width: 100%;" height="500px" border
@@ -182,10 +204,11 @@
 </template>
 
 <script>
-import {approveCheckpoints, listCheckpoints,} from "@/api/check/checkpoints";
+import {approveCheckpoints,approveCheckpointsAll, listCheckpoints,} from "@/api/check/checkpoints";
 import {getAllPlantName} from "@/api/base/plant";
 import {getToken} from "@/utils/auth";
 import {byInspectionId} from "@/api/check/repairpoints";
+import {deepClone} from "@/utils";
 
 export default {
   name: "pointEnter",
@@ -427,6 +450,20 @@ export default {
           }
         )
       })
+    },
+    handleApproveAll(status){
+      let data = deepClone(this.queryParams);
+      data.approveStatus = status
+      data.inspectionId = this.row.id;
+      this.$modal.confirm(status == 1?"是否确认送审?": "确认审核?").then(() => {
+        return approveCheckpointsAll(data).then(response => {
+          this.$modal.msgSuccess(status == 1?"送审成功": "审核成功");
+          this.getList();
+        }).catch(() => {
+            this.$modal.msgWarning("操作失败!请确认数据是否填写完整!");
+          }
+        )
+      })
     }
   }
 }