package com.microservices.pms.product.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.common.core.web.domain.BaseEntity;
import com.microservices.pms.product.domain.vo.PmsProductPlanDataVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 产品计划对象 pms_product_plan
 *
 * @author microservices
 * @date 2023-10-10
 */
@Data
@ApiModel("产品计划对象")
public class PmsProductPlan extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 产品计划ID */
    private Long id;

    /** 计划标题 */
    @ApiModelProperty(value = "计划标题")
    private String planTitle;

    /** 关联产品标识 */
    @ApiModelProperty(value = "关联产品标识")
    private String pmsProductIdentifier;

    /** 关联状态ID */
    @ApiModelProperty(value = "关联状态ID")
    private Long statusId;

    /** 关联优先级ID */
    @ApiModelProperty(value = "关联优先级ID")
    private Long priorityId;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    /** 计划描述 */
    @ApiModelProperty(value = "计划描述")
    private String planDescription;

    /** 工作量 */
    @ApiModelProperty(value = "工作量")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String workload;

    /** 排序 */
    @ApiModelProperty(value = "排序")
    private Integer sort;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 预留字段1 */
    @ApiModelProperty(value = "预留字段1")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String reservedField1;

    /** 预留字段2 */
    @ApiModelProperty(value = "预留字段2")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String reservedField2;

    /** 产品需求数 */
    @ApiModelProperty(value = "产品需求数")
    private Integer productRequirementCount;

    public PmsProductPlanDataVo toPmsProductPlanDataVo(){
        PmsProductPlanDataVo target = new PmsProductPlanDataVo();
        BeanUtils.copyProperties(this, target);
        return target;
    }
}
