1:大屏-管理全周期

2:大屏-管控全天候
3:大屏-健全机制
master
yangzhe123 2026-01-29 13:49:41 +08:00
parent 7153841cf1
commit 17fa0dd348
12 changed files with 438 additions and 1 deletions

View File

@ -0,0 +1,28 @@
package com.gunshi.project.ss.controller;
import com.gunshi.core.result.R;
import com.gunshi.project.ss.entity.vo.ScreenEquipmentVo;
import com.gunshi.project.ss.service.ScreenMechanismsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "大屏-健全机制")
@RestController
@RequestMapping(value="/screen/mechanisms")
public class ScreenMechanismsController {
@Autowired
private ScreenMechanismsService screenMechanismsService;
@GetMapping("/equipment")
public R<ScreenEquipmentVo> getScreenEquipment(){
ScreenEquipmentVo res = screenMechanismsService.getScreenEquipment();
return R.ok(res);
}
}

View File

@ -0,0 +1,30 @@
package com.gunshi.project.ss.controller;
import com.gunshi.core.result.R;
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
import com.gunshi.project.ss.service.ScreenMoniotrService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "大屏-管控全天候")
@RestController
@RequestMapping(value="/screen/monitoring")
public class ScreenMoniotrController {
@Autowired
private ScreenMoniotrService screenMoniotrService;
//水库水情
@GetMapping("/rsvr")
public R<List<ScreenRsvrVo>> getScreenRsvr(){
List<ScreenRsvrVo> res = screenMoniotrService.getScreenRsvr();
return R.ok(res);
}
}

View File

@ -0,0 +1,31 @@
package com.gunshi.project.ss.controller;
import com.gunshi.core.result.R;
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
import com.gunshi.project.ss.service.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/wholeCycle")
@Tag(name = "管理全周期")
public class WholeCycleController {
@Autowired
private WholeCycleService wholeCycleService;
@Operation(description = "大屏-获取数据")
@GetMapping("/get")
public R<WholeCycleVo> get(){
WholeCycleVo res = wholeCycleService.get();
return R.ok(res);
}
}

View File

@ -0,0 +1,30 @@
package com.gunshi.project.ss.entity.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.bouncycastle.cert.dane.DANEEntry;
import java.math.BigDecimal;
@Data
public class ScreenEquipmentVo {
@Schema(description = "管理用房")
private String managementHousing;
@Schema(description = "雨水情测报")
private Long rainWaterCount;
@Schema(description = "安全监测设施")
private Long safeCheckCount;
@Schema(description = "视频监控设施")
private Long cctvCount;
@Schema(description = "防汛物质种类数量")
private Long goodsTypeCount;
@Schema(description = "防汛道路-防汛路长度(m)")
private BigDecimal roadLength;
}

View File

@ -0,0 +1,37 @@
package com.gunshi.project.ss.entity.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ScreenRsvrVo {
//站点编码
private String stcd;
//站点名称
private String stnm;
private BigDecimal lttd;
private BigDecimal lgtd;
//当前水位
private BigDecimal rz;
//汛限水位
private BigDecimal flLowLimLev;
//距汛限
private BigDecimal gapFlLowLimLev;
//当前库容
private BigDecimal nowCap;
//有效库容
private BigDecimal effectiveCap;
}

View File

@ -0,0 +1,52 @@
package com.gunshi.project.ss.entity.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gunshi.core.dateformat.DateFormatString;
import com.gunshi.project.ss.common.validate.markers.Insert;
import com.gunshi.project.ss.common.validate.markers.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.Date;
@Data
public class WholeCycleVo {
/**
*
*/
@Schema(description="大坝安全评定类别(一类坝 二类坝 三类坝)")
private String identifyType;
/**
* 1:
*/
@Schema(description="是否病险 是 否")
// @Size(max = 0,message = "是否病险 1:病 最大长度要小于 0")
private String isDanger;
@Schema(description="开工日期")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
private Date startDate;
@Schema(description = "实施措施:降等 报废")
@NotNull(message = "实施措施不能为空", groups = {Insert.class, Update.class})
private String implementationMeasure;
@Schema(description="调度规程")
// @Size(max = 0,message = "批复时间最大长度要小于 0")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
private Date dispatchTime;
@Schema(description="应急预案")
// @Size(max = 0,message = "批复时间最大长度要小于 0")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
private Date emergencyTime;
}

