diff --git a/src/main/java/com/gunshi/project/hsz/controller/ReservoirWaterController.java b/src/main/java/com/gunshi/project/hsz/controller/ReservoirWaterController.java index 5011da0..1ca42d1 100644 --- a/src/main/java/com/gunshi/project/hsz/controller/ReservoirWaterController.java +++ b/src/main/java/com/gunshi/project/hsz/controller/ReservoirWaterController.java @@ -82,6 +82,11 @@ public class ReservoirWaterController { return R.ok(reservoirWaterService.listV2()); } + @Post(path = "/listV22", summary = "供水能力分析-水库水情列表") + public R> listV22() { + return R.ok(reservoirWaterService.listV22()); + } + @Get(path = "/image/channel", summary = "图像监测视角下拉") public R> channel(@Schema(name = "resCode") @RequestParam("resCode") String resCode) { return R.ok(reservoirWaterService.channel(resCode)); diff --git a/src/main/java/com/gunshi/project/hsz/controller/StWaterRRealController.java b/src/main/java/com/gunshi/project/hsz/controller/StWaterRRealController.java index 0ec8f33..2098cd1 100644 --- a/src/main/java/com/gunshi/project/hsz/controller/StWaterRRealController.java +++ b/src/main/java/com/gunshi/project/hsz/controller/StWaterRRealController.java @@ -2,6 +2,7 @@ package com.gunshi.project.hsz.controller; import java.io.Serializable; import java.util.Calendar; +import java.util.Date; import java.util.List; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/gunshi/project/hsz/entity/vo/StStatusVo.java b/src/main/java/com/gunshi/project/hsz/entity/vo/StStatusVo.java index 0150dc0..43b115a 100644 --- a/src/main/java/com/gunshi/project/hsz/entity/vo/StStatusVo.java +++ b/src/main/java/com/gunshi/project/hsz/entity/vo/StStatusVo.java @@ -1,8 +1,11 @@ package com.gunshi.project.hsz.entity.vo; +import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.math.BigDecimal; + @Data public class StStatusVo { diff --git a/src/main/java/com/gunshi/project/hsz/model/RiskControlInfo.java b/src/main/java/com/gunshi/project/hsz/model/RiskControlInfo.java index 5e25996..98bd338 100644 --- a/src/main/java/com/gunshi/project/hsz/model/RiskControlInfo.java +++ b/src/main/java/com/gunshi/project/hsz/model/RiskControlInfo.java @@ -105,4 +105,7 @@ public class RiskControlInfo implements Serializable { @Schema(description = "现场图片") private List files; + @TableField("possible_result") + private String possibleResult; + } \ No newline at end of file diff --git a/src/main/java/com/gunshi/project/hsz/model/StWaterRReal.java b/src/main/java/com/gunshi/project/hsz/model/StWaterRReal.java index 9eba77c..02fa9ef 100644 --- a/src/main/java/com/gunshi/project/hsz/model/StWaterRReal.java +++ b/src/main/java/com/gunshi/project/hsz/model/StWaterRReal.java @@ -79,4 +79,10 @@ public class StWaterRReal implements Serializable { @TableField(exist = false) private ResMonthEcoFlow resMonthEcoFlow; + + @TableField(exist = false) + private BigDecimal lgtd; + + @TableField(exist = false) + private BigDecimal lttd; } diff --git a/src/main/java/com/gunshi/project/hsz/service/GateValveRealService.java b/src/main/java/com/gunshi/project/hsz/service/GateValveRealService.java index 8af06b4..89295cf 100644 --- a/src/main/java/com/gunshi/project/hsz/service/GateValveRealService.java +++ b/src/main/java/com/gunshi/project/hsz/service/GateValveRealService.java @@ -156,6 +156,17 @@ public class GateValveRealService extends ServiceImpl irrQw1 = new QueryWrapper<>(); + irrQw1.eq("stcd", stcd1).orderBy(true, false, "tm"); + StWaterRReal stWaterRReal1 = stWaterRRealService.getOne(irrQw1); + if(stWaterRReal1 != null){ + totalSum = totalSum.add(stWaterRReal1.getQ()); + } + String stcd2 = "1113"; + QueryWrapper irrQw2 = new QueryWrapper<>(); + irrQw2.eq("stcd", stcd2).orderBy(true, false, "tm"); + StWaterRReal stWaterRReal2 = stWaterRRealService.getOne(irrQw2); + if(stWaterRReal2 != null){ + totalSum = totalSum.add(stWaterRReal2.getQ()); + } + for (AttResBaseVo attResBaseVo : voList) { + //设置灌溉流量 + attResBaseVo.setIrrigationFlowSum(totalSum); + //设置灌溉流量时间 + if(stWaterRReal1 != null){ + attResBaseVo.setIrrigationFlowTm(stWaterRReal1.getTm()); + }else if(stWaterRReal2 != null){ + attResBaseVo.setIrrigationFlowTm(stWaterRReal2.getTm()); + } + } + //获取新建生态供水流量站最新得流量 + String ecologyStcd = "1114"; + QueryWrapper ecologyQw = new QueryWrapper<>(); + ecologyQw.eq("stcd", ecologyStcd).orderBy(true, false, "tm"); + StWaterRReal ecologyWaterRReal = stWaterRRealService.getOne(ecologyQw); + if(ecologyWaterRReal != null){ + voList.stream().forEach(o -> { + o.setEcologyFlow(ecologyWaterRReal.getQ()); + o.setEcologyFlowTm(ecologyWaterRReal.getTm()); + }); + } + return voList; + } + + + public List listV22() { + List voList = attResBaseMapper.queryListV2(); + if(CollectionUtils.isEmpty(voList)){ + return voList; + } + + List zvarlList = stZvarlBService.list(); + zvarlList.sort(Comparator.comparing(StZvarlB::getRz)); + voList.forEach(vo -> { + if(vo.getCalState() == 1){ + vo.setDesState(0); + vo.setFlState(0); + }else if(vo.getCalState() == 0 && vo.getDesState() ==1){ + vo.setFlState(0); + } + BigDecimal rz = vo.getRz(); + if (rz != null) { + //BigDecimal w = stZvarlBService.getWFromZvarl(rz, null, zvarlList); + BigDecimal w = stZvarlBService.getWByZvarl(zvarlList,rz); + vo.setNowCap(w); + } }); //TODO 计算2个灌溉站的流量之和 @@ -381,4 +458,6 @@ public class ReservoirWaterService { List voList = attResBaseMapper.queryYhd(stcd); return voList; } + + } diff --git a/src/main/java/com/gunshi/project/hsz/service/RiskControlInfoService.java b/src/main/java/com/gunshi/project/hsz/service/RiskControlInfoService.java index 12cf4b1..1ca12b0 100644 --- a/src/main/java/com/gunshi/project/hsz/service/RiskControlInfoService.java +++ b/src/main/java/com/gunshi/project/hsz/service/RiskControlInfoService.java @@ -43,7 +43,7 @@ public class RiskControlInfoService extends ServiceImpl res = this.page(page.getPageSo().toPage(), query); if (res.getRecords() != null && res.getRecords().size() > 0) { fillAttach(res.getRecords()); - fillRel(res.getRecords()); +// fillRel(res.getRecords()); } return res; } diff --git a/src/main/java/com/gunshi/project/hsz/service/RiverWaterService.java b/src/main/java/com/gunshi/project/hsz/service/RiverWaterService.java index a4c4d18..340a608 100644 --- a/src/main/java/com/gunshi/project/hsz/service/RiverWaterService.java +++ b/src/main/java/com/gunshi/project/hsz/service/RiverWaterService.java @@ -66,6 +66,17 @@ public class RiverWaterService { if(CollectionUtils.isEmpty(attRvBaseVos)){ return attRvBaseVos; } + for (AttRvBaseVo attRvBaseVo : attRvBaseVos) { + Date tm = attRvBaseVo.getTm(); + Calendar now = Calendar.getInstance(); + now.set(Calendar.MINUTE, 0); + now.set(Calendar.SECOND, 0); + now.set(Calendar.MILLISECOND, 0); + Date currentDate = now.getTime(); + if(tm.before(currentDate)){ + attRvBaseVo.setZ(null); + } + } return attRvBaseVos; } diff --git a/src/main/java/com/gunshi/project/hsz/service/StQxWarnRService.java b/src/main/java/com/gunshi/project/hsz/service/StQxWarnRService.java index aabb5c8..7f6808f 100644 --- a/src/main/java/com/gunshi/project/hsz/service/StQxWarnRService.java +++ b/src/main/java/com/gunshi/project/hsz/service/StQxWarnRService.java @@ -117,7 +117,7 @@ public class StQxWarnRService extends ServiceImpl { .count(); vo.setAiWarnCount(aiWarnCount); //TODO 超河道上游 - String upperStcd = "123";//固定的站点编码 + String upperStcd = "999999999";//固定的站点编码 setUpAndDownOverRvUp(upperStcd,vo,dateTimeRangeSo); //TODO 超河道下游 diff --git a/src/main/java/com/gunshi/project/hsz/service/StWaterRRealService.java b/src/main/java/com/gunshi/project/hsz/service/StWaterRRealService.java index 3d8872b..aeedc50 100644 --- a/src/main/java/com/gunshi/project/hsz/service/StWaterRRealService.java +++ b/src/main/java/com/gunshi/project/hsz/service/StWaterRRealService.java @@ -1,5 +1,7 @@ package com.gunshi.project.hsz.service; +import java.util.Calendar; +import java.util.Date; import java.util.List; import org.springframework.stereotype.Service; @@ -23,7 +25,24 @@ public class StWaterRRealService extends ServiceImpl listRelated() { - return baseMapper.listRelated(); + List stWaterRReals = baseMapper.listRelated(); + if(stWaterRReals != null && stWaterRReals.size() > 0){ + for (StWaterRReal vo : stWaterRReals) { + Date tm = vo.getTm(); + if(tm != null){ + Calendar now = Calendar.getInstance(); + now.set(Calendar.MINUTE, 0); + now.set(Calendar.SECOND, 0); + now.set(Calendar.MILLISECOND, 0); + Date currentDate = now.getTime(); + if(tm.before(currentDate)){ + vo.setQ(null); + vo.setV(null); + } + } + } + } + return stWaterRReals; } public List listNewData() { diff --git a/src/main/resources/mapper/StWaterRRealMapper.xml b/src/main/resources/mapper/StWaterRRealMapper.xml index c53b2ae..ca6bacd 100644 --- a/src/main/resources/mapper/StWaterRRealMapper.xml +++ b/src/main/resources/mapper/StWaterRRealMapper.xml @@ -7,6 +7,8 @@ stb.stcd, stb.sttp, stb.stnm, + stb.lgtd, + stb.lttd, t.tm, t.q, t.v