package com.ssm.manage.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ssm.manage.entity.CourseListVo;
import com.ssm.manage.entity.PayList;
import com.ssm.manage.entity.RechargeAccount;
import com.ssm.manage.entity.Salesman;
import com.ssm.manage.page.BasePage;
import com.ssm.manage.utils.DateUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.servlet.http.HttpSession;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Setter
@Getter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class CourseListRequest extends BasePage {
    private List<CourseListVo> courseLists;
    private Long id;
    private String docId;
    private List<Long> storeIds;
    private Long projectType;
//    private Date date;
    //支付方式列表
    private List<PayList> payLists;
    //业务员列表
    private List<StaffRequest> staffLists;
    //充值卡付列表
    private List<RechargeAccountRequest> rechargeAccountList;
    //门店员工登录账户
    private String staffPhone;
    /**
     * 单据高管管理者
     */
    private List<Salesman> salesmens;

    private HttpSession session;


    private List<Long> storeList;



// 疗程编码、
// 疗程名称、
// 单次标价、  校验
// 成交单价、  校验
// 最少购买、
// 购买次数、  校验
// 成交金额、  校验
// 待付金额、  校验
// 充值卡付、  校验
// 卡付金额、  校验
// 现付金额、  校验
// 欠款金额、  校验
// 实付金额、  校验


    /**
     * 疗程开卡单
     */
    @Column(name = "course_reatment_num")
    private String courseReatmentNum;

    /**
     * 疗程开卡日期
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date date;

    /**
     * 会员编码
     */
    @Column(name = "member_id")
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(name = "member_name")
    private String memberName;

    /**
     * 会员手机号
     */
    @Column(name = "mobile_phone")
    private String mobilePhone;

    /**
     * 会员身份证号
     */
    @Column(name = "member_identity")
    private String memberIdentity;

    /**
     * 会员卡
     */
    private String card;

    /**
     * 项目编码
     */
    @Column(name = "projct_id")
    @Getter@Setter
    private Long projctId;

    /**
     * 项目名称
     */
    @Column(name = "project_name")
    private String projectName;

    /**
     * 门店编码
     */
    @Column(name = "store_id")
    private Long storeId;

    /**
     * 门店名称
     */
    @Column(name = "store_name")
    private String storeName;

    /**
     * 最少销售次数
     */
    @Column(name = "minumum_times")
    private Integer minumumTimes;

    /**
     * 散客价
     */
    private BigDecimal price;

    /**
     * 散客最低价
     */
    @Column(name = "minumum_price")
    private BigDecimal minumumPrice;

    /**
     * 会员价
     */
    @Column(name = "price_member")
    private BigDecimal priceMember;

    /**
     * 会员最低价
     */
    @Column(name = "minumum_price_member")
    private BigDecimal minumumPriceMember;

    /**
     * 销售次单价
     */
    @Column(name = "sales_price")
    private BigDecimal salesPrice;

    /**
     * 销售次数
     */
    @Column(name = "numberTimes")
    private Integer numberTimes;

    /**
     * 销售金额
     */
    private BigDecimal amount;

    /**
     * 现付金额
     */
    @Column(name = "collection_cash_amount")
    private BigDecimal collectionCashAmount;

    /**
     * 积分付金额
     */
    @Column(name = "collection_integral_amount")
    private BigDecimal collectionIntegralAmount;

    /**
     * 使用积分
     */
    private Integer integral;

    /**
     * 充值卡付金额
     */
    @Column(name = "collection_recharge_amount")
    private BigDecimal collectionRechargeAmount;

    /**
     * 实收总额
     */
    @Column(name = "course_reatment_amount")
    private BigDecimal courseReatmentAmount;

    /**
     * 现付销售业绩标准
     */
    @Column(name = "sales_achievement")
    private BigDecimal salesAchievement;

    /**
     * 现付销售提成标准
     */
    @Column(name = "sales_commission")
    private BigDecimal salesCommission;

    /**
     * 卡付销售业绩标准
     */
    @Column(name = "card_sales_achievement")
    private BigDecimal cardSalesAchievement;

    /**
     * 卡付销售提成标准
     */
    @Column(name = "card_sales_commission")
    private BigDecimal cardSalesCommission;

    /**
     * 现付销售业绩
     */
    @Column(name = "achievement_amount")
    private BigDecimal achievementAmount;

    /**
     * 现付销售提成
     */
    @Column(name = "commission_amount")
    private BigDecimal commissionAmount;

    /**
     * 卡付销售业绩
     */
    @Column(name = "card_achievement_amount")
    private BigDecimal cardAchievementAmount;

    /**
     * 卡付销售提成
     */
    @Column(name = "card_commission_amount")
    private BigDecimal cardCommissionAmount;

    /**
     * 销售员1水牌号
     */
    @Column(name = "sale_one_number")
    private String saleOneNumber;

    /**
     * 销售员2水牌号
     */
    @Column(name = "sale_two_number")
    private String saleTwoNumber;

    /**
     * 销售员3水牌号
     */
    @Column(name = "sale_three_number")
    private String saleThreeNumber;

    /**
     * 销售员4水牌号
     */
    @Column(name = "sale_four_number")
    private String saleFourNumber;

    /**
     * 销售员1编码
     */
    @Column(name = "sale_one_staff_id")
    private Long saleOneStaffId;

    /**
     * 销售员2编码
     */
    @Column(name = "sale_two_staff_id")
    private Long saleTwoStaffId;

    /**
     * 销售员3编码
     */
    @Column(name = "sale_three_staff_id")
    private Long saleThreeStaffId;

    /**
     * 销售员4编码
     */
    @Column(name = "sale_four_staff_id")
    private Long saleFourStaffId;

    /**
     * 销售员1名称
     */
    @Column(name = "sale_one_staff_name")
    private String saleOneStaffName;

    /**
     * 销售员2名称
     */
    @Column(name = "sale_two_staff_name")
    private String saleTwoStaffName;

    /**
     * 销售员3名称
     */
    @Column(name = "sale_three_staff_name")
    private String saleThreeStaffName;

    /**
     * 销售员4名称
     */
    @Column(name = "sale_four_staff_name")
    private String saleFourStaffName;

    /**
     * 销售员1身份证号
     */
    @Column(name = "sale_one_identity")
    private String saleOneIdentity;

    /**
     * 销售员2身份证号
     */
    @Column(name = "sale_two_identity")
    private String saleTwoIdentity;

    /**
     * 销售员3身份证号
     */
    @Column(name = "sale_three_identity")
    private String saleThreeIdentity;

    /**
     * 销售员4身份证号
     */
    @Column(name = "sale_four_identity")
    private String saleFourIdentity;

    /**
     * 销售员1占比
     */
    @Column(name = "sale_one_ratio")
    private BigDecimal saleOneRatio;

    /**
     * 销售员2占比
     */
    @Column(name = "sale_two_ratio")
    private BigDecimal saleTwoRatio;

    /**
     * 销售员3占比
     */
    @Column(name = "sale_three_ratio")
    private BigDecimal saleThreeRatio;

    /**
     * 销售员4占比
     */
    @Column(name = "sale_four_ratio")
    private BigDecimal saleFourRatio;

    /**
     * 门店高管编码
     */
    @Column(name = "manage_staff_id")
    private Long manageStaffId;

    /**
     * 门店高管名称
     */
    @Column(name = "manage_staff_name")
    private String manageStaffName;

    /**
     * 门店高管身份证号
     */
    @Column(name = "manage_identity")
    private String manageIdentity;

    /**
     * 门店高管水牌号
     */
    @Column(name = "manage_number")
    private String manageNumber;

    /**
     * 是否欠款 1:欠款/0:未欠款
     */
    @Column(name = "is_debt")
    private Integer isDebt;

    /**
     * 欠款金额
     */
    @Column(name = "debt_money")
    private BigDecimal debtMoney;

    /**
     * 是否作废 1:作废/0:未作废
     */
    @Column(name = "is_cancel")
    private Integer isCancel;

    /**
     * 作废时间
     */
    @Column(name = "cancel_date")
    private Date cancelDate;

    /**
     * 销售员1业绩
     */
    @Column(name = "sale_one_achievement_amount")
    private BigDecimal saleOneAchievementAmount;

    /**
     * 销售员2业绩
     */
    @Column(name = "sale_two_achievement_amount")
    private BigDecimal saleTwoAchievementAmount;

    /**
     * 销售员3业绩
     */
    @Column(name = "sale_three_achievement_amount")
    private BigDecimal saleThreeAchievementAmount;

    /**
     * 销售员4业绩
     */
    @Column(name = "sale_four_achievement_amount")
    private BigDecimal saleFourAchievementAmount;

    /**
     * 销售员1提成
     */
    @Column(name = "sale_one_commission_amount")
    private BigDecimal saleOneCommissionAmount;

    /**
     * 销售员2提成
     */
    @Column(name = "sale_two_commission_amount")
    private BigDecimal saleTwoCommissionAmount;

    /**
     * 销售员3提成
     */
    @Column(name = "sale_three_commission_amount")
    private BigDecimal saleThreeCommissionAmount;

    /**
     * 销售员3提成
     */
    @Column(name = "sale_four_commission_amount")
    private BigDecimal saleFourCommissionAmount;



    /**
     * 销售员5水牌号
     */
    @Column(name = "sale_five_number")
    private String saleFiveNumber;


    /**
     * 销售员5编码
     */
    @Column(name = "sale_five_staff_id")
    private Long saleFiveStaffId;

    /**
     * 销售员5名称
     */
    @Column(name = "sale_five_staff_name")
    private String saleFiveStaffName;

    /**
     * 销售员5身份证号
     */
    @Column(name = "sale_five_identity")
    private String saleFiveIdentity;

    /**
     * 销售员5占比
     */
    @Column(name = "sale_five_ratio")
    private BigDecimal saleFiveRatio;

    /**
     * 销售员5业绩
     */
    @Column(name = "salefive_achievement_amount")
    private BigDecimal saleFiveAchievementAmount;

    /**
     * 销售员5提成
     */
    @Column(name = "sale_five_commission_amount")
    private BigDecimal saleFiveCommissionAmount;



    /**
     * 销售员6水牌号
     */
    @Column(name = "sale_six_number")
    private String saleSixNumber;


    /**
     * 销售员6编码
     */
    @Column(name = "sale_six_staff_id")
    private Long saleSixStaffId;

    /**
     * 销售员6名称
     */
    @Column(name = "sale_six_staff_name")
    private String saleSixStaffName;

    /**
     * 销售员6身份证号
     */
    @Column(name = "sale_six_identity")
    private String saleSixIdentity;

    /**
     * 销售员6占比
     */
    @Column(name = "sale_six_ratio")
    private BigDecimal saleSixRatio;

    /**
     * 销售员6业绩
     */
    @Column(name = "salesix_achievement_amount")
    private BigDecimal saleSixAchievementAmount;

    /**
     * 销售员6提成
     */
    @Column(name = "sale_six_commission_amount")
    private BigDecimal saleSixCommissionAmount;


    /**
     * 销售员7水牌号
     */
    @Column(name = "sale_seven_number")
    private String saleSevenNumber;


    /**
     * 销售员7编码
     */
    @Column(name = "sale_seven_staff_id")
    private Long saleSevenStaffId;

    /**
     * 销售员7名称
     */
    @Column(name = "sale_seven_staff_name")
    private String saleSevenStaffName;

    /**
     * 销售员7身份证号
     */
    @Column(name = "sale_seven_identity")
    private String saleSevenIdentity;

    /**
     * 销售员7占比
     */
    @Column(name = "sale_seven_ratio")
    private BigDecimal saleSevenRatio;

    /**
     * 销售员7业绩
     */
    @Column(name = "saleseven_achievement_amount")
    private BigDecimal saleSevenAchievementAmount;

    /**
     * 销售员7提成
     */
    @Column(name = "sale_seven_commission_amount")
    private BigDecimal saleSevenCommissionAmount;


    /**
     * 销售员8水牌号
     */
    @Column(name = "sale_eight_number")
    private String saleEightNumber;


    /**
     * 销售员8编码
     */
    @Column(name = "sale_eight_staff_id")
    private Long saleEightStaffId;

    /**
     * 销售员8名称
     */
    @Column(name = "sale_eight_staff_name")
    private String saleEightStaffName;

    /**
     * 销售员8身份证号
     */
    @Column(name = "sale_eight_identity")
    private String saleEightIdentity;

    /**
     * 销售员8占比
     */
    @Column(name = "sale_eight_ratio")
    private BigDecimal saleEightRatio;

    /**
     * 销售员8业绩
     */
    @Column(name = "saleeight_achievement_amount")
    private BigDecimal saleEightAchievementAmount;

    /**
     * 销售员8提成
     */
    @Column(name = "sale_eight_commission_amount")
    private BigDecimal saleEightCommissionAmount;







    /**
     * 账户ID
     */
    @Column(name = "course_account_id")
    private Long courseAccountId;

    /**
     * 描述
     */
    private String description;


    private String selectDate;


    /**
     * 录单人ID
     */
    @Column(name = "input_id")
    private Long inputId;

    /**
     * 录单人名称
     */
    @Column(name = "input_by")
    private String inputBy;

    /**
     * 作废人ID
     */
    @Column(name = "cancel_id")
    private Long cancelId;

    /**
     * 作废人名称
     */
    @Column(name = "cancel_by")
    private String cancelBy;

    private String dateStr;
    private String projectNum;

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

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

    /**
     * 补单时间
     */
    @Column(name = "addition_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date additionDate;

    /**
     * 是否补单0:不是/1:是
     */
    @Column(name = "is_addition")
    private Integer isAddition;



    /**
     * 查询方式，0=指定查询，1=自动查询
     */
    private Integer selectType;

    private String memberInitList;



    @JsonIgnore
    public String getTab(){
        return DateUtils.YMFormat(date);
    }
}
