package com.unis.base.server.entity;

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

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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.unis.base.common.vo.TzSlqyUpdateLogVO;
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 = "TZ_SLQY")
public class TzSlqyDO extends BaseEntity {

	/**
	 * 主键
	 */
	@Id
	@Column(name= "id")
	private Integer id;

	/**
	 * 统一社会信用代码
	 */
	@Column(name = "tyshxydm")
	private String tyshxydm;

	/**
	 * 组织机构代码
	 */
	@Column(name = "zzjgdm")
	private String zzjgdm;

	/**
	 * 企业名称
	 */
	@Column(name = "qymc")
	private String qymc;

	/**
	 * 企业类型
	 */
	@Column(name = "qylx")
	private String qylx;

	/**
	 * 单位代码
	 */
	@Column(name = "dwdm")
	private String dwdm;


	/**
	 * 企业经济类型
	 */
	@Column(name = "qyjjlx")
	private String qyjjlx;

	/**
	 * 企业性质
	 */
	@Column(name = "qyxz")
	private String qyxz;

	/**
	 * 登记注册类型
	 */
	@Column(name = "djzclx")
	private String djzclx;

	/**
	 * 工商登记注册号
	 */
	@Column(name = "gsdjzch")
	private String gsdjzch;

	/**
	 * 法定代表人
	 */
	@Column(name = "fddbr")
	private String fddbr;

	/**
	 * 办公电话
	 */
	@Column(name = "bgdh")
	private String bgdh;

	/**
	 * 企业电子邮箱
	 */
	@Column(name = "frsjh")
	private String frsjh;

	/**
	 * 企业电子邮箱
	 */
	@Column(name = "qydzyx")
	private String qydzyx;

	/**
	 * 注册资本
	 */
	@Column(name = "zczb")
	private BigDecimal zczb;

	/**
	 * 从业人员数
	 */
	@Column(name = "qycyrys")
	private Integer qycyrys;

	/**
	 * 中级以上职称人数
	 */
	@Column(name = "zjyszcrs")
	private Integer zjyszcrs;

	/**
	 * 保管员人数
	 */
	@Column(name = "bgyrs")
	private Integer bgyrs;

	/**
	 * 检化验员人数
	 */
	@Column(name = "jhyyrs")
	private Integer jhyyrs;

	/**
	 * 有职业资格证书人数
	 */
	@Column(name = "yzyzgzsrs")
	private Integer yzyzgzsrs;

	/**
	 * 企业传真
	 */
	@Column(name = "qyczhm")
	private String qyczhm;

	/**
	 * 企业通讯地址
	 */
	@Column(name = "qytxdz")
	private String qytxdz;

	/**
	 * 企业邮编
	 */
	@Column(name = "qyyb")
	private String qyyb;

	/**
	 * 企业主营业务
	 */
	@Column(name = "qyzyyw")
	private String qyzyyw;

	/**
	 * 企业注册时间
	 */
	@Column(name = "qyzcsj")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date qyzcsj;

	/**
	 * 中专学历以上人员
	 */
	@Column(name = "zzxlysry")
	private Integer zzxlysry;

	/**
	 * 企业收储粮食主要品种
	 */
	@Column(name = "qysclszypz")
	private String qysclszypz;

	/**
	 * 企业隶属关系
	 */
	@Column(name = "qylsgx")
	private String qylsgx;

	/**
	 * 企业应急级别
	 */
	@Column(name = "qyyjjb")
	private String qyyjjb;

	/**
	 * 企业经度
	 */
	@Column(name = "qyjd")
	private String qyjd;

	/**
	 * 企业纬度
	 */
	@Column(name = "qywd")
	private String qywd;

	/**
	 * 企业所属区域
	 */
	@Column(name = "qyszqy")
	private String qyszqy;


	/**
	 * 企业仓储能力
	 */
	@Column(name = "qyccnl")
	private Integer qyccnl;

	/**
	 * 企业状态
	 */
	@Column(name = "qyzt")
	private Integer qyzt;

	/**
	 * 企业所属区域编号
	 */
	@Column(name = "qyszqybh")
	private String qyszqybh;

	/**
	 * 企业应急类型编号
	 */
	@Column(name = "qyyjlxbh")
	private String qyyjlxbh;

