From 53c50fadb458e7ed251eb942f865c06039fb5958 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期一, 21 八月 2023 17:17:45 +0800
Subject: [PATCH] 兴趣点管理
---
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java | 7 ++
ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWellParam.java | 62 ++++++++++++++++++++
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java | 32 ++++++++++
ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdAlarmpointsWellController.java | 49 ++++++++++++++++
4 files changed, 150 insertions(+), 0 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 42a3bad..d905b4c 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,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("鏌ヨ鏉冮檺涓嬫墍鏈夊叴瓒g偣")
+ public Results wellList(){
+ String usersId = SecurityUtils.getUserId();
+ //鏍规嵁userId鏌ヨ閮ㄩ棬Id
+ SysUser sysUser = sysUserService.selectUserById(usersId);
+ //鏍规嵁褰撳墠deptId鎴栬�呭綋鍓嶅強鎵�灞炰笅绾х殑鎵�鏈塪eptId
+ List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());
+ //鏍规嵁deptId鑾峰彇瀵瑰簲鍏磋叮鐐规暟鎹�
+ List<ArdAlarmpointsWell> list = ardAlarmpointsWellService.wellList(deptList);
+ return Results.succeed(list);
+ }
+
+ @PostMapping("/conditionList")
+ @ApiOperation("鏌ヨ骞剁瓫閫夋潈闄愪笅鎵�鏈夊叴瓒g偣")
+ public Results conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam){
+ String usersId = SecurityUtils.getUserId();
+ //鏍规嵁userId鏌ヨ閮ㄩ棬Id
+ SysUser sysUser = sysUserService.selectUserById(usersId);
+ //鏍规嵁褰撳墠deptId鎴栬�呭綋鍓嶅強鎵�灞炰笅绾х殑鎵�鏈塪eptId
+ List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());
+ ardAlarmpointsWellParam.setDeptList(deptList);
+ //鏍规嵁deptId鑾峰彇瀵瑰簲鍏磋叮鐐规暟鎹�
+ List<ArdAlarmpointsWell> list = ardAlarmpointsWellService.conditionList(ardAlarmpointsWellParam);
+ return Results.succeed(list);
+ }
+
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWellParam.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWellParam.java
new file mode 100644
index 0000000..c99f93b
--- /dev/null
+++ b/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;
+
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java
index 7651383..0f3e536 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java
+++ b/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;
/**
* 浜曠鐞哠ervice鎺ュ彛
@@ -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);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
index e89ccca..ca3d09d 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
+++ b/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);
+ }
}
--
Gitblit v1.9.3