Administrator
2023-08-21 53c50fadb458e7ed251eb942f865c06039fb5958
兴趣点管理
已添加1个文件
已修改3个文件
150 ■■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWellParam.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
    }
}