package com.ycl.domain.form; import com.ycl.common.group.Update; import com.ycl.common.group.Add; import com.ycl.system.domain.base.AbsForm; import com.ycl.domain.entity.ProjectInvestmentInfo; import org.springframework.beans.BeanUtils; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import org.springframework.lang.NonNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * 投资项目基础信息表表单 * * @author flq * @since 2024-11-27 */ @Data @ApiModel(value = "ProjectInvestmentInfo表单", description = "投资项目基础信息表表单") public class ProjectInvestmentInfoForm extends AbsForm { @NotNull(message = "项目id不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("项目id") private Long projectId; @NotNull(message = "建设地点是否跨域不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("建设地点是否跨域") private Integer beCrossRegion; @NotBlank(message = "项目建设地点不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("项目建设地点") private String constructionLocation; @NotBlank(message = "建设详细地址不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("建设详细地址") private String detailedAddress; @NotNull(message = "是否是补码项目不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("是否是补码项目") private Integer beCompensationProject; @NotBlank(message = "补码原因不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("补码原因") private String compensationReason; @NotNull(message = "计划开工时间不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("计划开工时间") private Date plannedStartDate; @NotNull(message = "拟建成时间不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("拟建成时间") private Date expectedCompletionDate; @NotBlank(message = "国标行业分类不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("国标行业分类") private String nationalIndustryClassification; @NotBlank(message = "所属行业分类不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("所属行业分类") private String industryClassification; @NotBlank(message = "项目建设性质不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("项目建设性质") private String projectNature; @NotBlank(message = "项目属性不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("项目属性") private String projectAttribute; @NotNull(message = "是否使用土地不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("是否使用土地") private Integer useEarth; @NotBlank(message = "主要建设内容及规模不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("主要建设内容及规模") private String contentScale; @NotBlank(message = "建管平台代码不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("建管平台代码") private String code; @NotNull(message = "创建时间不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("创建时间") private Date gmtCreateTime; @NotNull(message = "创建人不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("创建人") private Long createBy; @NotNull(message = "更新时间不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("更新时间") private Date gmtUpdateTime; @NotNull(message = "更新人不能为空", groups = {Add.class, Update.class}) @ApiModelProperty("更新人") private Long updateBy; public static ProjectInvestmentInfo getEntityByForm(@NonNull ProjectInvestmentInfoForm form, ProjectInvestmentInfo entity) { if(entity == null) { entity = new ProjectInvestmentInfo(); } BeanUtils.copyProperties(form, entity); return entity; } }