Sfoglia il codice sorgente

巡查任务api接口和代码优化

lidongyu 1 anno fa
parent
commit
80eb81c77a

+ 4 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/comprehensiveconflictdefusecontroller/AppGridLeaderController.java

@@ -42,6 +42,10 @@ public class AppGridLeaderController extends BaseController {
         }
     }
 
+    @GetMapping("/leader/listAll")
+    public AjaxResult listAll(ComprehensiveRfhGridLeader comprehensiveRfhGridLeader) {
+      return remoteRfhGridLeaderService.listAll();
+    }
 
     /**
      * 获取网格长管理详细信息

+ 1 - 1
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutioncontroller/AppBuildingController.java

@@ -84,7 +84,7 @@ public class AppBuildingController extends BaseController {
     }
 
     /**
-     * 删除楼栋管理
+     * 楼栋下拉选
      */
     @GetMapping("/comprehensivebuilding/getbuilding")
     public AjaxResult getbuilding(@RequestParam("estateId") String estateId) {

+ 5 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutioncontroller/AppBuildingLeaderController.java

@@ -43,6 +43,11 @@ public class AppBuildingLeaderController extends BaseController {
         }
     }
 
+    @GetMapping("/comprehensivebuildingleader/listAll")
+    public AjaxResult listAll(ComprehensiveBuildingLeader comprehensivebuildingleader) {
+     return remoteBuildingLeaderService.listAll(comprehensivebuildingleader.getDeptId());
+    }
+
     /**
      * 获取楼栋长管理详细信息
      */

+ 98 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutioncontroller/AppPatrolPlanController.java

@@ -0,0 +1,98 @@
+package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutioncontroller;
+
+import com.ruoyi.common.core.constant.HttpStatus;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.PageDomain;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.core.web.page.TableSupport;
+import com.ruoyi.common.security.utils.DictUtils;
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.domain.ComprehensivePatrolPlan;
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.service.RemotePatrolPlanService;
+import com.sooka.sponest.mobile.utils.DictUtil;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 巡查计划
+ *
+ * @author lidongyu
+ * @date 2023/9/14 10:16
+ */
+@RestController
+@RequestMapping("/AppPatrolPlanController")
+public class AppPatrolPlanController extends BaseController {
+
+    @Resource
+    RemotePatrolPlanService remotePatrolPlanService;
+
+    /**
+     * 查询巡查计划列表
+     */
+    @GetMapping("/comprehensivepatrolplan/list")
+    public AjaxResult list(ComprehensivePatrolPlan comprehensivepatrolplan) {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Integer pageNum = pageDomain.getPageNum();
+        Integer pageSize = pageDomain.getPageSize();
+        TableDataInfo tableDataInfo = remotePatrolPlanService.selectPatrolPlanList(pageNum, pageSize,comprehensivepatrolplan.getType(),comprehensivepatrolplan.getName());
+        if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            return AjaxResult.success(tableDataInfo.getRows());
+        }else{
+            return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
+        }
+    }
+
+    /**
+     * 获取巡查计划详细信息
+     */
+    @GetMapping("/comprehensivepatrolplan/edit")
+    public AjaxResult getInfo(String id) {
+        R<ComprehensivePatrolPlan> edit = remotePatrolPlanService.selectPatrolPlanById(id);
+        ComprehensivePatrolPlan data = edit.getData();
+        if (HttpStatus.SUCCESS == edit.getCode()){
+            data.setRankLabel(DictUtils.getDictDataByValue("forest_lin_level",data.getRank()));
+            data.setPeriodLabel(DictUtils.getDictDataByValue("centerdataplanning_cycle",data.getPeriod()));
+            data.setIsEdit(true);
+        }else if (HttpStatus.ERROR == edit.getCode() && null != edit.getData()) {
+            data.setIsEdit(false);
+        }else {
+            return AjaxResult.error(edit.getCode(), edit.getMsg());
+        }
+        return AjaxResult.success(data);
+    }
+
+    /**
+     * 新增巡查计划
+     */
+    @PostMapping("/comprehensivepatrolplan")
+    public AjaxResult add(@RequestBody String json) {
+        return remotePatrolPlanService.insertPatrolPlan(json);
+    }
+    /**
+     * 修改巡查计划
+     */
+    @PostMapping("/comprehensivepatrolplan/put")
+    public AjaxResult edit(@RequestBody String json) {
+        return remotePatrolPlanService.updatePatrolPlan(json);
+    }
+
+    /**
+     * 删除巡查计划
+     */
+    @GetMapping("/comprehensivepatrolplan/del")
+    public AjaxResult remove(@RequestParam("id") List<String> id) {
+        return remotePatrolPlanService.deletePatrolPlanByIds(id.toArray(new String[0]));
+    }
+
+    /**
+     * 查询计划下拉选
+     */
+    @GetMapping("/comprehensivepatrolplan/getPatrolPlanAll")
+    public AjaxResult getPatrolPlanAll(String type) {
+
+        return remotePatrolPlanService.getPatrolPlanAll(type);
+    }
+}

+ 92 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutioncontroller/AppPatrolTaskController.java

