package com.slodon.b2b2c.vo.integral;

import com.slodon.b2b2c.core.constant.OrderConst;
import com.slodon.b2b2c.core.i18n.Language;
import com.slodon.b2b2c.integral.pojo.IntegralOrder;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 封装打印电子面单校验订单VO对象
 */
@Data
public class FaceSheetPrintCheckOrderVO implements Serializable {

    private static final long serialVersionUID = -3988387278116057145L;
    @ApiModelProperty("订单号")
    private String orderSn;

    @ApiModelProperty("受限")
    private String restrict;

    @ApiModelProperty("受限原因")
    private String restrictReason;

    @ApiModelProperty("是否已生成电子面单 1 - 已生成 2 - 未生成")
    private Integer isGenerateFaceSheet;

    public FaceSheetPrintCheckOrderVO(IntegralOrder integralOrder) {
        this.orderSn = integralOrder.getOrderSn();
        this.isGenerateFaceSheet = integralOrder.getIsGenerateFacesheet();
        if (OrderConst.IS_GENERATE_FACE__SHEET_1 != this.isGenerateFaceSheet) {
            this.restrictReason = "当前订单未生成电子面单";
            //翻译
            this.restrictReason = Language.translate(this.restrictReason);
            this.restrict = "无法打印";
            this.restrict = Language.translate(this.restrict);
        } else {
            this.restrictReason = "点击继续操作";
            //翻译
            this.restrictReason = Language.translate(this.restrictReason);
            this.restrict = "无";
            this.restrict = Language.translate(this.restrict);
        }
    }

}
