package com.cool.store.vo;

import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.MemberQuestionDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

@Data
public class PartnerBaseInfoVO {

    private Long id;

    private String partnerId;

    private Long lineId;

    @ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
    private Integer joinType;
    @ApiModelProperty("姓名")
    private String userName;
    @ApiModelProperty("手机号")
    private String mobile;
    @ApiModelProperty("1男 2女")
    private Integer sex;
    @ApiModelProperty("意向加盟区域")
    private String area;
    @ApiModelProperty("意向区域编码")
    private String areaCode;
    @ApiModelProperty("常驻区域详细地址(居住地址)")
    private String liveAddress;

    @ApiModelProperty("线索审核信息id")
    private Long auditId;
    @ApiModelProperty("职业状态 1：在职 2：个体 3：自己开公司 0：待业")
    private Integer careerStatus;
    @ApiModelProperty("教育程度 1：小学 2：初中 3：高中 4大学及以上")
    private Integer educationLevel;
    @ApiModelProperty("家庭年收入 1：10-20万 2：20-30万 3：30-50万 4：50万以上")
    private Integer annualIncome;
    @ApiModelProperty("是否有合伙人 1：是 0：否")
    private Integer hasPartner;
    @ApiModelProperty("资金来源 1：自有资金 2：合伙资金 3：借贷")
    private Integer capitalSource;
    @ApiModelProperty("经营方式 1：自己独立经营 2：和家人一起经营 3：和合伙人一起经营 4：只投资让他人经营")
    private Integer businessMode;
    @ApiModelProperty("是否有加盟品牌经营的经验 1：无  2：单店经验 3：多店经验 4：多店连锁经验")
    private Integer joinExperience;
    @ApiModelProperty("是否有水果行业经营的经验 1：无  2：单店经验 3：多店经验 4：多店连锁经验")
    private Integer fruitIndustryExperience;
    @ApiModelProperty("店铺情况 1:自有店铺 2：自有意向店铺 3：无意向店铺" )
    private Integer storeCondition;
    @ApiModelProperty("预期回本的最长周期 1：1年半以上 2：1年半内 3：1年内 4：半年内")
    private Integer paybackPeriod;
    @ApiModelProperty("是否严格遵守管理标准 1：是 2：否")
    private Integer followsManagementStandard;
    @ApiModelProperty("是否能参加认证培训 1：是 2：否")
    private Integer canTraining;

    private Date createTime;

    private Date updateTime;

    private Integer deleted;


    @ApiModelProperty("公开拒绝原因")
    private String rejectPublicReason;
    @ApiModelProperty("大区regionId")
    private Long bigRegionId;




    public static PartnerBaseInfoVO from(MemberQuestionDO memberQuestionDO, LineInfoDO lineInfoDO) {
        if (Objects.isNull(memberQuestionDO) && Objects.isNull(lineInfoDO)) {
            return null;
        }
        PartnerBaseInfoVO partnerBaseInfoVO = new PartnerBaseInfoVO();
        // MemberQuestionDO
        partnerBaseInfoVO.setPartnerId(memberQuestionDO.getPartnerId());
        partnerBaseInfoVO.setAuditId(memberQuestionDO.getAuditId());
        partnerBaseInfoVO.setCareerStatus(memberQuestionDO.getCareerStatus());
        partnerBaseInfoVO.setEducationLevel(memberQuestionDO.getEducationLevel());
        partnerBaseInfoVO.setAnnualIncome(Integer.valueOf(memberQuestionDO.getAnnualIncome()));
        partnerBaseInfoVO.setHasPartner(memberQuestionDO.getHasPartner());
        partnerBaseInfoVO.setCapitalSource(memberQuestionDO.getCapitalSource());
        partnerBaseInfoVO.setBusinessMode(memberQuestionDO.getBusinessMode());
        partnerBaseInfoVO.setJoinExperience(memberQuestionDO.getJoinExperience());
        partnerBaseInfoVO.setFruitIndustryExperience(memberQuestionDO.getFruitIndustryExperience());
        partnerBaseInfoVO.setStoreCondition(Integer.valueOf(memberQuestionDO.getStoreCondition()));
        partnerBaseInfoVO.setPaybackPeriod(Integer.valueOf(memberQuestionDO.getPaybackPeriod()));
        partnerBaseInfoVO.setFollowsManagementStandard(memberQuestionDO.getFollowsManagementStandard());
        partnerBaseInfoVO.setCanTraining(memberQuestionDO.getCanTraining());
        partnerBaseInfoVO.setJoinType(memberQuestionDO.getJoinType());
        //LineInfoDO
        partnerBaseInfoVO.setId(lineInfoDO.getId());
        partnerBaseInfoVO.setPartnerId(lineInfoDO.getPartnerId());
        partnerBaseInfoVO.setUserName(lineInfoDO.getUsername());
        partnerBaseInfoVO.setMobile(lineInfoDO.getMobile());
        partnerBaseInfoVO.setLiveAddress(lineInfoDO.getLiveAddress());
        partnerBaseInfoVO.setLineId(lineInfoDO.getId());
        partnerBaseInfoVO.setSex(Integer.valueOf(lineInfoDO.getSex()));
        partnerBaseInfoVO.setAreaCode(String.valueOf(lineInfoDO.getWantShopAreaId()));
        partnerBaseInfoVO.setBigRegionId(lineInfoDO.getBigRegionId());
        return partnerBaseInfoVO;
    }


}