@@ -0,0 +1,92 @@
+package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutioncontroller;
+
+import com.ruoyi.common.core.constant.HttpStatus;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.PageDomain;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.core.web.page.TableSupport;
+import com.ruoyi.common.security.utils.DictUtils;
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.domain.ComprehensivePatrolTask;
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.service.RemotePatrolTaskService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 巡查任务
+ *
+ * @author lidongyu
+ * @date 2023/9/14 10:16
+ */
+@RestController
+@RequestMapping("/AppPatrolTaskController")
+public class AppPatrolTaskController extends BaseController {
+
+    @Resource
+    RemotePatrolTaskService remotePatrolTaskService;
+
+    /**
+     * 查询巡查任务列表
+     */
+    @GetMapping("/comprehensivepatroltask/list")
+    public AjaxResult list(ComprehensivePatrolTask comprehensivepatroltask) {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Integer pageNum = pageDomain.getPageNum();
+        Integer pageSize = pageDomain.getPageSize();
+        TableDataInfo tableDataInfo = remotePatrolTaskService.selectPatrolTaskList(pageNum, pageSize,comprehensivepatroltask.getType(),comprehensivepatroltask.getPlanName());
+        if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            return AjaxResult.success(tableDataInfo.getRows());
+        }else{
+            return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
+        }
+    }
+
+    /**
+     * 获取巡查任务详细信息
+     */
+    @GetMapping("/comprehensivepatroltask/edit")
+    public AjaxResult getInfo(String id) {
+        R<ComprehensivePatrolTask> edit = remotePatrolTaskService.selectPatrolTaskById(id);
+        ComprehensivePatrolTask data = edit.getData();
+        if(HttpStatus.SUCCESS == edit.getCode()){
+            data.setStatusLabel(DictUtils.getDictDataByValue("water_task_status",data.getStatus()));
+            return AjaxResult.success(data);
+        }else {
+            return AjaxResult.error(edit.getCode(), edit.getMsg());
+        }
+    }
+
+    /**
+     * 新增巡查任务
+     */
+    @PostMapping("/comprehensivepatroltask")
+    public AjaxResult add(@RequestBody String json) {
+        return remotePatrolTaskService.insertPatrolTask(json);
+    }
+    /**
+     * 修改巡查任务
+     */
+    @PostMapping("/comprehensivepatroltask/put")
+    public AjaxResult edit(@RequestBody String json) {
+        return remotePatrolTaskService.updatePatrolTask(json);
+    }
+
+    /**
+     * 删除巡查任务
+     */
+    @GetMapping("/comprehensivepatroltask/del")
+    public AjaxResult remove(@RequestParam("id") List<String> id) {
+        return remotePatrolTaskService.deletePatrolTaskByIds(id.toArray(new String[0]));
+    }
+
+    /**
+     * 查询巡查任务列表无分页
+     */
+    @GetMapping("/comprehensivepatroltask/getPatrolTaskAll")
+    public AjaxResult getPatrolTaskAll(String type) {
+        return remotePatrolTaskService.getPatrolTaskAll(type);
+    }
+}

+ 83 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutioncontroller/AppPatrolTrackController.java

@@ -0,0 +1,83 @@
+package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutioncontroller;
+
+import com.ruoyi.common.core.constant.HttpStatus;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.PageDomain;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.core.web.page.TableSupport;
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.domain.ComprehensivePatrolPlanRecord;
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.service.RemotePatrolTrackService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 巡查轨迹
+ *
+ * @author lidongyu
+ * @date 2023/9/14 10:16
+ */
+@RestController
+@RequestMapping("/AppPatrolTrackController")
+public class AppPatrolTrackController extends BaseController {
+
+    @Resource
+    RemotePatrolTrackService remotePatrolTrackService;
+
+    /**
+     * 查询巡查轨迹列表
+     */
+    @GetMapping("/comprehensivepatrolplanrecord/list")
+    public AjaxResult list(ComprehensivePatrolPlanRecord comprehensivepatrolplanrecord) {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Integer pageNum = pageDomain.getPageNum();
+        Integer pageSize = pageDomain.getPageSize();
+        TableDataInfo tableDataInfo = remotePatrolTrackService.selectPatrolPlanRecordList(pageNum, pageSize,comprehensivepatrolplanrecord.getType(),comprehensivepatrolplanrecord.getNickName(),comprehensivepatrolplanrecord.getTaskName());
+        if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            return AjaxResult.success(tableDataInfo.getRows());
+        }else{
+            return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
+        }
+    }
+
+    /**
+     * 获取巡查轨迹详细信息
+     */
+    @GetMapping("/comprehensivepatrolplanrecord/edit")
+    public AjaxResult getInfo(String id) {
+        R<ComprehensivePatrolPlanRecord> edit = remotePatrolTrackService.selectPatrolPlanRecordById(id);
+        ComprehensivePatrolPlanRecord data = edit.getData();
+        if(HttpStatus.SUCCESS == edit.getCode()){
+            return AjaxResult.success(data);
+        }else {
+            return AjaxResult.error(edit.getCode(), edit.getMsg());
+        }
+    }
+
+    /**
+     * 新增巡查轨迹
+     */
+    @PostMapping("/comprehensivepatrolplanrecord")
+    public AjaxResult add(@RequestBody String json) {
+        return remotePatrolTrackService.insertPatrolPlanRecord(json);
+    }
+    /**
+     * 修改巡查轨迹
+     */
+    @PostMapping("/comprehensivepatrolplanrecord/put")
+    public AjaxResult edit(@RequestBody String json) {
+        return remotePatrolTrackService.updatePatrolPlanRecord(json);
+    }
+
+    /**
+     * 删除巡查轨迹
+     */
+    @GetMapping("/comprehensivepatrolplanrecord/del")
+    public AjaxResult remove(@RequestParam("id") List<String> id) {
+        return remotePatrolTrackService.deletePatrolPlanRecordByIds(id.toArray(new String[0]));
+    }
+
+}