package com.ssm.manage.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ssm.manage.entity.PayList;
import com.ssm.manage.entity.PromotionProject;
import com.ssm.manage.entity.Salesman;
import com.ssm.manage.page.BasePage;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.boot.web.servlet.server.Session;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.Column;
import javax.persistence.Id;
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 DocPromotionRequest extends BasePage {
//    @DateTimeFormat(pattern = "yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
//    private Date startTime;
//    @DateTimeFormat(pattern = "yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
//    private Date endTime;
    /**
     * 主键ID
     */
    @Id
    private Long id;
    private Long roleId;
    private List<Long> storeIds;
private String strDate;
    /**
     * 门店ID
     */
    @Column(name = "store_id")
    private Long storeId;

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

    /**
     * 会员ID
     */
    @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_card")
    private String memberIdentityCard;

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

    /**
     * 单据号
     */
    @Column(name = "doc_num")
    private String docNum;

    /**
     * 单据时间
     */
    @Column(name = "doc_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date docDate;

    /**
     * 促销活动ID
     */
    @Column(name = "promotion_id")
    private Long promotionId;

    /**
     * 促销方案编码
     */
    @Column(name = "promotion_num")
    private String promotionNum;

    /**
     * 促销方案名称
     */
    @Column(name = "promotion_name")
    private String promotionName;

    /**
     * 促销方案价格
     */
    private BigDecimal price;

    /**
     * 套数
     */
    private Integer count;

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

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

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

    /**
     * 现付销售提成，大于1表示固定提成，小于等于1表示比率提成
     */
    @Column(name = "sales_commission")
    private BigDecimal salesCommission;

    /**
     * 卡付销售提成，大于1表示固定提成，小于等于1表示比率提成
     */
    @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;


    /**
     * 门店高管编码
     */
    @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;

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

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


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


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

    /**
     * 选择的项目序号数组
     */
    @Column(name = "project_count")
    private Integer projectCount;

    /**
     * 选择的项目序号数组
     */
    @Column(name = "project_total")
    private Integer projectTotal;
    /**
     * 选择的项目序号数组
     */
    @Column(name = "project_array")
    private String projectArray;

    /**
     * 选择的项目序号数组
     */
    @Column(name = "promotion_type")
    private Integer promotionType;

    /**
     * 选择的项目序号数组
     */
    @Column(name = "money_type")
    private Integer moneyType;

    //支付方式列表
    private List<PayList> payLists;
    //业务员列表
    private List<StaffRequest> staffLists;
    //高管业绩
    private List<Salesman> salesmens;
    //充值卡付列表
    private List<RechargeAccountRequest> rechargeAccountList;
    //门店员工登录账户
    private String staffPhone;

    @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;

    private HttpSession session;

    /**
     * 0=本店，1=所有门店，2=指定门店
     */
    private int storeType;

    //随心配疗程列表
    private List<PromotionProject> promotionProjects;

    private List<Long> storeList;

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