1:系统管理-监测体系

master
yangzhe123 2026-01-14 15:42:35 +08:00
parent 40b3dbcc74
commit 9b15d99fbe
12 changed files with 157 additions and 465 deletions

View File

@ -66,7 +66,7 @@ public interface JcskSyBMapper extends BaseMapper<JcskSyB> {
List<String> selectAllDvcd(); List<String> selectAllDvcd();
@Select(""" @Select("""
select t1.dvcd as stcd,t1.dvcd as stnm, t3.mstm as latestTm,t1.lttd,t1.lgtd select t1.dvcd as stcd,t1.dvcd as stnm, t3.mstm as tm,t1.lttd,t1.lgtd
from jcsk_sy_b t1 from jcsk_sy_b t1
left join( left join(
select stcd,mpcd,max(mstm) as max_tm from jcsk_sy_r group by stcd,mpcd select stcd,mpcd,max(mstm) as max_tm from jcsk_sy_r group by stcd,mpcd

View File

@ -79,7 +79,7 @@ public interface StStbprpBMapper extends BaseMapper<StStbprpB> {
t1.lttd, t1.lttd,
t1.stcd, t1.stcd,
t1.stnm, t1.stnm,
t4.tm as latestTm t4.tm
from st_stbprp_b t1 from st_stbprp_b t1
join st_stbprp_b_elem t2 on t1.stcd = t2.stcd join st_stbprp_b_elem t2 on t1.stcd = t2.stcd
left join ( left join (
@ -98,7 +98,7 @@ public interface StStbprpBMapper extends BaseMapper<StStbprpB> {
t1.lttd, t1.lttd,
t1.stcd, t1.stcd,
t1.stnm, t1.stnm,
t4.tm as latestTm t4.tm
from st_stbprp_b t1 from st_stbprp_b t1
join st_stbprp_b_elem t2 on t1.stcd = t2.stcd join st_stbprp_b_elem t2 on t1.stcd = t2.stcd
left join ( left join (

View File

@ -16,7 +16,9 @@ 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;
import java.util.List;
/** /**
* : sttp * : sttp
@ -32,10 +34,13 @@ public class StStbprpB implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.AUTO)
private Long id;
/** /**
* *
*/ */
@TableId(value="stcd", type= IdType.AUTO) @TableField(value="stcd")
@Schema(description="测站编码") @Schema(description="测站编码")
@Size(max = 32,message = "测站编码最大长度要小于 32") @Size(max = 32,message = "测站编码最大长度要小于 32")
@NotBlank(message = "测站编码不能为空",groups = {Insert.class, Update.class}) @NotBlank(message = "测站编码不能为空",groups = {Insert.class, Update.class})
@ -49,37 +54,13 @@ public class StStbprpB implements Serializable {
@Size(max = 150,message = "测站名称最大长度要小于 150") @Size(max = 150,message = "测站名称最大长度要小于 150")
private String stnm; private String stnm;
/**
*
*/
@TableField(value="rvnm")
@Schema(description="河流名称")
@Size(max = 300,message = "河流名称最大长度要小于 300")
private String rvnm;
/**
*
*/
@TableField(value="hnnm")
@Schema(description="水系名称")
@Size(max = 300,message = "水系名称最大长度要小于 300")
private String hnnm;
/**
*
*/
@TableField(value="bsnm")
@Schema(description="流域名称")
@Size(max = 300,message = "流域名称最大长度要小于 300")
private String bsnm;
/** /**
* *
*/ */
@TableField(value="lgtd") @TableField(value="lgtd")
@Schema(description="经度") @Schema(description="经度")
// @Size(max = 0,message = "经度最大长度要小于 0") // @Size(max = 0,message = "经度最大长度要小于 0")
private String lgtd; private BigDecimal lgtd;
/** /**
* *
@ -87,7 +68,7 @@ public class StStbprpB implements Serializable {
@TableField(value="lttd") @TableField(value="lttd")
@Schema(description="纬度") @Schema(description="纬度")
// @Size(max = 0,message = "纬度最大长度要小于 0") // @Size(max = 0,message = "纬度最大长度要小于 0")
private String lttd; private BigDecimal lttd;
/** /**
* *
@ -98,37 +79,6 @@ public class StStbprpB implements Serializable {
private String stlc; private String stlc;
/**
* alt
*/
@TableField(value="alt")
@Schema(description="alt")
// @Size(max = 0,message = "alt最大长度要小于 0")
private String alt;
/**
* mdbz
*/
@TableField(value="mdbz")
@Schema(description="mdbz")
// @Size(max = 0,message = "mdbz最大长度要小于 0")
private String mdbz;
/**
* mdpr
*/
@TableField(value="mdpr")
@Schema(description="mdpr")
// @Size(max = 0,message = "mdpr最大长度要小于 0")
private String mdpr;
/**
*
*/
@TableField(value="dtmnm")
@Schema(description="基面名称")
@Size(max = 160,message = "基面名称最大长度要小于 160")
private String dtmnm;
/** /**
* *
@ -136,15 +86,7 @@ public class StStbprpB implements Serializable {
@TableField(value="dtmel") @TableField(value="dtmel")
@Schema(description="基面高程") @Schema(description="基面高程")
// @Size(max = 0,message = "基面高程最大长度要小于 0") // @Size(max = 0,message = "基面高程最大长度要小于 0")
private String dtmel; private BigDecimal dtmel;
/**
*
*/
@TableField(value="dtpr")
@Schema(description="基面修正值")
// @Size(max = 0,message = "基面修正值最大长度要小于 0")
private String dtpr;
/** /**
* PP=RR=ZQ=TX= * PP=RR=ZQ=TX=
@ -154,125 +96,7 @@ public class StStbprpB implements Serializable {
@Size(max = 30,message = "站类MM=气象站,PP=雨量站,BB=蒸发站,ZQ=河道水文站,DD=堰闸水文站,ZZ=河道水位站,TT=潮位站,RR=水库水文站,DP=泵站,ZG=地下水站,SS=墒情站,ZB=分洪水位站,QQ=流量站,TX=图像站,ZI=渠道水位站,ZL=田间水层,QI=渠道流量站,ZT=塘堰,ZS=渗压渗流站,GT=闸位站,SZ=水质站,PQ=管道流量站。最大长度要小于 30") @Size(max = 30,message = "站类MM=气象站,PP=雨量站,BB=蒸发站,ZQ=河道水文站,DD=堰闸水文站,ZZ=河道水位站,TT=潮位站,RR=水库水文站,DP=泵站,ZG=地下水站,SS=墒情站,ZB=分洪水位站,QQ=流量站,TX=图像站,ZI=渠道水位站,ZL=田间水层,QI=渠道流量站,ZT=塘堰,ZS=渗压渗流站,GT=闸位站,SZ=水质站,PQ=管道流量站。最大长度要小于 30")
private String sttp; private String sttp;
/**
* dfrtms
*/
@TableField(value="dfrtms")
@Schema(description="dfrtms")
// @Size(max = 0,message = "dfrtms最大长度要小于 0")
private String dfrtms;
/**
* fritm
*/
@TableField(value="fritm")
@Schema(description="fritm")
@Size(max = 320,message = "fritm最大长度要小于 320")
private String fritm;
/**
*
*/
@TableField(value="frgrd")
@Schema(description="报汛等级")
@Size(max = 500,message = "报汛等级最大长度要小于 500")
private String frgrd;
/**
*
*/
@TableField(value="esstym")
@Schema(description="建站年月")
@Size(max = 60,message = "建站年月最大长度要小于 60")
private String esstym;
/**
* bgfrym
*/
@TableField(value="bgfrym")
@Schema(description="bgfrym")
@Size(max = 60,message = "bgfrym最大长度要小于 60")
private String bgfrym;
/**
* edfrym
*/
@TableField(value="edfrym")
@Schema(description="edfrym")
@Size(max = 60,message = "edfrym最大长度要小于 60")
private String edfrym;
/**
*
*/
@TableField(value="atcunit")
@Schema(description="隶属行业单位")
@Size(max = 200,message = "隶属行业单位最大长度要小于 200")
private String atcunit;
/**
*
*/
@TableField(value="admauth")
@Schema(description="信息管理单位")
@Size(max = 500,message = "信息管理单位最大长度要小于 500")
private String admauth;
/**
*
*/
@TableField(value="locality")
@Schema(description="交换管理单位")
@Size(max = 200,message = "交换管理单位最大长度要小于 200")
private String locality;
/**
*
*/
@TableField(value="stbk")
@Schema(description="测站岸别")
@Size(max = 1,message = "测站岸别最大长度要小于 1")
private String stbk;
/**
*
*/
@TableField(value="stazt")
@Schema(description="测站方位")
// @Size(max = 0,message = "测站方位最大长度要小于 0")
private String stazt;
/**
*
*/
@TableField(value="dstrvm")
@Schema(description="至河口距离")
// @Size(max = 0,message = "至河口距离最大长度要小于 0")
private String dstrvm;
/**
*
*/
@TableField(value="drna")
@Schema(description="集水面积")
// @Size(max = 0,message = "集水面积最大长度要小于 0")
private String drna;
/**
*
*/
@TableField(value="phcd")
@Schema(description="拼音码")
@Size(max = 60,message = "拼音码最大长度要小于 60")
private String phcd;
/**
*
*/
@TableField(value="usfl")
@Schema(description="启用标志")
@Size(max = 1,message = "启用标志最大长度要小于 1")
private String usfl;
/** /**
* *
@ -282,143 +106,6 @@ public class StStbprpB implements Serializable {
@Size(max = 200,message = "备注最大长度要小于 200") @Size(max = 200,message = "备注最大长度要小于 200")
private String comments; private String comments;
/**
*
*/
@TableField(value="moditime")
@Schema(description="时间戳")
// @Size(max = 0,message = "时间戳最大长度要小于 0")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date moditime;
/**
* rem_gd
*/
@TableField(value="rem_gd")
@Schema(description="rem_gd")
@Size(max = 300,message = "rem_gd最大长度要小于 300")
private String remGd;
/**
* ogid
*/
@TableField(value="ogid")
@Schema(description="ogid")
@Size(max = 100,message = "ogid最大长度要小于 100")
private String ogid;
/**
* vlfl
*/
@TableField(value="vlfl")
@Schema(description="vlfl")
// @Size(max = 0,message = "vlfl最大长度要小于 0")
private String vlfl;
/**
* atid
*/
@TableField(value="atid")
@Schema(description="atid")
@Size(max = 180,message = "atid最大长度要小于 180")
private String atid;
/**
* sdfl
*/
@TableField(value="sdfl")
@Schema(description="sdfl")
@Size(max = 500,message = "sdfl最大长度要小于 500")
private String sdfl;
/**
* rma
*/
@TableField(value="rma")
@Schema(description="rma")
@Size(max = 256,message = "rma最大长度要小于 256")
private String rma;
/**
* mdps
*/
@TableField(value="mdps")
@Schema(description="mdps")
@Size(max = 300,message = "mdps最大长度要小于 300")
private String mdps;
/**
* mddt
*/
@TableField(value="mddt")
@Schema(description="mddt")
// @Size(max = 0,message = "mddt最大长度要小于 0")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date mddt;
/**
* stindex
*/
@TableField(value="stindex")
@Schema(description="stindex")
// @Size(max = 0,message = "stindex最大长度要小于 0")
private String stindex;
/**
* starea
*/
@TableField(value="starea")
@Schema(description="starea")
@Size(max = 500,message = "starea最大长度要小于 500")
private String starea;
/**
* stlevel
*/
@TableField(value="stlevel")
@Schema(description="stlevel")
@Size(max = 1,message = "stlevel最大长度要小于 1")
private String stlevel;
/**
* code
*/
@TableField(value="code")
@Schema(description="code")
@Size(max = 300,message = "code最大长度要小于 300")
private String code;
/**
* ispbj
*/
@TableField(value="ispbj")
@Schema(description="ispbj")
@Size(max = 1,message = "ispbj最大长度要小于 1")
private String ispbj;
/**
* issxst
*/
@TableField(value="issxst")
@Schema(description="issxst")
@Size(max = 1,message = "issxst最大长度要小于 1")
private String issxst;
/**
* stpq
*/
@TableField(value="stpq")
@Schema(description="stpq")
@Size(max = 500,message = "stpq最大长度要小于 500")
private String stpq;
/**
* sthday
*/
@TableField(value="sthday")
@Schema(description="sthday")
// @Size(max = 0,message = "sthday最大长度要小于 0")
private Integer sthday;
/** /**
* source * source
@ -429,85 +116,15 @@ public class StStbprpB implements Serializable {
@NotBlank(message = "站点来源不能为空") @NotBlank(message = "站点来源不能为空")
private String source; private String source;
/**
* importancy
*/
@TableField(value="importancy")
@Schema(description="importancy")
// @Size(max = 0,message = "importancy最大长度要小于 0")
private Integer importancy;
/**
* clgtd
*/
@TableField(value="clgtd")
@Schema(description="clgtd")
// @Size(max = 0,message = "clgtd最大长度要小于 0")
private String clgtd;
/**
* clttd
*/
@TableField(value="clttd")
@Schema(description="clttd")
// @Size(max = 0,message = "clttd最大长度要小于 0")
private String clttd;
/**
* elev
*/
@TableField(value="elev")
@Schema(description="elev")
// @Size(max = 0,message = "elev最大长度要小于 0")
private String elev;
/**
* crucial
*/
@TableField(value="crucial")
@Schema(description="crucial")
// @Size(max = 0,message = "crucial最大长度要小于 0")
private Integer crucial;
/** /**
* build_year * build_year
*/ */
@TableField(value="build_year") @TableField(value="build_year")
@Schema(description="build_year") @Schema(description="建设年份")
@Size(max = 50,message = "build_year最大长度要小于 50") @Size(max = 50,message = "build_year最大长度要小于 50")
private String buildYear; private String buildYear;
/**
*
*/
@TableField(value="adcd")
@Schema(description="行政区划编码")
@Size(max = 15,message = "行政区划编码最大长度要小于 15")
private String adcd;
/**
*
*/
@TableField(value="lyid")
@Schema(description="流域编码")
@Size(max = 255,message = "流域编码最大长度要小于 255")
private String lyid;
/**
*
*/
@TableField(value="res_code")
@Schema(description="水库编码")
@Size(max = 255,message = "水库编码最大长度要小于 255")
private String resCode;
/**
*
*/
@TableField(value="rv_code")
@Schema(description="河流编码")
@Size(max = 255,message = "河流编码最大长度要小于 255")
private String rvCode;
/** /**
* 0 1 * 0 1
@ -517,27 +134,20 @@ public class StStbprpB implements Serializable {
// @Size(max = 0,message = "测站状态 0无效 1有效最大长度要小于 0") // @Size(max = 0,message = "测站状态 0无效 1有效最大长度要小于 0")
private Integer status; private Integer status;
/**
*
*/
@Schema(description="归属协议")
@TableField(value="agreement")
private String agreement;
/** @TableField(value = "build_unit")
* SIM @Schema(description = "承建单位")
*/ private String buildUnit;
@Schema(description="SIM卡")
@TableField(value="sim_card")
private String simCard;
/** @TableField(value = "management_unit")
* @Schema(description = "管理单位")
*/ private String managementUnit;
@Schema(description="北斗卡号")
@TableField(value="bd_card")
private String bdCard;
public static final String COL_STCD = "stcd"; @TableField(value = "operate_unit")
@Schema(description = "运维单位")
private String operateUnit;
@TableField(exist = false)
private List<String> elems;
} }

View File

@ -42,5 +42,5 @@ public class StationNormalVo {
* *
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime latestTm; private LocalDateTime tm;
} }

View File

@ -415,10 +415,10 @@ public class DebugController {
String jsonString = JSONObject.toJSONString(entity); String jsonString = JSONObject.toJSONString(entity);
esObjectDocument.setJsonStr(jsonString); esObjectDocument.setJsonStr(jsonString);
if(entity.getLgtd() != null){ if(entity.getLgtd() != null){
esObjectDocument.setLgtd(new BigDecimal(entity.getLgtd())); esObjectDocument.setLgtd(entity.getLgtd());
} }
if(entity.getLgtd() != null){ if(entity.getLgtd() != null){
esObjectDocument.setLttd(new BigDecimal(entity.getLttd())); esObjectDocument.setLttd(entity.getLttd());
} }
list.add(esObjectDocument); list.add(esObjectDocument);
} }

View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.core.result.R; import com.gunshi.core.result.R;
import com.gunshi.project.ss.entity.so.HomeStStbprpBSo; import com.gunshi.project.ss.entity.so.HomeStStbprpBSo;
import com.gunshi.project.ss.entity.so.StStbprpBPage; import com.gunshi.project.ss.entity.so.StStbprpBPage;
import com.gunshi.project.ss.entity.so.StStbprpBPageSo;
import com.gunshi.project.ss.entity.so.StStbprpBSo; import com.gunshi.project.ss.entity.so.StStbprpBSo;
import com.gunshi.project.ss.entity.vo.HomeStStbprpBVo; import com.gunshi.project.ss.entity.vo.HomeStStbprpBVo;
import com.gunshi.project.ss.entity.vo.StStatusListVo; import com.gunshi.project.ss.entity.vo.StStatusListVo;
@ -48,79 +49,61 @@ public class StStbprpBController {
if (Objects.nonNull(service.getById(dto.getStcd()))){ if (Objects.nonNull(service.getById(dto.getStcd()))){
throw new RuntimeException("测站编号已存在"); throw new RuntimeException("测站编号已存在");
} }
dto.setModitime(new Date()); boolean result = service.saveData(dto);
boolean result = service.save(dto);
return R.ok(result ? dto : null); return R.ok(result ? dto : null);
} }
@Operation(summary = "修改") @Operation(summary = "修改")
@PostMapping("/update") @PostMapping("/update")
public R<StStbprpB> update(@Validated(Update.class) @RequestBody StStbprpB dto) { public R<StStbprpB> update(@Validated(Update.class) @RequestBody StStbprpB dto) {
if (Objects.isNull(service.getById(dto.getStcd()))){ service.edit(dto);
throw new RuntimeException("当前数据不存在"); return R.ok(dto);
}
boolean result = service.updateById(dto);
return R.ok(result ? dto : null);
} }
@Operation(summary = "删除") @Operation(summary = "删除")
@GetMapping("/del/{id}") @GetMapping("/del/{id}")
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) { public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
if (Objects.isNull(service.getById(id))){ service.deleteById(id);
throw new RuntimeException("当前数据不存在"); return R.ok(true);
}
return R.ok(service.removeById(id));
} }
@Operation(summary = "列表") // @Operation(summary = "列表")
@PostMapping("/list") // @PostMapping("/list")
public R<List<StStbprpB>> list(@RequestBody StStbprpBSo dto) { // public R<List<StStbprpB>> list(@RequestBody StStbprpBSo dto) {
LambdaQueryChainWrapper<StStbprpB> query = service.lambdaQuery(); // LambdaQueryChainWrapper<StStbprpB> query = service.lambdaQuery();
query // query
.eq(StStbprpB::getSttp,dto.getSttp()) // .eq(StStbprpB::getSttp,dto.getSttp())
.eq(StStbprpB::getStcd,dto.getStcd()) // .eq(StStbprpB::getStcd,dto.getStcd())
.like(StStbprpB::getStnm,dto.getStnm()) // .like(StStbprpB::getStnm,dto.getStnm())
.like(StStbprpB::getRvnm,dto.getRvnm()) // .like(StStbprpB::getRvnm,dto.getRvnm())
.like(StStbprpB::getHnnm,dto.getHnnm()) // .like(StStbprpB::getHnnm,dto.getHnnm())
.like(StStbprpB::getBsnm,dto.getBsnm()) // .like(StStbprpB::getBsnm,dto.getBsnm())
; // ;
return R.ok(query.list()); // return R.ok(query.list());
} // }
@Operation(summary = "分页") @Operation(summary = "分页")
@PostMapping("/page") @PostMapping("/page")
public R<Page<StStbprpB>> page(@RequestBody @Validated StStbprpBPage page) { public R<Page<StStbprpB>> page(@RequestBody @Validated StStbprpBPageSo pageSo) {
LambdaQueryWrapper<StStbprpB> query = Wrappers.lambdaQuery(); Page<StStbprpB> pageinfo = service.pageInfo(pageSo);
if (ObjectUtils.isNotNull(page.getCode())) {
query.like(StStbprpB::getStcd, page.getCode()); return R.ok(pageinfo);
}
if (ObjectUtils.isNotNull(page.getName())) {
query.like(StStbprpB::getStnm, page.getName());
}
if (ObjectUtils.isNotNull(page.getAgreement())) {
query.like(StStbprpB::getAgreement, page.getAgreement());
}
query.orderByDesc(StStbprpB::getModitime);
return R.ok(service.page(page.getPageSo().toPage(), query));
} }
@Operation(summary = "雨量站详情带雨量列表") @Operation(summary = "雨量站详情带雨量列表")
@PostMapping("/rainfallStationDetails/rainfallList") @PostMapping("/rainfallStationDetails/rainfallList")
@Deprecated(since = "代码重构-废弃")
public R<List<HomeStStbprpBVo>> rainfallStationDetailsList(@RequestBody @Validated HomeStStbprpBSo dto) { public R<List<HomeStStbprpBVo>> rainfallStationDetailsList(@RequestBody @Validated HomeStStbprpBSo dto) {
return R.ok(service.rainfallStationDetailsList(dto)); return R.ok(service.rainfallStationDetailsList(dto));
} }
@Operation(summary = "水库站点详情带实时水位列表") @Operation(summary = "水库站点详情带实时水位列表")
@PostMapping("/reservoirStationDetails/realTimeWaterLevelList") @PostMapping("/reservoirStationDetails/realTimeWaterLevelList")
@Deprecated(since = "代码重构-废弃")
public R<List<HomeStStbprpBVo>> reservoirStationDetailsList() { public R<List<HomeStStbprpBVo>> reservoirStationDetailsList() {
return R.ok(service.reservoirStationDetailsList()); return R.ok(service.reservoirStationDetailsList());
} }
@Operation(summary = "输/放水管流量站点详情带实时流量列表") @Operation(summary = "输/放水管流量站点详情带实时流量列表")
@PostMapping("/trafficSiteDetails/realTimeTrafficList") @PostMapping("/trafficSiteDetails/realTimeTrafficList")
@Deprecated(since = "代码重构-废弃")
public R<List<HomeStStbprpBVo>> trafficStationDetailsList() { public R<List<HomeStStbprpBVo>> trafficStationDetailsList() {
return R.ok(service.flowStationDetailsList()); return R.ok(service.flowStationDetailsList());
} }

View File

@ -106,7 +106,7 @@ public class StationController {
public void handlerStatus(List<StationNormalVo> stationNormalVos){ public void handlerStatus(List<StationNormalVo> stationNormalVos){
for (StationNormalVo station : stationNormalVos) { for (StationNormalVo station : stationNormalVos) {
LocalDateTime latestTm = station.getLatestTm(); LocalDateTime latestTm = station.getTm();
if(latestTm == null){ if(latestTm == null){
station.setStatus(0); station.setStatus(0);
continue; continue;

View File

@ -9,7 +9,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
import java.math.BigDecimal; import java.math.BigDecimal;
@Data @Data
@Document(indexName="ss_object") //@Document(indexName="ss_object")
public class EsObjectDocument { public class EsObjectDocument {
@Id // 必须添加这个注解 @Id // 必须添加这个注解
private String id; // 字段名可以是id或自定义 private String id; // 字段名可以是id或自定义

View File

@ -19,4 +19,6 @@ public class StStbprpBPage extends GeneralDataPage{
*/ */
@Schema(description="归属协议") @Schema(description="归属协议")
private String agreement; private String agreement;
private Integer status;
} }

View File

@ -0,0 +1,22 @@
package com.gunshi.project.ss.entity.so;
import com.gunshi.db.dto.PageSo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Data
public class StStbprpBPageSo {
private String stcd;
private String stnm;
private Integer status;
@NotNull(message = "分页参数不能为空")
@Schema(description = "分页参数")
private PageSo pageSo;
}

View File

@ -1,8 +1,11 @@
package com.gunshi.project.ss.service; package com.gunshi.project.ss.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.ss.common.mapper.StStbprpBElemMapper; import com.gunshi.project.ss.common.mapper.StStbprpBElemMapper;
import com.gunshi.project.ss.common.model.StStbprpBElem; import com.gunshi.project.ss.common.model.StStbprpBElem;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.extern.slf4j.Slf4j; 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;
@ -18,6 +21,11 @@ import org.springframework.transaction.annotation.Transactional;
public class StStbprpBElemService extends ServiceImpl<StStbprpBElemMapper, StStbprpBElem> public class StStbprpBElemService extends ServiceImpl<StStbprpBElemMapper, StStbprpBElem>
{ {
public void delete(String stcd) {
LambdaQueryWrapper<StStbprpBElem> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StStbprpBElem::getStcd, stcd);
int delete = baseMapper.delete(queryWrapper);
}
} }

View File

@ -2,20 +2,22 @@ package com.gunshi.project.ss.service;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.ss.common.mapper.StStbprpBMapper; import com.gunshi.project.ss.common.mapper.StStbprpBMapper;
import com.gunshi.project.ss.common.model.StRiverR; import com.gunshi.project.ss.common.model.*;
import com.gunshi.project.ss.common.model.StStbprpB;
import com.gunshi.project.ss.common.model.StationNormalVo;
import com.gunshi.project.ss.common.model.vo.OsmoticShiftListVo2; import com.gunshi.project.ss.common.model.vo.OsmoticShiftListVo2;
import com.gunshi.project.ss.entity.dto.StZqrlBDto; import com.gunshi.project.ss.entity.dto.StZqrlBDto;
import com.gunshi.project.ss.entity.so.HomeStStbprpBSo; import com.gunshi.project.ss.entity.so.HomeStStbprpBSo;
import com.gunshi.project.ss.entity.so.StStbprpBPage;
import com.gunshi.project.ss.entity.so.StStbprpBPageSo;
import com.gunshi.project.ss.entity.vo.*; import com.gunshi.project.ss.entity.vo.*;
import com.gunshi.project.ss.mapper.OsmoticPressRMapper; import com.gunshi.project.ss.mapper.OsmoticPressRMapper;
import com.gunshi.project.ss.mapper.OsmoticShiftRMapper; import com.gunshi.project.ss.mapper.OsmoticShiftRMapper;
import com.gunshi.project.ss.mapper.StWaterFlowMapper; import com.gunshi.project.ss.mapper.StWaterFlowMapper;
import com.gunshi.project.ss.mapper.StbprpBVoMapper; import com.gunshi.project.ss.mapper.StbprpBVoMapper;
import com.gunshi.project.ss.common.model.StRsvrR;
import com.gunshi.project.ss.model.*; import com.gunshi.project.ss.model.*;
import com.gunshi.project.ss.util.DateUtil; import com.gunshi.project.ss.util.DateUtil;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
@ -73,6 +75,9 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB> {
@Autowired @Autowired
private StZqRSerivce stZqRSerivce; private StZqRSerivce stZqRSerivce;
@Autowired
private StStbprpBElemService stStbprpBElemService;
public List<HomeStStbprpBVo> rainfallStationDetailsList(HomeStStbprpBSo dto) { public List<HomeStStbprpBVo> rainfallStationDetailsList(HomeStStbprpBSo dto) {
return stbprpBVoMapper.rainfallStationDetailsList(dto); return stbprpBVoMapper.rainfallStationDetailsList(dto);
} }
@ -588,6 +593,68 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB> {
public List<StationNormalVo> getFlowNormalStations() { public List<StationNormalVo> getFlowNormalStations() {
return baseMapper.getFlowNormalStations(); return baseMapper.getFlowNormalStations();
} }
public boolean saveData(StStbprpB dto) {
boolean save = save(dto);
List<StStbprpBElem> elemList = new ArrayList<>();
for (String el : dto.getElems()) {
StStbprpBElem elem = new StStbprpBElem();
elem.setElem(el);
elem.setStcd(dto.getStcd());
elemList.add(elem);
}
if(CollectionUtil.isNotEmpty(elemList)) {
stStbprpBElemService.saveBatch(elemList);
}
return save;
}
public Page<StStbprpB> pageInfo(StStbprpBPageSo pageSo) {
LambdaQueryWrapper<StStbprpB> query = Wrappers.lambdaQuery();
if (ObjectUtils.isNotNull(pageSo.getStcd())) {
query.like(StStbprpB::getStcd, pageSo.getStcd());
}
if (ObjectUtils.isNotNull(pageSo.getStnm())) {
query.like(StStbprpB::getStnm, pageSo.getStnm());
}
if (ObjectUtils.isNotNull(pageSo.getStatus())) {
query.like(StStbprpB::getStatus,pageSo.getStatus());
}
Page<StStbprpB> stStbprpBPage = this.baseMapper.selectPage(pageSo.getPageSo().toPage(), query);
for (StStbprpB record : stStbprpBPage.getRecords()) {
List<StStbprpBElem> elemList = stStbprpBElemService.lambdaQuery()
.eq(StStbprpBElem::getStcd, record.getStcd()).list();
List<String> elems = elemList.stream().map(o -> o.getElem()).collect(Collectors.toList());
record.setElems(elems);
}
return stStbprpBPage;
}
public void edit(StStbprpB dto) {
StStbprpB byId = getById(dto.getId());
updateById(dto);
stStbprpBElemService.delete(byId.getStcd());
List<StStbprpBElem> elemList = new ArrayList<>();
for (String el : dto.getElems()) {
StStbprpBElem elem = new StStbprpBElem();
elem.setElem(el);
elem.setStcd(dto.getStcd());
elemList.add(elem);
}
if(CollectionUtil.isNotEmpty(elemList)) {
stStbprpBElemService.saveBatch(elemList);
}
}
public void deleteById(Serializable id) {
StStbprpB byId = getById(id);
if(byId == null){
return;
}
stStbprpBElemService
.delete(byId.getStcd());
removeById(id);
}
} }