ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java
@@ -4,11 +4,19 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam; import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.poi.ExcelUtil; 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.beans.factory.annotation.Autowired; import org.springframework.dao.DuplicateKeyException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -45,6 +53,12 @@ public class ArdAlarmpointsWellController extends BaseController { @Resource private IArdAlarmpointsWellService ardAlarmpointsWellService; @Autowired private ISysUserService sysUserService; @Autowired private ISysDeptService sysDeptService; /** * æ¥è¯¢äºç®¡çå表 @@ -165,4 +179,39 @@ } return options; } @GetMapping("/wellById/{id}") @ApiOperation("æ¥è¯¢åæ¡å ´è¶£ç¹") public Results wellById(@PathVariable String id) { return Results.succeed(ardAlarmpointsWellService.wellById(id)); } @PostMapping("/wellList") @ApiOperation("æ¥è¯¢æé䏿æå ´è¶£ç¹") public Results wellList(){ String usersId = SecurityUtils.getUserId(); //æ ¹æ®userIdæ¥è¯¢é¨é¨Id SysUser sysUser = sysUserService.selectUserById(usersId); //æ ¹æ®å½ådeptIdæè å½ååæå±ä¸çº§çæædeptId List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId()); //æ ¹æ®deptIdè·å对åºå ´è¶£ç¹æ°æ® List<ArdAlarmpointsWell> list = ardAlarmpointsWellService.wellList(deptList); return Results.succeed(list); } @PostMapping("/conditionList") @ApiOperation("æ¥è¯¢å¹¶çéæé䏿æå ´è¶£ç¹") public Results conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam){ String usersId = SecurityUtils.getUserId(); //æ ¹æ®userIdæ¥è¯¢é¨é¨Id SysUser sysUser = sysUserService.selectUserById(usersId); //æ ¹æ®å½ådeptIdæè å½ååæå±ä¸çº§çæædeptId List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId()); ardAlarmpointsWellParam.setDeptList(deptList); //æ ¹æ®deptIdè·å对åºå ´è¶£ç¹æ°æ® List<ArdAlarmpointsWell> list = ardAlarmpointsWellService.conditionList(ardAlarmpointsWellParam); return Results.succeed(list); } } ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWellParam.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,62 @@ package com.ruoyi.alarmpoints.well.domain; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import lombok.Data; import java.util.Date; import java.util.List; /** * äºç®¡ç对象 ard_alarmpoints_well * * @author åèä¹ * @date 2023-03-07 */ @Data public class ArdAlarmpointsWellParam { private static final long serialVersionUID = 1L; /** äºå· */ private String wellId; /** äºå·ç¼ç */ private String wellNumber; /** éæ²¹æ¹å¼ */ private String oilProduction; /** è¿æå±åºå */ private String wellBlock; /** é©±æ¿æ¹å¼ */ private String displacementMode; /** å¨è¾¹ç¯å¢ */ private String surroundingEnvironment; /** æ²¹äºç±»å */ private String wellType; /** è£ è½½è´è· */ private String installedLoad; /** æå±è®¡éç«æéç»åç§° */ private String meteringStation; /** æå±è½¬æ¥ç« */ private String transferStation; /** æå±è±æ°´ç« */ private String dehydrationStation; /** è¿è¡ç¶æ */ private String runStatus; @TableField(exist = false) private List<Long> deptList; } ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java
@@ -3,6 +3,7 @@ import java.util.List; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam; /** * äºç®¡çServiceæ¥å£ @@ -97,4 +98,10 @@ public void checkWellAllowed(ArdAlarmpointsWell well); List<ArdAlarmpointsWell> wellByDeptList(List<Long> deptList); ArdAlarmpointsWell wellById(String id); List<ArdAlarmpointsWell> wellList(List<Long> deptList); List<ArdAlarmpointsWell> conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam); } ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam; import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper; import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService; import com.ruoyi.common.annotation.DataScope; @@ -235,4 +236,35 @@ queryWrapper.in("dept_id",deptList); return ardAlarmpointsWellMapper.selectList(queryWrapper); } @Override public ArdAlarmpointsWell wellById(String id) { return ardAlarmpointsWellMapper.selectById(id); } @Override public List<ArdAlarmpointsWell> wellList(List<Long> deptList) { QueryWrapper<ArdAlarmpointsWell> queryWrapper = new QueryWrapper<>(); queryWrapper.in("dept_id",deptList); return ardAlarmpointsWellMapper.selectList(queryWrapper); } @Override public List<ArdAlarmpointsWell> conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam){ QueryWrapper<ArdAlarmpointsWell> queryWrapper = new QueryWrapper<>(); queryWrapper.in("dept_id",ardAlarmpointsWellParam.getDeptList()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellId()),"well_id",ardAlarmpointsWellParam.getWellId()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellNumber()),"well_number",ardAlarmpointsWellParam.getWellNumber()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getOilProduction()),"oil_production",ardAlarmpointsWellParam.getOilProduction()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellBlock()),"well_block",ardAlarmpointsWellParam.getWellBlock()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getDisplacementMode()),"displacement_mode",ardAlarmpointsWellParam.getDisplacementMode()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getSurroundingEnvironment()),"surrounding_environment",ardAlarmpointsWellParam.getSurroundingEnvironment()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellType()),"well_type",ardAlarmpointsWellParam.getWellType()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getInstalledLoad()),"installed_load",ardAlarmpointsWellParam.getInstalledLoad()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getMeteringStation()),"metering_station",ardAlarmpointsWellParam.getMeteringStation()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getTransferStation()),"transfer_station",ardAlarmpointsWellParam.getTransferStation()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getDehydrationStation()),"dehydration_station",ardAlarmpointsWellParam.getDehydrationStation()) .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getRunStatus()),"run_status",ardAlarmpointsWellParam.getRunStatus()); return ardAlarmpointsWellMapper.selectList(queryWrapper); } }