package com.ruoyi.bst.device.domain;

import java.math.BigDecimal;
import java.util.List;

import com.ruoyi.common.utils.MathUtils;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class DeviceVO extends Device {

    @ApiModelProperty("直属用户名称")
    private String mchName;

    @ApiModelProperty("直属用户分成")
    private BigDecimal mchPoint;

    @ApiModelProperty("车型名称")
    private String modelName;

    @ApiModelProperty("型号满电电压")
    private BigDecimal modelFullVoltage;

    @ApiModelProperty("型号亏电电压")
    private BigDecimal modelLowVoltage;

    @ApiModelProperty("型号续航")
    private BigDecimal modelFullEndurance;

    @ApiModelProperty("型号套餐ID列表")
    private List<Long> modelSuitIds;

    @ApiModelProperty("运营区名称")
    private String areaName;

    @ApiModelProperty("运营区用户分成")
    private BigDecimal areaUserPoint;

    @ApiModelProperty("运营区用户名称")
    private String areaUserName;

    @ApiModelProperty("运营区是否需要实名认证")
    private Boolean areaAuthentication;

    @ApiModelProperty("运营区用户ID")
    private Long areaUserId;

    @ApiModelProperty("运营区最低骑行电量")
    private BigDecimal areaUndercharge;

    @ApiModelProperty("运营区代理商分成")
    private BigDecimal areaAgentPoint;

    @ApiModelProperty("运营区代理商ID")
    private Long areaAgentId;

    @ApiModelProperty("运营区代理商名称")
    private String areaAgentName;

    @ApiModelProperty("当前订单ID")
    private Long orderId;

    @ApiModelProperty("当前订单状态")
    private String orderStatus;

    @ApiModelProperty("当前订单编号")
    private String orderNo;

    @ApiModelProperty("当前订单设备状态")
    private String orderDeviceStatus;

    // 剩余续航（公里）
    public BigDecimal getRemainEndurance() {
        BigDecimal remainEndurance = MathUtils.mulDecimal(getRemainingPower(), getModelFullEndurance());
        return remainEndurance.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
    }
}
