package com.fs.live.param;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fs.common.core.domain.BaseEntity;
import com.fs.common.utils.security.SqlSafeUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class LiveOrderParam extends BaseEntity implements Serializable
{

    private String orderCode;

    //多个订单号搜索
    private List<String> orderCodes;

    private String nickname;

    private String phone;

    private String userPhone;

    /** 订单状态（-1 : 申请退款 -2 : 退货成功 1：待支付 2：待发货；3：待收货；4：待评价；5：已完成） 6(金牛代服待推送，请避开6)*/
    private Integer status;

    private Long companyId;

    private String isHealth;

    private Integer notHealth;

    private Long companyUserId;

    private String createTimeRange;

    private String[] createTimeList;

    private String payTimeRange;

    private String[] payTimeList;

    private String deliverySendTimeRange;

    private String[] deliverySendTimeList;

    private String deliveryImportTimeRange;

    private String[] deliveryImportTimeList;

    private Integer orderType;


    private String companyUserNickName;

    private String deliveryId;

    private Integer deliveryStatus;

    private Integer deliveryPayStatus;

    private Long deptId;

    private Long userId;

    private Long customerId;

    private String realName;

    private Integer isPayRemain;

    private Integer payType;

    private String productName;

    private Integer isUpload;

    /** 开始时间 */
    @JsonIgnore
    private String beginTime;

    /** 结束时间 */
    @JsonIgnore
    private String endTime;

    private Long scheduleId;

    private String orderVisit;

    /**
     * 支付状态 待支付 1已支付
     */
    private Integer paidStatus;

    private Long storeId;

    //排序字段
    private String sortField;
    //排序规则
    private String sortOrder;

    //erp电话
    private String erpPhoneNumber;

    //小程序id
    private Long coursePlaySourceConfigId;
    //erp账户
    private String erpAccount;

    //导出字段
    private String filter;

    //银行交易流水号
    private String bankTransactionId;

    /**
     * 排序方向白名单校验，防止 ${sortOrder} SQL 注入
     */
    public void setSortOrder(String sortOrder) {
        this.sortOrder = SqlSafeUtils.validateOrderDirection(sortOrder);
    }

}
