package cn.pluss.platform.vo;

import cn.pluss.platform.entity.DeviceStock;
import cn.pluss.platform.util.StringUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class DeviceStockVO extends DeviceStock {

    private String groupNoDesc;

    private String codeDesc;

    private String typeDesc;

    private String statusDesc;

    /**
     * 总数量
     */
    private Integer totalNum;

    /**
     * 绑定数量
     */
    private Integer bindNum;

    /**
     * 未绑定数量
     */
    private Integer unbindNum;

    private String deviceName;

    private String deviceLogo;

    /**
     * 划拨状态描述01:表示待接收
     */
    private String transferStatusDesc;

    /**
     * 提货人
     */
    private String extractName;

    /**
     * 提货人手机号
     */
    private String extractPhone;

    /**
     * 持有人
     */
    private String belongName;

    /**
     * 持有人手机号
     */
    private String belongPhone;

    /**
     * 商户手机号
     */
    private String mercPhone;

    private String cashPlaceName;

    /**
     * 付款码标签
     */
    private Boolean payCodeFlag;

    public String getStatusDesc() {
        String status = this.getStatus();
        if("3".equals(status)){
            this.statusDesc = this.getActMercName();
        }else{
            this.statusDesc = "未绑定";
        }
        return statusDesc;
    }

    public String getTransferStatusDesc() {
        String tStatus = StringUtil.isEmpty(this.getTransferStatus()) ? "" : this.getTransferStatus();
        switch (tStatus){
            case "01":
                this.transferStatusDesc = "待接收";
                break;
            default:
                this.transferStatusDesc = "";
        }
        return transferStatusDesc;
    }

}
