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;