修复洪水预报方案管理详情接口

master
cxw 2024-11-14 10:22:26 +08:00
parent 64cb394f1e
commit 67841fded3
1 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
@ -124,7 +126,7 @@ public class ForecastProjectController {
@Operation(summary = "根据方案id查看方案洪水预报结果")
@PostMapping("/getForecastProjectResults")
@GetMapping("/getForecastProjectResults")
public R<ForecastProject> getForecastProjectResults(@Schema(name = "projectId", description = "预测方案id") @RequestParam("projectId") String projectId) {
ForecastProject forecastProject = service.getById(projectId);
if (Objects.isNull(forecastProject)) {
@ -142,7 +144,9 @@ public class ForecastProjectController {
vo.setRealCkQValue(result.getRealCkQValue());
vo.setYcSwHValue(result.getYcSwHValue());
vo.setRealSwHValue(result.getRealSwHValue());
vo.setSwHDValue(result.getYcSwHValue().subtract(result.getRealSwHValue()));// 处理预测与实测水位差
BigDecimal ycSwHValue = result.getYcSwHValue() == null ? BigDecimal.ZERO : result.getYcSwHValue();
BigDecimal realSwHValue = result.getRealSwHValue() == null ? BigDecimal.ZERO : result.getRealSwHValue();
vo.setSwHDValue(ycSwHValue.subtract(realSwHValue));// 处理预测与实测水位差
vo.setDrp(result.getDrp());
vo.setIspreDrp(result.getIspreDrp());
vo.setR(result.getR());