预测来水量
parent
a8f38885f1
commit
0653c3ad63
|
|
@ -94,4 +94,10 @@ public class GateValveRealController {
|
|||
public R<Map<BigDecimal, String>> supplyTime(@RequestParam(value = "year",required = false) @Parameter(description = "年份") Integer year,@RequestParam(value = "month",required = false) @Parameter(description = "月份") Integer month) {
|
||||
return R.ok(service.supplyTime(year,month));
|
||||
}
|
||||
|
||||
@Operation(summary = "预测来水量")
|
||||
@GetMapping("/predict/water")
|
||||
public R<BigDecimal> predictWater(@RequestParam(value = "year") @Parameter(description = "年份") Integer year, @RequestParam(value = "month") @Parameter(description = "月份") Integer month) {
|
||||
return R.ok(service.predictWater(year,month));
|
||||
}
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ public class GateValveRealService extends ServiceImpl<GateValveRealMapper, GateV
|
|||
}
|
||||
AttResBaseVo attResBaseVo = list.get(0);
|
||||
BigDecimal nowCap = attResBaseVo.getNowCap() == null ? new BigDecimal(0) : attResBaseVo.getNowCap();
|
||||
BigDecimal deadCap = attResBaseVo.getDeadCap();
|
||||
BigDecimal deadCap = attResBaseVo.getDeadCap() == null ? new BigDecimal(0) : attResBaseVo.getDeadCap();
|
||||
|
||||
BigDecimal supplyV = nowCap.subtract(deadCap);
|
||||
if(year != null){
|
||||
|
|
@ -170,6 +170,13 @@ public class GateValveRealService extends ServiceImpl<GateValveRealMapper, GateV
|
|||
return sum.multiply(watShedArea);
|
||||
}
|
||||
|
||||
public BigDecimal predictWater(Integer year, Integer month) {
|
||||
List<AttResBaseVo> list = reservoirWaterService.list();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
return calcPredictV(year,month,list.get(0).getWatShedArea());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue