package com.cool.bang.modules.business.domain;

import com.cool.bang.common.base.BaseDomain;
import com.cool.bang.common.constant.emuns.StatusType;
import com.cool.bang.modules.api.domain.CorpVo;

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

/**
 * 企业信息
 *
 * @author PeiZhi Guo
 * 2024-10-31 17:00
 */
public class Corp extends BaseDomain {

    private static final long serialVersionUID = 1L;

    private Long id;

    /**
     * 机构名称
     */
    private String name;

    /**
     * 社会统一信用代码
     */
    private String idCard;

    /**
     * 父类机构主键
     */
    private Integer parentId;

    /**
     * 父类机构名称
     */
    private String parentName;

    /**
     * 联系电话
     */
    private String phone;

    /**
     * 机构执业编号
     */
    private String code;

    /**
     * 机构类型 0其他、1房地产中介机构
     */
    private Integer type;

    /**
     * 注册资金
     */
    private String registerCapital;

    /**
     * 所属区县 * 1张店区 2博山区 3淄川区 4周村区 5临淄区 6桓台县 7高青县 8沂源县 9高新区 10经开区 11文昌湖区
     */
    private Integer district;

    /**
     * 所属区县名称
     */
    private String districtName;

    /**
     * 法人
     */
    private String legalPerson;

    /**
     * 法人证件号
     */
    private String legalPersonIdCard;

    /**
     * 公司地址
     */
    private String address;

    /**
     * 微信唯一识别码
     */
    private String openId;

    /**
     * 是否绑定 0未绑定 1已绑定
     */
    private Integer isBind;

    /**
     * 审批状态 0待审批 1已审批 2已驳回
     */
    private Integer examineStatus;

    /**
     * 审批备注信息
     */
    private String examineRemark;

    /**
     * 删除标识 0 删除 1 正常
     */
    private Integer delFlag;

    //非数据库
    private List<DataCollection> dataCollectionList;

    @Override
    public void insertConfigure() {
        super.insertConfigure();
        this.delFlag = StatusType.ENABLE.ordinal();
    }

    /**
     * 接口查询企业中介数据
     */
    public void getCorpView(CorpVo param) {
        this.name = param.getJgmc();
        this.idCard = param.getShtyxydm();
        this.parentId = param.getFljg();
        this.parentName = param.getFljgmc();
        this.code = param.getCode();
        this.type = param.getJglx() == 1? 1:0;
        this.registerCapital = param.getZczj();
        this.district = param.getJgssqy();
        switch ( param.getJgssqy()) {
            case 1:
                this.districtName = "张店区";
                break;
            case 2:
                 this.districtName = "博山区";
                break;
            case 3:
                 this.districtName = "淄川区";
                break;
            case 4:
                 this.districtName = "周村区";
                break;
            case 5:
                 this.districtName = "临淄区";
                break;
            case 6:
                 this.districtName = "桓台县";
                break;
            case 7:
                 this.districtName = "高青县";
                break;
            case 8:
                 this.districtName = "沂源县";
                break;
            case 9:
                this.districtName = "高新区";
                break;
            case 10:
                this.districtName = "经开区";
                break;
            case 11:
                this.districtName = "文昌湖区";
                break;
            default:
                 this.districtName = "未知区县"; // 如果提供的编号不在预期范围内
        }
        this.legalPerson = param.getJgfr();
        this.legalPersonIdCard = param.getFrsfz();
        this.address = param.getGsdz();
        this.isBind = 1;
        this.examineStatus = 0;
        this.delFlag = 1;
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    public String getExamineRemark() {
        return examineRemark;
    }

    public void setExamineRemark(String examineRemark) {
        this.examineRemark = examineRemark;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public List<DataCollection> getDataCollectionList() {
        return dataCollectionList;
    }

    public void setDataCollectionList(List<DataCollection> dataCollectionList) {
        this.dataCollectionList = dataCollectionList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getRegisterCapital() {
        return registerCapital;
    }

    public void setRegisterCapital(String registerCapital) {
        this.registerCapital = registerCapital;
    }

    public Integer getDistrict() {
        return district;
    }

    public void setDistrict(Integer district) {
        this.district = district;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getLegalPerson() {
        return legalPerson;
    }

    public void setLegalPerson(String legalPerson) {
        this.legalPerson = legalPerson;
    }

    public String getLegalPersonIdCard() {
        return legalPersonIdCard;
    }

    public void setLegalPersonIdCard(String legalPersonIdCard) {
        this.legalPersonIdCard = legalPersonIdCard;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public Integer getIsBind() {
        return isBind;
    }

    public void setIsBind(Integer isBind) {
        this.isBind = isBind;
    }

    public Integer getExamineStatus() {
        return examineStatus;
    }

    public void setExamineStatus(Integer examineStatus) {
        this.examineStatus = examineStatus;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }
}
