package cn.iocoder.yudao.module.finance.controller.admin.asset.vo;
|
|
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
import cn.iocoder.yudao.module.finance.enums.FinFixedAssetStatusEnum;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
import jakarta.validation.constraints.DecimalMax;
|
import jakarta.validation.constraints.DecimalMin;
|
import jakarta.validation.constraints.Min;
|
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.Size;
|
import lombok.Data;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import java.math.BigDecimal;
|
import java.time.LocalDate;
|
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
|
@Schema(description = "管理后台 - 固定资产新增/修改 Request VO")
|
@Data
|
public class FinFixedAssetSaveReqVO {
|
|
@Schema(description = "资产编号", example = "1024")
|
private Long id;
|
|
@Schema(description = "资产编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "GD202610120001")
|
@NotEmpty(message = "资产编号不能为空")
|
@Size(max = 64, message = "资产编号长度不能超过 64 个字符")
|
private String assetCode;
|
|
@Schema(description = "资产名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "数控车床")
|
@NotEmpty(message = "资产名称不能为空")
|
@Size(max = 128, message = "资产名称长度不能超过 128 个字符")
|
private String assetName;
|
|
@Schema(description = "资产类别", example = "生产设备")
|
@Size(max = 64, message = "资产类别长度不能超过 64 个字符")
|
private String category;
|
|
@Schema(description = "规格型号", example = "CK6140")
|
@Size(max = 255, message = "规格型号长度不能超过 255 个字符")
|
private String specification;
|
|
@Schema(description = "购置日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
@NotNull(message = "购置日期不能为空")
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
private LocalDate purchaseDate;
|
|
@Schema(description = "资产原值", requiredMode = Schema.RequiredMode.REQUIRED, example = "120000.00")
|
@NotNull(message = "资产原值不能为空")
|
@DecimalMin(value = "0", message = "资产原值不能小于 0")
|
private BigDecimal originalValue;
|
|
@Schema(description = "使用年限(年)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
@NotNull(message = "使用年限不能为空")
|
@Min(value = 1, message = "使用年限必须大于等于 1 年")
|
private Integer usefulLife;
|
|
@Schema(description = "残值率(%)", example = "5.00")
|
@DecimalMin(value = "0", message = "残值率不能小于 0")
|
@DecimalMax(value = "100", message = "残值率不能大于 100")
|
private BigDecimal residualRate;
|
|
@Schema(description = "存放地点", example = "一号车间")
|
@Size(max = 255, message = "存放地点长度不能超过 255 个字符")
|
private String location;
|
|
@Schema(description = "使用部门编号", example = "100")
|
private Long departmentId;
|
|
@Schema(description = "保管人编号(用户编号)", example = "1")
|
private Long keeperId;
|
|
@Schema(description = "状态", example = "1")
|
@InEnum(value = FinFixedAssetStatusEnum.class, message = "状态必须是 {value}")
|
private Integer status;
|
|
@Schema(description = "备注", example = "备注")
|
@Size(max = 500, message = "备注长度不能超过 500 个字符")
|
private String remark;
|
|
}
|