渗压,渗流,位移新增创建时间字段
parent
9a9d599359
commit
f3d3ff04f6
|
|
@ -20,6 +20,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;
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ public class OsmoticFlowDeviceController extends AbstractCommonFileController{
|
|||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getProfileCode());
|
||||
|
|
@ -61,7 +62,7 @@ public class OsmoticFlowDeviceController extends AbstractCommonFileController{
|
|||
if (Objects.isNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getProfileCode());
|
||||
|
|
@ -94,6 +95,7 @@ public class OsmoticFlowDeviceController extends AbstractCommonFileController{
|
|||
if (ObjectUtils.isNotNull(page.getDeviceCode())) {
|
||||
query.like(OsmoticFlowDevice::getDeviceName, page.getDeviceCode());
|
||||
}
|
||||
query.orderByDesc(OsmoticFlowDevice::getCreateTime);
|
||||
|
||||
Page<OsmoticFlowDevice> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(o -> o.setFiles(
|
||||
|
|
|
|||
|
|
@ -20,6 +20,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;
|
||||
|
||||
|
|
@ -45,7 +46,7 @@ public class OsmoticPressDeviceController extends AbstractCommonFileController{
|
|||
if (Objects.nonNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getStationCode());
|
||||
|
|
@ -59,6 +60,7 @@ public class OsmoticPressDeviceController extends AbstractCommonFileController{
|
|||
if (Objects.isNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getStationCode());
|
||||
|
|
@ -93,6 +95,8 @@ public class OsmoticPressDeviceController extends AbstractCommonFileController{
|
|||
query.like(OsmoticPressDevice::getDeviceName, page.getDeviceCode());
|
||||
}
|
||||
|
||||
query.orderByDesc(OsmoticPressDevice::getCreateTime);
|
||||
|
||||
Page<OsmoticPressDevice> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(o -> o.setFiles(
|
||||
fileService.getFiles(getGroupId(),o.getStationCode())
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ 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;
|
||||
|
||||
/**
|
||||
* 描述: 位移监测记录表
|
||||
|
|
@ -33,6 +35,10 @@ public class OsmoticShiftDeviceController {
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticShiftDevice> insert(@Validated(Insert.class) @RequestBody OsmoticShiftDevice dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -40,6 +46,10 @@ public class OsmoticShiftDeviceController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticShiftDevice> update(@Validated(Update.class) @RequestBody OsmoticShiftDevice dto) {
|
||||
if (Objects.isNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,6 +185,15 @@ public class OsmoticFlowDevice implements Serializable {
|
|||
// @Size(max = 0,message = "纬度最大长度要小于 0")
|
||||
private String lttd;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value="create_time")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
|
|
|
|||
|
|
@ -193,6 +193,14 @@ public class OsmoticPressDevice implements Serializable {
|
|||
// @Size(max = 0,message = "纬度最大长度要小于 0")
|
||||
private String lttd;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value="create_time")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
|
|
|
|||
|
|
@ -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.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;
|
||||
|
|
@ -14,6 +16,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 位移设备表
|
||||
|
|
@ -73,4 +76,12 @@ public class OsmoticShiftDevice implements Serializable {
|
|||
@TableField(value="lttd")
|
||||
@Schema(description="纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value="create_time")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue