148 lines
3.7 KiB
C#
148 lines
3.7 KiB
C#
using System.Text.Json.Serialization;
|
||
using SqlSugar;
|
||
using WcsMain.Enum.Location;
|
||
|
||
namespace WcsMain.DataBase.TableEntity;
|
||
|
||
/// <summary>
|
||
/// tbl_app_location
|
||
/// 点位信息表
|
||
/// </summary>
|
||
[SugarTable("tbl_app_location")]
|
||
public class AppLocation
|
||
{
|
||
/// <summary>
|
||
/// Wcs点位
|
||
/// </summary>
|
||
[SugarColumn(IsPrimaryKey = true, ColumnName = "wcs_location")]
|
||
[JsonPropertyName("wcsLocation")]
|
||
public string? WcsLocation { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wms点位,该列主要用于映射
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "wms_location")]
|
||
[JsonPropertyName("wmsLocation")]
|
||
public string? WmsLocation { get; set; }
|
||
|
||
/// <summary>
|
||
/// 巷道编号
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "tunnel_no")]
|
||
[JsonPropertyName("tunnelNo")]
|
||
public int? TunnelNo { get; set; }
|
||
|
||
/// <summary>
|
||
/// 设备编号
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "equipment_id")]
|
||
[JsonPropertyName("equipmentId")]
|
||
public int? EquipmentId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 点位状态
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "location_status")]
|
||
[JsonPropertyName("locationStatus")]
|
||
public int? LocationStatus { get; set; }
|
||
|
||
/// <summary>
|
||
/// 排
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "queue")]
|
||
[JsonPropertyName("queue")]
|
||
public int? Queue { get; set; }
|
||
|
||
/// <summary>
|
||
/// 列
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "line")]
|
||
[JsonPropertyName("line")]
|
||
public int? Line { get; set; }
|
||
|
||
/// <summary>
|
||
/// 层
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "layer")]
|
||
[JsonPropertyName("layer")]
|
||
public int? Layer { get; set; }
|
||
|
||
/// <summary>
|
||
/// 深
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "depth")]
|
||
[JsonPropertyName("depth")]
|
||
public int? Depth { get; set; }
|
||
|
||
/// <summary>
|
||
/// 点位类型
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "location_type")]
|
||
[JsonPropertyName("locationType")]
|
||
public int? LocationType { get; set; }
|
||
|
||
/// <summary>
|
||
/// 载具编号
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "vehicle_no")]
|
||
[JsonPropertyName("vehicleNo")]
|
||
public string? VehicleNo { get; set; }
|
||
|
||
/// <summary>
|
||
/// 修改时间
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "modify_time")]
|
||
[JsonPropertyName("modifyTime")]
|
||
public DateTime? ModifyTime { get; set; }
|
||
|
||
/// <summary>
|
||
/// 说明信息
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "explain")]
|
||
[JsonPropertyName("explain")]
|
||
public string? Explain { get; set; }
|
||
|
||
/// <summary>
|
||
/// 备注
|
||
/// </summary>
|
||
[SugarColumn(ColumnName = "remark")]
|
||
[JsonPropertyName("remark")]
|
||
public string? Remark { get; set; }
|
||
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// 创建一个正在使用的信息实例
|
||
/// </summary>
|
||
/// <param name="wcsLocation"></param>
|
||
/// <param name="vehicleNo"></param>
|
||
/// <returns></returns>
|
||
public static AppLocation CreateUsedInstance(string? wcsLocation, string? vehicleNo)
|
||
{
|
||
return new AppLocation()
|
||
{
|
||
WcsLocation = wcsLocation,
|
||
VehicleNo = vehicleNo,
|
||
ModifyTime = DateTime.Now,
|
||
LocationStatus = (int)LocationStatusEnum.used
|
||
};
|
||
}
|
||
|
||
/// <summary>
|
||
/// 创建一个空货位的实例
|
||
/// </summary>
|
||
/// <param name="wcsLocation"></param>
|
||
/// <returns></returns>
|
||
public static AppLocation CreateEmptyInstance(string? wcsLocation)
|
||
{
|
||
return new AppLocation()
|
||
{
|
||
WcsLocation = wcsLocation,
|
||
VehicleNo = "",
|
||
ModifyTime = DateTime.Now,
|
||
LocationStatus = (int)LocationStatusEnum.empty
|
||
};
|
||
}
|
||
|
||
} |