package com.ruoyi.ss.device.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.iot.interfaces.IotDevice;
import com.ruoyi.ss.bonus.domain.Bonus;
import com.ruoyi.ss.device.domain.Device;
import com.ruoyi.ss.device.domain.DeviceView;
import com.ruoyi.ss.suit.domain.SuitVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author wjh
 * 2024/3/15
 */
@Data
public class DeviceVO extends Device implements IotDevice {
    @ApiModelProperty("是否默认")
    private Boolean isDefault;    // 是否默认

    @ApiModelProperty("店铺名称")
    private String storeName;

    @ApiModelProperty("型号")
    private String model;

    @ApiModelProperty("所属用户名称")
    @JsonView(DeviceView.SuitList.class)
    private String userName;

    @ApiModelProperty("用户电话")
    @JsonView(DeviceView.SuitList.class)
    private String userMobile;

    @ApiModelProperty("图片")
    @JsonView(JsonViewProfile.App.class)
    private String picture;

    @ApiModelProperty("型号标签列表")
    private List<String> modelTags;

    @ApiModelProperty("套餐列表")
    @JsonView(DeviceView.SuitList.class)
    private List<SuitVO> suitList;

    @ApiModelProperty("店铺营业时间（起始）")
    @JsonView(JsonViewProfile.App.class)
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private LocalTime storeBusinessTimeStart;

    @ApiModelProperty("店铺营业时间（结束）")
    @JsonView(JsonViewProfile.App.class)
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private LocalTime storeBusinessTimeEnd;

    @ApiModelProperty("订单总数量")
    private Integer orderCount;

    @ApiModelProperty("订单总金额")
    private BigDecimal orderAmount;

    @ApiModelProperty("店铺联系人名称")
    @JsonView(DeviceView.SuitList.class)
    private String storeContactName;

    @ApiModelProperty("店铺联系人电话")
    @JsonView(DeviceView.SuitList.class)
    private String storeContactMobile;

    @ApiModelProperty("型号产品ID")
    private String modelProductId;

    @ApiModelProperty("商户服务费率")
    private BigDecimal userServiceRate;

    @ApiModelProperty("最终生效的服务费率")
    private BigDecimal realServiceRate;

    @ApiModelProperty("代理商本人服务费")
    private BigDecimal agentUserServiceRate;

    @ApiModelProperty("代理名称")
    private String agentName;

    @ApiModelProperty("代理商手机号")
    private String agentMobile;

    @ApiModelProperty("商户是否需要用户手机号")
    @JsonView(DeviceView.SuitList.class)
    private Boolean mchShowBillMobile;

    @ApiModelProperty("正在使用中的订单数量")
    private Integer usingBillCount;

    @ApiModelProperty("代理商是否允许商户开关设备")
    private Boolean agentAllowMchSwitch;

    @ApiModelProperty("是否允许当前用户开关设备")
    @JsonView(JsonViewProfile.App.class)
    private Boolean allowSwitch;

    @ApiModelProperty("分成比例列表")
    private List<Bonus> bonusList;

    @Override
    public String iotMac1() {
        return getMac();
    }
    @Override
    public String iotMac2() {
        return getMac2();
    }

    @Override
    public String getProductId() {
        return getModelProductId();
    }
}
