package org.dromara.payment.merchant.domain.bo;

import org.dromara.common.core.utils.DateUtils;
import org.dromara.payment.merchant.domain.BusMerchant;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 商户业务对象 bus_merchant
 *
 * @author LionLi
 * @date 2024-04-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BusMerchant.class, reverseConvertGenerate = false)
public class BusMerchantBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 商户编号
     */
    private String no;

    /**
     * 所属行业（字典值）
     */
    @NotBlank(message = "所属行业不能为空", groups = { AddGroup.class, EditGroup.class })
    private String industry;

    /**
     * 商户名称
     */
    @NotBlank(message = "企业名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 商户简称
     */
    @NotBlank(message = "企业简称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String nameNc;

    /**
     * 统一社会信用代码
     */
    @NotBlank(message = "统一社会信用代码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String nsrSbh;

    /**
     * 法人手机号
     */
    @NotBlank(message = "法人手机号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String frSjh;

    /**
     * 经办人手机号
     */
    @NotBlank(message = "经办人手机号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String wtrSjh;

    /**
     * 经办人姓名
     */
    @NotBlank(message = "经办人姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String wtr;

    /**
     * 经办人身份证
     */
    @NotBlank(message = "经办人身份证不能为空", groups = { AddGroup.class, EditGroup.class })
    private String wtrSfz;

    /**
     * 经办人邮件
     */
    @NotBlank(message = "经办人邮件不能为空", groups = { AddGroup.class, EditGroup.class })
    private String wtrEmail;

    /**
     * 所属行政区编码
     */
    @NotBlank(message = "所属行政区编码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String unitArea;

    /**
     * 行政区名称
     */
    @NotBlank(message = "行政区名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String unitAreaName;

    /**
     * 法人身份证
     */
    @NotBlank(message = "法人身份证不能为空", groups = { AddGroup.class, EditGroup.class })
    private String frSfz;

    /**
     * 法人姓名
     */
    @NotBlank(message = "法人姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String fr;

    /**
     * 银行账号
     */
    @NotBlank(message = "银行账号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String bankCard;

    /**
     * 实际经营地址
     */
    @NotBlank(message = "实际经营地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String address;

    /**
     * 营业执照有效期开始日期
     */
//    @NotNull(message = "营业执照有效期开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date yyzzBeginDate;

    /**
     * 营业执照有效期结束日期
     */
//    @NotNull(message = "营业执照有效期结束日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date yyzzEndDate;

    /**
     * 营业执照图片（多个逗号分隔）
     */
    @NotBlank(message = "营业执照图片不能为空", groups = { AddGroup.class, EditGroup.class })
    private String yyzz;

    /**
     * 支付密码
     */
//    @NotBlank(message = "支付密码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String payPassword;

    /**
     * 密码输入错误次数
     */
//    @NotNull(message = "密码输入错误次数不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long passErrorNum;

    /**
     * 密码冻结结束时间
     */
//    @NotNull(message = "密码冻结结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date passFrozenTime;

    /**
     * 状态（0:禁用 1:启用 ）
     */
//    @NotNull(message = "状态（0:禁用 1:启用 ）不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long status;

    /**
     * 添加时间
     */
//    @NotNull(message = "添加时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date addTime;

    /**
     * 添加人
     */
//    @NotBlank(message = "添加人不能为空", groups = { AddGroup.class, EditGroup.class })
    private String addBy;

    /**
     * 编辑人
     */
//    @NotBlank(message = "编辑人不能为空", groups = { AddGroup.class, EditGroup.class })
    private String editer;

    /**
     * 编辑时间
     */
//    @NotNull(message = "编辑时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date editTime;

    /**
     * 开户名
     */
    @NotBlank(message = "账户名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String khm;

    /**
     * 开户支行
     */
    @NotBlank(message = "开户行不能为空", groups = { AddGroup.class, EditGroup.class })
    private String khd;

    /**
     * 开户行
     */
    @NotBlank(message = "开户银行不能为空", groups = { AddGroup.class, EditGroup.class })
    private String khh;

    /**
     * 开户行行号/银联号
     */
    @NotBlank(message = "开户行行号/银联号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String khhNo;

    /**
     * 基本存款账户编号
     */
    @NotBlank(message = "基本存款账户编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String jbckzhbm;

    /**
     * 结算通道
     */
    @NotBlank(message = "结算通道不能为空", groups = { AddGroup.class, EditGroup.class })
    private String passage;

    /**
     * 法人身份证有效期开始日期
     */
    @NotNull(message = "法人身份证有效期开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date frCardidBeginDate;

    /**
     * 法人身份证有效期结束日期
     */
    @NotNull(message = "法人身份证有效期结束日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date frCardidEndDate;

    /**
     * 经办人身份证有效期开始日期
     */
    @NotNull(message = "经办人身份证有效期开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date jbrCardidBeginDate;

    /**
     * 经办人身份证有效期结束日期
     */
    @NotNull(message = "经办人身份证有效期结束日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date jbrCardidEndDate;

    /**
     * 业务员id
     */
    private Long ywyId;

    /**
     * 发票抬头
     */
    @NotBlank(message = "发票抬头不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoceHeader;

    /**
     * 发票纳税人识别号
     */
    @NotBlank(message = "发票纳税人识别号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoceCreditCode;

    /**
     * 发票开户银行名称
     */
    @NotBlank(message = "发票开户银行名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoceBankName;

    /**
     * 发票开户银行账号
     */
    @NotBlank(message = "发票开户银行账号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoceBankCard;

    /**
     * 发票单位注册地址
     */
    @NotBlank(message = "发票单位注册地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoceAddress;

    /**
     * 发票单位电话
     */
    @NotBlank(message = "发票单位电话不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoceDwdh;

    /**
     * 开户许可证
     */
    @NotBlank(message = "开户许可证不能为空", groups = { AddGroup.class, EditGroup.class })
    private String fhxkzPic;

    /**
     * 法人身份证正面
     */
    @NotBlank(message = "法人身份证正面不能为空", groups = { AddGroup.class, EditGroup.class })
    private String frSfzzm;

    /**
     * 法人身份证反面
     */
    @NotBlank(message = "法人身份证反面不能为空", groups = { AddGroup.class, EditGroup.class })
    private String frSfzfm;

    /**
     * 经办人身份证正面
     */
    @NotBlank(message = "经办人身份证正面不能为空", groups = { AddGroup.class, EditGroup.class })
    private String jbrSfzzm;

    /**
     * 经办人身份证反面
     */
    @NotBlank(message = "经办人身份证反面不能为空", groups = { AddGroup.class, EditGroup.class })
    private String jbrSfzfm;

    /**
     * 门头全景照
     */
    @NotBlank(message = "门头全景照不能为空", groups = { AddGroup.class, EditGroup.class })
    private String mtqjzPic;

    /**
     * 办公照片1
     */
    @NotBlank(message = "办公照片1不能为空", groups = { AddGroup.class, EditGroup.class })
    private String bgzp1Pic;

    /**
     * 办公照片2
     */
    @NotBlank(message = "办公照片2不能为空", groups = { AddGroup.class, EditGroup.class })
    private String bgzp2Pic;

    /**
     * 业务场景真实性承诺函
     */
    @NotBlank(message = "业务场景真实性承诺函不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ywcjzsxcnh;

    /**
     * 业务场景说明
     */
    @NotBlank(message = "业务场景说明不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ywcjsm;

    /**
     * 法大大授权协议
     */
//    @NotBlank(message = "法大大授权协议不能为空", groups = { AddGroup.class, EditGroup.class })
    private String fddsqxy;

    /**
     * 特殊行业许可证
     */
//    @NotBlank(message = "特殊行业许可证不能为空", groups = { AddGroup.class, EditGroup.class })
    private String tshyxkz;

    /**
     * 审核状态（0:待审核、1:驳回、2:审核通过）
     */
//    @NotNull(message = "审核状态（0:待审核、1:驳回、2:审核通过）不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long verifyStatus;

    /**
     * 审核时间
     */
//    @NotNull(message = "审核时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date verifyTime;

    /**
     * 审核人
     */
//    @NotBlank(message = "审核人不能为空", groups = { AddGroup.class, EditGroup.class })
    private String verifyBy;

    /**
     * 驳回原因
     */
//    @NotBlank(message = "驳回原因不能为空", groups = { AddGroup.class, EditGroup.class })
    private String verifyReason;

    /**
     * 企业规模
     */
//    @NotBlank(message = "企业规模不能为空", groups = { AddGroup.class, EditGroup.class })
    private String scale;

    /**
     * 企业logo地址
     */
//    @NotBlank(message = "企业logo地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String logo;

    /**
     * 企业介绍
     */
//    @NotBlank(message = "企业介绍不能为空", groups = { AddGroup.class, EditGroup.class })
    private String introduce;

    /**
     * 业务员id
     */
//    @NotNull(message = "业务员id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long salesmanId;

    /**
     * 是否验证资金账户(0:否 1:是)
     */
//    @NotNull(message = "是否验证资金账户(0:否 1:是)不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer isValiAcc;


    private String agentNo;

    private String operatorNo;

    private String industryCode;

    private String khhCode;

    private Integer isProduct;



    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date startTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date endTime;

    private String scaleName;


    private Long createUnitId;

    private String createUnitNo;
    public Date getEndTime() {
        if(this.endTime != null){
            return DateUtils.addOneDay(this.endTime);
        }
        return this.endTime;
    }



}
