package com.shinsoft.sto.model.main;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shinsoft.generator.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

@Getter
@Setter
@Accessors(chain = true)
@TableName("T_MAIN_CARGO")
@ApiModel(value = "货权管理", description = "货权管理信息表")
public class Cargo extends BaseModel {

    @ApiModelProperty("上游客户ID")
    private String uperCustomerId;

    @ApiModelProperty("客户ID")
    private String customerId;

    @ApiModelProperty("可进行货权转移的重量")
    private BigDecimal sumWeight = BigDecimal.ZERO;

    @ApiModelProperty("使用重量")
    private BigDecimal useWeight = BigDecimal.ZERO;

    // 关联上游客户信息
    @TableField(exist = false)
    @ApiModelProperty("上游客户信息")
    private Customer uperCustomer;

    // 关联客户信息
    @TableField(exist = false)
    @ApiModelProperty("客户信息")
    private Customer customer;

    // 为了方便前端显示，添加客户名称字段
    @TableField(exist = false)
    @ApiModelProperty("上游客户名称")
    private String uperCustomerName;

    @TableField(exist = false)
    @ApiModelProperty("客户名称")
    private String customerName;
}