完成测站关系、库容曲线、责任人、工程图片增删改查
parent
5a7b960c16
commit
d34b2a5aaf
|
|
@ -6,6 +6,7 @@ import com.gunshi.project.xyt.entity.dto.*;
|
|||
import com.gunshi.project.xyt.model.*;
|
||||
import com.gunshi.project.xyt.service.EngineeringDrainageService;
|
||||
import com.gunshi.project.xyt.so.*;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
@ -32,140 +33,241 @@ public class EngineeringDrainageController {
|
|||
private EngineeringDrainageService engineeringDrainageService;
|
||||
|
||||
@Operation(summary = "新增水库基础信息")
|
||||
@PostMapping("/insertStRes")
|
||||
@PostMapping("/StRes/insert")
|
||||
public R<String> insertRes(@RequestBody @Validated StResDto stResDto){
|
||||
engineeringDrainageService.insertStRes(stResDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新水库的基础信息")
|
||||
@PostMapping("/updateStRes")
|
||||
public R<String> updateStRes(@RequestBody StResDto stResDto){
|
||||
engineeringDrainageService.updateStRes(stResDto);
|
||||
@PostMapping("/StRes/update")
|
||||
public R<String> updateStRes(@Validated(Insert.class) @RequestBody StResB stResB){
|
||||
engineeringDrainageService.updateStRes(stResB);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据水库ID删除水库基本信息")
|
||||
@GetMapping("/deleteStRes")
|
||||
@GetMapping("/StRes/delete")
|
||||
public R<String> deleteStRes(@Parameter(description = "水库ID") @RequestParam("resId") String resId){
|
||||
engineeringDrainageService.deleteStRes(resId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "分页查询水库的基础信息")
|
||||
@PostMapping("/queryStRes")
|
||||
@PostMapping("/StRes/page")
|
||||
public R<Page<StResB>> pageStRes(@RequestBody @Validated StResPageSo stResPageSo){
|
||||
return R.ok(engineeringDrainageService.pageStRes(stResPageSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增水库测站关系")
|
||||
@PostMapping("/StResStcdRef/insert")
|
||||
public R<String> insertStResStcdRef(@RequestBody @Validated StResStcdRefDto stResStcdRefDto){
|
||||
engineeringDrainageService.insertStResStcdRef(stResStcdRefDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新水库测站关系")
|
||||
@PostMapping("/StResStcdRef/update")
|
||||
public R<String> updateStResStcdRef(@RequestBody @Validated StResStcdRef stResStcdRef){
|
||||
engineeringDrainageService.updateStResStcdRef(stResStcdRef);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "删除水库测站关系")
|
||||
@GetMapping("/StResStcdRef/delete")
|
||||
public R<String> deleteStResStcdRef(@Parameter(description = "水库ID") @RequestParam("resId") String resId){
|
||||
engineeringDrainageService.deleteStResStcdRef(resId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据水库ID查询水库测站关系")
|
||||
@GetMapping("/StResStcdRef/queryByResId")
|
||||
public R<StResStcdRef> queryStResStcdRefByResId(@Parameter(description = "水库ID") @RequestParam("resId")String resId){
|
||||
return R.ok(engineeringDrainageService.queryStResStcdRefByResId(resId));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增库容曲线信息")
|
||||
@PostMapping("/StZvarl/insert")
|
||||
public R<String> insertStZvarl(@RequestBody @Validated StZvarlDto stZvarlDto){
|
||||
engineeringDrainageService.insertStZvarl(stZvarlDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新库容曲线信息")
|
||||
@PostMapping("/StZvarl/update")
|
||||
public R<String> updateStZvarl(@RequestBody @Validated StZvarlB stZvarlB){
|
||||
engineeringDrainageService.updateStZvarl(stZvarlB);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "删除库容曲线信息")
|
||||
@GetMapping("/StZvarl/delete")
|
||||
public R<String> deleteStZvarl(
|
||||
@Parameter(description = "水库ID") @RequestParam("resId") String resId,
|
||||
@Parameter(description = "序号") @RequestParam("ptno") String ptno){
|
||||
engineeringDrainageService.deleteStZvarl(resId,ptno);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询库容曲线信息")
|
||||
@PostMapping("/StZvarl/page")
|
||||
public R<Page<StZvarlB>> pageStZvarl(@RequestBody @Validated StZvarlSo stZvarlSo){
|
||||
return R.ok(engineeringDrainageService.pageStZvarl(stZvarlSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增水库责任人信息")
|
||||
@PostMapping("/StResPersonRef/insert")
|
||||
public R<String> insertStResPersonRef(@RequestBody @Validated StResPersonRefDto stResPersonRefDto){
|
||||
engineeringDrainageService.insertStResPersonRef(stResPersonRefDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新水库责任人关系")
|
||||
@PostMapping("/StResPersonRef/update")
|
||||
public R<String> updateStResPersonRef(@RequestBody @Validated StResPersonRef stResPersonRef){
|
||||
engineeringDrainageService.updateStResPersonRef(stResPersonRef);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "删除水库责任人信息")
|
||||
@GetMapping("/StResPersonRef/delete")
|
||||
public R<String> deleteStResPersonRef(@Parameter(description = "水库责任人关系ID") @RequestParam("id") String id){
|
||||
engineeringDrainageService.deleteStResPersonRef(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询水库责任人信息")
|
||||
@PostMapping("/StResPersonRef/page")
|
||||
public R<Page<StResPersonRef>> pageStResPersonRef(StResPersonRefSo stResPersonRefSo){
|
||||
return R.ok(engineeringDrainageService.pageStResPersonRef(stResPersonRefSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增水库附件信息")
|
||||
@PostMapping("/StResFileRef/insert")
|
||||
public R<String> insertStResFileRef(@RequestBody @Validated StResFileRefDto stResFileRefDto){
|
||||
engineeringDrainageService.insertStResFileRef(stResFileRefDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据水库附件关系ID删除水库附件信息")
|
||||
@GetMapping("/StResFileRef/delete")
|
||||
public R<String> deleteStResFileRef(@Parameter(description = "水库附件关系ID") @RequestParam("id") String id){
|
||||
engineeringDrainageService.deleteStResFileRef(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询水库附件")
|
||||
@PostMapping("/StResFileRef/page")
|
||||
public R<Page<StResFileRef>> pageStResFileRef(@RequestBody @Validated StResFileRefSo stResFileRefSo){
|
||||
return R.ok(engineeringDrainageService.pageStResFileRef(stResFileRefSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增河流基础信息")
|
||||
@PostMapping("/insertStRv")
|
||||
@PostMapping("/StRv/insert")
|
||||
public R<String> insertStRv(@RequestBody @Validated StRvDto stRvDto){
|
||||
engineeringDrainageService.insertStRv(stRvDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新河流的基础信息")
|
||||
@PostMapping("/updateStRv")
|
||||
@PostMapping("/StRv/update")
|
||||
public R<String> updateStRv(@RequestBody StRvB stRvB){
|
||||
engineeringDrainageService.updateStRv(stRvB);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据河流ID删除河流信息")
|
||||
@GetMapping("/deleteStRv")
|
||||
@GetMapping("/StRv/delete")
|
||||
public R<String> deleteStRv(@Parameter(description = "河流ID") @RequestParam("rvId") String rvId){
|
||||
engineeringDrainageService.deleteStRv(rvId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询河流基础信息")
|
||||
@PostMapping("/pageStRv")
|
||||
@PostMapping("/StRv/page")
|
||||
public R<Page<StRvB>> pageStRv(@RequestBody StRvPageSo stRvPageSo){
|
||||
return R.ok(engineeringDrainageService.pageStRv(stRvPageSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增大坝基础信息")
|
||||
@PostMapping("/insertStDam")
|
||||
@PostMapping("/StDam/insert")
|
||||
public R<String> insertStDam(@RequestBody @Validated StDamDto stDamDto){
|
||||
engineeringDrainageService.insertStDam(stDamDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新大坝基础信息")
|
||||
@PostMapping("/updateStDam")
|
||||
@PostMapping("/StDam/update")
|
||||
public R<String> updateStDam(@RequestBody StDamB stDamB){
|
||||
engineeringDrainageService.updateStDam(stDamB);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据大坝ID删除大坝基础信息")
|
||||
@GetMapping("/deleteStDam")
|
||||
@GetMapping("/StDam/delete")
|
||||
public R<String> deleteStDam(@Parameter(description = "大坝ID") @RequestParam("damId") String damId){
|
||||
engineeringDrainageService.deleteStDam(damId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询大坝信息")
|
||||
@PostMapping("/queryByDam")
|
||||
public R<Page<StDamB>> queryByDam(@RequestBody @Validated StDamPageSo stDamPageSo){
|
||||
@PostMapping("/StDam/query")
|
||||
public R<Page<StDamB>> PageStDam(@RequestBody @Validated StDamPageSo stDamPageSo){
|
||||
return R.ok(engineeringDrainageService.pageStDam(stDamPageSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增闸阀基础信息")
|
||||
@PostMapping("/insertStGate")
|
||||
@PostMapping("/StGate/insert")
|
||||
public R<String> insertStGate(@RequestBody @Validated StGateDto stGateDto){
|
||||
engineeringDrainageService.insertStGate(stGateDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新闸阀基础信息")
|
||||
@PostMapping("/updateStGate")
|
||||
@PostMapping("/StGate/update")
|
||||
public R<String> updateStGate(@RequestBody @Validated StGateB stGateB){
|
||||
engineeringDrainageService.updateStGate(stGateB);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据闸阀ID删除闸阀基础信息")
|
||||
@GetMapping("/deleteStGate")
|
||||
@GetMapping("/StGate/delete")
|
||||
public R<String> deleteStGate(@Parameter(description = "闸阀ID") @RequestParam("gateId") String gateId){
|
||||
engineeringDrainageService.deleteStGate(gateId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询闸阀基础信息")
|
||||
@PostMapping("/pageStGate")
|
||||
@PostMapping("/StGate/page")
|
||||
public R<Page<StGateB>> pageStGate(@RequestBody @Validated StGatePageSo stGatePageSo){
|
||||
return R.ok(engineeringDrainageService.pageStGate(stGatePageSo));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "新增量水堰基础信息")
|
||||
@PostMapping("/insertStEqpt")
|
||||
@PostMapping("/StEqpt/insert")
|
||||
public R<String> insertStEqpt(@RequestBody @Validated StEqptDto stEqptDto){
|
||||
engineeringDrainageService.insertStEqpt(stEqptDto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新量水堰基础信息")
|
||||
@PostMapping("/updateStEqpt")
|
||||
@PostMapping("/StEqpt/update")
|
||||
public R<String> updateStEqpt(@RequestBody StEqptB stEqptB){
|
||||
engineeringDrainageService.updateStEqpt(stEqptB);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据量水设施ID删除量水堰基础信息")
|
||||
@GetMapping("/deleteStEqpt")
|
||||
@GetMapping("/StEqpt/delete")
|
||||
public R<String> deleteStEqpt(@Parameter(description = "量水设施ID") @RequestParam("wmeqId") String wmeqId){
|
||||
engineeringDrainageService.deleteStEqpt(wmeqId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据量水设施ID查询量水堰基础信息")
|
||||
@GetMapping("/queryByWmegId")
|
||||
public R<Page<StEqptB>> pageEqpt(@RequestBody @Validated StEqptPageSo stEqptPageSo){
|
||||
@PostMapping("/StEqpt/page")
|
||||
public R<Page<StEqptB>> pageStEqpt(@RequestBody @Validated StEqptPageSo stEqptPageSo){
|
||||
return R.ok(engineeringDrainageService.pageStEqpt(stEqptPageSo));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,106 +16,99 @@ import java.math.BigDecimal;
|
|||
* @Date 2024/1/24 14:43
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description="水库的基础信息DTO")
|
||||
@Schema(description = "水库的基础信息DTO")
|
||||
@Data
|
||||
public class StResDto extends StResB {
|
||||
|
||||
/**
|
||||
* 水库名称
|
||||
*/
|
||||
@Schema(description="水库名称")
|
||||
@Schema(description = "水库名称")
|
||||
@NotNull(message = "水库名称不能为空")
|
||||
private String resName;
|
||||
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@Schema(description="水库代码")
|
||||
@Schema(description = "水库代码")
|
||||
@NotNull(message = "水库代码不能为空")
|
||||
private String resCode;
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
@Schema(description="行政区划编码")
|
||||
@Schema(description = "行政区划编码")
|
||||
@NotNull(message = "行政区化编码不能为空")
|
||||
private String addvcd;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description="经度")
|
||||
@Schema(description = "经度")
|
||||
@NotNull(message = "经度不能为空")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description="纬度")
|
||||
@Schema(description = "纬度")
|
||||
@NotNull(message = "维度不能为空")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 设计洪水位
|
||||
*/
|
||||
@Schema(description="设计洪水位")
|
||||
@Schema(description = "设计洪水位")
|
||||
@NotNull(message = "设计洪水位不能为空")
|
||||
private BigDecimal dsfllv;
|
||||
|
||||
/**
|
||||
* 校核洪水位
|
||||
*/
|
||||
@Schema(description="校核洪水位")
|
||||
@Schema(description = "校核洪水位")
|
||||
@NotNull(message = "校核洪水位不能为空")
|
||||
private BigDecimal chfllv;
|
||||
|
||||
/**
|
||||
* 正常蓄水位
|
||||
*/
|
||||
@Schema(description="正常蓄水位")
|
||||
@Schema(description = "正常蓄水位")
|
||||
@NotNull(message = "正常蓄水位不能为空")
|
||||
private BigDecimal normWatLev;
|
||||
|
||||
/**
|
||||
* 死水位
|
||||
*/
|
||||
@Schema(description="死水位")
|
||||
@Schema(description = "死水位")
|
||||
@NotNull(message = "死水位不能为空")
|
||||
private BigDecimal deadLev;
|
||||
|
||||
/**
|
||||
* 总库容
|
||||
*/
|
||||
@Schema(description="总库容")
|
||||
@Schema(description = "总库容")
|
||||
@NotNull(message = "总库容不能为空")
|
||||
private BigDecimal totCap;
|
||||
|
||||
/**
|
||||
* 汛限水位
|
||||
*/
|
||||
@Schema(description="汛限水位")
|
||||
@Schema(description = "汛限水位")
|
||||
@NotNull(message = "汛限水位不能为空")
|
||||
private BigDecimal flLowLimLev;
|
||||
|
||||
/**
|
||||
* 集雨面积
|
||||
*/
|
||||
@Schema(description="集雨面积")
|
||||
@Schema(description = "集雨面积")
|
||||
@NotNull(message = "集雨面积不能为空")
|
||||
private BigDecimal watShedArea;
|
||||
|
||||
/**
|
||||
* 水库规模 dict_id
|
||||
*/
|
||||
@Schema(description="水库规模 dict_id")
|
||||
@Schema(description = "水库规模 dict_id")
|
||||
@NotNull(message = "水库规模不能为空")
|
||||
private Long engScal;
|
||||
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@Schema(description = "测站编码")
|
||||
@NotNull(message = "测站编码不能为空")
|
||||
private String STCD;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.gunshi.project.xyt.entity.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.project.xyt.model.StResFileRef;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StResFileRefDto
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 11:47
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description="水库附件信息DTO")
|
||||
@Data
|
||||
public class StResFileRefDto extends StResFileRef {
|
||||
|
||||
/**
|
||||
* 水库ID
|
||||
*/
|
||||
@Schema(description="水库ID")
|
||||
@NotNull(message = "水库ID不能为空")
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@Schema(description="序号")
|
||||
@NotNull(message = "需要不能为空")
|
||||
private Integer sortOn;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.gunshi.project.xyt.entity.dto;
|
||||
|
||||
import com.gunshi.project.xyt.model.StResPersonRef;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StResPersonRefDto
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 11:20
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description="水库责任人信息DTO")
|
||||
@Data
|
||||
public class StResPersonRefDto extends StResPersonRef {
|
||||
/**
|
||||
* 水库ID
|
||||
*/
|
||||
@Schema(description="水库ID")
|
||||
@NotNull(message = "水库ID不能为空")
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@Schema(description="序号")
|
||||
@NotNull(message = "需要不能为空")
|
||||
private Integer sortOn;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.gunshi.project.xyt.entity.dto;
|
||||
|
||||
import com.gunshi.project.xyt.model.StResStcdRef;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StResStcdRefDto
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 14:24
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description="水库测站关系信息DTO")
|
||||
@Data
|
||||
public class StResStcdRefDto extends StResStcdRef {
|
||||
|
||||
/**
|
||||
* 水库ID
|
||||
*/
|
||||
@Schema(description="水库ID")
|
||||
@NotNull(message = "水库ID不能为空")
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@Schema(description="测站编码")
|
||||
@NotNull(message = "测站编码不能为空")
|
||||
private String stcd;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.gunshi.project.xyt.entity.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.project.xyt.model.StZvarlB;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StZvarlDto
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 10:47
|
||||
*/
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description="库容曲线信息DTO")
|
||||
@Data
|
||||
public class StZvarlDto extends StZvarlB {
|
||||
/**
|
||||
* 水库ID
|
||||
*/
|
||||
@Schema(description="水库ID")
|
||||
@NotNull(message = "水库ID不能为空")
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 点序号
|
||||
*/
|
||||
@Schema(description="点序号")
|
||||
@NotNull(message = "点序号不能为空")
|
||||
private Integer ptno;
|
||||
|
||||
}
|
||||
|
|
@ -7,11 +7,14 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -27,6 +30,7 @@ public class StResB implements Serializable {
|
|||
@TableId(value = "RES_ID", type = IdType.INPUT)
|
||||
@Schema(description="水库id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@NotEmpty(groups = Insert.class)
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,16 +13,17 @@ import com.gunshi.project.xyt.model.StDamBAutoDao;
|
|||
import com.gunshi.project.xyt.model.StEqptBAutoDao;
|
||||
import com.gunshi.project.xyt.model.StGateBAutoDao;
|
||||
import com.gunshi.project.xyt.model.StResBAutoDao;
|
||||
import com.gunshi.project.xyt.model.StResFileRefAutoDao;
|
||||
import com.gunshi.project.xyt.model.StResPersonRefAutoDao;
|
||||
import com.gunshi.project.xyt.model.StResStcdRefAutoDao;
|
||||
import com.gunshi.project.xyt.model.StRvBAutoDao;
|
||||
import com.gunshi.project.xyt.model.StZvarlBAutoDao;
|
||||
import com.gunshi.project.xyt.so.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.print.DocFlavor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -43,6 +44,12 @@ public class EngineeringDrainageService {
|
|||
@Resource
|
||||
private StResStcdRefAutoDao stResStcdRefAutoDao;
|
||||
@Resource
|
||||
private StZvarlBAutoDao stZvarlBAutoDao;
|
||||
@Resource
|
||||
private StResPersonRefAutoDao stResPersonRefAutoDao;
|
||||
@Resource
|
||||
private StResFileRefAutoDao stResFileRefAutoDao;
|
||||
@Resource
|
||||
private StRvBAutoDao stRvBAutoDao;
|
||||
@Resource
|
||||
private StDamBAutoDao stDamBAutoDao;
|
||||
|
|
@ -77,21 +84,15 @@ public class EngineeringDrainageService {
|
|||
|
||||
/**
|
||||
* 更新水库的基础信息
|
||||
* @param stResDto 水库的基础信息
|
||||
* @param stResB 水库的基础信息
|
||||
*/
|
||||
public void updateStRes(StResDto stResDto) {
|
||||
Long resId = stResDto.getResId();
|
||||
public void updateStRes(StResB stResB) {
|
||||
Long resId = stResB.getResId();
|
||||
StResB byId = stResBAutoDao.getById(resId);
|
||||
if (byId == null) {
|
||||
throw new IllegalArgumentException("resId:" + resId + "不存在");
|
||||
}
|
||||
//判断水库代码是否唯一
|
||||
if (queryByResCode(stResDto.getResCode()) != null){
|
||||
throw new IllegalArgumentException("水库代码必须唯一");
|
||||
}
|
||||
|
||||
StResB stResB = new StResB();
|
||||
BeanUtil.copyProperties(stResDto,stResB);
|
||||
Date date = new Date();
|
||||
stResB.setTm(date);
|
||||
//更新水库基本信息
|
||||
|
|
@ -160,6 +161,193 @@ public class EngineeringDrainageService {
|
|||
return stResBAutoDao.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水库测站关系
|
||||
* @param stResStcdRefDto 水库测站关系信息DTO
|
||||
*/
|
||||
public void insertStResStcdRef(StResStcdRefDto stResStcdRefDto){
|
||||
StResStcdRef stResStcdRef = new StResStcdRef();
|
||||
BeanUtil.copyProperties(stResStcdRefDto,stResStcdRef);
|
||||
stResStcdRef.setTm(new Date());
|
||||
stResStcdRefAutoDao.save(stResStcdRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新水库测站关系
|
||||
* @param stResStcdRef 水库测站关系信息
|
||||
*/
|
||||
public void updateStResStcdRef(StResStcdRef stResStcdRef){
|
||||
Long resId = stResStcdRef.getResId();
|
||||
String stcd = stResStcdRef.getStcd();
|
||||
if (stResStcdRefAutoDao.getById(resId) == null){
|
||||
throw new IllegalArgumentException("水库ID : " + resId + "不存在测站关系");
|
||||
}
|
||||
UpdateWrapper<StResStcdRef> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq(StResStcdRef.COL_RES_ID,resId)
|
||||
.set(StResStcdRef.COL_STCD,stcd)
|
||||
.set(StResStcdRef.COL_TM,new Date());
|
||||
stResStcdRefAutoDao.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水库测站关系
|
||||
* @param resId 水库ID
|
||||
*/
|
||||
public void deleteStResStcdRef(String resId){
|
||||
if (stResStcdRefAutoDao.getById(resId) != null){
|
||||
throw new IllegalArgumentException("该水库ID不存在测站关系");
|
||||
}
|
||||
stResStcdRefAutoDao.removeById(resId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据水库ID查询水库测站关系
|
||||
* @param resId 水库ID
|
||||
* @return
|
||||
*/
|
||||
public StResStcdRef queryStResStcdRefByResId(String resId){
|
||||
StResStcdRef stResStcdRef = stResStcdRefAutoDao.getById(resId);
|
||||
if (stResStcdRef == null){
|
||||
throw new IllegalArgumentException("该水库ID不存在水库测站关系");
|
||||
}
|
||||
return stResStcdRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库容曲线信息
|
||||
* @param stZvarlDto 库容曲线信息DTO
|
||||
*/
|
||||
public void insertStZvarl(StZvarlDto stZvarlDto){
|
||||
StZvarlB stZvarlB = new StZvarlB();
|
||||
BeanUtil.copyProperties(stZvarlDto,stZvarlB);
|
||||
stZvarlB.setModitime(new Date());
|
||||
stZvarlBAutoDao.save(stZvarlB);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新库容曲线信息
|
||||
* @param stZvarlB 库容曲线信息
|
||||
*/
|
||||
public void updateStZvarl(StZvarlB stZvarlB){
|
||||
StZvarlB byId = stZvarlBAutoDao.getById(stZvarlB.getResId());
|
||||
if (byId == null){
|
||||
throw new IllegalArgumentException("该水库ID对应的库容曲线不存在");
|
||||
}
|
||||
stZvarlB.setMstm(new Date());
|
||||
stZvarlBAutoDao.updateById(stZvarlB);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库容曲线信息
|
||||
* @param resId 水库ID
|
||||
* @param ptno 序号
|
||||
*/
|
||||
public void deleteStZvarl(String resId,String ptno){
|
||||
QueryWrapper<StZvarlB> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StZvarlB.COL_RES_ID,resId)
|
||||
.eq(StZvarlB.COL_PTNO,ptno);
|
||||
StZvarlB stZvarlB = stZvarlBAutoDao.getOne(queryWrapper);
|
||||
if (stZvarlB == null) {
|
||||
throw new IllegalArgumentException("要删除的水库ID或点序号不存在");
|
||||
}
|
||||
stZvarlBAutoDao.remove(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询库容曲线信息
|
||||
* @param stZvarlSo 库容曲线信息查询参数
|
||||
* @return
|
||||
*/
|
||||
public Page<StZvarlB> pageStZvarl(StZvarlSo stZvarlSo){
|
||||
QueryWrapper<StZvarlB> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc(StZvarlB.COL_PTNO);
|
||||
return stZvarlBAutoDao.page(stZvarlSo.getPageSo().toPage(),queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水库责任人信息
|
||||
* @param stResPersonRefDto 水库责任人信息DTO
|
||||
*/
|
||||
public void insertStResPersonRef(StResPersonRefDto stResPersonRefDto){
|
||||
StResPersonRef stResPersonRef = new StResPersonRef();
|
||||
BeanUtil.copyProperties(stResPersonRefDto,stResPersonRef);
|
||||
long id = IdWorker.getId();
|
||||
stResPersonRef.setId(id);
|
||||
stResPersonRef.setTm(new Date());
|
||||
stResPersonRefAutoDao.save(stResPersonRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新水库责任人关系
|
||||
* @param stResPersonRef 水库责任人关系信息
|
||||
*/
|
||||
public void updateStResPersonRef(StResPersonRef stResPersonRef){
|
||||
Long id = stResPersonRef.getId();
|
||||
if (stResPersonRefAutoDao.getById(id) == null ){
|
||||
throw new IllegalArgumentException("要更新的水库责任人关系不存在");
|
||||
}
|
||||
stResPersonRefAutoDao.updateById(stResPersonRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水库责任人信息
|
||||
* @param id 水库责任人关系ID
|
||||
*/
|
||||
public void deleteStResPersonRef(String id){
|
||||
StResPersonRef byId = stResPersonRefAutoDao.getById(id);
|
||||
if (byId == null){
|
||||
throw new IllegalArgumentException("该水库责任人关系ID不存在");
|
||||
}
|
||||
stResPersonRefAutoDao.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询水库责任人信息
|
||||
* @param stResPersonRefSo 水库责任人关系信息查询参数
|
||||
* @return
|
||||
*/
|
||||
public Page<StResPersonRef> pageStResPersonRef(StResPersonRefSo stResPersonRefSo){
|
||||
QueryWrapper<StResPersonRef> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc(StResPersonRef.COL_SORT_ON);
|
||||
return stResPersonRefAutoDao.page(stResPersonRefSo.getPageSo().toPage(),queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水库附件信息
|
||||
* @param stResFileRefDto 水库附件信息DTO
|
||||
*/
|
||||
public void insertStResFileRef(StResFileRefDto stResFileRefDto){
|
||||
StResFileRef stResFileRef = new StResFileRef();
|
||||
BeanUtil.copyProperties(stResFileRefDto,stResFileRef);
|
||||
long id = IdWorker.getId();
|
||||
stResFileRef.setId(id);
|
||||
stResFileRef.setTm(new Date());
|
||||
stResFileRefAutoDao.save(stResFileRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据水库附件关系ID删除水库附件信息
|
||||
* @param id 水库附件关系ID
|
||||
*/
|
||||
public void deleteStResFileRef(String id){
|
||||
StResFileRef byId = stResFileRefAutoDao.getById(id);
|
||||
if (byId == null){
|
||||
throw new IllegalArgumentException("该水库附件关系ID不存在");
|
||||
}
|
||||
stResFileRefAutoDao.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询水库附件
|
||||
* @param stResFileRefSo 水库附件关系信息查询参数
|
||||
*/
|
||||
public Page<StResFileRef> pageStResFileRef(StResFileRefSo stResFileRefSo){
|
||||
QueryWrapper<StResFileRef> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc(StResPersonRef.COL_SORT_ON);
|
||||
return stResFileRefAutoDao.page(stResFileRefSo.getPageSo().toPage(),queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增河流基础信息
|
||||
* @param stRvDto 河流的基础信息DTO
|
||||
|
|
@ -182,6 +370,9 @@ public class EngineeringDrainageService {
|
|||
* @param stRvB 河流的基础信息
|
||||
*/
|
||||
public void updateStRv(StRvB stRvB) {
|
||||
if (queryByRvCode(stRvB.getRvCode()) != null){
|
||||
throw new IllegalArgumentException("河流代码必须唯一");
|
||||
}
|
||||
Long rvId = stRvB.getRvId();
|
||||
StRvB byId = stRvBAutoDao.getById(rvId);
|
||||
if (byId == null){
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.gunshi.project.xyt.so;
|
||||
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StResFileRefSo
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 11:57
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "水库附件关系信息查询参数")
|
||||
public class StResFileRefSo {
|
||||
|
||||
@NotNull(message = "分页参数不能为空")
|
||||
private PageSo pageSo;
|
||||
|
||||
@Schema(description="序号")
|
||||
private Integer sortOn;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.gunshi.project.xyt.so;
|
||||
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StResPersonRefSo
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 11:39
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "水库责任人关系信息查询参数")
|
||||
public class StResPersonRefSo {
|
||||
|
||||
@NotNull(message = "分页参数不能为空")
|
||||
private PageSo pageSo;
|
||||
|
||||
@Schema(description="序号")
|
||||
private Integer sortOn;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.gunshi.project.xyt.so;
|
||||
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import com.gunshi.project.xyt.model.StZvarlB;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @ClassName StZvarlDto
|
||||
* @Author Huang Qianxiang
|
||||
* @Date 2024/1/29 10:39
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Schema(description = "库容曲线信息查询参数")
|
||||
public class StZvarlSo extends StZvarlB {
|
||||
|
||||
@NotNull(message = "分页参数不能为空")
|
||||
private PageSo pageSo;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue