package com.cyksj.model.views;

import com.cyksj.model.entity.GoodsDon;
import com.cyksj.model.entity.GroupsRelation;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author chan
 * @date 2022/9/27 11:54 AM
 */
@SearchBean(tables = "groups_relation gr left join groups_trips gt on gt.id = gr.groups_id " +
        "left join account a on a.id = gt.account_id " +
        "left join goods_don_sku sku on gt.sku_id = sku.id " +
        "left join goods_don g on g.id = sku.goods_id ",
        where = ":condition:")
@Getter
@Setter
public class RenewalView {

    @DbField("g.id")
    private Long goodsId;

    @DbField("sku.id")
    private Long skuId;

    @DbField("sku.sub_title")
    private String subTitle;

    @DbField("g.status")
    private Boolean goodsStatus;

    @DbField("sku.status")
    private Boolean skuStatus;

    @DbField("sku.months")
    private Integer months;

    @DbField("sku.days")
    private Integer days;

    @DbField("sku.num")
    private Integer skuNum;

    /**
     * 是否是多人规格
     */
    @DbIgnore
    private Boolean isMulti;

    @DbField("sku.price")
    private BigDecimal price;

    @DbField("sku.spec_val")
    private String specVal;

    @DbField("gr.id")
    private Long relationId;

    @DbField("gr.num")
    private Integer num;

    @DbField("gr.groups_id")
    private Long groupId;

    @DbField("g.title")
    private String title;

    @DbField("g.logo")
    private String logo;

    @DbField("g.img")
    private String img;

    @DbField("g.type")
    @JsonIgnore
    private Integer goodsType;

    /**
     * 是否是第三方平台
     */
    @DbField("g.is_third_goods")
    private Boolean isThirdGoods;

    /**
     * 二级分类
     * 虚物品 1邀请制 2非邀请制
     */
    @DbField("g.second_type")
    private Integer secondType;

    /**
     * 邀请制是否完成
     */
    @DbIgnore
    private Boolean isComplete;

    @DbField("g.special_type")
    private GoodsDon.SpecialType specialType;

    /**
     * 用户端车票展示字段
     */
    @DbField("g.show_field_info")
    private String showFieldInfo;

    @DbField("gt.status")
    private String groupsStatus;

    @DbField("gr.user_id")
    @JsonIgnore
    private Long userId;

    @DbField("gr.start_time")
    private Date startTime;

    @DbField("gr.expiry_time")
    private Date expiryTime;

    @DbIgnore
    private Long total;

    @DbIgnore
    private String expiryTimeStr;

    @DbField("gr.status")
    private String status;

    @DbField("a.account")
    private String account;

    @DbField("a.password")
    @JsonIgnore
    private String password;

    @DbField("a.api_key")
    private String apiKey;

    @DbField("a.gpt_email_pwd")
    private String gptEmailPwd;

    @DbField("a.email")
    private String email;

    @DbField("if(a.api_secret='',false,true)")
    private Boolean isVerify;

    @DbField("a.gpt_refresh_token")
    private String gptRefreshToken;

    @DbField("gr.verify_code")
    private String verifyCode;

    @DbField("a.secret")
    private String secret;

    @DbField("a.api_secret")
    @JsonIgnore
    private String apiSecret;

    /**
     * 是否外部采购
     */
    @DbField("a.outside_purchase")
    private Boolean outsidePurchase;

    @DbField("gr.account")
    private String grAccount;

    @DbField("gr.password")
    private String grPassword;

    /**
     * 代充剩余次数
     */
    @DbField("gr.recharge_remain_num")
    private Integer rechargeRemainNum;

    @DbField("gr.recharge_status")
    private GroupsRelation.RechargeStatus rechargeStatus;

    @DbField("gr.recharge_error_info")
    private String rechargeErrorInfo;

    /**
     * 代充任务id
     */
    @DbField("gr.gpt_task_id")
    private String gptTaskId;

    /**
     * 家庭组邀请链接
     */
    @DbField("gr.invite_link")
    private String inviteLink;

    /**
     * 联系方式
     */
    @DbField("gr.contact")
    private String contact;

    /**
     * 备用验证码
     */
    @DbField("gr.bp_verify_code")
    private String bpVerifyCode;

    @DbIgnore
    private String orderNo;
    @DbIgnore
    private Long orderId;

    @DbIgnore
    private String transactionId;

    /**
     * 店铺id
     */
    @DbField("gr.yhs_id")
    private Long yhsId;

    /**
     * 店铺类型
     * 0无 1.普通店铺 2.镜像店铺
     */
    @DbField("gr.cmt")
    private Integer cmt;

    /**
     * 车票获取类型 默认1购买,2.体验 3.镜像裂变
     */
    @DbField("gr.aq_type")
    private Integer aqType;

    /**
     * 是否是VIP
     */
    @DbField("gr.is_vip")
    private Boolean isVip;

    /**
     * 是否被冻结
     * 默认false
     */
    @DbField("gr.is_frozen")
    private Boolean isFrozen;

    /**
     * 解冻时长
     */
    @DbField("gr.unfrozen_time")
    private Date unfrozenTime;

    /**
     * 冻结保留天数
     */
    @DbField("gr.reserved_days")
    private Integer reservedDays;

    @DbIgnore
    private Date payTime;

    @DbIgnore
    private GoodsDonViews goodsDonViews;

    @DbIgnore
    private String remainDays;

    @DbIgnore
    private List<GroupsRelationUserView> relationViews;

    @DbIgnore
    private Integer codeNum;

    /**
     * nano次数
     */
    @DbField("sku.nano_quota")
    private Boolean skuNanoQuota;

    /**
     * 是否为镜像服务
     */
    @DbField("sku.is_mirror")
    private Boolean isMirror;
    /**
     * 是否为镜像车队服务
     */
    @DbField("sku.is_car")
    private Boolean isCar;


    /**
     * mj fast次数
     */
    @DbField("sku.mj_fast_num")
    private Integer mjFastNum;


    /**
     * mj relax次数
     */
    @DbField("sku.mj_relax_num")
    private Integer mjRelaxNum;

    /**
     * 镜像限制次数
     */
    @DbField("sku.gpt_limit_num")
    private Integer gptLimitNum;

    /**
     * luma 次数
     */
    @DbField("sku.luma_num")
    private Integer lumaNUm;

    /**
     * deepseek限制次数
     */
    @DbField("sku.ds_limit_num")
    private Integer dsLimitNum;

    /**
     * deepseek限制时间
     */
    @DbField("sku.ds_limit_time")
    private Long dsLimitTime;

    /**
     * 其他模型限制次数
     */
    @DbField("sku.other_limit_num")
    private Integer otherLimitNum;

    /**
     * 其他模型限制时间
     */
    @DbField("sku.other_limit_time")
    private Long otherLimitTime;

    /**
     * 关联邮箱 接收邮件
     */
    @DbField("a.relate_email")
    @JsonIgnore
    private String relateEmail;

    @DbField("a.created_time")
    private Date createdTime;

    /**
     * 奈飞同步装置链接
     */
    @DbField("a.verify_link")
    private String verifyLink;

    /**
     * 激活码
     */
    @DbField("a.act_code")
    private String actCode;

    /**
     * 分类id
     */
    @DbIgnore
    private List<Long> categoryIdList;

    /**
     * mj 套餐包最低单价
     */
    @DbIgnore
    private BigDecimal mjPackagePrice;

    /**
     * luma 套餐包最低单价
     */
    @DbIgnore
    private BigDecimal lumaPackagePrice;

    /**
     * 用户 mj fast次数
     */
    @DbIgnore
    private Integer mjUserFastNum;

    /**
     * 用户 mj 加量包次数
     */
    @DbIgnore
    private Integer mjUserUpgradeNum;


    /**
     * 用户 mj relax次数
     */
    @DbIgnore
    private Integer mjUserRelaxNum;

    /**
     * gpt 用户镜像限制次数
     */
    @DbIgnore
    private Integer gptUserLimitNum;

    /**
     * gpt 用户镜像限制时间
     */
    @DbIgnore
    private Long gptUserLimitTime;

    /**
     * luma 用户次数
     */
    @DbIgnore
    private Integer lumaUserNum;

    /**
     * deepseek限制次数
     */
    @DbIgnore
    private Integer userDsLimitNum;

    /**
     * deepseek限制时间
     */
    @DbIgnore
    private Long userDsLimitTime;

    /**
     * 其他模型限制次数
     */
    @DbIgnore
    private Integer userOtherLimitNum;

    /**
     * 其他模型限制时间
     */
    @DbIgnore
    private Long userOtherLimitTime;

    /**
     * 镜像token
     */
    @DbIgnore
    private String userToken;

    @DbIgnore
    private Long use;

    /**
     * 是否可升级套餐 （标准，专业）
     */
    @DbIgnore
    private Boolean upgrade;

    @DbIgnore
    private Long packageId;

    /**
     * 目前已升级套餐价格
     */
    @DbIgnore
    private BigDecimal packagePrice;

    /**
     * 是否有配置售后问题
     */
    @DbIgnore
    private Boolean qa;

    @DbIgnore
    private DistributePosterGoodsDetailView posterInfo;

    /**
     * 是否是续费升级
     */
    @DbIgnore
    private Boolean isRenewPackage;

    /**
     * 续费升级规格id
     */
    @DbIgnore
    private Long renewSkuId;

    /**
     * 续费升级目前规格
     */
    @DbIgnore
    private GoodsDonSkuRenewView renewSku;

    /**
     * 续费升级折扣
     */
    @DbIgnore
    private BigDecimal discount;

    /**
     * 是否是续费减免skuId
     */
    @DbIgnore
    private Boolean isRenewReduce = false;

    /**
     * gpt模式 0旧版 1新版
     */
    @DbIgnore
    private Integer model;

    /**
     * 是否领取过GPT日卡
     */
    @DbIgnore
    private Boolean receivedGptGift;

    /**
     * 是否是会员抵扣车票
     */
    @DbIgnore
    private Boolean isVipDeduct = false;
}