	/**
	 * 企业应急类型名称
	 */
	@Column(name = "qyyjlxmc")
	private String qyyjlxmc;

	/**
	 * 是否独立法人资格 0否.1、是
	 */
	@Column(name = "sfdlfrzg")
	private Integer sfdlfrzg;

	/**
	 * 下属企业个数
	 */
	@Column(name = "xsqygs")
	private Integer xsqygs;

	/**
	 *注册日期
	 */
	@Column(name = "zcrq")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date zcrq;

	/**
	 * 是否具有收购资格0、否。1、有
	 */
	@Column(name = "sfjysgzg")
	private Integer sfjysgzg;

	/**
	 *粮食收购许可证发证机关
	 */
	@Column(name = "lssgxkzfzjg")
	private String lssgxkzfzjg;

	/**
	 *粮食收购许可证发证机关所属区粮办编码
	 */
	@Column(name = "lssgcode")
	private String lssgcode;

	/**
	 * 粮食收购资格证编号
	 */
	@Column(name = "sgzgzbh")
	private String sgzgzbh;

	/**
	 * 所属粮食行政管理部门
	 */
	@Column(name = "sslsxzglbm")
	private String sslsxzglbm;

	/**
	 * 占地面积
	 */
	@Column(name = "zdmj")
	private BigDecimal zdmj;

	/**
	 * 设施占地面积
	 */
	@Column(name = "sszdmj")
	private BigDecimal sszdmj;

	/**
	 * 申请竣工时间
	 */
	@Column(name = "sqjgzdmj")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date sqjgzdmj;

	/**
	 * 企业工商登记机关
	 */
	@Column(name = "qygsdjjg")
	private String qygsdjjg;

	/**
	 * 企业联系人
	 */
	@Column(name = "qylxr")
	private String qylxr;

	/**
	 * 营业收入
	 */
	@Column(name = "yysr")
	private Integer yysr;

	/**
	 * 利税总额
	 */
	@Column(name = "lsze")
	private Integer lsze;

	/**
	 * 当年研究开发投入
	 */
	@Column(name = "dnyjkftr")
	private Integer dnyjkftr;

	/**
	 * 发明专利
	 */
	@Column(name = "fmzl")
	private String fmzl;

	/**
	 * 工业总产值
	 */
	@Column(name = "gyzcz")
	private Integer gyzcz;

	/**
	 * 利润总额
	 */
	@Column(name = "lrze")
	private Integer lrze;

	/**
	 * 政府支持投入
	 */
	@Column(name = "zfzctr")
	private Integer zfzctr;

	/**
	 * 产品销售收入
	 */
	@Column(name = "cpxssr")
	private Integer cpxssr;

	/**
	 * 资产总额
	 */
	@Column(name = "zcze")
	private BigDecimal zcze;

	/**
	 * 当年专利获得数
	 */
	@Column(name = "dnzlhds")
	private Integer dnzlhds;

	/**
	 * 年产粮油机械制造
	 */
	@Column(name = "nclyjxzz")
	private Integer nclyjxzz;

	/**
	 * 油脂加工主机
	 */
	@Column(name = "yzjgzj")
	private String yzjgzj;

	/**
	 * 通用设备
	 */
	@Column(name = "tysb")
	private String tysb;

	/**
	 * 能源消耗标准煤
	 */
	@Column(name = "nhxhbzm")
	private Integer nhxhbzm;

	/**
	 * 罐容
	 */
	@Column(name = "gr")
	private BigDecimal gr;

	/**
	 * 大米加工主机
	 */
	@Column(name = "dmjgzj")
	private String dmjgzj;

	/**
	 * 饲料加工主机
	 */
	@Column(name = "sljgzj")
	private String sljgzj;

	/**
	 * 能源耗电
	 */
	@Column(name = "nyhd")
	private Integer nyhd;

	/**
	 * 能源消耗溶剂
	 */
	@Column(name = "nyxhrj")
	private String nyxhrj;

	/**
	 * 小麦粉加工主机
	 */
	@Column(name = "xmfjgzj")
	private String xmfjgzj;

	/**
	 * 仓储设备
	 */
	@Column(name = "ccsb")
	private String ccsb;

