jiangbiao пре 1 година
родитељ
комит
2a953e0649

+ 5 - 5
ruoyi-admin/src/main/java/com/ruoyi/project/approval/domain/TApproval.java

@@ -30,7 +30,7 @@ public class TApproval extends BaseEntity
     private String division;
 
     /** 批准日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date effetivedate;
 
@@ -99,7 +99,7 @@ public class TApproval extends BaseEntity
     private String reviewer;
 
     /** 回顾时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "回顾时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date reviewdate;
 
@@ -108,7 +108,7 @@ public class TApproval extends BaseEntity
     private String isCompliance;
 
     /** 下次回顾时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "下次回顾时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date nextreviewdate;
 
@@ -124,7 +124,7 @@ public class TApproval extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -133,7 +133,7 @@ public class TApproval extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 

+ 65 - 31
ruoyi-admin/src/main/java/com/ruoyi/project/asset/controller/TLeakagePointsPatrolController.java

@@ -1,48 +1,60 @@
 package com.ruoyi.project.asset.controller;
 
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.project.asset.domain.TLeakagePoints;
 import com.ruoyi.project.asset.domain.TLeakagePointsPatrol;
+import com.ruoyi.project.asset.domain.TLeakagePointsRecord;
 import com.ruoyi.project.asset.service.ITLeakagePointsPatrolService;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.project.asset.service.ITLeakagePointsRecordService;
+import com.ruoyi.project.asset.service.ITLeakagePointsService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 漏点巡检Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-04-01
  */
 @RestController
 @RequestMapping("/asset/pointPatrol")
