package com.unis.base.server.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.unis.base.common.vo.DCfxxsjyUpdateLogVO;
import com.unis.base.common.vo.OiltankUpdateLogVO;
import com.unis.base.common.vo.OiltankVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author huangxing
 * @version 1.0
 * @Title DCfxxsjyDO
 * @ProjectName 廒间信息实体类
 * @Description
 * @date 2019/07/22 17点26分
 */

@SuppressWarnings("serial")
@Getter
@Setter
@Table(name = "D_YGXXSJY")
public class DYgxxsjyDO extends BaseEntity {
	@Column(name = "id")
	private String id;
	/**
	 * 油罐编号
	 */
	@Column(name = "ygbh")
	private String ygbh;


	/**
	 * 油罐名称
	 */
	@Column(name = "ygmc")
	private String ygmc;


	/**
	 * 库点编号
	 */
	@Column(name = "kddm")
	private String kddm;

	/**
	 * 库点名称
	 */
	@Column(name = "kdmc")
	private String kdmc;

	/**
	 * 设计罐容
	 */
	@Column(name = "sjgr")
	private Double sjgr;

	/**
	 * 实际罐容
	 */
	@Column(name = "sjgr01")
	private Double sjgr01;

	/**
	 * 油罐直径
	 */
	@Column(name = "ygzj")
	private Double ygzj;

	/**
	 * 油罐高度
	 */
	@Column(name = "yggd")
	private Double yggd;

	/**
	 * 装油高度
	 */
	@Column(name = "zygd")
	private Double zygd;

	/**
	 * 设计年代
	 */
	@Column(name = "sjnd")
	@DateTimeFormat( pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date sjnd;

	/**
	 * 油罐精度
	 */
	@Column(name = "ygjd")
	private Double ygjd;

	/**
	 * 油罐维度
	 */
	@Column(name = "ygwd")
	private Double ygwd;

	/**
	 * 油罐状态
	 */
	@Column(name = "ygzt")
	private String ygzt;

	/**
	 * 油罐使用状态
	 */
	@Column(name = "ygsyzt")
	private String ygsyzt;


	/**
	 * 油罐类型
	 */
	@Column(name = "yglx")
	private String yglx;

	/**
	 * 油罐底面积
	 */
	@Column(name = "ygdmj")
	private Double ygdmj;

	/**
	 * 油罐内直径
	 */
	@Column(name = "ygnzj")
	private Double ygnzj;

	/**
	 * 油罐出油口高度
	 */
	@Column(name = "ygcykgd")
	private Double ygcykgd;

	/**
	 * 油罐检查口高度
	 */
	@Column(name = "ygjckgd")
	private Double ygjckgd;

	/**
	 * 油罐平面图
	 */
	@Column(name = "ygpmt")
	private String ygpmt;


	/**
	 * 油罐库区图
	 */
	@Column(name = "ygkqt")
	private String ygkqt;


	@ApiModelProperty(value = "是否备案，1:待提交，2:待审核，3:驳回，5:已备案", notes ="是否备案，1:待提交，2:待审核，3:驳回，5:已备案", required = false)
	private Integer sfba;

	@ApiModelProperty(value="油罐验收申请状态，0 可编辑 1 不可编辑",notes ="油罐验收申请状态，0 可编辑 1 不可编辑")
	private String sqzt="0";

	@ApiModelProperty(value="出入库状态(1空仓,2入库中,3封仓,4出库中)")
	@Column(name = "crk_status")
	private String crkStatus;

	private String lspzmc;

	private String lspzbm;

	@Column(name = "fcsl")
	private Integer fcsl;

	@ApiModelProperty(value = "入仓年月")
	private String rcny;

	@ApiModelProperty(value = "油罐类型名称")
	private String yglxmc;

	@ApiModelProperty(value = "油罐代码")
	@Column(name = "ygdm")
	private String ygdm;

	@ApiModelProperty(value = "设计单位")
	@Column(name = "sjdw")
	private String sjdw;

	@ApiModelProperty(value = "建设单位")
	@Column(name = "jsdw")
	private String jsdw;

	@ApiModelProperty(value = "监理单位")
	@Column(name = "jldw")
	private String jldw;

	@ApiModelProperty(value = "廒间代码")
	@Column(name = "ajdh")
	private String ajdh;

	@ApiModelProperty(value = "货位代码")
	@Column(name = "hwdm")
	private String hwdm;

	@ApiModelProperty(value = "存放粮油类型(0:原粮,1:成品粮)")
	@Column(name = "lylx")
	private String lylx;

	@ApiModelProperty(value = "审核人")
	@Column(name = "approver")
	private String approver;

	@ApiModelProperty(value = "审核意见")
	@Column(name = "approval_comments")
	private String approvalComments;

	@ApiModelProperty(value = "审核日期")
	@DateTimeFormat( pattern = "yyyy-MM-dd")
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@Column(name = "approval_date")
	private Date approvalDate;

	@ApiModelProperty(value = "库级推送返回信息")
	@Column(name = "send_result")
	private String sendResult;

	@ApiModelProperty(value = "油罐及附属设施是否完好")
	@Column(name = "ygjfssssfwh")
	private String ygjfssssfwh;

	@ApiModelProperty(value = "有无加热装置")
	@Column(name = "ywjrzz")
	private String ywjrzz;

	@ApiModelProperty(value = "检定方式")
	@Column(name = "jdfs")
	private String jdfs;

	@ApiModelProperty(value = "焊接方式")
	@Column(name = "hjfs")
	private String hjfs;

	@ApiModelProperty(value = "信用代码")
	@Column(name = "tyshxydm")
	private String tyshxydm;

	@ApiModelProperty(value = "审核结果（通过：1；驳回：0）")
	@Column(name = "approval_result")
	private String approvalResult;

	@ApiModelProperty(value = "备案状态 1:待提交，2:待审核，3:已驳回，5:已备案")
	private String sfbaName;

	@ApiModelProperty("标准库区编码")
	@Column(name = "kqdm")
	private String kqdm;

	@ApiModelProperty("ygbh油罐编号")
	private String realYgbh;

	@ApiModelProperty(value="是否可删除，0 可删除 1 不可删除")
	private String delFlag;

    @Column(name = "data_ver")
    private Integer dataVer;

    @ApiModelProperty(value = "变更原因")
    @Column(name = "change_reason")
    private String changeReason;

    public List<DCfxxsjyUpdateLogVO> checkInfo(OiltankVO afterData) {
        List<DCfxxsjyUpdateLogVO> dataList = new ArrayList<>();
        DCfxxsjyUpdateLogVO data1 = new DCfxxsjyUpdateLogVO(afterData.getTyshxydm(), this.ygdm, this.ygmc, OiltankUpdateLogVO.COL.YGZT.getName(), this.ygzt, afterData.getYgzt());
        dataList.add(data1);
        return dataList;
    }
}
