大屏-实时雨情,大坝安全监测统计

master
wany 2024-09-11 10:18:38 +08:00
parent b0f7b5eed1
commit 55f0174f8c
6 changed files with 64 additions and 11 deletions

View File

@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* : * :
@ -70,6 +71,12 @@ public class OsmoticPressRController {
return R.ok(service.queryPage(osmoticQueryPageSo)); return R.ok(service.queryPage(osmoticQueryPageSo));
} }
@Operation(summary = "大屏-大坝安全监测统计")
@GetMapping("/stat")
public R<Map<Integer,Integer>> stat() {
return R.ok(service.stat());
}
@Operation(summary = "布置图-渗压/渗流监测") @Operation(summary = "布置图-渗压/渗流监测")
@GetMapping("/list/value") @GetMapping("/list/value")
public R<List<OsmoticPressVo>> listValue(@Schema(name = "type",description = "类型1渗压 2渗流") @RequestParam("type") Integer type) { public R<List<OsmoticPressVo>> listValue(@Schema(name = "type",description = "类型1渗压 2渗流") @RequestParam("type") Integer type) {

View File

@ -51,7 +51,7 @@ public class StPptnRRealController {
@Operation(summary = "列表") @Operation(summary = "列表")
@PostMapping("/list") @PostMapping("/list")
public R<List<StPptnRReal>> list() { public R<List<StPptnRReal>> list() {
return R.ok(service.lambdaQuery().list()); return R.ok(service.queryList());
} }
// @Operation(summary = "分页") // @Operation(summary = "分页")

View File

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gunshi.project.xyt.model.StPptnRReal; import com.gunshi.project.xyt.model.StPptnRReal;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* : * :
@ -14,4 +17,13 @@ import org.apache.ibatis.annotations.Param;
public interface StPptnRRealMapper extends BaseMapper<StPptnRReal> { public interface StPptnRRealMapper extends BaseMapper<StPptnRReal> {
int updatePptnRReal(@Param("stcd") String stcd); int updatePptnRReal(@Param("stcd") String stcd);
@Select("""
<script>
SELECT t.*,s.stnm FROM public.st_pptn_r_real t
left join public.st_stbprp_b s on t.stcd = s.stcd
WHERE t.stcd in (select distinct(stcd) from st_stbprp_b_elem where elem ='drp')
</script>
""")
List<StPptnRReal> queryList();
} }

View File

@ -15,6 +15,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -55,7 +56,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="drp") @TableField(value="drp")
@Schema(description="drp") @Schema(description="drp")
// @Size(max = 0,message = "drp最大长度要小于 0") // @Size(max = 0,message = "drp最大长度要小于 0")
private String drp; private BigDecimal drp;
/** /**
* today * today
@ -63,7 +64,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="today") @TableField(value="today")
@Schema(description="today") @Schema(description="today")
// @Size(max = 0,message = "today最大长度要小于 0") // @Size(max = 0,message = "today最大长度要小于 0")
private String today; private BigDecimal today;
/** /**
* m10 * m10
@ -71,7 +72,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="m10") @TableField(value="m10")
@Schema(description="m10") @Schema(description="m10")
// @Size(max = 0,message = "m10最大长度要小于 0") // @Size(max = 0,message = "m10最大长度要小于 0")
private String m10; private BigDecimal m10;
/** /**
* m30 * m30
@ -79,7 +80,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="m30") @TableField(value="m30")
@Schema(description="m30") @Schema(description="m30")
// @Size(max = 0,message = "m30最大长度要小于 0") // @Size(max = 0,message = "m30最大长度要小于 0")
private String m30; private BigDecimal m30;
/** /**
* h1 * h1
@ -87,7 +88,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="h1") @TableField(value="h1")
@Schema(description="h1") @Schema(description="h1")
// @Size(max = 0,message = "h1最大长度要小于 0") // @Size(max = 0,message = "h1最大长度要小于 0")
private String h1; private BigDecimal h1;
/** /**
* h3 * h3
@ -95,7 +96,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="h3") @TableField(value="h3")
@Schema(description="h3") @Schema(description="h3")
// @Size(max = 0,message = "h3最大长度要小于 0") // @Size(max = 0,message = "h3最大长度要小于 0")
private String h3; private BigDecimal h3;
/** /**
* h6 * h6
@ -103,7 +104,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="h6") @TableField(value="h6")
@Schema(description="h6") @Schema(description="h6")
// @Size(max = 0,message = "h6最大长度要小于 0") // @Size(max = 0,message = "h6最大长度要小于 0")
private String h6; private BigDecimal h6;
/** /**
* h12 * h12
@ -111,7 +112,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="h12") @TableField(value="h12")
@Schema(description="h12") @Schema(description="h12")
// @Size(max = 0,message = "h12最大长度要小于 0") // @Size(max = 0,message = "h12最大长度要小于 0")
private String h12; private BigDecimal h12;
/** /**
* h24 * h24
@ -119,7 +120,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="h24") @TableField(value="h24")
@Schema(description="h24") @Schema(description="h24")
// @Size(max = 0,message = "h24最大长度要小于 0") // @Size(max = 0,message = "h24最大长度要小于 0")
private String h24; private BigDecimal h24;
/** /**
* h48 * h48
@ -127,7 +128,7 @@ public class StPptnRReal implements Serializable {
@TableField(value="h48") @TableField(value="h48")
@Schema(description="h48") @Schema(description="h48")
// @Size(max = 0,message = "h48最大长度要小于 0") // @Size(max = 0,message = "h48最大长度要小于 0")
private String h48; private BigDecimal h48;
/** /**
* chtm * chtm
@ -163,4 +164,7 @@ public class StPptnRReal implements Serializable {
@Size(max = 10,message = "cluster最大长度要小于 10") @Size(max = 10,message = "cluster最大长度要小于 10")
private String cluster; private String cluster;
@TableField(exist = false)
@Schema(description = "站点名称")
private String stnm;
} }

View File

@ -17,12 +17,14 @@ import com.gunshi.project.xyt.util.MyBeanUtil;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* : * :
@ -34,6 +36,8 @@ import java.util.stream.Collectors;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, OsmoticPressR> public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, OsmoticPressR>
{ {
@Autowired
private OsmoticShiftRService shiftRService;
public Page<OsmoticPressR> queryPage(OsmoticQueryPageSo osmoticQueryPageSo) { public Page<OsmoticPressR> queryPage(OsmoticQueryPageSo osmoticQueryPageSo) {
return baseMapper.queryPage(osmoticQueryPageSo.getPageSo().toPage(),osmoticQueryPageSo); return baseMapper.queryPage(osmoticQueryPageSo.getPageSo().toPage(),osmoticQueryPageSo);
@ -450,6 +454,26 @@ public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, Osmot
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return resList.stream().sorted(Comparator.comparing(OsmoticPressDetailVo::getTm)).collect(Collectors.toList()); return resList.stream().sorted(Comparator.comparing(OsmoticPressDetailVo::getTm)).collect(Collectors.toList());
} }
public Map<Integer, Integer> stat() {
Map<Integer, Integer> map = new HashMap<>();
List<OsmoticPressVo> press = this.listValue(1);
Integer pressSize = press.size();
Long pressWarn = press.stream().filter(o -> o.getStatus() == 1).collect(Collectors.counting());
List<OsmoticPressVo> flow = this.listValue(2);
Integer flowSize = flow.size();
Long flowWarn = flow.stream().filter(o -> o.getStatus() == 1).collect(Collectors.counting());
List<OsmoticShiftListVo> shift = shiftRService.listValue();
Integer shiftSize = shift.size();
Long shiftWarn = shift.stream().filter(o -> o.getXStatus() == 1 || o.getYStatus() ==1 || o.getHStatus() == 1).collect(Collectors.counting());
Integer size = pressSize + flowSize + shiftSize;
Integer warn = Stream.of(pressWarn, flowWarn, shiftWarn).mapToInt(Long::intValue).sum();
map.put(warn,size);
return map;
}
} }

View File

@ -7,6 +7,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* : * :
* author: xusan * author: xusan
@ -21,6 +23,10 @@ public class StPptnRRealService extends ServiceImpl<StPptnRRealMapper, StPptnRRe
public int updatePptnRReal(String stcd) { public int updatePptnRReal(String stcd) {
return baseMapper.updatePptnRReal(stcd); return baseMapper.updatePptnRReal(stcd);
} }
public List<StPptnRReal> queryList() {
return this.baseMapper.queryList();
}
} }