View File

@ -39,4 +39,10 @@ public interface RescueGoodsMapper extends BaseMapper<RescueGoodsB> {
""")
List<FileDescriptor> detail(@Param("goodsId") Long goodsId);
@Select("""
select count(DISTINCT goods_type) from rescue_goods_b
""")
Long queryTypeCount();
}

View File

@ -94,4 +94,8 @@ public class RescueGoodsService
public List<FileDescriptor> detail(Long goodsId) {
return rescueGoodsMapper.detail(goodsId);
}
public Long queryTypeCount() {
return rescueGoodsMapper.queryTypeCount();
}
}

View File

@ -137,7 +137,7 @@ public class ReservoirWaterService {
BigDecimal rz = vo.getRz();
if (rz != null) {
//BigDecimal w = stZvarlBService.getWFromZvarl(rz, null, zvarlList);
BigDecimal w = stZvarlBService.getWByZvarl(zvarlList,rz);
BigDecimal w = stZvarlBService.getWByZvarl(zvarlList,rz);
vo.setNowCap(w);
}
Date tm = vo.getTm();

View File

@ -0,0 +1,73 @@
package com.gunshi.project.ss.service;
import com.gunshi.project.ss.entity.vo.ScreenEquipmentVo;
import com.gunshi.project.ss.model.AttResBase;
import com.gunshi.project.ss.model.AttResBuilding;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class ScreenMechanismsService {
@Autowired
private AttResBuildingService attResBuildingService;
@Autowired
private AttResBaseService attResBaseService;
@Autowired
private StStbprpBElemService stStbprpBElemService;
@Autowired
private JcskSyBService jcskSyBService;
@Autowired
private JcskSlBService jcskSlBService;
@Autowired
private JcskGnssBService jcskGnssBService;
@Autowired
private AttCctvBaseService attCctvBaseService;
@Autowired
private RescueGoodsService rescueGoodsService;
public ScreenEquipmentVo getScreenEquipment() {
ScreenEquipmentVo res = new ScreenEquipmentVo();
//管理用房
AttResBase one = attResBaseService.lambdaQuery().one();
if(one != null){
res.setManagementHousing(one.getManagementHousing());
}
//雨晴、水情、流量站总数量
Long count = stStbprpBElemService.lambdaQuery().count();
res.setRainWaterCount(count);
//安全监测设备
Long jcskSyCount = jcskSyBService.lambdaQuery().count();
Long jcskSlCount = jcskSlBService.lambdaQuery().count();
Long jcskGnssCount = jcskGnssBService.lambdaQuery().count();
res.setSafeCheckCount(jcskSyCount + jcskSlCount + jcskGnssCount);
//视频监控设施
Long attCctvCount = attCctvBaseService.lambdaQuery().count();
res.setCctvCount(attCctvCount);
//防汛物质总类
Long goodsTypeCount = rescueGoodsService.queryTypeCount();
res.setGoodsTypeCount(goodsTypeCount);
//防汛道路
AttResBuilding attResBuilding = attResBuildingService.lambdaQuery().one();
if(attResBuilding != null){
res.setRoadLength(attResBuilding.getRoadLength());
}
return res;
}
}

View File

@ -0,0 +1,56 @@
package com.gunshi.project.ss.service;
import com.gunshi.project.ss.common.model.StStbprpB;
import com.gunshi.project.ss.entity.vo.AttResBaseVo;
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Service
@Slf4j
public class ScreenMoniotrService {
@Autowired
private StStbprpBService stStbprpBService;
@Autowired
private AttResBaseService attResBaseService;
@Autowired
private ReservoirWaterService reservoirWaterService;
public List<ScreenRsvrVo> getScreenRsvr() {
//查询所有的水库水情站点
List<ScreenRsvrVo> res = new ArrayList<>();
List<AttResBaseVo> attResBaseVos = reservoirWaterService.listV2();
for (AttResBaseVo rsvrStation : attResBaseVos) {
ScreenRsvrVo entity = new ScreenRsvrVo();
entity.setStcd(rsvrStation.getStcd());
entity.setStnm(rsvrStation.getStnm());
entity.setLgtd(rsvrStation.getLgtd());
entity.setLttd(rsvrStation.getLttd());
BigDecimal rz = rsvrStation.getRz();
entity.setRz(rz);
BigDecimal nowCap = rsvrStation.getNowCap();
BigDecimal deadCap = rsvrStation.getDeadCap();
entity.setNowCap(rsvrStation.getNowCap());
if(nowCap != null && deadCap != null){
entity.setEffectiveCap(nowCap.subtract(deadCap));
}
BigDecimal flLowLimLev = rsvrStation.getFlLowLimLev();
entity.setFlLowLimLev(rsvrStation.getFlLowLimLev());
if(rz != null && flLowLimLev != null){
entity.setGapFlLowLimLev(rz.subtract(flLowLimLev));
}
res.add(entity);
}
return res;
}
}

View File

@ -0,0 +1,90 @@
package com.gunshi.project.ss.service;
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
import com.gunshi.project.ss.model.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class WholeCycleService {
@Autowired
private SafetyIdentifyService safetyIdentifyService;//安全鉴定
@Autowired
private AttResBaseService attResBaseService;//病险水库
@Autowired
private SafetyReinforcementService safetyReinforcementService;//除险加固
@Autowired
private DegradeScrapLedgerService degradeScrapLedgerService;//降等报废
@Autowired
private ResPlanBService resPlanBService;//type 1 防汛预案 type2 调度规程
public WholeCycleVo get() {
WholeCycleVo res = new WholeCycleVo();
SafetyIdentify one = safetyIdentifyService.lambdaQuery().orderByDesc(SafetyIdentify::getIdentifyDate).last("limit 1").one();
//安全鉴定
if(one == null || one.getIdentifyType() == null){
res.setIdentifyType("无");
}else{
if(one.getIdentifyType() == 1){
res.setIdentifyType("一类坝");
}else if(one.getIdentifyType() == 2){
res.setIdentifyType("二类坝");
}else if(one.getIdentifyType() == 3){
res.setIdentifyType("三类坝");
}
}
//病险水库
AttResBase attResBase = attResBaseService.lambdaQuery().last("limit 1").one();
if(attResBase == null){
res.setIsDanger("无");
}else if(attResBase.getIsDanger() != null && attResBase.getIsDanger() == 1){
res.setIsDanger("是");
}else{
res.setIsDanger("否");
}
//除险加固
SafetyReinforcement safetyReinforcement = safetyReinforcementService.lambdaQuery().orderByDesc(SafetyReinforcement::getStartDate).last("limit 1").one();
if(safetyReinforcement == null || safetyReinforcement.getStartDate() == null){
res.setStartDate(null);
}else{
res.setStartDate(safetyReinforcement.getStartDate());
}
//降等报废
DegradeScrapLedger degradeScrapLedger = degradeScrapLedgerService.lambdaQuery().orderByDesc(DegradeScrapLedger::getYear).last("limit 1").one();
if(degradeScrapLedger == null){
res.setImplementationMeasure("无");
}else if(degradeScrapLedger.getImplementationMeasure() != null && degradeScrapLedger.getImplementationMeasure() == 1){
res.setImplementationMeasure("报废");
}else if(degradeScrapLedger.getImplementationMeasure() != null && degradeScrapLedger.getImplementationMeasure() == 0){
res.setIsDanger("降等");
}
//调度规则
ResPlanB dispatcher = resPlanBService.lambdaQuery().eq(ResPlanB::getType, 2).eq(ResPlanB::getIsAvailable, 1).orderByDesc(ResPlanB::getPrepTime).last("limit 1").one();
if(dispatcher == null){
res.setDispatchTime(null);
}else{
res.setDispatchTime(dispatcher.getPrepTime());
}
//应急预案
ResPlanB emergency = resPlanBService.lambdaQuery().eq(ResPlanB::getType, 1).eq(ResPlanB::getIsAvailable, 1).orderByDesc(ResPlanB::getPrepTime).last("limit 1").one();
if(emergency == null){
res.setEmergencyTime(null);
}else{
res.setEmergencyTime(emergency.getPrepTime());
}
return res;
}
}