	/**
	 * 能源消耗水
	 */
	@Column(name = "nyxhs")
	private String nyxhs;

	/**
	 * 总仓容（以三等小麦计）
	 */
	@Column(name = "zcr")
	private BigDecimal zcr;

	/**
	 * 仓房栋
	 */
	@Column(name = "cfd")
	private Integer cfd;

	/**
	 * 仓房间
	 */
	@Column(name = "cfj")
	private Integer cfj;

	/**
	 * 备注
	 */
	@Column(name = "bz")
	private String  bz;

	/**
	 * 企业机构代码
	 */
	@Column(name = "qyjgdm")
	private String  qyjgdm;

	/**
	 * 是否备案  （0，未备案，1，待提交，2待审核，3已驳回，4，已备案）
	 */
	@Column(name = "sfba")
	private Integer  sfba;

	@ApiModelProperty(value = "经营范围", notes ="经营范围", required = false)
	@Column(name = "jyfw")
	private String jyfw;

	@ApiModelProperty(value = "周边有无污染源及易燃易爆场所，1：有，0：无", notes ="周边有无污染源及易燃易爆场所，1：有，0：无", required = false)
	@Column(name = "wryjyrybcs")
	private Integer wryjyrybcs;

	@ApiModelProperty(value = "企业层级", notes ="企业层级", required = false)
	@Column(name = "qycj")
	private String qycj;

	@ApiModelProperty(value = "企业工商注册地", notes ="企业工商注册地", required = false)
	@Column(name = "qygszcd")
	private String qygszcd;

	@ApiModelProperty(value = "入统状态0：停用。1：启用", notes ="入统状态0：停用。1：启用", required = false)
	@Column(name = "rtzt")
	private Integer rtzt;

	@ApiModelProperty(value = "市级承储企业", notes ="市级承储企业", required = false)
	@Column(name = "sjccqy")
	private String sjccqy;

	@ApiModelProperty(value = "区级承储企业", notes ="区级承储企业", required = false)
	@Column(name = "qjccqy")
	private String qjccqy;

	@ApiModelProperty(value = "上级集团名称", notes ="上级集团名称", required = false)
	@Column(name = "sjjtmc")
	private String sjjtmc;

	@ApiModelProperty(value = "上级集团机构代码", notes ="上级集团机构代码", required = false)
	@Column(name = "sjjtjgdm")
	private String sjjtjgdm;

	@ApiModelProperty(value = "上级集团统一社会信用代码", notes ="上级集团统一社会信用代码", required = false)
	@Column(name = "sjjttyshxydm")
	private String sjjttyshxydm;

	@ApiModelProperty(value = "仓房数量（座）", notes ="仓房数量（座）", required = false)
	@Column(name = "cfsl")
	private Integer cfsl;

	@ApiModelProperty(value = "油罐数量（个）", notes ="油罐数量（个）", required = false)
	@Column(name = "ygsl")
	private Integer ygsl;

	@ApiModelProperty(value = "所属地区市code", notes ="所属地区市code", required = false)
	@Column(name = "shi")
	private String shi;

	@ApiModelProperty(value = "所属地区市名称", notes ="所属地区市名称", required = false)
	@Column(name = "shi_name")
	private String shiName;

	@ApiModelProperty(value = "所属地区县code", notes ="所属地区县code", required = false)
	@Column(name = "xian")
	private String xian;

	@ApiModelProperty(value = "所属地区县名称", notes ="所属地区县名称", required = false)
	@Column(name = "xian_name")
	private String xianName;

	@ApiModelProperty(value = "距离", notes ="距离", required = false)
	@Column(name = "distance")
	private BigDecimal distance;

	@ApiModelProperty(value = "审核时间", notes ="审核时间", required = false)
	@Column(name = "shsj")
	@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
	private Date shsj;

	@ApiModelProperty(value = "", notes ="审核人", required = false)
	@Column(name = "shrmc")
	private String shrmc;

	@ApiModelProperty(value = "", notes ="审核意见", required = false)
	@Column(name = "shyj")
	private String shyj;

	@Column(name = "dwlx")
	private String dwlx;

	@Column(name = "lssgxkzfzsj")
	private Date lssgxkzfzsj;

	@Column(name = "tbr")
	private String tbr;

