From d1ebb26ab19f83f32c5314771a5381db6f1b2a6d Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: 星期日, 28 四月 2024 11:49:37 +0800
Subject: [PATCH] 修改雷达井不存在到处excel

---
 ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java |  282 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 251 insertions(+), 31 deletions(-)

diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
index 9df4bf1..4d8fa15 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
@@ -1,7 +1,28 @@
 package com.ruoyi.app.patrolplan.controller;
 
+import java.text.ParseException;
 import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
+import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService;
+import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecord;
+import com.ruoyi.app.patrolplan.domain.param.*;
+import com.ruoyi.app.patrolplan.service.IArdAppPatrolpointRecordService;
+import com.ruoyi.app.patrolplan.service.IArdAppPatrolpointService;
+import com.ruoyi.app.patrolplan.service.IArdAppPatroluserService;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.service.ISysDeptService;
+import com.ruoyi.system.service.ISysUserService;
+import com.ruoyi.utils.result.Results;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -29,29 +50,58 @@
  */
 @RestController
 @RequestMapping("/app/appPatrolplan")
+@Api(tags = "app宸℃璁″垝")
 public class ArdAppPatrolplanController extends BaseController
 {
     @Autowired
     private IArdAppPatrolplanService ardAppPatrolplanService;
 
+    @Resource
+    IArdAppPatrolpointService ardAppPatrolpointService;
+
+    @Resource
+    IArdAppPatroluserService ardAppPatroluserService;
+
+    @Resource
+    ISysUserService sysUserService;
+
+    @Resource
+    ISysDeptService sysDeptService;
+
+    @Resource
+    IArdAlarmpointsWellService wellService;
+
+    @Resource
+    IArdAppPatrolpointRecordService recordService;
+
     /**
-     * 鏌ヨapp宸℃璁″垝鍒楄〃
+     * 绠$悊绔�--鏌ヨapp宸℃璁″垝鍒楄〃
      */
     @PreAuthorize("@ss.hasPermi('app:appPatrolplan:list')")
     @GetMapping("/list")
-    public TableDataInfo list(ArdAppPatrolplan ardAppPatrolplan)
+    @ApiOperation("绠$悊绔�--鏌ヨ鍏ㄩ儴宸℃鍒楄〃鍙婃悳绱㈢瓫閫�")
+    public Results list(ArdAppPatrolplan ardAppPatrolplan)
     {
-        startPage();
+        String userId = SecurityUtils.getUserId();
+        ardAppPatrolplan.setUserId(userId);
+        if(ardAppPatrolplan.getPageNum()==null || ardAppPatrolplan.getPageNum() == 0){
+            ardAppPatrolplan.setPageNum(1);
+        }
+        if(ardAppPatrolplan.getPageSize()==null || ardAppPatrolplan.getPageSize() == 0){
+            ardAppPatrolplan.setPageSize(10);
+        }
+        PageHelper.startPage(ardAppPatrolplan.getPageNum(),ardAppPatrolplan.getPageSize());
         List<ArdAppPatrolplan> list = ardAppPatrolplanService.selectArdAppPatrolplanList(ardAppPatrolplan);
-        return getDataTable(list);
+        return Results.succeed(new PageInfo<>(list));
     }
 
     /**
-     * 瀵煎嚭app宸℃璁″垝鍒楄〃
+     * 绠$悊绔�--瀵煎嚭app宸℃璁″垝鍒楄〃
      */
     @PreAuthorize("@ss.hasPermi('app:appPatrolplan:export')")
     @Log(title = "app宸℃璁″垝", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
+    @ApiOperation("绠$悊绔�--瀵煎嚭鍏ㄩ儴宸℃鍒楄〃")
     public void export(HttpServletResponse response, ArdAppPatrolplan ardAppPatrolplan)
     {
         List<ArdAppPatrolplan> list = ardAppPatrolplanService.selectArdAppPatrolplanList(ardAppPatrolplan);
@@ -60,45 +110,215 @@
     }
 
     /**
-     * 鑾峰彇app宸℃璁″垝璇︾粏淇℃伅
+     * 鏍规嵁宸℃ID鏌ヨ鍏磋叮鐐�
      */
-    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:query')")
-    @GetMapping(value = "/{patroEndTime}")
-    public AjaxResult getInfo(@PathVariable("patroEndTime") String patroEndTime)
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:wellByPlanId')")
+    @GetMapping(value = "wellByPlanId/{id}")
+    @ApiOperation("鏍规嵁宸℃ID鏌ヨ鍏磋叮鐐�")
+    public Results wellByPlanId(@PathVariable String id)
     {
-        return success(ardAppPatrolplanService.selectArdAppPatrolplanByPatroEndTime(patroEndTime));
+        return ardAppPatrolpointService.wellByPlanId(id);
     }
 
     /**
-     * 鏂板app宸℃璁″垝
+     * 鏍规嵁宸℃ID鏌ヨ宸℃浜�
      */
-    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:add')")
-    @Log(title = "app宸℃璁″垝", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody ArdAppPatrolplan ardAppPatrolplan)
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:userByPlanId')")
+    @GetMapping(value = "userByPlanId/{id}")
+    @ApiOperation("鏍规嵁宸℃ID鏌ヨ宸℃浜哄憳")
+    public Results userByPlanId(@PathVariable String id)
     {
-        return toAjax(ardAppPatrolplanService.insertArdAppPatrolplan(ardAppPatrolplan));
+        return ardAppPatroluserService.userByPlanId(id);
     }
 
     /**
-     * 淇敼app宸℃璁″垝
-     */
-    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:edit')")
-    @Log(title = "app宸℃璁″垝", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody ArdAppPatrolplan ardAppPatrolplan)
-    {
-        return toAjax(ardAppPatrolplanService.updateArdAppPatrolplan(ardAppPatrolplan));
-    }
-
-    /**
-     * 鍒犻櫎app宸℃璁″垝
+     * 绠$悊绔�--鍒犻櫎app宸℃璁″垝
      */
     @PreAuthorize("@ss.hasPermi('app:appPatrolplan:remove')")
     @Log(title = "app宸℃璁″垝", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{patroEndTimes}")
-    public AjaxResult remove(@PathVariable String[] patroEndTimes)
+    @DeleteMapping("/{id}")
+    @ApiOperation("绠$悊绔�--鍒犻櫎app宸℃璁″垝")
+    //public Results remove(@PathVariable String id)
+    public AjaxResult remove(@PathVariable String id)
     {
-        return toAjax(ardAppPatrolplanService.deleteArdAppPatrolplanByPatroEndTimes(patroEndTimes));
+        //return ardAppPatrolplanService.deleteArdApp(id);
+        return toAjax(ardAppPatrolplanService.deleteArdApp(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:allPlanUser')")
+    @PostMapping("allPlanUser")
+    @ApiOperation("鏌ヨ鏉冮檺涓嬪叏閮ㄤ汉鍛樺拰鍏磋叮鐐�")
+    public Results allPlanUser()
+    {
+        JSONObject jsonObject = new JSONObject();
+        String userId = SecurityUtils.getUserId();
+        //鏍规嵁userId鏌ヨ閮ㄩ棬Id
+        SysUser sysUser = sysUserService.selectUserById(userId);
+        //鏍规嵁褰撳墠deptId鎴栬�呭綋鍓嶅強鎵�灞炰笅绾х殑鎵�鏈塪eptId
+        List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());
+        //鏍规嵁deptId鍒楄〃鑾峰彇鍒版墍鏈夌敤鎴�
+        List<SysUser> sysUserList = sysUserService.userByDeptList(deptList);
+        jsonObject.put("user",sysUserList);
+        //鏍规嵁deptId鍒楄〃鑾峰彇鍒版墍鏈夊叴瓒g偣
+        List<ArdAlarmpointsWell> wellList = wellService.wellByDeptList(deptList);
+        jsonObject.put("well",wellList);
+        return Results.succeed(jsonObject);
+    }
+
+    /**
+     * 绠$悊绔�--鏂板app宸℃璁″垝鍙婁汉鍛樼偣浣�
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:insertArdAppPatrolplan')")
+    @Log(title = "app宸℃璁″垝", businessType = BusinessType.INSERT)
+    @PostMapping("/insertArdAppPatrolplan")
+    @ApiOperation("绠$悊绔�--鏂板app宸℃璁″垝鍙婁汉鍛樼偣浣�")
+    public AjaxResult addArdAppPatrolplan(@RequestBody Map<String,Object> para)
+    {
+        return toAjax(ardAppPatrolplanService.insertArdAppPatrolplan(para));
+    }
+
+    /**
+     *  绠$悊绔�--鏌ヨ鍗曟潯鏁版嵁
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:oneById')")
+    @PostMapping("/oneById/{id}")
+    @ApiOperation("绠$悊绔�--鏌ヨ鍗曟潯鏁版嵁")
+    public Results oneById(@PathVariable String id)
+    {
+        return ardAppPatrolplanService.oneById(id);
+    }
+
+    /**
+     * 绠$悊绔�--淇敼app宸℃璁″垝
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:edit')")
+    @Log(title = "app宸℃璁″垝", businessType = BusinessType.UPDATE)
+    @ApiOperation("绠$悊绔�--淇敼鍗曟潯鏁版嵁")
+    @PutMapping("upd")
+    public Results edit(@RequestBody Map<String,Object> para)
+    {
+        return ardAppPatrolplanService.updateArdAppPatrolplan(para);
+    }
+
+    /**
+     * 宸℃鎵撳崱
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:record')")
+    @ApiOperation("宸℃鎵撳崱")
+    @PostMapping("record")
+    public Results edit(@RequestBody ArdAppPatrolpointRecord ardAppPatrolpointRecord) {
+        return recordService.record(ardAppPatrolpointRecord);
+    }
+
+    /**
+     * 绠$悊绔�--宸℃鏃ュ巻
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordMonth')")
+    @ApiOperation("绠$悊绔�--宸℃鏃ュ巻")
+    @PostMapping("recordMonth")
+    public Results recordMonth(@RequestBody RecordMonthParam recordMonthParam) throws ParseException {
+        return recordService.recordMonth(recordMonthParam);
+    }
+
+    /**
+     * 绠$悊绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヨ褰曚笅浜哄憳鎵撳崱璁板綍
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordDetails')")
+    @ApiOperation("绠$悊绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヨ褰曚笅浜哄憳鎵撳崱璁板綍")
+    @PostMapping("recordDetails")
+    public Results recordDetails(@RequestBody RecordDetailsParam recordDetailsParam) throws ParseException {
+        return recordService.recordDetails(recordDetailsParam);
+    }
+
+    /**
+     * 鍗曚汉璇︽儏
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordSolo')")
+    @ApiOperation("鍗曚汉璇︽儏")
+    @PostMapping("recordSolo")
+    public Results recordSolo(@RequestBody RecordSoloParam recordSoloParam) throws ParseException {
+        return recordService.recordSolo(recordSoloParam);
+    }
+
+    /**
+     * 鍗曞叺绔�--鏌ヨapp宸℃璁″垝鍒楄〃
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:executeList')")
+    @GetMapping("/executeList")
+    @ApiOperation("鍗曞叺绔�--鏌ヨ璇ョ敤鎴蜂笅鎵�鏈夋墽琛岃鍒掑強鎼滅储绛涢��")
+    public Results executeList(ArdAppPatrolplan ardAppPatrolplan)
+    {
+        String userId = SecurityUtils.getUserId();
+        ardAppPatrolplan.setUserId(userId);
+        if(ardAppPatrolplan.getPageNum()==null || ardAppPatrolplan.getPageNum() == 0){
+            ardAppPatrolplan.setPageNum(1);
+        }
+        if(ardAppPatrolplan.getPageSize()==null || ardAppPatrolplan.getPageSize() == 0){
+            ardAppPatrolplan.setPageSize(10);
+        }
+        PageHelper.startPage(ardAppPatrolplan.getPageNum(),ardAppPatrolplan.getPageSize());
+        List<ArdAppPatrolplan> list = ardAppPatrolplanService.executeList(ardAppPatrolplan);
+        return Results.succeed(new PageInfo<>(list));
+    }
+
+    /**
+     *  鍗曞叺绔�--鏌ヨ鍗曟潯鏁版嵁
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:executeOneById')")
+    @PostMapping("/executeOneById/{id}")
+    @ApiOperation("鍗曞叺绔�--鏌ヨ鍗曟潯鏁版嵁")
+    public Results executeOneById(@PathVariable String id)
+    {
+        return ardAppPatrolplanService.executeOneById(id);
+    }
+
+    /**
+     * 鍗曞叺绔�--宸℃鏃ュ巻
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:executeMonth')")
+    @ApiOperation("鍗曞叺绔�--宸℃鏃ュ巻")
+    @PostMapping("executeMonth")
+    public Results executeMonth(@RequestBody RecordMonthExParam recordMonthExParam) throws ParseException {
+        return recordService.executeMonth(recordMonthExParam);
+    }
+
+    /**
+     * 鍗曞叺绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヨ褰曚笅浜哄憳鎵撳崱璁板綍
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:executeDetails')")
+    @ApiOperation("鍗曞叺绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヤ汉鍛樹笅鎵�鏈夊湴鐐规墦鍗¤褰�")
+    @PostMapping("executeDetails")
+    public Results executeDetails(@RequestBody RecordDetailsExParam recordDetailsExParam) throws ParseException {
+        return recordService.executeDetails(recordDetailsExParam);
+    }
+
+    /**
+     * 鍗曞叺绔�--鍗曚汉璇︽儏
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:executeSolo')")
+//    @ApiOperation("鍗曞叺绔�--鍗曚汉璇︽儏")
+    @PostMapping("executeSolo")
+    public Results executeSolo(@RequestBody RecordSoloExParam recordSoloExParam) throws ParseException {
+        return recordService.executeSolo(recordSoloExParam);
+    }
+
+    /**
+     * 鍗曞叺绔�--鎵撳崱鍓�
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordBefore')")
+    @ApiOperation("鍗曞叺绔�--鎵撳崱鍓�")
+    @PostMapping("recordBefore")
+    public Results recordBefore(@RequestBody RecordBeforeParam recordBeforeParam) throws ParseException {
+        return recordService.recordBefore(recordBeforeParam);
+    }
+
+    /**
+     * 鍗曞叺绔�--寰幆
+     */
+    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:son')")
+    @ApiOperation("鍗曞叺绔�--寰幆")
+    @GetMapping("son")
+    public Results son(){
+        return recordService.son();
     }
 }

--
Gitblit v1.9.3