完成首页基础信息查询

master
hqx 2024-02-07 10:48:28 +08:00
parent d58fc49be5
commit 8aefdef0ae
3 changed files with 46 additions and 2 deletions

View File

@ -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.ReservoirLevelVo;
import com.gunshi.project.xyt.entity.vo.StPptnVo; import com.gunshi.project.xyt.entity.vo.StPptnVo;
import com.gunshi.project.xyt.model.StRcvReal; 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.model.StResPersonRef;
import com.gunshi.project.xyt.service.*; import com.gunshi.project.xyt.service.*;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -37,6 +38,8 @@ public class HomePageController {
@Resource @Resource
private RainMonitoringService rainMonitoringService; private RainMonitoringService rainMonitoringService;
@Resource @Resource
private BasicInfoService basicInfoService;
@Resource
private StResPersonRefService stResPersonRefService; private StResPersonRefService stResPersonRefService;
@Resource @Resource
private WarningInfoService warningInfoService; private WarningInfoService warningInfoService;
@ -108,6 +111,11 @@ public class HomePageController {
return R.ok(rainMonitoringService.querySevenDayDrpByResId(resId)); return R.ok(rainMonitoringService.querySevenDayDrpByResId(resId));
} }
@Get(path = "/basicInfo/queryStResBasicInfo",summary = "根据水库ID查询水库基础信息")
public R<StResB> queryStResBasicInfoByResId(@Parameter(description = "水库ID") @RequestParam("resId") String resId){
return R.ok(basicInfoService.queryStResBasicInfoByResId(resId));
}
@Get(path = "/personInCharge/queryStResPersonRef",summary = "根据水库ID查询责任人信息") @Get(path = "/personInCharge/queryStResPersonRef",summary = "根据水库ID查询责任人信息")
public R<List<StResPersonRef>> queryStResPersonRefByResId(@Parameter(description = "水库ID") @RequestParam("resId") String resId){ public R<List<StResPersonRef>> queryStResPersonRefByResId(@Parameter(description = "水库ID") @RequestParam("resId") String resId){
return R.ok(stResPersonRefService.queryStResPersonRefByResId(resId)); return R.ok(stResPersonRefService.queryStResPersonRefByResId(resId));

View File

@ -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);
}
}

View File

@ -1,9 +1,7 @@
package com.gunshi.project.xyt.service; 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.mapper.StRcvRealMapper;
import com.gunshi.project.xyt.model.StRcvReal; import com.gunshi.project.xyt.model.StRcvReal;
import com.gunshi.project.xyt.model.StRcvRealAutoDao;
import com.gunshi.project.xyt.model.StStbprpBAutoDao; import com.gunshi.project.xyt.model.StStbprpBAutoDao;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;