From 8aefdef0ae78ca65b704e941c4b5aa593e893324 Mon Sep 17 00:00:00 2001 From: hqx <3376194473@qq.com> Date: Wed, 7 Feb 2024 10:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=A6=96=E9=A1=B5=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xyt/controller/HomePageController.java | 8 ++++ .../project/xyt/service/BasicInfoService.java | 38 +++++++++++++++++++ .../MonitorEquipmentHealthService.java | 2 - 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/gunshi/project/xyt/service/BasicInfoService.java diff --git a/src/main/java/com/gunshi/project/xyt/controller/HomePageController.java b/src/main/java/com/gunshi/project/xyt/controller/HomePageController.java index a50906c..ec2b0ce 100644 --- a/src/main/java/com/gunshi/project/xyt/controller/HomePageController.java +++ b/src/main/java/com/gunshi/project/xyt/controller/HomePageController.java @@ -5,6 +5,7 @@ import com.gunshi.core.result.R; import com.gunshi.project.xyt.entity.vo.ReservoirLevelVo; import com.gunshi.project.xyt.entity.vo.StPptnVo; import com.gunshi.project.xyt.model.StRcvReal; +import com.gunshi.project.xyt.model.StResB; import com.gunshi.project.xyt.model.StResPersonRef; import com.gunshi.project.xyt.service.*; import io.swagger.v3.oas.annotations.Parameter; @@ -37,6 +38,8 @@ public class HomePageController { @Resource private RainMonitoringService rainMonitoringService; @Resource + private BasicInfoService basicInfoService; + @Resource private StResPersonRefService stResPersonRefService; @Resource private WarningInfoService warningInfoService; @@ -108,6 +111,11 @@ public class HomePageController { return R.ok(rainMonitoringService.querySevenDayDrpByResId(resId)); } + @Get(path = "/basicInfo/queryStResBasicInfo",summary = "根据水库ID查询水库基础信息") + public R queryStResBasicInfoByResId(@Parameter(description = "水库ID") @RequestParam("resId") String resId){ + return R.ok(basicInfoService.queryStResBasicInfoByResId(resId)); + } + @Get(path = "/personInCharge/queryStResPersonRef",summary = "根据水库ID查询责任人信息") public R> queryStResPersonRefByResId(@Parameter(description = "水库ID") @RequestParam("resId") String resId){ return R.ok(stResPersonRefService.queryStResPersonRefByResId(resId)); diff --git a/src/main/java/com/gunshi/project/xyt/service/BasicInfoService.java b/src/main/java/com/gunshi/project/xyt/service/BasicInfoService.java new file mode 100644 index 0000000..32e260f --- /dev/null +++ b/src/main/java/com/gunshi/project/xyt/service/BasicInfoService.java @@ -0,0 +1,38 @@ +package com.gunshi.project.xyt.service; + +import com.gunshi.project.xyt.model.StResB; +import com.gunshi.project.xyt.model.StResBAutoDao; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * TODO + * + * @ClassName BasicInfoService + * @Author Huang Qianxiang + * @Date 2024/2/7 9:44 + */ +@Service +@Slf4j +public class BasicInfoService { + + @Resource + private StResBAutoDao stResBAutoDao; + + /** + * 根据水库ID查询水库基础信息 + * @param resId 水库ID + * @return + */ + public StResB queryStResBasicInfoByResId(String resId){ + StResB stResB = stResBAutoDao.getById(resId); + if (stResB == null){ + throw new IllegalArgumentException("该水库ID不存在"); + } + return stResBAutoDao.getById(resId); + } + + + +} diff --git a/src/main/java/com/gunshi/project/xyt/service/MonitorEquipmentHealthService.java b/src/main/java/com/gunshi/project/xyt/service/MonitorEquipmentHealthService.java index ae721ed..7f89ca2 100644 --- a/src/main/java/com/gunshi/project/xyt/service/MonitorEquipmentHealthService.java +++ b/src/main/java/com/gunshi/project/xyt/service/MonitorEquipmentHealthService.java @@ -1,9 +1,7 @@ package com.gunshi.project.xyt.service; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.gunshi.project.xyt.mapper.StRcvRealMapper; import com.gunshi.project.xyt.model.StRcvReal; -import com.gunshi.project.xyt.model.StRcvRealAutoDao; import com.gunshi.project.xyt.model.StStbprpBAutoDao; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j;