修改EngineeringDrainageService
parent
abc51e4709
commit
4252d45330
|
|
@ -6,7 +6,7 @@ import com.gunshi.project.xyt.entity.dto.*;
|
||||||
import com.gunshi.project.xyt.model.*;
|
import com.gunshi.project.xyt.model.*;
|
||||||
import com.gunshi.project.xyt.service.EngineeringDrainageService;
|
import com.gunshi.project.xyt.service.EngineeringDrainageService;
|
||||||
import com.gunshi.project.xyt.so.*;
|
import com.gunshi.project.xyt.so.*;
|
||||||
import com.gunshi.project.xyt.validate.markers.Update;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
@ -41,7 +41,7 @@ public class EngineeringDrainageController {
|
||||||
|
|
||||||
@Operation(summary = "更新水库的基础信息")
|
@Operation(summary = "更新水库的基础信息")
|
||||||
@PostMapping("/StRes/update")
|
@PostMapping("/StRes/update")
|
||||||
public R<String> updateStRes(@Validated(Update.class) @RequestBody StResB stResB) {
|
public R<String> updateStRes(@Validated(Insert.class) @RequestBody StResB stResB){
|
||||||
engineeringDrainageService.updateStRes(stResB);
|
engineeringDrainageService.updateStRes(stResB);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +138,7 @@ public class EngineeringDrainageController {
|
||||||
|
|
||||||
@Operation(summary = "分页查询水库责任人信息")
|
@Operation(summary = "分页查询水库责任人信息")
|
||||||
@PostMapping("/StResPersonRef/page")
|
@PostMapping("/StResPersonRef/page")
|
||||||
public R<Page<StResPersonRef>> pageStResPersonRef(StResPersonRefSo stResPersonRefSo) {
|
public R<Page<StResPersonRef>> pageStResPersonRef(@RequestBody @Validated StResPersonRefSo stResPersonRefSo){
|
||||||
return R.ok(engineeringDrainageService.pageStResPersonRef(stResPersonRefSo));
|
return R.ok(engineeringDrainageService.pageStResPersonRef(stResPersonRefSo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ public class EngineeringDrainageController {
|
||||||
|
|
||||||
@Operation(summary = "更新河流的基础信息")
|
@Operation(summary = "更新河流的基础信息")
|
||||||
@PostMapping("/StRv/update")
|
@PostMapping("/StRv/update")
|
||||||
public R<String> updateStRv(@RequestBody StRvB stRvB) {
|
public R<String> updateStRv(@RequestBody @Validated StRvB stRvB){
|
||||||
engineeringDrainageService.updateStRv(stRvB);
|
engineeringDrainageService.updateStRv(stRvB);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
@ -258,14 +258,14 @@ public class EngineeringDrainageController {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "根据量水设施ID删除量水堰基础信息")
|
@Operation(summary = "删除量水堰基础信息")
|
||||||
@GetMapping("/StEqpt/delete")
|
@GetMapping("/StEqpt/delete")
|
||||||
public R<String> deleteStEqpt(@Parameter(description = "量水设施ID") @RequestParam("wmeqId") String wmeqId){
|
public R<String> deleteStEqpt(@Parameter(description = "量水设施ID") @RequestParam("wmeqId") String wmeqId){
|
||||||
engineeringDrainageService.deleteStEqpt(wmeqId);
|
engineeringDrainageService.deleteStEqpt(wmeqId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "根据量水设施ID查询量水堰基础信息")
|
@Operation(summary = "分页查询量水堰信息")
|
||||||
@PostMapping("/StEqpt/page")
|
@PostMapping("/StEqpt/page")
|
||||||
public R<Page<StEqptB>> pageStEqpt(@RequestBody @Validated StEqptPageSo stEqptPageSo){
|
public R<Page<StEqptB>> pageStEqpt(@RequestBody @Validated StEqptPageSo stEqptPageSo){
|
||||||
return R.ok(engineeringDrainageService.pageStEqpt(stEqptPageSo));
|
return R.ok(engineeringDrainageService.pageStEqpt(stEqptPageSo));
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,17 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.gunshi.project.xyt.validate.markers.Update;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水库的基础信息
|
* 水库的基础信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -29,7 +31,7 @@ public class StResB implements Serializable {
|
||||||
@TableId(value = "RES_ID", type = IdType.INPUT)
|
@TableId(value = "RES_ID", type = IdType.INPUT)
|
||||||
@Schema(description="水库id")
|
@Schema(description="水库id")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
@NotEmpty(groups = Update.class)
|
@NotNull(groups = Insert.class)
|
||||||
private Long resId;
|
private Long resId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.gunshi.project.xyt.model;
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
@ -8,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库(湖)容曲线表
|
* 库(湖)容曲线表
|
||||||
|
|
@ -24,7 +23,7 @@ public class StZvarlB implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 水库ID
|
* 水库ID
|
||||||
*/
|
*/
|
||||||
@TableField(value = "RES_ID")
|
@TableId(value = "RES_ID")
|
||||||
@Schema(description = "水库ID")
|
@Schema(description = "水库ID")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long resId;
|
private Long resId;
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ public class EngineeringDrainageService {
|
||||||
* @param resId 水库ID
|
* @param resId 水库ID
|
||||||
*/
|
*/
|
||||||
public void deleteStResStcdRef(String resId){
|
public void deleteStResStcdRef(String resId){
|
||||||
if (stResStcdRefAutoDao.getById(resId) != null){
|
if (stResStcdRefAutoDao.getById(resId) == null){
|
||||||
throw new IllegalArgumentException("该水库ID不存在测站关系");
|
throw new IllegalArgumentException("该水库ID不存在测站关系");
|
||||||
}
|
}
|
||||||
stResStcdRefAutoDao.removeById(resId);
|
stResStcdRefAutoDao.removeById(resId);
|
||||||
|
|
@ -233,7 +233,7 @@ public class EngineeringDrainageService {
|
||||||
if (byId == null){
|
if (byId == null){
|
||||||
throw new IllegalArgumentException("该水库ID对应的库容曲线不存在");
|
throw new IllegalArgumentException("该水库ID对应的库容曲线不存在");
|
||||||
}
|
}
|
||||||
stZvarlB.setMstm(new Date());
|
stZvarlB.setModitime(new Date());
|
||||||
stZvarlBAutoDao.updateById(stZvarlB);
|
stZvarlBAutoDao.updateById(stZvarlB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -286,6 +286,7 @@ public class EngineeringDrainageService {
|
||||||
if (stResPersonRefAutoDao.getById(id) == null ){
|
if (stResPersonRefAutoDao.getById(id) == null ){
|
||||||
throw new IllegalArgumentException("要更新的水库责任人关系不存在");
|
throw new IllegalArgumentException("要更新的水库责任人关系不存在");
|
||||||
}
|
}
|
||||||
|
stResPersonRef.setTm(new Date());
|
||||||
stResPersonRefAutoDao.updateById(stResPersonRef);
|
stResPersonRefAutoDao.updateById(stResPersonRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -353,7 +354,7 @@ public class EngineeringDrainageService {
|
||||||
* @param stRvDto 河流的基础信息DTO
|
* @param stRvDto 河流的基础信息DTO
|
||||||
*/
|
*/
|
||||||
public void insertStRv(StRvDto stRvDto) {
|
public void insertStRv(StRvDto stRvDto) {
|
||||||
if (queryByResCode(stRvDto.getRvCode()) != null){
|
if (queryByRvCode(stRvDto.getRvCode()) != null){
|
||||||
throw new IllegalArgumentException("河流代码必须唯一");
|
throw new IllegalArgumentException("河流代码必须唯一");
|
||||||
}
|
}
|
||||||
StRvB stRvB = new StRvB();
|
StRvB stRvB = new StRvB();
|
||||||
|
|
@ -370,9 +371,6 @@ public class EngineeringDrainageService {
|
||||||
* @param stRvB 河流的基础信息
|
* @param stRvB 河流的基础信息
|
||||||
*/
|
*/
|
||||||
public void updateStRv(StRvB stRvB) {
|
public void updateStRv(StRvB stRvB) {
|
||||||
if (queryByRvCode(stRvB.getRvCode()) != null){
|
|
||||||
throw new IllegalArgumentException("河流代码必须唯一");
|
|
||||||
}
|
|
||||||
Long rvId = stRvB.getRvId();
|
Long rvId = stRvB.getRvId();
|
||||||
StRvB byId = stRvBAutoDao.getById(rvId);
|
StRvB byId = stRvBAutoDao.getById(rvId);
|
||||||
if (byId == null){
|
if (byId == null){
|
||||||
|
|
@ -643,7 +641,7 @@ public class EngineeringDrainageService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据量水设施ID删除量水堰基础信息
|
* 删除量水堰基础信息
|
||||||
* @param wmeqId 量水设施ID
|
* @param wmeqId 量水设施ID
|
||||||
*/
|
*/
|
||||||
public void deleteStEqpt(String wmeqId){
|
public void deleteStEqpt(String wmeqId){
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,4 @@ public class StResFileRefSo {
|
||||||
@NotNull(message = "分页参数不能为空")
|
@NotNull(message = "分页参数不能为空")
|
||||||
private PageSo pageSo;
|
private PageSo pageSo;
|
||||||
|
|
||||||
@Schema(description="序号")
|
|
||||||
private Integer sortOn;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class StResPageSo {
|
||||||
@Schema(description="水库规模 dict_id")
|
@Schema(description="水库规模 dict_id")
|
||||||
private String engScal;
|
private String engScal;
|
||||||
|
|
||||||
@Schema(description=" 状态 1:启用 0:禁用,默认1")
|
@Schema(description=" 状态 1:启用 0:禁用")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,4 @@ public class StResPersonRefSo {
|
||||||
@NotNull(message = "分页参数不能为空")
|
@NotNull(message = "分页参数不能为空")
|
||||||
private PageSo pageSo;
|
private PageSo pageSo;
|
||||||
|
|
||||||
@Schema(description="序号")
|
|
||||||
private Integer sortOn;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "库容曲线信息查询参数")
|
@Schema(description = "库容曲线信息查询参数")
|
||||||
public class StZvarlSo extends StZvarlB {
|
public class StZvarlSo{
|
||||||
|
|
||||||
@NotNull(message = "分页参数不能为空")
|
@NotNull(message = "分页参数不能为空")
|
||||||
private PageSo pageSo;
|
private PageSo pageSo;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue