using iWareCommon.Common.Entity;
|
using iWareCommon.Utils;
|
using iWareDataCore.ORM;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWareDataCore.BASE.Entity
|
{
|
public class EmptyPlaceViewEntity : ICommonEntity<BASEEmptyPlaceView>
|
{
|
|
/// <summary>
|
/// 库位ID
|
/// </summary>
|
public int Id { get; set; }
|
|
|
/// <summary>
|
/// 库位编码
|
/// </summary>
|
public string Code { get; set; }
|
|
/// <summary>
|
/// 库位类型名字
|
/// </summary>
|
public string PlaceTypeName { get; set; }
|
|
/// <summary>
|
/// 库位类型备注
|
/// </summary>
|
public string PlaceTypeRemark { get; set; }
|
|
|
/// <summary>
|
/// 库位类型id
|
/// </summary>
|
public int? TypeId { get; set; }
|
|
|
/// <summary>
|
/// 库位行
|
/// </summary>
|
public int? Row { get; set; }
|
|
/// <summary>
|
/// 库位列
|
/// </summary>
|
public int? Col { get; set; }
|
|
/// <summary>
|
/// 层
|
/// </summary>
|
public int? Layer { get; set; }
|
|
/// <summary>
|
/// 宽
|
/// </summary>
|
public decimal? Width { get; set; }
|
|
/// <summary>
|
/// 长
|
/// </summary>
|
public decimal? Length { get; set; }
|
|
/// <summary>
|
/// 高
|
/// </summary>
|
public decimal? Height { get; set; }
|
/// <summary>
|
/// 最大承重
|
/// </summary>
|
public decimal? MaxWeight { get; set; }
|
|
/// <summary>
|
/// 档位
|
/// </summary>
|
public int? HeightLevel { get; set; }
|
|
/// <summary>
|
/// X坐标
|
/// </summary>
|
public int? Posx { get; set; }
|
|
/// <summary>
|
/// Y坐标
|
/// </summary>
|
public int? Posy { get; set; }
|
|
/// <summary>
|
/// Z坐标
|
/// </summary>
|
public int? Posz { get; set; }
|
|
/// <summary>
|
/// 库位状态
|
/// </summary>
|
public int Status { get; set; }
|
|
/// <summary>
|
/// 库位锁
|
/// </summary>
|
public int IsLock { get; set; }
|
|
/// <summary>
|
/// 是否执行
|
/// </summary>
|
public int IsExecute { get; set; }
|
/// <summary>
|
/// 库位锁定标记
|
/// </summary>
|
public int? VoidLabel { get; set; }
|
|
/// <summary>
|
/// 库位中的物料
|
/// </summary>
|
public List<MaterialViewEntity> Materials { get; set; }
|
|
|
|
/// <summary>
|
/// 无参构造
|
/// </summary>
|
public EmptyPlaceViewEntity() { Materials = new List<MaterialViewEntity>(); }
|
|
|
/// <summary>
|
/// 有参构造
|
/// </summary>
|
/// <param name="place">orm映射的类</param>
|
public EmptyPlaceViewEntity(BASEEmptyPlaceView place)
|
{
|
EntityPropHelper<EmptyPlaceViewEntity, BASEEmptyPlaceView>.CopyProp(place, this, GetColumnMap());
|
Materials = new List<MaterialViewEntity>();
|
}
|
|
|
|
/// <summary>
|
/// 将对象转换成ORM中的类型
|
/// </summary>
|
/// <returns>Orm中的BASEEmptyPlaceView类型</returns>
|
public BASEEmptyPlaceView ToOrm()
|
{
|
BASEEmptyPlaceView place = new BASEEmptyPlaceView();
|
|
EntityPropHelper<EmptyPlaceViewEntity, BASEEmptyPlaceView>.CopyProp(this, place, GetColumnMap());
|
|
return place;
|
}
|
|
///<summary>
|
/// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段
|
/// </summary>
|
/// <returns></returns>
|
public static Dictionary<string, string> GetColumnMap()
|
{
|
return new Dictionary<string, string>()
|
{
|
{"Id", "id"},
|
{"PlaceTypeName", "placetypename"},
|
{"PlaceTypeRemark", "placetyperemark"},
|
{"Code", "code"},
|
{"TypeId", "typeid"},
|
{"Row", "row"},
|
{"Col", "col"},
|
{"Layer", "layer"},
|
{"Width", "width"},
|
{"Length", "length"},
|
{"Height", "height"},
|
{"MaxWeight", "maxweight"},
|
{"HeightLevel", "heightlevel"},
|
{"Posx", "posx"},
|
{"Posy", "posy"},
|
{"Posz", "posz"},
|
{"Status", "status"},
|
{"IsLock", "islock"},
|
{"IsExecute", "isexecute"}
|
};
|
}
|
|
|
/// <summary>
|
/// 根据WareHouseAreaTypeEntity的字段转BASEEmptyPlaceView的字段
|
/// </summary>
|
/// <param name="name">WareHouseAreaTypeEntity的字段</param>
|
/// <returns>BASEEmptyPlaceView</returns>
|
public static string GetColumnName(string name)
|
{
|
var columnMap = GetColumnMap();
|
return columnMap.ContainsKey(name) ? columnMap[name] : name;
|
}
|
|
/// <summary>
|
/// 获取WareHouseAreaTypeEntity对应的表名
|
/// </summary>
|
/// <returns>表名</returns>
|
public static string GetTableName()
|
{
|
return "[dbo].[BASEEmptyPlaceView]";
|
}
|
}
|
}
|