using HH.WCS.QingXigongchang.process;
using HH.WCS.QingXigongchang.util;
using SqlSugar;
using System;
namespace HH.WCS.QingXigongchang.wms
{
//---------------------------------------仓库信息---------------------------------------
public class BaseModel
{
[SugarColumn(IsPrimaryKey = true)]
public string S_ID { get; set; } = Guid.NewGuid().ToString("D");
public string S_CREATOR_ID { get; set; } = "sa";
public string S_CREATOR_NAME { get; set; } = "超级用户";
public DateTime T_CREATE { get; set; } = DateTime.Now;
public DateTime T_MODIFY { get; set; } = DateTime.Now;
}
//均州现场
//[SugarTable("TN_0038")]
//[SugarTable("TN_0129")]//198服务器
[SuGG("入库排锁表")]
public class InworkRecord : BaseModel
{
public string SQL_PLineNo { get; set; }
public string S_Fule_Code { get; set; }
public string S_IP_Address { get; set; }
public string S_AREA_CODE { get; set; }
public string N_ROW { get; set; }
}
public class locCntItem
{
public string S_LOC_CODE { get; set; }
public int N_CURRENT_NUM { get; internal set; }
public string S_AREA_CODE { get; internal set; }
public int N_ROW { get; internal set; }
public int N_COL { get; internal set; }
///
/// 1 零头1 2零头2 (标签特有) 3 整托
///
public int HalfOrFull { get; internal set; } = 0;
[SugarColumn(IsIgnore = true)]
public string HalfFull
{
get
{
switch (this.HalfOrFull)
{
case 1:
return "零头1";
case 2:
return "零头2";
case 3:
return "整托";
default: return this.HalfOrFull + "未知";
}
}
}
public string S_NOTE { get; internal set; }
public string S_CNTR_CODE { get; internal set; }
public string S_TYPE { get; internal set; }
public int N_LAYER { get; internal set; }
public string S_ITEM_CODE { get; internal set; }
public string S_ITEM_NAME { get; internal set; }
public string S_CJ_NAME { get; set; }
}
[SuGG("货位表")]//TN_0010新安江
public class Location : BaseModel
{
///
/// 货位码
///
public string S_LOC_CODE { get; set; }
//库区码
public string S_AREA_CODE { get; set; }
//[SugarColumn(IsIgnore = true)]
public string S_Fule_LOC { get; set; }
///
/// 仓库名称表
///
public string S_WH_CODE { get; set; }
//容量 可容纳层数
public int N_CAPACITY { get; set; }
///
// - 瓶坯用作 瓶坯机号(名称)
// - 瓶坯空框区 用作标识有空框
// - 不用了。 换 S_NOTE
///
public string S_AGV_SITE { get; set; }
///
/// 备注 - 标注机器。 瓶盖用,瓶坯配置了独立库区
///
public string S_NOTE { get; set; }
///
/// 需要注意
///
//[SugarColumn(IsIgnore = true)]
public int N_AGV_CODE { get; set; }
// 大于0有货。 0 没货,
public int N_CURRENT_NUM { get; set; }
// 搬运时
///
/// 置满时间
///
public DateTime? T_FULL_TIME { get; set; }
public DateTime? T_EMPTY_TIME { get; set; }
// 巷道
public int N_ROADWAY { get; set; }
// 竖排
public int N_ROW { get; set; }
// 横列
public int N_COL { get; set; }
// - 考虑用作层数
public int N_LAYER { get; set; }
///
/// 无/入库锁/出库锁/其它锁
///
public string S_LOCK_STATE
{
get; set;
}
//public string S_DEEP { get; set; }
[SugarColumn(IsIgnore = true)]
[Navigate(NavigateType.OneToMany, nameof(S_LOC_CODE))]
public LocCntrRel LocCntrRel { get; set; }
[SugarColumn(IsIgnore = true)]
public string Batch { get; set; }
//[SugarColumn(IsIgnore = true)]
//[Navigate(NavigateType.OneToMany, nameof(S_LOC_CODE))]
//public List LocCntrRels { get; set; }
}
//均州现场
//[SugarTable("TN_0039")]
//198服务器
///
/// 货位容器表
///
//[SugarTable("TN_0130")]
//[SugarTable("TN_0011")]
[SuGG("托盘货位表")]
public class LocCntrRel : BaseModel
{
///
/// 注意,mapper方式不需要
///
[SugarColumn(IsPrimaryKey = true)]
public string S_LOC_CODE { get; set; }
public string S_CNTR_CODE { get; set; }
///
/// 空筐 -> 即产Y 非即产N
/// 瓶坯 -> 物料iTEMCODE ===> 改 产线+物料 ”lineNo+物料“
/// 成品 -> 版型
/// 瓶盖 -> 产线 || 取消 2024年12月9日 10:02:10 改=> LineNo>物料 ||-- 2024年12月9日 10:16:23 改=>
///
public string S_TYPE { get; set; }
[SugarColumn(IsIgnore = true)]
[Navigate(NavigateType.OneToOne, nameof(S_CNTR_CODE))]
public CntrItemRel CntrItemRel { get; set; }
[SugarColumn(IsIgnore = true)]
[Navigate(NavigateType.OneToOne, nameof(S_CNTR_CODE))]
public Container Container { get; set; }
[SugarColumn(IsIgnore = true)]
public LocCntrRel Reference { get; set; }
public LocCntrRel Clone()
{
var clone = (LocCntrRel)this.MemberwiseClone();
if (this.Reference != null)
{
clone.Reference = (LocCntrRel)this.Reference.Clone();
}
return clone;
}
}
//均州现场
//[SugarTable("TN_0028")]
//198服务器
//[SugarTable("TN_0116")]
[SuGG("托盘物料表")]
public class CntrItemRel : BaseModel
{
[SugarColumn(IsPrimaryKey = true)]
public string S_CNTR_CODE { get; set; }
public string S_ITEM_CODE { get; set; }
public string S_ITEM_NAME { get; set; }
public string S_BATCH_NO { get; set; }
public string F_QTY { get; set; }
public string B_TYPE { get; set; }
///
/// 半托1 0.5 半托2。 0.75 满托 1
///
public double N_BQ_TRAY_TYPE { get; set; } = 1;
///
/// 厂家
///
public string S_CJ_NAME { get; set; }
public int ItemLayer { get; set; }
[SugarColumn(IsIgnore = true)]
public int qty
{
get
{
int q = 0;
int.TryParse(F_QTY, out q);
return q;
}
}
public string S_ITEM_STATE { get; set; } = "无";
[SugarColumn(IsIgnore = true)]
public CntrItemRel Reference { get; set; }
public CntrItemRel Clone()
{
var clone = (CntrItemRel)this.MemberwiseClone();
if (this.Reference != null)
{
clone.Reference = (CntrItemRel)this.Reference.Clone();
}
return clone;
}
///
/// 下线是的工单号_isFule GDH1000001_Y
///
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public string S_ORDER_NO { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public DateTime? Off_T { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public string Off_report { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public DateTime? In_T { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public string In_report { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public DateTime? Out_T { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public string Out_report { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public string Out_LingNo { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public DateTime? DoF_T { get; set; }
[SugarColumn(IsIgnore = !TaskProcess.UPFule)]
public string DoF_report { get; set; }
}
[SuGG("物料表")]
public class ItemInfo : BaseModel
{
public string S_ITEM_CODE { get; set; }
public string S_ITEM_NAME { get; set; }
public int trayHeight { get; set; }
public int ItemLayer { get; set; }
//物料所在托盘的可堆叠层数。 《》与货位容量取 最小值。
public int MaxLayer { get; set; }
public string B_Type { get; set; }
///
/// 逗号连接, 标签编码。 -
///
public string S_BQ_NAME { get; set; }
}
[SuGG("自由线段表")]
public class FreeLineInfo : BaseModel
{
public string area { get; set; }
public int row { get; set; }
public int minCol { get; set; }
public int maxCol { get; set; }
public int bit1 { get; set; }
public int bit2 { get; set; }
}
//均州现场
//[SugarTable("TN_0029")]
//[SugarTable("TN_0117")]//198服务器
//[SugarTable("TN_0018")]//新安江
[SuGG("密集锁排")]
public class RowLock : BaseModel
{
public string S_AREA_CODE { get; set; }
public int N_ROW { get; set; }
public string S_LOCK_STATE { get; set; }
public string S_WORK_MODE { get; set; } = "";
public string S_LOCK_SRC { get; set; }
public DateTime T_LOCK_TIME { get; set; }
public DateTime T_UNLOCK_TIME { get; set; }
}
//均州现场
//[SugarTable("TN_0026")]
//198服务器
//[SugarTable("TN_0114")]
[SuGG("托盘表")]
public class Container : BaseModel
{
///
/// 容器编码
///
[SugarColumn(IsPrimaryKey = true)]
public string S_CNTR_CODE { get; set; }
///
/// 大/小板 集化板
///
public string S_TYPE { get; set; }
///
/// 规格
///
public string S_SPEC { get; set; }
///
/// 容器用途
///
public string N_PURPOSE { get; set; }
///
/// 容器来源
///
public string S_SRC { get; set; }
///
/// 容器目的地
///
public string S_DEST { get; set; }
///
/// 容器状态(空-已清洁-无-转运-待生产)
///
public string S_CNTR_STATE { get; set; }
}
//均州现场
//[SugarTable("dbo.")]
//[SugarTable("dbo.TN_0098")]//198服务器
//[SugarTable("dbo.TN_0004")]//新安江
[SuGG("任务表")]
public class WMSTask : BaseModel
{
public string S_DEPART_NAME { get; set; }
public string S_TASK_NO { get; set; }
public string S_START_LAREA { get; set; }
public string S_END_LAREA { get; set; }
public string S_START_LOC { get; set; }
public string S_END_LOC { get; set; }
public string S_TWO_END_LOC { get; set; }
public string S_TYPE { get; set; }
public string S_NOTE { get; set; }
public string S_SRC_SYS { get; set; }
public string S_SRC_NO { get; set; }
///
/// agv/人工/输送线
///
public string S_WORK_MODE { get; set; }
public DateTime? T_START_TIME { get; set; }
public DateTime? T_END_TIME { get; set; }
///
/// 任务状态
///
public string S_B_STATE { get; set; }
public int N_PRIORITY { get; set; }
///
/// 搬运的托盘号,多个用英文逗号分开
///
public string S_CNTRS { get; set; }
public string S_EQ_NO { get; set; }
///
/// 起点层
///
public int N_START_LAYER { get; set; }
///
/// 终点层
///
public int N_END_LAYER { get; set; }
///
/// 搬运的托盘数量
///
public int N_CNTR_COUNT { get; set; }
}
//均州现场
//[SugarTable("dbo.")]
//198服务器
//[SugarTable("dbo.TN_0146")]
//新安江
//[SugarTable("dbo.TN_0027")]
[SuGG("任务动作表")]
public class WmsTaskAction : BaseModel
{
public string S_TASK_NO { get; set; }
public string S_ACTION_CODE { get; set; }
///
/// 设备号
///
public string S_EQ_NO { get; set; }
///
/// 设备类型
///
public string S_EQ_TYPE { get; set; }
///
/// 其它数据
///
public string S_DATA { get; set; }
}
//均州现场
//[SugarTable("dbo.")]
//[SugarTable("dbo.TN_0023")]//新安江
//[SugarTable("dbo.TN_0132")]//198服务器
[SuGG("货位扩展表")]
public class LocationExt : BaseModel
{
///
/// 货位
///
public string S_LOC_CODE { get; set; }
///
/// agv站点
///
public string S_AGV_SITE { get; set; }
///
/// 标识
///
public string S_PICKUP_POINT { get; set; }
}
}