package com.cool.store.request;

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

import javax.validation.constraints.NotBlank;

@Data
public class JoinIntentionRequest {
    private Long id;
    @ApiModelProperty("线索信息表-线索id")
    private Long lineId;
    @ApiModelProperty("用户信息表partnerId")
    @NotBlank(message = "partnerId不能为空")
    private String partnerId;
    @ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
    private Integer joinType;
    @ApiModelProperty("姓名")
    private String userName;
    @ApiModelProperty("手机号")
    private String mobile;
    @ApiModelProperty("1男 2女")
    private Integer sex;
    @ApiModelProperty("意向加盟区域")
    private String wantShopArea;
    @ApiModelProperty("意向区域编码")
    private String areaCode;
    @ApiModelProperty("常驻区域")
    private String liveArea;
    @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 String 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 String storeCondition;
    @ApiModelProperty("预期回本的最长周期 1：1年半以上 2：1年半内 3：1年内 4：半年内")
    private String paybackPeriod;
    @ApiModelProperty("是否严格遵守管理标准 1：是 2：否")
    private Integer followsManagementStandard;
    @ApiModelProperty("是否能参加认证培训 1：是 2：否")
    private Integer canTraining;

    public LineInfoDO toLineInfoDO() {
        LineInfoDO lineInfoDO = new LineInfoDO();
        lineInfoDO.setPartnerId(this.partnerId);
        lineInfoDO.setMobile(this.mobile);
        lineInfoDO.setLiveAddress(this.liveAddress);
        lineInfoDO.setUsername(this.userName);
        lineInfoDO.setSex(String.valueOf(this.sex));
        lineInfoDO.setWantShopAreaId(Long.valueOf(this.areaCode));
        lineInfoDO.setId(this.lineId);
        return lineInfoDO;
    }


    public MemberQuestionDO toMemberQuestionDO() {
        MemberQuestionDO memberQuestionDO = new MemberQuestionDO();
        memberQuestionDO.setId(this.id);
        memberQuestionDO.setAuditId(this.auditId);
        memberQuestionDO.setPartnerId(this.partnerId);
        memberQuestionDO.setLineId(this.lineId);
        memberQuestionDO.setCareerStatus(this.careerStatus);
        memberQuestionDO.setEducationLevel(this.educationLevel);
        memberQuestionDO.setAnnualIncome(this.annualIncome);
        memberQuestionDO.setHasPartner(this.hasPartner);
        memberQuestionDO.setCapitalSource(this.capitalSource);
        memberQuestionDO.setBusinessMode(this.businessMode);
        memberQuestionDO.setJoinExperience(this.joinExperience);
        memberQuestionDO.setFruitIndustryExperience(this.fruitIndustryExperience);
        memberQuestionDO.setStoreCondition(this.storeCondition);
        memberQuestionDO.setPaybackPeriod(this.paybackPeriod);
        memberQuestionDO.setFollowsManagementStandard(this.followsManagementStandard);
        memberQuestionDO.setCanTraining(this.canTraining);
        memberQuestionDO.setJoinType(this.joinType);
        return memberQuestionDO;
    }
}