	@Column(name = "lxdh")
	private String lxdh;

	@Column(name = "sjh")
	private String sjh;

	@Column(name = "qyfzr")
	private String qyfzr;

	@Column(name = "fzrq")
	private Date fzrq;

	@Column(name = "sgzt")
	private String sgzt;

	@Column(name = "sfzdzgqy")
	private String sfzdzgqy;

	@Column(name = "yxqz")
	private Date yxqz;

	@Column(name = "qfcj")
	private String qfcj;//企业层级

	@Column(name = "sfsb")
	private BigDecimal sfsb;//是否上报

	@Column(name = "qybm")
	private String qybm;//企业编号用于跟库级系统

	/*lgd add */
	@Column(name = "txprovince")
	private String txprovince;

	@Column(name = "txcity")
	private String txcity;

	@Column(name = "zcprovince")
	private String zcprovince;

	@Column(name = "zccity")
	private String zccity;

	/**
	 * 企业注册审核状态
	 */
	@Column(name = "shzt")
	private Integer  shzt;
	/*lgd end */

	@ApiModelProperty(value = "文件信息", notes ="")
	@Column(name = "file_id")
	private String fileId;

	@ApiModelProperty(value="更新时间")
	@Column(name = "refresh_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date refreshTime;

	@ApiModelProperty(value="法人身份证号")
	@Column(name = "frsfzh")
	private String frsfzh;

	@ApiModelProperty(value="所在地所属地区县code")
	@Column(name = "txcounty")
	private String txcounty;

	@ApiModelProperty(value="注册所属地区县code")
	@Column(name = "zccounty")
	private String zccounty;

	@ApiModelProperty(value="设计仓容(T)")
	@Column(name = "sjcr")
	private BigDecimal sjcr;

	@ApiModelProperty(value="库区产权")
	@Column(name = "kqcq")
	private String kqcq;

	@ApiModelProperty(value="首页库区图")
	@Column(name = "sykqt")
	private String sykqt;

	@ApiModelProperty(value="企业性质")
	@Column(name = "qyxzfl")
	private String qyxzfl;

	@ApiModelProperty(value="库区类别（标准单位类型）")
	@Column(name = "kqlb")
	private String kqlb;

	@ApiModelProperty(value="单位类型（库级使用）")
	@Column(name = "lx")
	private String lx;

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

	@ApiModelProperty(value="是否上传（1：是；0：否）")
	@Column(name = "sfsc")
	private String sfsc;

	@ApiModelProperty(value = "库区数量", notes ="库区数量", required = false)
	private Integer kqsl;

	private String pjjg;

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

    /**
     * 检查企业名称、法人、企业性质 是否变更
     * */
    public List<TzSlqyUpdateLogVO> checkInfo(TzSlqyDO afterData) {
        ArrayList<TzSlqyUpdateLogVO> dataList = new ArrayList<>();
        TzSlqyUpdateLogVO entity = new TzSlqyUpdateLogVO(this.tyshxydm, TzSlqyUpdateLogVO.COL.QYMC.getName(), this.qymc, afterData.qymc);
        dataList.add(entity);
        TzSlqyUpdateLogVO entity2 = new TzSlqyUpdateLogVO(this.tyshxydm, TzSlqyUpdateLogVO.COL.QYXZ.getName(), this.qyxz, afterData.qyxz);
        dataList.add(entity2);
        TzSlqyUpdateLogVO entity3 = new TzSlqyUpdateLogVO(this.tyshxydm, TzSlqyUpdateLogVO.COL.FDDBR.getName(), this.fddbr, afterData.fddbr);
        dataList.add(entity3);
        return dataList;
    }

    
    /**
	 * 是否为备案企业
	 */
	@ApiModelProperty(value="是否为备案企业")
	@Column(name="sfbaqy")
	private String sfbaqy;
	
	
	/**
	 * 是否为流通统计企业
	 */
	@ApiModelProperty(value="是否为流通统计企业")
	@Column(name="sflttjqy")
	private String sflttjqy;
	
	
	/**
	 * 企业类型  qiyeleix
	 */
	@ApiModelProperty(value="企业类型")
	@Column(name="qiyeleix")
	private String qiyeleix;
}