-public class TLeakagePointsPatrolController extends BaseController
-{
+public class TLeakagePointsPatrolController extends BaseController {
     @Autowired
     private ITLeakagePointsPatrolService tLeakagePointsPatrolService;
 
+    @Autowired
+    private ITLeakagePointsRecordService tLeakagePointsRecordService;
+
+    @Autowired
+    private ITLeakagePointsService tLeakagePointsService;
+
     /**
      * 查询漏点巡检列表
      */
     @PreAuthorize("@ss.hasPermi('asset:pointPatrol:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TLeakagePointsPatrol tLeakagePointsPatrol)
-    {
+    public TableDataInfo list(TLeakagePointsPatrol tLeakagePointsPatrol) {
         startPage();
+        if (tLeakagePointsPatrol.getCheckDateM() == null) {
+            tLeakagePointsPatrol.setCheckDateM(new Date());
+        }
         List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
+        if (CollectionUtils.isNotEmpty(list)) {
+            TLeakagePointsRecord record = new TLeakagePointsRecord();
+            record.setPatrolId(list.get(0).getId());
+            list.get(0).setRecords(tLeakagePointsRecordService.selectTLeakagePointsRecordList(record));
+        }
         return getDataTable(list);
     }
 
@@ -52,8 +64,7 @@ public class TLeakagePointsPatrolController extends BaseController
     @PreAuthorize("@ss.hasPermi('asset:pointPatrol:export')")
     @Log(title = "漏点巡检", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TLeakagePointsPatrol tLeakagePointsPatrol)
-    {
+    public void export(HttpServletResponse response, TLeakagePointsPatrol tLeakagePointsPatrol) {
         List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
         ExcelUtil<TLeakagePointsPatrol> util = new ExcelUtil<TLeakagePointsPatrol>(TLeakagePointsPatrol.class);
         util.exportExcel(response, list, "漏点巡检数据");
@@ -64,8 +75,7 @@ public class TLeakagePointsPatrolController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('asset:pointPatrol:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(tLeakagePointsPatrolService.selectTLeakagePointsPatrolById(id));
     }
 
@@ -75,9 +85,28 @@ public class TLeakagePointsPatrolController extends BaseController
     @PreAuthorize("@ss.hasPermi('asset:pointPatrol:add')")
     @Log(title = "漏点巡检", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol)
-    {
-        return toAjax(tLeakagePointsPatrolService.insertTLeakagePointsPatrol(tLeakagePointsPatrol));
+    public AjaxResult add(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol) {
+        tLeakagePointsPatrol.setCheckDateN(tLeakagePointsPatrol.getCheckDateM());
+        TLeakagePointsPatrol patrol = new TLeakagePointsPatrol();
+        patrol.setCheckDateM(tLeakagePointsPatrol.getCheckDateM());
+        List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(patrol);
+        if (CollectionUtils.isNotEmpty(list)) {
+            return AjaxResult.warn("当前日期已存在巡检记录!");
+        }
+        tLeakagePointsPatrolService.insertTLeakagePointsPatrol(tLeakagePointsPatrol);
+        TLeakagePoints tLeakagePoints = new TLeakagePoints();
+        tLeakagePoints.setLeakageEliminationResult("1,2");
+        for (TLeakagePoints leakagePoints : tLeakagePointsService.selectTLeakagePointsList(tLeakagePoints)) {
+            TLeakagePointsRecord record = new TLeakagePointsRecord();
+            record.setPatrolId(tLeakagePointsPatrol.getId());
+            record.setPointNo(leakagePoints.getPointNo());
+            record.setLeakagePosition(leakagePoints.getLeakagePosition());
+            record.setLeakageMedium(leakagePoints.getLeakageMedium());
+            record.setCreatedate(new Date());
+            record.setCreaterCode(getUserId().toString());
+            tLeakagePointsRecordService.insertTLeakagePointsRecord(record);
+        }
+        return toAjax(1);
     }
 
     /**
@@ -86,8 +115,14 @@ public class TLeakagePointsPatrolController extends BaseController
     @PreAuthorize("@ss.hasPermi('asset:pointPatrol:edit')")
     @Log(title = "漏点巡检", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol)
-    {
+    public AjaxResult edit(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol) {
+        if (CollectionUtils.isNotEmpty(tLeakagePointsPatrol.getRecords())) {
+            tLeakagePointsPatrol.getRecords().forEach(item -> {
+                item.setUpdatedate(new Date());
+                item.setUpdaterCode(getUserId().toString());
+                tLeakagePointsRecordService.updateTLeakagePointsRecord(item);
+            });
+        }
         return toAjax(tLeakagePointsPatrolService.updateTLeakagePointsPatrol(tLeakagePointsPatrol));
     }
 
@@ -96,9 +131,8 @@ public class TLeakagePointsPatrolController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('asset:pointPatrol:remove')")
     @Log(title = "漏点巡检", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tLeakagePointsPatrolService.deleteTLeakagePointsPatrolByIds(ids));
     }
 }

+ 5 - 5
ruoyi-admin/src/main/java/com/ruoyi/project/asset/domain/TLeakagePoints.java

@@ -33,7 +33,7 @@ public class TLeakagePoints extends BaseEntity
     private String leakageMedium;
 
     /** 发现时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "发现时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date discoveryTime;
 
@@ -50,7 +50,7 @@ public class TLeakagePoints extends BaseEntity
     private String sapNo;
 
     /** 消漏时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "消漏时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date leakageEliminationTime;
 
@@ -71,7 +71,7 @@ public class TLeakagePoints extends BaseEntity
     private String leakageEliminationResult;
 
     /** 下次检修日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "下次检修日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date nextCheckDate;
 
@@ -87,7 +87,7 @@ public class TLeakagePoints extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -96,7 +96,7 @@ public class TLeakagePoints extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 

+ 17 - 5
ruoyi-admin/src/main/java/com/ruoyi/project/asset/domain/TLeakagePointsPatrol.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.asset.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -25,7 +27,7 @@ public class TLeakagePointsPatrol extends BaseEntity
     private String teamM;
 
     /** 日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date checkDateM;
 
@@ -38,7 +40,7 @@ public class TLeakagePointsPatrol extends BaseEntity
     private String teamN;
 
     /** 日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date checkDateN;
 
@@ -58,7 +60,7 @@ public class TLeakagePointsPatrol extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -67,7 +69,7 @@ public class TLeakagePointsPatrol extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 
@@ -75,7 +77,17 @@ public class TLeakagePointsPatrol extends BaseEntity
     @Excel(name = "部门编号")
     private Long deptId;
 
-    public void setId(Long id) 
+    private List<TLeakagePointsRecord> records;
+
+    public List<TLeakagePointsRecord> getRecords() {
+        return records;
+    }
+
+    public void setRecords(List<TLeakagePointsRecord> records) {
+        this.records = records;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/project/asset/domain/TLeakagePointsRecord.java

@@ -64,7 +64,7 @@ public class TLeakagePointsRecord extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -73,7 +73,7 @@ public class TLeakagePointsRecord extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/project/asset/domain/TSpecdevTypemgr.java

@@ -40,7 +40,7 @@ public class TSpecdevTypemgr extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -49,7 +49,7 @@ public class TSpecdevTypemgr extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/project/file/domain/TFile.java

@@ -30,7 +30,7 @@ public class TFile extends BaseEntity
     private String fileName;
 
     /** 上传时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date uploadDate;
 

+ 3 - 3
ruoyi-admin/src/main/java/com/ruoyi/project/plant/domain/TStaffmgrRecord.java

@@ -30,7 +30,7 @@ public class TStaffmgrRecord extends BaseEntity
     private String type;
 
     /** 日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date actionDate;
 
@@ -48,7 +48,7 @@ public class TStaffmgrRecord extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -57,7 +57,7 @@ public class TStaffmgrRecord extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/project/shiftmgr/domain/TShiftLog.java

@@ -175,7 +175,7 @@ public class TShiftLog extends BaseEntity
     private String createrCode;
 
     /** 创建日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
@@ -184,7 +184,7 @@ public class TShiftLog extends BaseEntity
     private String updaterCode;
 
     /** 更新日期 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 

+ 6 - 1
ruoyi-admin/src/main/resources/mapper/asset/TLeakagePointsMapper.xml

@@ -46,7 +46,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="leakageEliminationFunc != null  and leakageEliminationFunc != ''"> and leakage_elimination_func = #{leakageEliminationFunc}</if>
             <if test="listing != null  and listing != ''"> and listing = #{listing}</if>
             <if test="pressurePlugging != null  and pressurePlugging != ''"> and pressure_plugging = #{pressurePlugging}</if>
-            <if test="leakageEliminationResult != null  and leakageEliminationResult != ''"> and leakage_elimination_result = #{leakageEliminationResult}</if>
+            <if test="leakageEliminationResult != null  and leakageEliminationResult != ''"> and leakage_elimination_result in
+             <foreach collection="leakageEliminationResult.split(',')" item="item" index="index"
+                      open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+            </if>
             <if test="nextCheckDate != null "> and next_check_date = #{nextCheckDate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>

+ 2 - 2
ruoyi-admin/src/main/resources/mapper/asset/TLeakagePointsPatrolMapper.xml

@@ -29,10 +29,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTLeakagePointsPatrolVo"/>
         <where>  
             <if test="teamM != null  and teamM != ''"> and team_m = #{teamM}</if>
-            <if test="checkDateM != null "> and check_date_m = #{checkDateM}</if>
+            <if test="checkDateM != null "> and date_format(check_date_m,'%y-%m-%d') = date_format(#{checkDateM},'%y-%m-%d')</if>
             <if test="signM != null  and signM != ''"> and sign_m = #{signM}</if>
             <if test="teamN != null  and teamN != ''"> and team_n = #{teamN}</if>
-            <if test="checkDateN != null "> and check_date_n = #{checkDateN}</if>
+            <if test="checkDateN != null "> and date_format(check_date_n,'%y-%m-%d') = date_format(#{checkDateN},'%y-%m-%d')</if>
             <if test="signN != null  and signN != ''"> and sign_n = #{signN}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>

+ 1 - 1
ruoyi-generator/src/main/resources/vm/java/domain.java.vm

@@ -40,7 +40,7 @@ public class ${ClassName} extends ${Entity}
 #if($parentheseIndex != -1)
     @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
 #elseif($column.javaType == 'Date')
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
 #else
     @Excel(name = "${comment}")

+ 1 - 1
ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm

@@ -31,7 +31,7 @@ public class ${subClassName} extends BaseEntity
 #if($parentheseIndex != -1)
     @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
 #elseif($column.javaType == 'Date')
-    @JsonFormat(pattern = "yyyy-MM-dd")
+     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
 #else
     @Excel(name = "${comment}")

+ 37 - 26
ruoyi-ui/src/views/asset/pointPatrol/index.vue

@@ -17,17 +17,25 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :search="false"></right-toolbar>
     </el-form>
 
-    <table class="patrolTable" style="width: 100%;">
+    <table class="patrolTable" style="width: 100%; margin-bottom: 30px">
       <tr>
-        <td rowspan="3"  colspan="2">漏点巡检记录表</td>
+        <td rowspan="3" colspan="2">漏点巡检记录表</td>
         <td>日期</td>
-        <td colspan="2">{{ parseTime(pointPatrol.checkDateM,'{y}年{m}月{d}日')}}</td>
-        <td colspan="2">{{ parseTime(pointPatrol.checkDateN,'{y}年{m}月{d}日')}}</td>
+        <td colspan="2">{{ parseTime(pointPatrol.checkDateM, '{y}年{m}月{d}日') }}</td>
+        <td colspan="2">{{ parseTime(pointPatrol.checkDateN, '{y}年{m}月{d}日') }}</td>
       </tr>
       <tr>
         <td>班组</td>
-        <td colspan="2">{{pointPatrol.teamM}}班</td>
-        <td colspan="2">{{pointPatrol.teamN}}班</td>
+        <td colspan="2">
+          <span v-if="!isEdit">{{ pointPatrol.teamM }}班</span>
+          <span v-else><el-input v-model="pointPatrol.teamM" placeholder="请输入当前班组"
+                                 style="width: 150px"/> 班</span>
+        </td>
+        <td colspan="2">
+          <span v-if="!isEdit">{{ pointPatrol.teamN }}班</span>
+          <span v-else><el-input v-model="pointPatrol.teamN" placeholder="请输入当前班组"
+                                 style="width: 150px"/> 班</span>
+        </td>
       </tr>
       <tr>
         <td>时间</td>
@@ -44,6 +52,10 @@
         <td>泄露状态<br/>(未检出/轻微/严重)</td>
       </tr>
     </table>
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="submitForm">保 存</el-button>
+      <el-button @click="cancel">取 消</el-button>
+    </div>
   </div>
 </template>
 
@@ -55,7 +67,6 @@ import {
   listPointPatrol,
   updatePointPatrol
 } from "@/api/asset/pointPatrol";
-import {parseTime} from "../../../utils/ruoyi";
 import PointRecord from "@/views/asset/pointRecord/index.vue";
 
 export default {
@@ -63,6 +74,7 @@ export default {
   components: {PointRecord},
   data() {
     return {
+      isEdit: false,
       // 页面高度
       clientHeight: 300,
       // 遮罩层
@@ -115,17 +127,19 @@ export default {
     });
   },
   methods: {
-    parseTime,
     /** 查询漏点巡检列表 */
     getList() {
       this.loading = true;
-      if (this.queryParams.checkDateM) {
+      if (this.queryParams.checkDateM==null) {
         this.queryParams.checkDateM = new Date();
       }
       listPointPatrol(this.queryParams).then(response => {
         this.pointPatrolList = response.rows;
         if (this.pointPatrolList.length > 0) {
           this.pointPatrol = this.pointPatrolList[0]
+          this.isEdit = false
+        } else {
+          this.isEdit = true
         }
         this.total = response.total;
         this.loading = false;
@@ -190,23 +204,19 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updatePointPatrol(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addPointPatrol(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
+      this.isEdit = false
+      this.pointPatrol.checkDateM=this.queryParams.checkDateM;
+      if (this.form.id != null) {
+        updatePointPatrol(this.pointPatrol).then(response => {
+          this.$modal.msgSuccess("修改成功");
+          this.getList();
+        });
+      } else {
+        addPointPatrol(this.pointPatrol).then(response => {
+          this.$modal.msgSuccess("新增成功");
+          this.getList();
+        });
+      }
     },
     /** 删除按钮操作 */
     handleDelete(row) {
@@ -240,4 +250,5 @@ table td {
   padding: 10px;
   text-align: center;
 }
+
 </style>

+ 183 - 4
ruoyi-ui/src/views/asset/points/index.vue

@@ -26,8 +26,10 @@
         />
       </el-form-item>
 
-      <el-form-item label="消漏结果" prop="leakageEliminationResult">
-        <el-select clearable v-model="queryParams.leakageEliminationResult" placeholder="请选择消漏结果" @change="handleQuery">
+      <el-form-item label="消漏结果" prop="leakageEliminationResults">
+        <el-select clearable multiple
+                   v-model="queryParams.leakageEliminationResults"
+                   placeholder="请选择消漏结果">
           <el-option v-for="dict in dict.type.leakage_result"
                      :value="dict.value"
                      :label="dict.label"
@@ -249,7 +251,94 @@
 
     <el-dialog title="日常巡检记录" :visible.sync="record.open" width="80%" append-to-body
                :close-on-click-modal="false">
-      <point-patrol/>
+      <el-form :model="record.queryParams" ref="recordQueryForm" size="small" :inline="true" label-width="68px">
+        <el-form-item label="日期" prop="checkDateM">
+          <el-date-picker
+            v-model="record.queryParams.checkDateM"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请选择日期"
+            @change="handleRecordQuery">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleRecordQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetRecordQuery">重置</el-button>
+        </el-form-item>
+        <right-toolbar :showSearch.sync="record.showSearch" @queryTable="getRecordList" :search="false"></right-toolbar>
+      </el-form>
+
+      <table style="width: 100%; margin-bottom: 30px">
+        <tr>
+          <td rowspan="3" colspan="2">漏点巡检记录表</td>
+          <td>日期</td>
+          <td colspan="2">{{ parseTime(record.pointPatrol.checkDateM, '{y}年{m}月{d}日') }}</td>
+          <td colspan="2">{{ parseTime(record.pointPatrol.checkDateN, '{y}年{m}月{d}日') }}</td>
+        </tr>
+        <tr>
+          <td>班组</td>
+          <td colspan="2">
+            <span v-if="!record.isEdit">{{ record.pointPatrol.teamM }}班</span>
+            <span v-else><el-input v-model="record.pointPatrol.teamM" placeholder="请输入当前班组"
+                                   style="width: 150px"/> 班</span>
+          </td>
+          <td colspan="2">
+            <span v-if="!record.isEdit">{{ record.pointPatrol.teamN }}班</span>
+            <span v-else><el-input v-model="record.pointPatrol.teamN" placeholder="请输入当前班组"
+                                   style="width: 150px"/> 班</span>
+          </td>
+        </tr>
+        <tr>
+          <td>时间</td>
+          <td colspan="2">早班一次</td>
+          <td colspan="2">夜班一次</td>
+        </tr>
+        <tr>
+          <td>漏点编号</td>
+          <td>漏点位置</td>
+          <td>介质</td>
+          <td>挂牌(是/否)</td>
+          <td>泄露状态<br/>(未检出/轻微/严重)</td>
+          <td>挂牌(是/否)</td>
+          <td>泄露状态<br/>(未检出/轻微/严重)</td>
+        </tr>
+        <tr v-for="item in record.pointPatrol.records">
+          <td>{{ item.pointNo }}</td>
+          <td>{{ item.leakagePosition }}</td>
+          <td>{{ item.leakageMedium }}</td>
+          <td>
+            <el-radio-group v-model="item.suspendPlateM">
+              <el-radio label="是">是</el-radio>
+              <el-radio label="否">否</el-radio>
+            </el-radio-group>
+          </td>
+          <td>
+            <el-radio-group v-model="item.leakageStatusM">
+              <el-radio label="未检出">未检出</el-radio>
+              <el-radio label="轻微">轻微</el-radio>
+              <el-radio label="严重">严重</el-radio>
+            </el-radio-group>
+          </td>
+          <td>
+            <el-radio-group v-model="item.suspendPlateN">
+              <el-radio label="是">是</el-radio>
+              <el-radio label="否">否</el-radio>
+            </el-radio-group>
+          </td>
+          <td>
+            <el-radio-group v-model="item.leakageStatusN">
+              <el-radio label="未检出">未检出</el-radio>
+              <el-radio label="轻微">轻微</el-radio>
+              <el-radio label="严重">严重</el-radio>
+            </el-radio-group>
+          </td>
+        </tr>
+      </table>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitPatrolForm" v-if="isToday(record.queryParams.checkDateM)">保 存
+        </el-button>
+        <el-button @click="cancelPatrol">返 回</el-button>
+      </div>
     </el-dialog>
 
     <!-- 用户导入对话框 -->
@@ -296,6 +385,7 @@ import {addPoints, delPoints, getPoints, listPoints, updatePoints} from "@/api/a
 import PointRecord from "@/views/asset/pointRecord/index.vue";
 import PointPatrol from "@/views/asset/pointPatrol/index.vue";
 import {getToken} from "@/utils/auth";
+import {addPointPatrol, listPointPatrol, updatePointPatrol} from "@/api/asset/pointPatrol";
 
 export default {
   dicts: ['leakage_result'],
@@ -305,7 +395,27 @@ export default {
     return {
       fullscreenLoading: false,
       record: {
-        open: false
+        open: false,
+        queryParams: {
+          pageNum: 1,
+          pageSize: 20,
+          teamM: null,
+          checkDateM: new Date(),
+          signM: null,
+          teamN: null,
+          checkDateN: null,
+          signN: null,
+          remarks: null,
+          createrCode: null,
+          createdate: null,
+          updaterCode: null,
+          updatedate: null,
+          deptId: null
+        },
+        isEdit: false,
+        pointPatrol: {},
+        // 显示搜索条件
+        showSearch: false,
       },
       // 用户导入参数
       upload: {
@@ -360,6 +470,7 @@ export default {
         listing: null,
         pressurePlugging: null,
         leakageEliminationResult: null,
+        leakageEliminationResults: [],
         nextCheckDate: null,
         remarks: null,
         createrCode: null,
@@ -382,6 +493,55 @@ export default {
     });
   },
   methods: {
+    isToday(date) {
+      const today = new Date();
+      const todayISOString = today.toISOString().split('T')[0];
+      if (typeof (date) == "object") {
+        date = date.toISOString().split('T')[0];
+      }
+      return date === todayISOString;
+    },
+    getRecordList() {
+      this.record.pointPatrol = {};
+      if (this.record.queryParams.checkDateM == null) {
+        this.record.queryParams.checkDateM = new Date();
+      }
+      listPointPatrol(this.record.queryParams).then(response => {
+        let list = response.rows;
+        if (list.length > 0) {
+          this.record.pointPatrol = list[0]
+          this.record.isEdit = false
+        } else {
+          this.record.pointPatrol = {}
+          this.record.isEdit = true
+        }
+      });
+    },
+    resetRecordQuery() {
+      this.resetForm("recordQueryForm");
+      this.getRecordList();
+    },
+    handleRecordQuery() {
+      this.getRecordList();
+    },
+    cancelPatrol() {
+      this.record.open = false;
+    },
+    submitPatrolForm() {
+      this.record.isEdit = false
+      this.record.pointPatrol.checkDateM = this.record.queryParams.checkDateM;
+      if (this.record.pointPatrol.id != null) {
+        updatePointPatrol(this.record.pointPatrol).then(response => {
+          this.$modal.msgSuccess("修改成功");
+          this.getRecordList();
+        });
+      } else {
+        addPointPatrol(this.record.pointPatrol).then(response => {
+          this.$modal.msgSuccess("新增成功");
+          this.getRecordList();
+        });
+      }
+    },
     /** 导入按钮操作 */
     handleImport() {
       this.upload.title = "用户导入";
@@ -418,10 +578,15 @@ export default {
     },
     openRecord() {
       this.record.open = true;
+      this.record.queryParams.checkDateM = new Date();
+      this.getRecordList();
     },
     /** 查询漏点清单列表 */
     getList() {
       this.loading = true;
+      if (this.queryParams.leakageEliminationResults && this.queryParams.leakageEliminationResults.length > 0) {
+        this.queryParams.leakageEliminationResult = this.queryParams.leakageEliminationResults.join(",");
+      }
       listPoints(this.queryParams).then(response => {
         this.pointsList = response.rows;
         this.total = response.total;
@@ -532,3 +697,17 @@ export default {
   }
 };
 </script>
+
+<style scoped lang="scss">
+/* 表格边框 */
+table {
+  border-collapse: collapse;
+}
+
+table td {
+  border: 1px #b4b4b4 solid;
+  padding: 10px;
+  text-align: center;
+}
+
+</style>

+ 0 - 4
ruoyi-ui/src/views/login.vue

@@ -90,7 +90,6 @@ export default {
     }
   },
   created() {
-    this.getCode();
     this.getCookie();
   },
   methods: {
@@ -121,9 +120,6 @@ export default {
             this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
           }).catch(() => {
             this.loading = false;
-            if (this.captchaEnabled) {
-              this.getCode();
-            }
           });
         }
       });