Administrator
2023-08-05 bc8ca5f34b3c8f163bbfdda49a1b085aa8b4f019
ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
@@ -1,13 +1,20 @@
package com.ruoyi.app.patrolplan.controller;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpoint;
import com.ruoyi.app.patrolplan.service.IArdAppPatrolpointService;
import com.ruoyi.app.patrolplan.service.IArdAppPatroluserService;
import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -41,6 +48,12 @@
    @Autowired
    private IArdAppPatrolplanService ardAppPatrolplanService;
    @Resource
    IArdAppPatrolpointService ardAppPatrolpointService;
    @Resource
    IArdAppPatroluserService ardAppPatroluserService;
    /**
     * 查询app巡检计划列表
     */
@@ -69,14 +82,41 @@
    }
    /**
     * 获取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);
    }
    /**
     * 根据巡检ID查询巡检人
     */
    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:userByPlanId')")
    @GetMapping(value = "userByPlanId/{id}")
    @ApiOperation("根据巡检ID查询巡检人")
    public Results userByPlanId(@PathVariable String id)
    {
        return ardAppPatroluserService.userByPlanId(id);
    }
    /**
     * 删除app巡检计划
     */
    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:remove')")
    @Log(title = "app巡检计划", businessType = BusinessType.DELETE)
    @DeleteMapping("/{id}")
    @ApiOperation("删除app巡检计划")
    //public Results remove(@PathVariable String id)
    public AjaxResult remove(@PathVariable String id)
    {
        //return ardAppPatrolplanService.deleteArdApp(id);
        return toAjax(ardAppPatrolplanService.deleteArdApp(id));
    }
    /**
     * 新增app巡检计划
@@ -101,13 +141,14 @@
    }
    /**
     * 删除app巡检计划
     * 新增app巡检计划及人员点位
     */
    @PreAuthorize("@ss.hasPermi('app:appPatrolplan:remove')")
    @Log(title = "app巡检计划", businessType = BusinessType.DELETE)
   @DeleteMapping("/{patroEndTimes}")
    public AjaxResult remove(@PathVariable String[] patroEndTimes)
    @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.deleteArdAppPatrolplanByPatroEndTimes(patroEndTimes));
        return toAjax(ardAppPatrolplanService.insertArdAppPatrolplan(para));
    }
}