From 57c673aa3e83677bcf5d30b4b45d06bae6609db8 Mon Sep 17 00:00:00 2001 From: liusuyi <1951119284@qq.com> Date: 星期四, 08 八月 2024 16:14:40 +0800 Subject: [PATCH] 优化:获取会话 --- ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java index 1ba431f..523ac98 100644 --- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java +++ b/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("鏌ヨ鏉冮檺涓嬫墍鏈夊叴瓒g偣") public Results wellList() { - String usersId = SecurityUtils.getUserId(); + /*String usersId = SecurityUtils.getUserId(); //鏍规嵁userId鏌ヨ閮ㄩ棬Id SysUser sysUser = sysUserService.selectUserById(usersId); //鏍规嵁褰撳墠deptId鎴栬�呭綋鍓嶅強鎵�灞炰笅绾х殑鎵�鏈塪eptId - 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("鏌ヨ骞剁瓫閫夋潈闄愪笅鎵�鏈夊叴瓒g偣") + @ApiOperation("鏌ョ湅閮ㄩ棬涓嬬瓫閫夋潯浠剁殑鍏磋叮鐐�") public Results conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam) { - String usersId = SecurityUtils.getUserId(); + /*String usersId = SecurityUtils.getUserId(); //鏍规嵁userId鏌ヨ閮ㄩ棬Id SysUser sysUser = sysUserService.selectUserById(usersId); //鏍规嵁褰撳墠deptId鎴栬�呭綋鍓嶅強鎵�灞炰笅绾х殑鎵�鏈塪eptId - 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(); @@ -257,4 +254,11 @@ Map<String,Object> result = ardAlarmpointsWellService.getWellDataByPatrolplanIdAndPosition(para,sysConfigResult); return AjaxResult.success(result); } + + @PostMapping("/getWellById") + @ApiOperation("鏍规嵁鏌ヨ鍏磋叮鐐瑰熀鏈睘鎬�") + public AjaxResult getWellById(@RequestBody Map<String,String> para){ + ArdAlarmpointsWell result = ardAlarmpointsWellService.getWellById(para.get("id")); + return AjaxResult.success(result); + } } -- Gitblit v1.9.3