package com.zfire.mall.manager.bean.k3;

import cn.hutool.core.date.DateUtil;
import com.zfire.mall.manager.plus.entity.KingDeeInterface;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@ApiModel(value="KingDeeInterface对象", description="金蝶接口记录")
public class KingDeeInterfaceBean {

    @NotNull(message = "组织不能为空")
    @ApiModelProperty(value = "组织")
    private String orgId;

    @NotNull(message = "组织编码不能为空")
    @ApiModelProperty(value = "组织编码")
    private String orgNumber;

    @NotNull(message = "表单编号不能为空")
    @ApiModelProperty(value = "表单id")
    private String formId;

    @NotNull(message = "表单名称不能为空")
    @ApiModelProperty(value = "表单名称")
    private String name;

    @ApiModelProperty(value = "同步最后时间")
    private String syncLastTime = DateUtil.formatDateTime(new Date());

    @ApiModelProperty(value = "表单类型：0=基础资料 1=业务")
    private Integer type = 0;

    public KingDeeInterface copyToDto() {
        KingDeeInterface kingDeeInterface = new KingDeeInterface();
        BeanUtils.copyProperties(this, kingDeeInterface);
        return kingDeeInterface;
    }
}
