监测站点,视频基本信息,监测断面,渗压设备,渗流设备,位移设备,数据字典,闸阀与摄像头相关接口开发
parent
595c96a05e
commit
d690aa8d5b
|
|
@ -1,5 +1,6 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -24,8 +25,10 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 视频基本信息表
|
||||
|
|
@ -44,6 +47,8 @@ public class AttCctvBaseController {
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttCctvBase> insert(@Validated(Insert.class) @RequestBody AttCctvBase dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -51,6 +56,9 @@ public class AttCctvBaseController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttCctvBase> update(@Validated(Update.class) @RequestBody AttCctvBase dto) {
|
||||
if (Objects.isNull(service.getById(dto.getId()))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -58,6 +66,9 @@ public class AttCctvBaseController {
|
|||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,16 +7,19 @@ import com.gunshi.core.result.R;
|
|||
import com.gunshi.project.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.model.AttDamBase;
|
||||
import com.gunshi.project.xyt.service.AttDamBaseService;
|
||||
import com.gunshi.project.xyt.service.AttResBaseService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -34,9 +37,16 @@ public class AttDamBaseController {
|
|||
private AttDamBaseService service;
|
||||
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService resService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttDamBase> insert(@Validated(Insert.class) @RequestBody AttDamBase dto) {
|
||||
if (StringUtils.isNotBlank(dto.getResCode()) && Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -44,6 +54,9 @@ public class AttDamBaseController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttDamBase> update(@Validated(Update.class) @RequestBody AttDamBase dto) {
|
||||
if (StringUtils.isNotBlank(dto.getResCode()) && Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
if (Objects.isNull(service.getById(dto.getDamCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ public class AttGateValveController {
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttGateValve> insert(@Validated(Insert.class) @RequestBody AttGateValve dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getValveCode()))){
|
||||
throw new IllegalArgumentException("当前闸阀编码已存在");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ import com.gunshi.core.result.R;
|
|||
import com.gunshi.project.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.model.AttMeaWeir;
|
||||
import com.gunshi.project.xyt.service.AttMeaWeirService;
|
||||
import com.gunshi.project.xyt.service.StAddvcdDService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -33,10 +35,19 @@ public class AttMeaWeirController {
|
|||
@Autowired
|
||||
private AttMeaWeirService service;
|
||||
|
||||
@Autowired
|
||||
private StAddvcdDService stAddvcdDService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttMeaWeir> insert(@Validated(Insert.class) @RequestBody AttMeaWeir dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getWeirCode()))){
|
||||
throw new IllegalArgumentException("当前闸阀编码已存在");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getAdcd()) && Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))){
|
||||
throw new IllegalArgumentException("当前行政区划不存在");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -47,6 +58,10 @@ public class AttMeaWeirController {
|
|||
if (Objects.isNull(service.getById(dto.getWeirCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(dto.getAdcd()) && Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))){
|
||||
throw new IllegalArgumentException("当前行政区划不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.GateValveCctvRelPage;
|
||||
|
|
@ -17,6 +18,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -43,6 +45,8 @@ public class GateValveCctvRelController {
|
|||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前编号已关联");
|
||||
}
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.gunshi.core.result.R;
|
|||
import com.gunshi.project.xyt.entity.vo.HomeIaCFlrvvlgVo;
|
||||
import com.gunshi.project.xyt.model.IaCFlrvvlg;
|
||||
import com.gunshi.project.xyt.service.IaCFlrvvlgService;
|
||||
import com.gunshi.project.xyt.service.StAddvcdDService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
|
@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 重要沿河村落居民户调查成果表
|
||||
* author: xusan
|
||||
|
|
@ -28,10 +31,16 @@ public class IaCFlrvvlgController {
|
|||
@Autowired
|
||||
private IaCFlrvvlgService service;
|
||||
|
||||
@Autowired
|
||||
private StAddvcdDService stAddvcdDService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<IaCFlrvvlg> insert(@Validated(Insert.class) @RequestBody IaCFlrvvlg dto) {
|
||||
if (Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))) {
|
||||
throw new RuntimeException("请输入正确的行政区划代码");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -39,6 +48,13 @@ public class IaCFlrvvlgController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<IaCFlrvvlg> update(@Validated(Update.class) @RequestBody IaCFlrvvlg dto) {
|
||||
|
||||
if (Objects.isNull( service.getById(dto.getAvrcd()))){
|
||||
throw new RuntimeException("请输入正确的沿河村落居民户编码");
|
||||
}
|
||||
if (Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))) {
|
||||
throw new RuntimeException("请输入正确的行政区划代码");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -46,6 +62,9 @@ public class IaCFlrvvlgController {
|
|||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(stAddvcdDService.getById(id))) {
|
||||
throw new RuntimeException("请输入正确的行政区划代码");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.xyt.model.ResPlanB;
|
||||
|
|
@ -11,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -39,6 +42,7 @@ public class ResPlanBController extends AbstractCommonFileController{
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResPlanB> insert(@Validated(Insert.class) @RequestBody ResPlanB dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
|
||||
if (result){
|
||||
|
|
@ -81,7 +85,14 @@ public class ResPlanBController extends AbstractCommonFileController{
|
|||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResPlanB>> list(@Validated @RequestBody ResCodeSo so) {
|
||||
List<ResPlanB> list = service.lambdaQuery().eq(ResPlanB::getResCode, so.getResCode()).list();
|
||||
LambdaQueryChainWrapper<ResPlanB> query = service.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(so.getResCode())){
|
||||
query.eq(ResPlanB::getResCode, so.getResCode());
|
||||
}
|
||||
if (StringUtils.isNotBlank(so.getType())){
|
||||
query.eq(ResPlanB::getType, so.getType());
|
||||
}
|
||||
List<ResPlanB> list = query.list();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),String.valueOf( o.getId()))));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.gunshi.project.xyt.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.xyt.model.ResProjectImg;
|
||||
import com.gunshi.project.xyt.service.AttResBaseService;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.ResProjectImgService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
|
|
@ -16,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -35,10 +37,16 @@ public class ResProjectImgController extends AbstractCommonFileController{
|
|||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService resService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResProjectImg> insert(@Validated(Insert.class) @RequestBody ResProjectImg dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
dto.setModitime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf( dto.getId()));
|
||||
|
|
@ -49,6 +57,9 @@ public class ResProjectImgController extends AbstractCommonFileController{
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResProjectImg> update(@Validated(Update.class) @RequestBody ResProjectImg dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.gunshi.project.xyt.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.xyt.model.ResSafePersonB;
|
||||
import com.gunshi.project.xyt.service.AttResBaseService;
|
||||
import com.gunshi.project.xyt.service.ResSafePersonBService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
|
|
@ -14,7 +15,10 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 水库责任体系表
|
||||
* author: xusan
|
||||
|
|
@ -28,10 +32,16 @@ public class ResSafePersonBController {
|
|||
@Autowired
|
||||
private ResSafePersonBService service;
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService resService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResSafePersonB> insert(@Validated(Insert.class) @RequestBody ResSafePersonB dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
dto.setModitime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -39,6 +49,9 @@ public class ResSafePersonBController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResSafePersonB> update(@Validated(Update.class) @RequestBody ResSafePersonB dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -46,6 +59,9 @@ public class ResSafePersonBController {
|
|||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 测站基础信息表
|
||||
* author: xusan
|
||||
|
|
@ -39,6 +41,9 @@ public class StStbprpBController {
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<StStbprpB> insert(@Validated(Insert.class) @RequestBody StStbprpB dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getStcd()))){
|
||||
throw new RuntimeException("测站编号已存在");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -46,6 +51,9 @@ public class StStbprpBController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<StStbprpB> update(@Validated(Update.class) @RequestBody StStbprpB dto) {
|
||||
if (Objects.isNull(service.getById(dto.getStcd()))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -53,6 +61,9 @@ public class StStbprpBController {
|
|||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -50,6 +51,7 @@ public class SysDictBController {
|
|||
throw new IllegalArgumentException("当父级不存在");
|
||||
}
|
||||
}
|
||||
dto.setCreateTm(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -70,6 +72,7 @@ public class SysDictBController {
|
|||
throw new IllegalArgumentException("当父级不存在");
|
||||
}
|
||||
}
|
||||
dto.setTm(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,10 @@ public class ResCodeSo {
|
|||
@Schema(description="水库代码")
|
||||
@NotBlank(message = "水库代码不能为空")
|
||||
private String resCode;
|
||||
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@Schema(description="类型(1防汛预案 2调度规程)")
|
||||
private String type;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public interface FileAssociationsMapper extends BaseMapper<FileAssociations> {
|
|||
fa.business_id = #{businessId}
|
||||
AND fa."table_name" = #{tableName}
|
||||
AND fd.group_id = #{tableName}
|
||||
ORDER BY fa.tm desc
|
||||
</script>
|
||||
""")
|
||||
List<FileAssociations> getFiles(@Param("tableName") String tableName,@Param("businessId") String businessId);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
|
@ -34,7 +36,7 @@ public class AttCctvBase implements Serializable {
|
|||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="id")
|
||||
@NotNull(message = "id不能为空")
|
||||
@NotNull(message = "id不能为空",groups = { Update.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
@ -43,7 +45,7 @@ public class AttCctvBase implements Serializable {
|
|||
@TableField(value="index_code")
|
||||
@Schema(description="序列号")
|
||||
@Size(max = 150,message = "序列号最大长度要小于 150")
|
||||
@NotBlank(message = "序列号不能为空")
|
||||
@NotBlank(message = "序列号不能为空",groups = {Insert.class, Update.class})
|
||||
private String indexCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -34,7 +36,7 @@ public class AttDamBase implements Serializable {
|
|||
@TableId(value="dam_code", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@Size(max = 32,message = "主键最大长度要小于 32")
|
||||
@NotBlank(message = "主键不能为空")
|
||||
@NotBlank(message = "主键不能为空",groups = {Insert.class, Update.class})
|
||||
private String damCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -34,7 +36,7 @@ public class AttGateValve implements Serializable {
|
|||
@TableId(value="valve_code", type= IdType.AUTO)
|
||||
@Schema(description="闸阀编码")
|
||||
@Size(max = 20,message = "闸阀编码最大长度要小于 20")
|
||||
@NotBlank(message = "闸阀编码不能为空")
|
||||
@NotBlank(message = "闸阀编码不能为空",groups = {Insert.class, Update.class})
|
||||
private String valveCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -34,7 +36,7 @@ public class AttMeaWeir implements Serializable {
|
|||
@TableId(value="weir_code", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@Size(max = 32,message = "主键最大长度要小于 32")
|
||||
@NotBlank(message = "主键不能为空")
|
||||
@NotBlank(message = "主键不能为空",groups = {Insert.class, Update.class})
|
||||
private String weirCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -34,7 +36,7 @@ public class AttSpillwayBase implements Serializable {
|
|||
@TableId(value="code", type= IdType.AUTO)
|
||||
@Schema(description="溢洪道代码")
|
||||
@Size(max = 32,message = "溢洪道代码最大长度要小于 32")
|
||||
@NotBlank(message = "溢洪道代码不能为空")
|
||||
@NotBlank(message = "溢洪道代码不能为空",groups = {Insert.class, Update.class})
|
||||
private String code;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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.core.dateformat.DateFormatString;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
|
@ -35,6 +37,7 @@ public class FileAssociations implements Serializable {
|
|||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@NotBlank(message = "主键不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
@ -51,6 +54,7 @@ public class FileAssociations implements Serializable {
|
|||
@TableField(value="file_id")
|
||||
@Schema(description="文件id")
|
||||
@NotBlank(message = "文件id不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import jakarta.validation.constraints.Size;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀关联视频点
|
||||
|
|
@ -59,6 +60,6 @@ public class GateValveCctvRel implements Serializable {
|
|||
*/
|
||||
@TableField(value="create_time")
|
||||
@Schema(description="创建时间")
|
||||
private String createTime;
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
|
@ -45,6 +45,13 @@ public class IaCFlrvvlg implements Serializable {
|
|||
@Size(max = 50,message = "户主名称最大长度要小于 50")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@TableField(value="phone")
|
||||
@Schema(description="联系电话")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 行政区划代码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -35,7 +37,7 @@ public class OsmoticFlowDevice implements Serializable {
|
|||
@TableId(value="station_code", type= IdType.AUTO)
|
||||
@Schema(description="测点编号")
|
||||
@Size(max = 50,message = "测点编号最大长度要小于 50")
|
||||
@NotBlank(message = "测点编号不能为空")
|
||||
@NotBlank(message = "测点编号不能为空",groups = {Insert.class, Update.class})
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -35,7 +37,7 @@ public class OsmoticPressDevice implements Serializable {
|
|||
@TableId(value="station_code", type= IdType.AUTO)
|
||||
@Schema(description="测点编号")
|
||||
@Size(max = 50,message = "测点编号最大长度要小于 50")
|
||||
@NotBlank(message = "测点编号不能为空")
|
||||
@NotBlank(message = "测点编号不能为空",groups = {Insert.class, Update.class})
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -31,7 +33,7 @@ public class OsmoticShiftDevice implements Serializable {
|
|||
@TableId(value="station_code", type= IdType.AUTO)
|
||||
@Schema(description="测点编号")
|
||||
@Size(max = 50,message = "测点编号最大长度要小于 50")
|
||||
@NotBlank(message = "测点编号不能为空")
|
||||
@NotBlank(message = "测点编号不能为空",groups = {Insert.class, Update.class})
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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.core.dateformat.DateFormatString;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
|
@ -36,6 +38,8 @@ public class ResPlanB implements Serializable {
|
|||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@NotNull(message = "主键不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -34,7 +36,7 @@ public class StStbprpB implements Serializable {
|
|||
@TableId(value="stcd", type= IdType.AUTO)
|
||||
@Schema(description="测站编码")
|
||||
@Size(max = 32,message = "测站编码最大长度要小于 32")
|
||||
@NotBlank(message = "测站编码不能为空")
|
||||
@NotBlank(message = "测站编码不能为空",groups = {Insert.class, Update.class})
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -35,7 +38,7 @@ public class SysDictB implements Serializable {
|
|||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="ID")
|
||||
// @Size(max = 0,message = "ID最大长度要小于 0")
|
||||
@NotBlank(message = "ID不能为空")
|
||||
@NotBlank(message = "ID不能为空",groups = {Insert.class, Update.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
@ -44,7 +47,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="dict_nm")
|
||||
@Schema(description="字典名称")
|
||||
@Size(max = 250,message = "字典名称最大长度要小于 250")
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
@NotBlank(message = "字典名称不能为空",groups = {Insert.class, Update.class})
|
||||
private String dictNm;
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +56,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="dict_cd")
|
||||
@Schema(description="字典编码")
|
||||
@Size(max = 250,message = "字典编码最大长度要小于 250")
|
||||
@NotBlank(message = "字典编码不能为空")
|
||||
@NotBlank(message = "字典编码不能为空",groups = {Insert.class, Update.class})
|
||||
private String dictCd;
|
||||
|
||||
/**
|
||||
|
|
@ -62,7 +65,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="pid")
|
||||
@Schema(description="父id")
|
||||
// @Size(max = 0,message = "父id最大长度要小于 0")
|
||||
@NotBlank(message = "父id不能为空")
|
||||
@NotBlank(message = "父id不能为空",groups = {Insert.class, Update.class})
|
||||
private Long pid;
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +74,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="sort_on")
|
||||
@Schema(description="排序字段")
|
||||
// @Size(max = 0,message = "排序字段最大长度要小于 0")
|
||||
@NotBlank(message = "排序字段不能为空")
|
||||
@NotBlank(message = "排序字段不能为空",groups = {Insert.class, Update.class})
|
||||
private Integer sortOn;
|
||||
|
||||
/**
|
||||
|
|
@ -80,7 +83,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="create_tm")
|
||||
@Schema(description="创建时间")
|
||||
// @Size(max = 0,message = "创建时间最大长度要小于 0")
|
||||
@NotBlank(message = "创建时间不能为空")
|
||||
// @NotBlank(message = "创建时间不能为空")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTm;
|
||||
|
||||
|
|
@ -90,7 +93,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="tm")
|
||||
@Schema(description="修改时间")
|
||||
// @Size(max = 0,message = "修改时间最大长度要小于 0")
|
||||
@NotBlank(message = "修改时间不能为空")
|
||||
// @NotBlank(message = "修改时间不能为空")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date tm;
|
||||
|
||||
|
|
@ -100,7 +103,7 @@ public class SysDictB implements Serializable {
|
|||
@TableField(value="status")
|
||||
@Schema(description="状态 1:启用 0:禁用")
|
||||
// @Size(max = 0,message = "状态 1:启用 0:禁用最大长度要小于 0")
|
||||
@NotBlank(message = "状态 1:启用 0:禁用不能为空")
|
||||
@NotNull(message = "状态 1:启用 0:禁用不能为空",groups = {Insert.class, Update.class})
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class FileAssociationsService extends ServiceImpl<FileAssociationsMapper,
|
|||
|
||||
private static final String THIS_REDIS_KEY = REDIS_KEY + FileAssociations.thisTableName + ":";
|
||||
|
||||
@CacheEvict(value = THIS_REDIS_KEY, key = "#tableName+':'+#businessId", allEntries = true)
|
||||
@CacheEvict(value = THIS_REDIS_KEY, key = "#p0 +':*'", allEntries = true)
|
||||
public void saveFile(List<FileAssociations> files, String tableName, String businessId) {
|
||||
if (CollectionUtils.isEmpty(files)) {
|
||||
log.info("fileIds is null!");
|
||||
|
|
@ -84,7 +84,7 @@ public class FileAssociationsService extends ServiceImpl<FileAssociationsMapper,
|
|||
|
||||
}
|
||||
|
||||
@CacheEvict(value = THIS_REDIS_KEY, key = "#tableName+':'+#businessId", allEntries = true)
|
||||
@CacheEvict(value = THIS_REDIS_KEY, key = "#p0 +':*'", allEntries = true)
|
||||
public void deleteFile(String tableName, String businessId) {
|
||||
// 删除
|
||||
if (this.lambdaUpdate()
|
||||
|
|
@ -96,9 +96,9 @@ public class FileAssociationsService extends ServiceImpl<FileAssociationsMapper,
|
|||
}
|
||||
}
|
||||
|
||||
@Cacheable(value = THIS_REDIS_KEY, key = "#tableName+':'+#businessId")
|
||||
public List<FileAssociations> getFiles(String tableName, String businessId) {
|
||||
return this.baseMapper.getFiles(tableName,businessId);
|
||||
@Cacheable(value = THIS_REDIS_KEY, key = "#p0 +':'+ #p1", unless = "false")
|
||||
public List<FileAssociations> getFiles(String tName, String bId) {
|
||||
return this.baseMapper.getFiles(tName,bId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue