大屏-实时雨情,大坝安全监测统计
parent
b0f7b5eed1
commit
55f0174f8c
|
|
@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 描述: 渗压监测记录表
|
||||
|
|
@ -70,6 +71,12 @@ public class OsmoticPressRController {
|
|||
return R.ok(service.queryPage(osmoticQueryPageSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "大屏-大坝安全监测统计")
|
||||
@GetMapping("/stat")
|
||||
public R<Map<Integer,Integer>> stat() {
|
||||
return R.ok(service.stat());
|
||||
}
|
||||
|
||||
@Operation(summary = "布置图-渗压/渗流监测")
|
||||
@GetMapping("/list/value")
|
||||
public R<List<OsmoticPressVo>> listValue(@Schema(name = "type",description = "类型(1渗压 2渗流)") @RequestParam("type") Integer type) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class StPptnRRealController {
|
|||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<StPptnRReal>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
return R.ok(service.queryList());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.gunshi.project.xyt.model.StPptnRReal;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
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> {
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import jakarta.validation.constraints.Size;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +56,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="drp")
|
||||
@Schema(description="drp")
|
||||
// @Size(max = 0,message = "drp最大长度要小于 0")
|
||||
private String drp;
|
||||
private BigDecimal drp;
|
||||
|
||||
/**
|
||||
* today
|
||||
|
|
@ -63,7 +64,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="today")
|
||||
@Schema(description="today")
|
||||
// @Size(max = 0,message = "today最大长度要小于 0")
|
||||
private String today;
|
||||
private BigDecimal today;
|
||||
|
||||
/**
|
||||
* m10
|
||||
|
|
@ -71,7 +72,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="m10")
|
||||
@Schema(description="m10")
|
||||
// @Size(max = 0,message = "m10最大长度要小于 0")
|
||||
private String m10;
|
||||
private BigDecimal m10;
|
||||
|
||||
/**
|
||||
* m30
|
||||
|
|
@ -79,7 +80,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="m30")
|
||||
@Schema(description="m30")
|
||||
// @Size(max = 0,message = "m30最大长度要小于 0")
|
||||
private String m30;
|
||||
private BigDecimal m30;
|
||||
|
||||
/**
|
||||
* h1
|
||||
|
|
@ -87,7 +88,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="h1")
|
||||
@Schema(description="h1")
|
||||
// @Size(max = 0,message = "h1最大长度要小于 0")
|
||||
private String h1;
|
||||
private BigDecimal h1;
|
||||
|
||||
/**
|
||||
* h3
|
||||
|
|
@ -95,7 +96,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="h3")
|
||||
@Schema(description="h3")
|
||||
// @Size(max = 0,message = "h3最大长度要小于 0")
|
||||
private String h3;
|
||||
private BigDecimal h3;
|
||||
|
||||
/**
|
||||
* h6
|
||||
|
|
@ -103,7 +104,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="h6")
|
||||
@Schema(description="h6")
|
||||
// @Size(max = 0,message = "h6最大长度要小于 0")
|
||||
private String h6;
|
||||
private BigDecimal h6;
|
||||
|
||||
/**
|
||||
* h12
|
||||
|
|
@ -111,7 +112,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="h12")
|
||||
@Schema(description="h12")
|
||||
// @Size(max = 0,message = "h12最大长度要小于 0")
|
||||
private String h12;
|
||||
private BigDecimal h12;
|
||||
|
||||
/**
|
||||
* h24
|
||||
|
|
@ -119,7 +120,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="h24")
|
||||
@Schema(description="h24")
|
||||
// @Size(max = 0,message = "h24最大长度要小于 0")
|
||||
private String h24;
|
||||
private BigDecimal h24;
|
||||
|
||||
/**
|
||||
* h48
|
||||
|
|
@ -127,7 +128,7 @@ public class StPptnRReal implements Serializable {
|
|||
@TableField(value="h48")
|
||||
@Schema(description="h48")
|
||||
// @Size(max = 0,message = "h48最大长度要小于 0")
|
||||
private String h48;
|
||||
private BigDecimal h48;
|
||||
|
||||
/**
|
||||
* chtm
|
||||
|
|
@ -163,4 +164,7 @@ public class StPptnRReal implements Serializable {
|
|||
@Size(max = 10,message = "cluster最大长度要小于 10")
|
||||
private String cluster;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,14 @@ import com.gunshi.project.xyt.util.MyBeanUtil;
|
|||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
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.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 描述: 渗压监测记录表
|
||||
|
|
@ -34,6 +36,8 @@ import java.util.stream.Collectors;
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, OsmoticPressR>
|
||||
{
|
||||
@Autowired
|
||||
private OsmoticShiftRService shiftRService;
|
||||
|
||||
public Page<OsmoticPressR> queryPage(OsmoticQueryPageSo osmoticQueryPageSo) {
|
||||
return baseMapper.queryPage(osmoticQueryPageSo.getPageSo().toPage(),osmoticQueryPageSo);
|
||||
|
|
@ -450,6 +454,26 @@ public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, Osmot
|
|||
}).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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 降水量历史表
|
||||
* author: xusan
|
||||
|
|
@ -21,6 +23,10 @@ public class StPptnRRealService extends ServiceImpl<StPptnRRealMapper, StPptnRRe
|
|||
public int updatePptnRReal(String stcd) {
|
||||
return baseMapper.updatePptnRReal(stcd);
|
||||
}
|
||||
|
||||
public List<StPptnRReal> queryList() {
|
||||
return this.baseMapper.queryList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue