liusuyi
2024-08-08 57c673aa3e83677bcf5d30b4b45d06bae6609db8
ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java
@@ -4,8 +4,6 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam;
import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService;
@@ -22,9 +20,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -198,24 +193,26 @@
    @PostMapping("/wellList")
    @ApiOperation("查询权限下所有兴趣点")
    public Results wellList() {
        String usersId = SecurityUtils.getUserId();
        /*String usersId = SecurityUtils.getUserId();
        //根据userId查询部门Id
        SysUser sysUser = sysUserService.selectUserById(usersId);
        //根据当前deptId或者当前及所属下级的所有deptId
        List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());
        List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());*/
        List<Long> deptList = sysDeptService.selectDeptIdBySubAndUserId(SecurityUtils.getDeptId(),SecurityUtils.getUserId());
        //根据deptId获取对应兴趣点数据
        List<ArdAlarmpointsWell> list = ardAlarmpointsWellService.wellList(deptList);
        return Results.succeed(list);
    }
    @PostMapping("/conditionList")
    @ApiOperation("查询并筛选权限下所有兴趣点")
    @ApiOperation("查看部门下筛选条件的兴趣点")
    public Results conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam) {
        String usersId = SecurityUtils.getUserId();
        /*String usersId = SecurityUtils.getUserId();
        //根据userId查询部门Id
        SysUser sysUser = sysUserService.selectUserById(usersId);
        //根据当前deptId或者当前及所属下级的所有deptId
        List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());
        List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());*/
        List<Long> deptList = sysDeptService.selectDeptIdBySubAndUserId(SecurityUtils.getDeptId(),SecurityUtils.getUserId());
        ardAlarmpointsWellParam.setDeptList(deptList);
        //根据deptId获取对应兴趣点数据
        return Results.succeed(ardAlarmpointsWellService.conditionList(ardAlarmpointsWellParam));
@@ -248,7 +245,7 @@
        return AjaxResult.success(result);
    }
    @GetMapping("/getWellDataByPatrolplanIdAndPosition")
    @PostMapping("/getWellDataByPatrolplanIdAndPosition")
    @ApiOperation("查询最近巡检设备动静态属性")
    public AjaxResult getWellDataByPatrolplanIdAndPosition(@RequestBody Map<String,Object> para){
        SysConfig config = new SysConfig();
@@ -258,7 +255,7 @@
        return AjaxResult.success(result);
    }
    @GetMapping("/getWellById")
    @PostMapping("/getWellById")
    @ApiOperation("根据查询兴趣点基本属性")
    public AjaxResult getWellById(@RequestBody Map<String,String> para){
        ArdAlarmpointsWell result = ardAlarmpointsWellService.getWellById(para.get("id"));