package com.bohuikeji.frame.module.admin.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.constant.RegEx;
import com.bohuikeji.frame.module.admin.entity.vo.AddressVo;
import com.bohuikeji.frame.module.admin.entity.web.block.AddressBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.FileBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.TextBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;

/**
 * <p>
 * 加盟商信息表
 * </p>
 *
 * @author 10552
 * @since 2019-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TFranchiseeInformation对象", description="加盟商信息表")
@TableName("t_franchisee_information")
public class TFranchiseeInformation extends EntityBase<TFranchiseeInformation> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "加盟商信息id")
    @TableId(value = "fran_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(add = false,show = false,required = false)
    private Integer franId;

    @ApiModelProperty(value = "上级加盟商ID")
    @TableField("super_id")
    private Integer superId;

    @ApiModelProperty(value = "加盟商名称")
    @TableField("fran_name")
    @TableShowField(value = "加盟商名称")
    @TableNewField()
    @TableQueryField
    private String franName;

    /**
     * 1-国家-中国
     * 2-省-河北省、北京市
     * 3-市-宁波市
     * 4-区县-北京市朝阳区
     * 5-开发区-亦庄经济开发区
     * 6-乡镇-回龙观镇
     * 7-村庄-三元村
     * 8-热点商圈-上海市黄浦区老西门
     * 9-兴趣点-北京市朝阳区奥林匹克公园(南门)
     * 10-门牌号-朝阳区阜通东大街6号
     * 11-单元号-望京西园四区5号楼2单元
     * 12-道路-北京市朝阳区阜通东大街
     * 13-道路交叉路口-北四环西路辅路/善缘街
     * 14-公交站台、地铁站-海淀黄庄站A1西北口
     * 15-未知-未确认级别的POI
     */
    @ApiModelProperty(value = "加盟商服务级别(地理编码匹配级别划分，共15级)")
    @TableField("fran_service_level")
    @TableShowField(value = "加盟商服务级别",show = false)
    private Integer franServiceLevel;

    @ApiModelProperty(value = "加盟商服务范围描述")
    @TableField("fran_service_desc")
    @TableShowField(value = "加盟商服务范围描述",show = false)
    private String franServiceDesc;

    @ApiModelProperty(value = "加盟商服务范围行政区划代码")
    @TableField("fran_service_adcode")
    @TableShowField(value = "加盟商服务范围行政区划代码（参照代码表）",show = false)
    @TableNewField(limit = RegEx.INTEGER,block = TextBlock.class)
    private String franServiceAdcode;

    @ApiModelProperty(value = "加盟商服务范围地理围栏坐标")
    @TableField("fran_service_polyline")
    @TableShowField(value = "加盟商服务范围地理围栏坐标(区级以下填写此项，围栏最大覆盖半径5公里)",show = false)
    @TableNewField(required = false,block = TextBlock.class)
    private String franServicePolyline;

    @ApiModelProperty(value = "加盟商服务范围地理围栏高德id")
    @TableField("fran_service_gid")
    @TableShowField(value = "加盟商服务范围地理围栏高德id",show = false)
    private String franServiceGid;

    @ApiModelProperty(value = "办公地址")
    @TableField("fran_address")
    @TableShowField("办公地址")
    @TableNewField(required = false,add = false,block = TextBlock.class)
    private String franAddress;

    @ApiModelProperty(value = "公司注册资金")
    @TableField("fran_capital")
    @TableShowField(value = "公司注册资金(万元)",show = false)
    @TableNewField(required = false,limit = RegEx.INTEGER,add = false)
    private Long franCapital;

    @ApiModelProperty(value = "公司成立时间")
    @TableField("fran_time")
    @TableShowField(value = "公司成立时间",show = false)
    @TableNewField(required = false,add = false)
    private LocalDateTime franTime;

    @ApiModelProperty(value = "公司类型")
    @TableField("fran_type")
    @TableShowField("公司类型")
    private String franType="加盟商";

    @ApiModelProperty(value = "经营范围")
    @TableField("fran_scope")
    @TableShowField(value = "经营范围",show = false)
    @TableNewField(block = TextBlock.class,required = false,add = false)
    private String franScope;

    @ApiModelProperty(value = "人员规模")
    @TableField("fran_people_number")
    @TableShowField(value = "人员规模",show = false)
    @TableNewField(required = false,limit = RegEx.INTEGER)
    private Integer franPeopleNumber=5;

    @ApiModelProperty(value = "营业执照号")
    @TableField("fran_license")
    @TableShowField(value = "营业执照号",show = false)
    @TableNewField(required = false)
    private String franLicense;

    @ApiModelProperty(value = "开户银行")
    @TableField("fran_opening_bank")
    @TableShowField(value = "开户银行",show = false)
    @TableNewField(required = false)
    private String franOpeningBank;

    @ApiModelProperty(value = "开户账号")
    @TableField("fran_account_number")
    @TableShowField(value = "开户账号",show = false)
    @TableNewField(limit = RegEx.INTEGER,required = false)
    private String franAccountNumber;

    @ApiModelProperty(value = "账户名称")
    @TableField("fran_account_name")
    @TableShowField(value = "账户名称",show = false)
    @TableNewField(required = false)
    private String franAccountName;

    @ApiModelProperty(value = "开户许可证")
    @TableField("fran_opening_permit")
    @TableShowField(value = "开户许可证",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false,add = false)
    private String franOpeningPermit;

    @ApiModelProperty(value = "法定代表人")
    @TableField("fran_legal_person")
    @TableShowField("法定代表人")
    @TableNewField(required = false)
    private String franLegalPerson;

    @ApiModelProperty(value = "身份证号")
    @TableField("fran_identity")
    @TableShowField(value = "身份证号",show = false)
    @TableNewField(required = false)
    private String franIdentity;

    @ApiModelProperty(value = "身份证附件")
    @TableField("fran_identity_url")
    @TableShowField(value = "身份证附件",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false,add = false)
    private String franIdentityUrl;

    @ApiModelProperty(value = "门店名称")
    @TableField("fran_store_name")
    @TableShowField("门店名称")
    @TableNewField(required = false,add = false)
    @TableQueryField(show = false)
    private String franStoreName;

    @ApiModelProperty(value = "门店地址")
    @TableField("fran_store_address")
    @TableShowField("门店地址")
    @TableNewField(block = AddressBlock.class)
    private AddressVo franStoreAddress;

    /*@ApiModelProperty(value = "平台抽成(%)")
    @TableField("sys_divided")
    @TableShowField(value = "平台抽成",show = false)
    @TableQueryField(like = false,show = false)
    @TableNewField(edit = false,add = false,required = false)
    private BigDecimal sysDivided=new BigDecimal("0.00").setScale(2, RoundingMode.DOWN);

    @ApiModelProperty(value = "加盟商抽成(%)")
    @TableField("fran_divided")
    @TableShowField(value = "加盟商抽成",show = false)
    @TableQueryField(like = false,show = false)
    @TableNewField(edit = false,add = false,required = false)
    private BigDecimal franDivided=new BigDecimal("0.00").setScale(2, RoundingMode.DOWN);

    @ApiModelProperty(value = "配送员抽成(%)")
    @TableField("courier_divided")
    @TableShowField(value = "配送员抽成",show = false)
    @TableQueryField(like = false,show = false)
    @TableNewField(edit = false,add = false,required = false)
    private BigDecimal courierDivided=new BigDecimal("0.00").setScale(2, RoundingMode.DOWN);*/

    @ApiModelProperty(value = "全职抽成配置项")
    @TableField("full_time_divided")
    @TableShowField(value = "全职抽成配置项",show = false)
    @TableNewField(edit = false,add = false,show = false)
    private JSONObject fullTimeDivided;

    @ApiModelProperty(value = "兼职抽成配置项")
    @TableField("part_time_divided")
    @TableShowField(value = "兼职抽成配置项",show = false)
    @TableNewField(edit = false,add = false,show = false)
    private JSONObject partTimeDivided;

    @ApiModelProperty(value = "按距离抽成")
    @TableField("dist_time_divided")
    @TableShowField(value = "按距离抽成",show = false)
    @TableNewField(edit = false,add = false,show = false)
    private JSONObject distTimeDivided;

    @ApiModelProperty(value = "门店面积(㎡)")
    @TableField("fran_store_area")
    @TableShowField(value = "门店面积",show = false)
    @TableNewField(required = false,add = false)
    private Double franStoreArea=100D;

    @ApiModelProperty(value = "加盟时间")
    @TableField("fran_join_create_time")
    @TableShowField("加盟时间")
    @TableNewField(required = false,add = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime franJoinCreateTime=LocalDateTime.now();

    @ApiModelProperty(value = "加盟费用(￥)")
    @TableField("fran_join_money")
    @TableShowField(value = "加盟费用(￥)",show = false)
    @TableNewField(limit = RegEx.INTEGER,required = false)
    private Long franJoinMoney;

    @ApiModelProperty(value = "状态0启用1不启用")
    @TableField("fran_status")
    @TableShowField("状态")
    @TableNewField(add = false,block = SelectBlock.class,options = {"启用","暂停"})
    private String franStatus="启用";

    @TableField("fran_join_update_time")
    private LocalDateTime franJoinUpdateTime;

    @ApiModelProperty(value = "加盟商管理者")
    @TableField("fran_controller")
    @TableShowField("加盟商管理者")
    @TableNewField(add = false,block = SelectBlock.class,options = {"平台","加盟商"})
    private String franController="平台";

    @ApiModelProperty(value = "推送开关及间隔分钟")
    @TableField("fran_push")
    @TableShowField("推送开关及间隔分钟")
    @TableNewField(add = false,block = SelectBlock.class,options = {"关闭","0","1","2","5"})
    private String franPush="0";

    @ApiModelProperty(value = "允许接单数量")
    @TableField("allow_num")
    @TableShowField(value = "允许接单数量")
    @TableNewField(required = false)
    private Integer allowNum=4;

}
