package com.dhcc.finance.main.domain;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@ApiModel(value = "CwBdRecordGlorgbook",description = "自动建账记录表")
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class CwBdRecordGlorgbook {
    
	@ApiModelProperty(value = "主键", required = true, example = "")
	private String id;

	@ApiModelProperty(value = "发起人", required = true, example = "")
    private String initiateUse;

	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "发起时间", required = true, example = "")
    private Date initiateTime;

	@ApiModelProperty(value = "子项目编号", required = true, example = "")
    private String projectCode;

	@ApiModelProperty(value = "子项目全称", required = true, example = "")
    private String projectName;

	@ApiModelProperty(value = "建账标志", required = true, example = "")
    private String buildType;

	@ApiModelProperty(value = "失败原因", required = true, example = "")
    private String failReason;

	@ApiModelProperty(value = "使用状态", required = true, example = "")
    private String useState;

	@ApiModelProperty(value = "录入人员", required = true, example = "")
    private String createUser;

	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "录入时间", required = true, example = "")
    private Date createTime;

	@ApiModelProperty(value = "最后修改人员", required = true, example = "")
    private String updateUser;

	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "最后修改时间", required = true, example = "")
    private Date updateTime;
	
	@ApiModelProperty(value = "备注", required = true, example = "")
    private String remark;
	
	// add dml 2020/3/9
	@ApiModelProperty(value = "子项目编号", required = true, example = "")
    private String xtxmbh;
	
    public String chackData() {
		if (StringUtils.isBlank(this.projectCode)) {
			return "信托子项目编号为空";
		}
		if (StringUtils.isBlank(this.xtxmbh)) {
			return "信托子项目名称为空";
		}
		if (StringUtils.isBlank(this.projectName)) {
			return "信托项目为空";
		}
		return null;
	
    }
}