package com.willalp.canteen.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.willalp.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.*;

/**
 * 食堂订单对象 hs_canteen_order
 *
 * @author songyu
 * @date 2021-12-03
 */

@TableName("hs_canteen_order")
public class HsCanteenOrder {
    private static final long serialVersionUID = 1L;

    /**
     * 消费订单id
     */
    @TableId
    private String orderId;

    /**
     * 订单编号
     */
    @Excel(name = "订单编号")
    private String orderNumber;

    /**
     * 用户编号
     */
    @Excel(name = "用户编号")
    private String userNumber;

    /**
     * 菜单编号
     */
    @Excel(name = "菜单编号")
    private String menuNumber;

    /**
     * 订单总额
     */
    @Excel(name = "订单总额")
    private BigDecimal orderTotal;

    /**
     * 设备编号
     */
    @Excel(name = "设备编号")
    private String deviceNumber;

    /**
     * 设备名称
     */
    @Excel(name = "设备名称")
    private String deviceName;


    @TableField(exist = false)
    List <HsCanteenCuisine> list = new ArrayList<>();

    /**
     * 付款时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paytime;

    /**
     * 作废时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "作废时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date zfsj;

    /**
     * 作废标志
     */
    @Excel(name = "作废标志")
    private Integer zfbz;

    @Excel(name = "机构代码")
    private String jgid;

    /**
     * 是否删除（0.未删除；1.已删除）
     */
    @TableLogic
    private Integer isDelete;

    @Excel(name = "账户名称")
    @TableField(exist = false)
    private String nickName;


    /**
     * 0消费 1记账
     */
    @Excel(name = "是否消费")
    private Integer consumeSign;

    @TableField(exist = false)
    private Integer patternId;

    @Excel(name = "就餐地")
    private String placeNumber;

    @TableField(exist = false)
    private String phonenumber;

    @TableField(exist = false)
    private String placeName;

    @TableField(exist = false)
    private String cardCode;

    @TableField(exist = false)
    private List<String> loginName = new ArrayList<>();


    /**
     * 请求参数
     */
    @TableField(exist = false)
    private Map<String, Object> params;

    public List<String> getLoginName() {
        return loginName;
    }

    public void setLoginName(List<String> loginName) {
        this.loginName = loginName;
    }

    public List<HsCanteenCuisine> getList() {
        return list;
    }

    public void setList(List<HsCanteenCuisine> list) {
        this.list = list;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getMenuNumber() {
        return menuNumber;
    }

    public void setMenuNumber(String menuNumber) {
        this.menuNumber = menuNumber;
    }

    public BigDecimal getOrderTotal() {
        return orderTotal;
    }

    public void setOrderTotal(BigDecimal orderTotal) {
        this.orderTotal = orderTotal;
    }

    public String getDeviceNumber() {
        return deviceNumber;
    }

    public void setDeviceNumber(String deviceNumber) {
        this.deviceNumber = deviceNumber;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public Date getPaytime() {
        return paytime;
    }

    public void setPaytime(Date paytime) {
        this.paytime = paytime;
    }

    public Integer getZfbz() {
        return zfbz;
    }

    public void setZfbz(Integer zfbz) {
        this.zfbz = zfbz;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public String getJgid() {
        return jgid;
    }

    public void setJgid(String jgid) {
        this.jgid = jgid;
    }

    public String getUserNumber() {
        return userNumber;
    }

    public void setUserNumber(String userNumber) {
        this.userNumber = userNumber;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getConsumeSign() {
        return consumeSign;
    }

    public void setConsumeSign(Integer consumeSign) {
        this.consumeSign = consumeSign;
    }

    public Integer getPatternId() {
        return patternId;
    }

    public void setPatternId(Integer patternId) {
        this.patternId = patternId;
    }

    public String getPlaceNumber() {
        return placeNumber;
    }

    public void setPlaceNumber(String placeNumber) {
        this.placeNumber = placeNumber;
    }

    public Date getZfsj() {
        return zfsj;
    }

    public void setZfsj(Date zfsj) {
        this.zfsj = zfsj;
    }

    public String getPhonenumber() {
        return phonenumber;
    }

    public void setPhonenumber(String phonenumber) {
        this.phonenumber = phonenumber;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public String getCardCode() {
        return cardCode;
    }

    public void setCardCode(String cardCode) {
        this.cardCode = cardCode;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("orderNumber", getOrderNumber())
                .append("menuNumber", getMenuNumber())
                .append("orderTotal", getOrderTotal())
                .append("deviceNumber", getDeviceNumber())
                .append("deviceName", getDeviceName())
                .append("paytime", getPaytime())
                .append("zfbz", getZfbz())
                .append("isDelete", getIsDelete())
                .append("jgid", getJgid())
                .append("userNumber", getUserNumber())
                .append("nickName", getNickName())
                .append("consumeSign", getConsumeSign())
                .append("patternId", getPatternId())
                .append("placeNumber", getPlaceNumber())
                .append("zfsj", getZfsj())
                .append("phonenumber", getPhonenumber())
                .append("cardCode", getCardCode())
                .append("placeName", getPlaceName())
                .toString();
    }

    public Map<String, Object> getParams() {
        if (params == null) {
            params = new HashMap<>();
        }
        return params;
    }
}
