package cn.estsh.i3plus.pojo.wms.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Description : 物流费用记录明细
 * @Reference :
 * @Author :QianHuaSheng
 * @CreateDate : 2020-05-15 3:18 下午
 * @Modify:
 **/
@Data
@Entity
@Table(name = "WMS_LOGISTIC_EXPENSE_RECORDS_DETAILS")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value = "物流费用记录明细")
public class WmsLogisticExpenseRecordsDetails extends BaseBean {

    private static final long serialVersionUID = -6839107270239441520L;
    @Column(name = "ORGANIZE_NAME")
    @ApiParam(value = "工厂名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String organizeName;

    @Column(name = "ORDER_NO")
    @ApiParam("单据号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String orderNo;

    @Column(name = "PART_NO")
    @ApiParam("物料号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String partNo;

    @Column(name = "PART_NAME")
    @ApiParam("物料名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String partName;

    @Column(name = "PART_UNIT")
    @ApiParam(value = "物料单位")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String partUnit;

    @Column(name = "unit")
    @ApiParam(value = "计量单位")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.URL,
            isRequire = 2, dataSrc = "/wms/wmsUnit/wms-unit/query", listColumnName = "unitCode", explicitColumnName = "unitCode")
    private String unit;

    @Column(name = "QTY")
    @ApiParam(value = "数量")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private Double qty;

    @Column(name = "COST")
    @ApiParam(value = "总运输费用")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private Double cost;

    @Column(name = "START_TIME")
    @ApiParam(value = "开始时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String startTime;

    @Column(name = "END_TIME")
    @ApiParam(value = "结束时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String endTime;

    /**
     * 状态:N=正常,C=行取消
     */
    @Column(name = "ITEM_STATUS")
    @ApiParam(value = "状态", example = "1")
    @AnnoOutputColumn(refClass = WmsEnumUtil.ORDER_DETAILS_STATUS.class, refForeignKey = "value", value = "description")
    private Integer itemStatus;
}
