123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434 |
- using PlcSiemens.Core.Extension;
- using ServiceCenter.Extensions;
- using ServiceCenter.Logs;
- using ServiceCenter.SqlSugars;
- using SqlSugar;
- using System.ComponentModel;
- using WCS.Core;
- using WCS.Entity;
- using WCS.Entity.Protocol.BCR;
- using WCS.Entity.Protocol.RGV;
- using WCS.Entity.Protocol.Robot;
- using WCS.Entity.Protocol.Station;
- using WCS.Entity.Protocol.Truss;
- using WCS.WorkEngineering.Extensions;
- using WCS.WorkEngineering.Worlds;
- using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
- using TaskStatus = WCS.Entity.TaskStatus;
- using TaskType = WCS.Entity.TaskType;
- namespace WCS.WorkEngineering.Systems
- {
- /// <summary>
- /// RGV交互系统
- /// </summary>
- [BelongTo(typeof(RgvWorld))]
- [Description("RGV交互系统")]
- public class RGVSystems : DeviceSystem<Device<IRGV520, IRGV521, IBCR81>>
- {
- protected override bool ParallelDo => true;
- /// <summary>
- /// 取货点设备集合
- /// </summary>
- private readonly Dictionary<string, List<Device<IStation520, IStation521, IStation523>>> _pickUpDevices = new();
- public RGVSystems()
- {
- //获取所有的巷道集合
- var rgvList = Device.All.Where(v => v.HasFlag(DeviceFlags.RGV));
- foreach (var rgv in rgvList)
- {
- _pickUpDevices.Add(rgv.Code, rgv.Sources.Where(v => v.HasFlag(DeviceFlags.输送机)).Select(v => new Device<IStation520, IStation521, IStation523>(v, this.World)).ToList());
- }
- }
- public override void Do(Device<IRGV520, IRGV521, IBCR81> obj)
- {
- try
- {
- if (obj.Data.VoucherNo != obj.Data2.VoucherNo)
- {
- World.Log($"凭证号不一致,DB520:{obj.Data.VoucherNo}-DB521:{obj.Data2.VoucherNo}", LogLevelEnum.High);
- return;
- }
- if (obj.Data2.WorkMode != RGVWorkMode.Automatic)
- {
- World.Log(obj.Data2.WorkMode.GetDescription());
- return;
- }
- //wcs任务完成确认信号未清除
- if (obj.Data.RES1 == 1)
- {
- World.Log("wcs任务完成确认信号未清除");
- return;
- }
- if (obj.Data2.Status.HasFlag(RGVStatus.Taskfinishi))
- {
- switch (obj.Data2.CmdType)
- {
- case RGVCmdType.PickGoods: //单独取货任务完成,默认只有空托盘才会下发单独取货任务
- World.Log($"任务处理:开始-取货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
- //开始申请读码信息
- var bcrCode = obj.Data3.GetBCRCode();
- if (bcrCode.IsNullOrWhiteSpace() || bcrCode.Contains(":"))
- {
- World.Log("扫码失败,内容为空", LogLevelEnum.Mid);
- return;
- }
- World.Log($"任务处理:扫码结果-{bcrCode}");
- var taskNumber = 0;
- SqlSugarHelper.Do(_db =>
- {
- var db = _db.Default;
- //检查库存表是否有残留库存信息
- if (db.Queryable<BillInvnow>().Any(x => x.ContGrpBarCode == bcrCode))
- {
- //删除库存
- var invNow = db.Queryable<BillInvnow>().Where(x => x.ContGrpBarCode == bcrCode).OrderByDescending(x => x.AddTime).First();
- if (invNow.IsTorsChk) //是一楼码垛入库
- {
- db.DeleteableRowLock(invNow).ExecuteCommand(); //删除库存
- var invInit = db.Queryable<BillInvinit>().Where(x => x.ContGrpBarCode == bcrCode).OrderByDescending(x => x.AddTime).First();
- db.DeleteableRowLock(invInit).ExecuteCommand();//删除条码
- var taskInfos = db.Queryable<WCS_TaskInfo>().Where(x => x.BarCode == bcrCode && x.Status == TaskStatus.NewBuild && x.BusType == "人工满托入库").ToList();
- foreach (var task in taskInfos)
- {
- //取消任务
- task.Status = TaskStatus.Cancel;
- task.ManualRemarks = "托盘已使用,需在二楼组盘";
- db.Updateable(task).ExecuteCommand();
- task.AddWCS_TASK_DTL(db, obj.Entity.Code, "", "取消任务");
- }
- }
- World.Log($"【{obj.Entity.Code}】上的托盘 【{bcrCode}】存在历史库存信息,请检查对应托盘条码是否存在未完成的出库任务!!!!!", LogLevelEnum.High);
- return;
- }
- var dev = Device.All.First(x => x.Code == obj.Data2.DestPosition.ToString());
- if (dev.HasFlag(DeviceFlags.桁架码垛位))
- {
- //开始绑定任务,并下发新的任务信息到小车
- var palletizingInfo = db.Queryable<WCS_Palletizing>().Single(x => x.Id == obj.Data2.TaskNumber);
- if (palletizingInfo == null)
- {
- World.Log($"未找到对应的码垛信息{obj.Data2.TaskNumber}", LogLevelEnum.Mid);
- return;
- }
- palletizingInfo.PalleCode = bcrCode;
- db.UpdateableRowLock(palletizingInfo).UpdateColumns(x => new { x.PalleCode }).ExecuteCommand();
- taskNumber = palletizingInfo.Id;
- World.Log($"任务处理:当前任务为桁架区域补空托任务");
- }
- else if (dev.HasFlag(DeviceFlags.环形库码垛工位))
- {
- //开始处理对应的搬运任务信息
- var task = db.Queryable<WCS_TaskInfo>().UpdLock().First(x => x.Type == TaskType.Delivery && x.ID == obj.Data2.TaskNumber && x.AddrTo == obj.Data2.DestPosition.ToString());
- if (task == null)
- {
- World.Log($"未找到对应的搬运任务{obj.Data2.TaskNumber}", LogLevelEnum.Mid);
- return;
- }
- task.BarCode = bcrCode;
- db.UpdateableRowLock(task).UpdateColumns(x => new { x.BarCode }).ExecuteCommand();
- task.AddWCS_TASK_DTL(db, obj.Entity.Code, obj.Data2.DestPosition.ToString(), $"环形库码垛位{obj.Data2.DestPosition}搬运任务绑定条码信息{bcrCode}");
- taskNumber = task.ID;
- World.Log($"任务处理:当前任务为环形库区域补空托任务");
- }
- });
- if (taskNumber == 0)
- {
- World.Log($"取货完成处理失败", LogLevelEnum.Mid);
- return;
- }
- //清空目标点信息
- var destDev = new Device<IStation520>(Device.All.FirstOrDefault(x => x.Code == obj.Data2.DestPosition.ToString())!, World);
- destDev.Data.TaskNumber = 0;
- destDev.Data.GoodsStart = 0;
- destDev.Data.GoodsEnd = 0;
- obj.Data2.TaskNumber = taskNumber;
- obj.Data.RES1 = 1;
- World.Log($"任务处理:结束-取货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
- break;
- case RGVCmdType.PutGoods:
- Device destPosition = null;
- bool isPalletizing = false;
- try
- {
- World.Log($"任务处理:开始-放货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
- WCS_TaskInfo finishiTask = null;
- var startPosition = Device.All.Where(x => x.Code == obj.Data2.StartPosition.ToString())
- .Select(x => new Device<IStation520, IStation521, IStation523>(x, World))
- .FirstOrDefault();
- destPosition = Device.All.FirstOrDefault(x => x.Code == obj.Data2.DestPosition.ToString());
- isPalletizing = destPosition!.HasFlag(DeviceFlags.桁架码垛位, DeviceFlags.环形库码垛工位);
- short countQty = 0;
- short shortCode = 0;
- SqlSugarHelper.Do(_db =>
- {
- var db = _db.Default;
- if (isPalletizing)
- {
- if (destPosition.HasFlag(DeviceFlags.桁架码垛位))
- {
- var palletizingInfo = db.Queryable<WCS_Palletizing>()
- .First(x => x.Id == obj.Data.TaskNumber);
- countQty = palletizingInfo.CountQty.ToShort();
- shortCode = palletizingInfo.ShortCode;
- World.Log($"任务处理:当前任务为桁架区域补空托任务");
- }
- else if (destPosition.HasFlag(DeviceFlags.环形库码垛工位))
- {
- var deliveryTask = db.Queryable<WCS_TaskInfo>().UpdLock()
- .First(x => x.ID == obj.Data.TaskNumber);
- countQty = deliveryTask.FullQty;
- shortCode = deliveryTask.PalletType;
- deliveryTask.Status = TaskStatus.RgvCompleted;
- deliveryTask.EditTime = DateTime.Now;
- deliveryTask.LastInteractionPoint = obj.Entity.Code;
- db.Updateable(deliveryTask).UpdateColumns(x => new { x.Status, x.EditTime, x.LastInteractionPoint }).ExecuteCommand();
- deliveryTask.AddWCS_TASK_DTL(db, deliveryTask.AddrTo, $"RGV任务执行结束");
- World.Log($"任务处理:当前任务为环形库区域补空托任务");
- }
- }
- });
- if (startPosition.Data.TaskNumber == obj.Data.TaskNumber) //初始化起始点信息
- {
- startPosition.Data.TaskNumber = 0;
- startPosition.Data.GoodsEnd = 0;
- World.Log($"任务处理:初始化取货点{startPosition.Entity.Code}任务及目标地址信息");
- }
- //目标地址是码垛工位
- if (isPalletizing)
- {
- if (destPosition.HasFlag(DeviceFlags.桁架码垛位))
- {
- var dest = new Device<ITruss530,ITruss531>(destPosition!, World);
- if (dest.Data2.MaxQuantity == 0)
- {
- dest.Data.MaxQuantity = countQty;
- dest.Data.Quantity = 0;
- dest.Data.Type = shortCode;
- dest.Data.VoucherNo++;
- World.Log($"任务处理:写入码垛信息-码垛位[{dest.Entity.Code}]最大码垛数量[{dest.Data.MaxQuantity}]已码数量[{dest.Data.Quantity}]垛形[{dest.Data.Type}]凭证号[{dest.Data.VoucherNo}]");
- }
- else {
- World.Log($"桁架垛型信息未清除,无法写入新垛型信息请检查确认,最大码垛数量[{dest.Data.MaxQuantity}]已码数量[{dest.Data.Quantity}]垛形[{dest.Data.Type}]凭证号[{dest.Data.VoucherNo}]",LogLevelEnum.Mid);
- return;
- }
-
- }
- else if (destPosition.HasFlag(DeviceFlags.环形库码垛工位))
- {
- var dest = new Device<IRobot530>(destPosition!, World);
- dest.Data.MaxQuantity = countQty;
- dest.Data.Type = shortCode;
- dest.Data.VoucherNo++;
- World.Log($"任务处理:写入码垛信息-码垛位[{dest.Entity.Code}]最大码垛数量[{dest.Data.MaxQuantity}]垛形[{dest.Data.Type}]凭证号[{dest.Data.VoucherNo}]");
- }
- }
- }
- catch (Exception e)
- {
- World.Log($"处理小车放货完成是出现错误:{e.Message}-{e.StackTrace}");
- return;
- }
- obj.Data.RES1 = 1;
- World.Log($"任务处理:结束-放货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
- break;
- case RGVCmdType.Move:
- World.Log($"任务处理:开始-移动完成-任务号[{obj.Data2.TaskNumber}]目标地址[{obj.Data2.DestPosition}]");
- obj.Data.RES1 = 1;
- World.Log($"任务处理:结束-移动完成-任务号[{obj.Data2.TaskNumber}]目标地址[{obj.Data2.DestPosition}]");
- break;
- case RGVCmdType.ChangePutGoods:
- break;
- case RGVCmdType.ChangePickGoods:
- break;
- case RGVCmdType.PickPutGoods:
- World.Log($"任务处理:开始-取放货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
- var statDev = Device.All.FirstOrDefault(x => x.Code == obj.Data.StartPosition.ToString());
- var stDev = new Device<IStation520, IStation521>(Device.All.FirstOrDefault(x => x.Code == obj.Data.StartPosition.ToString())!, World);
- stDev.Data.TaskNumber = 0;
- stDev.Data.GoodsStart = 0;
- stDev.Data.GoodsEnd = 0;
- World.Log($"任务处理:清除目标地址信息-目标货位{stDev.Entity.Code}");
- obj.Data.RES1 = 1;
- World.Log($"任务处理:结束-取放货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
- return;
- }
- if (obj.Data2.SystemStatus != RGVSystemStatus.空闲)
- {
- World.Log(obj.Data2.SystemStatus.GetDescription());
- return;
- }
- if (obj.Data2.Status.HasFlag(RGVStatus.RES1)) //离开非安全区域
- {
- World.Log($"任务处理:开始-下发移动任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- obj.Data.TaskNumber = obj.Data.TaskNumber;
- obj.Data.CmdType = RGVCmdType.Move;
- obj.Data.DestPosition = obj.Entity.Code switch
- {
- "RGV1" => 1668,
- "RGV2" => 1683,
- "RGV3" => 1698,
- "RGV4" => 1713,
- "RGV5" => 1728,
- "RGV6" => 1743,
- _ => throw new ArgumentOutOfRangeException()
- };
- obj.Data.VoucherNo++;
- World.Log($"任务处理:结束-下发移动任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- return;
- }
- if (obj.Data2.CmdType == RGVCmdType.PickGoods && !obj.Data2.Status.HasFlag(RGVStatus.Taskfinishi))
- {
- if (obj.Data2.Status.HasFlag(RGVStatus.PH_Status))
- {
- World.Log($"任务处理:开始-下发放货任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]起始地址[{obj.Data.StartPosition}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- obj.Data.TaskNumber = obj.Data.TaskNumber;
- obj.Data.CmdType = RGVCmdType.PutGoods;
- obj.Data.StartPosition = obj.Data2.StartPosition;
- obj.Data.DestPosition = obj.Data2.DestPosition;
- obj.Data.VoucherNo++;
- World.Log($"任务处理:结束-下发放货任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]起始地址[{obj.Data.StartPosition}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- return;
- }
- }
- var pickUpDevices = _pickUpDevices.FirstOrDefault(x => x.Key == obj.Entity.Code).Value;
- //有货且需要搬运货物的站台
- var devs = pickUpDevices.Where(v => v.Data3.Status.HasFlag(StationStatus.PH_Status) && v.Data.TaskNumber != 0)
- .Where(v => v.Entity.Code.ToShort() != v.Data.GoodsEnd && v.Data.GoodsEnd != 0)
- .ToList();
- //筛选出目标站台无货的站台
- var putDev = obj.Entity.Targets.Where(x => x.HasFlag(DeviceFlags.输送机))
- .Select(x => new Device<IStation520, IStation521, IStation523>(x, World))
- .Where(x => !x.Data3.Status.HasFlag(StationStatus.PH_Status))
- .Where(x => !x.Data3.Status.HasFlag(StationStatus.OT_Status))
- .Select(x => x.Entity.Code.ToShort());
- //var devList = devs.OrderBy(x => x.Entity.Code).Where(x => putDev.Contains(x.Data.GoodsEnd));
- var devList = devs.OrderBy(x => x.Data.TaskNumber).Where(x => putDev.Contains(x.Data.GoodsEnd));
- if (!devList.Any())
- {
- World.Log($"无可用任务");
- }
- foreach (var dev in devList)
- {
- //区分任务是拆盘机到码垛工位,还是码垛工位到拆盘机
- if (dev.Entity.HasFlag(DeviceFlags.拆盘机))
- {
- World.Log($"任务处理:开始-下发取货任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]RGV运行状态[{obj.Data2.WorkMode.GetDescription()}]起始地址[{obj.Data.StartPosition}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- obj.Data.TaskNumber = dev.Data.TaskNumber;
- obj.Data.CmdType = RGVCmdType.PickGoods;
- obj.Data.StartPosition = dev.Entity.Code.ToShort();
- obj.Data.DestPosition = dev.Data.GoodsEnd;
- obj.Data.VoucherNo++;
- World.Log($"任务处理:结束-下发取货任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]起始地址[{obj.Data.StartPosition}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- return;
- }
- //if (dev.Entity.HasFlag(DeviceFlags.二次码垛RGV取货口))
- //{
- // obj.Data.TaskNumber = dev.Data.TaskNumber;
- // obj.Data.CmdType = RGVCmdType.PickPutGoods;
- // obj.Data.StartPosition = dev.Entity.Code.ToShort();
- // obj.Data.DestPosition = dev.Data.GoodsEnd;
- // obj.Data.VoucherNo++;
- // return;
- //}
- World.Log($"任务处理:开始-下发满托入库任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]RGV运行状态[{obj.Data2.WorkMode.GetDescription()}]起始地址[{obj.Data.StartPosition}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- //非拆盘机起始任务
- //站台中的任务号
- WCS_TaskInfo task = null;
- SqlSugarHelper.Do(_db =>
- {
- var db = _db.Default;
- var taskInfo = db.Queryable<WCS_TaskInfo>().First(p => p.ID == dev.Data.TaskNumber && p.Status == TaskStatus.ConveyorExecution);
- if (taskInfo == null)
- {
- World.Log($"任务处理:未找到对应的任务{dev.Entity.Code}--{dev.Data.TaskNumber}-1");
- return;
- }
- taskInfo.Status = TaskStatus.RgvExecution;
- taskInfo.AddrNext = obj.Entity.Code;
- taskInfo.EditWho = "WCS";
- taskInfo.EditTime = DateTime.Now; ;
- db.UpdateableRowLock(taskInfo).UpdateColumns(x => new { x.Status, x.AddrNext, x.EditWho, x.EditTime }).ExecuteCommand();
- taskInfo.AddWCS_TASK_DTL(db, dev.Entity.Code, obj.Entity.Code, $"任务分配至{obj.Entity.Code}");
- task = taskInfo;
- });
- if (task == null)
- {
- World.Log($"任务处理:未找到对应的任务{dev.Entity.Code}--{dev.Data.TaskNumber}-2");
- return;
- }
- World.Log($"任务处理:满托入库业务流程处理完成-任务[{task.ID}]状态已变更为[{task.Status}]开始准备写入PLC");
- obj.Data.TaskNumber = task.ID;
- obj.Data.CmdType = RGVCmdType.PickPutGoods;
- obj.Data.StartPosition = dev.Entity.Code.ToShort();
- obj.Data.DestPosition = dev.Data.GoodsEnd;
- obj.Data.VoucherNo++;
- World.Log($"任务处理:结束-下发满托入库任务-任务号[{obj.Data.TaskNumber}]任务类型[{obj.Data.CmdType}]起始地址[{obj.Data.StartPosition}]目标地址[{obj.Data.DestPosition}]凭证号[{obj.Data.VoucherNo}]");
- return;
- }
- }
- catch (Exception ex)
- {
- if (ex.Message == "Destination array was not long enough. Check the destination index, length, and the array's lower bounds")
- {
- World.Log($"未知异常:{ex.StackTrace}");
- }
- else if (ex.Message == "Number was less than the array's lower bound in the first dimension")
- {
- World.Log($"未知异常:{ex.StackTrace}");
- }
- else throw new KnownException(ex.Message, LogLevelEnum.Mid);
- }
- }
- public override bool Select(Device dev)
- {
- return dev.Code is "RGV1" or "RGV2" or "RGV3" or "RGV4" or "RGV5" or "RGV6";
- //return dev.HasFlag(Extensions.DeviceFlags.RGV);
- }
- }
- /// <summary>
- /// 库存表
- /// </summary>
- [SugarTable("Bill_InvNow")]
- public partial class BillInvnow : BaseModel
- {
- /// <summary>
- /// 仓库ID 关联仓库表 ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long WarehouseId { get; set; }
- /// <summary>
- /// 组盘ID
- /// 创建库存的时候 获取条码表ContGrpId
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long ContGrpId { get; set; }
- /// <summary>
- /// 容器条码 同联容器表容器条码 ContBarCode
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ContGrpBarCode { get; set; }
- /// <summary>
- /// 组盘类型(1物料盘 2空盘)
- /// </summary>
- [SugarColumn(IsNullable = true)]
- public FJContGrpType ContGrpType { get; set; }
- /// <summary>
- /// 箱条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BoxBarCode { get; set; }
- /// <summary>
- /// Bom单号 关联投料单 帘线工序工单号 BillCode
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BomDocsNo { get; set; }
- /// <summary>
- /// Bom物料ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long BomMatId { get; set; }
- /// <summary>
- /// Bom物料编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BomMatCode { get; set; }
- /// <summary>
- /// Bom物料
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = true)]
- public string BomMatName { get; set; }
- /// <summary>
- /// 垛形主表 ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long BomSetId { get; set; }
- /// <summary>
- /// 垛型编码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = true)]
- public string SetGrpCode { get; set; }
- /// <summary>
- /// 库存状态码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecStateCode { get; set; }
- /// <summary>
- /// 单据编号 关联单据表单据编号 DocsNo
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecDocsNo { get; set; }
- /// <summary>
- /// 单据行号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecDocsRowNo { get; set; }
- /// <summary>
- /// 单据类型编号 同单据表TypeNum
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecDocsTypeCode { get; set; }
- /// <summary>
- /// 出入库标识
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public FJInvInOutType InvInOut { get; set; }
- /// <summary>
- /// 执行人
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecWho { get; set; }
- /// <summary>
- /// 执行时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime ExecTime { get; set; }
- /// <summary>
- /// 行
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int PutRow { get; set; }
- /// <summary>
- /// 列
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int PutCol { get; set; }
- /// <summary>
- /// 层
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int PutLayer { get; set; }
- /// <summary>
- /// 入库条码号 FJ材料号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InvBarCode { get; set; }
- /// <summary>
- /// 库存状态
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InvStateCode { get; set; }
- /// <summary>
- /// 入库单号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InDocsNo { get; set; }
- /// <summary>
- /// 入库单行号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InDocsRowNo { get; set; }
- /// <summary>
- /// 供应编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string SuppCode { get; set; }
- /// <summary>
- /// 供应商名称
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string SuppName { get; set; }
- /// <summary>
- /// 海关编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string CustCode { get; set; }
- /// <summary>
- /// 海关名称
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string CustName { get; set; }
- /// <summary>
- /// 物料ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long MatId { get; set; }
- /// <summary>
- /// 物料编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string MatCode { get; set; }
- /// <summary>
- /// 物料名称
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = true)]
- public string MatName { get; set; }
- /// <summary>
- /// 总重量
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal TolWQty { get; set; }
- /// <summary>
- /// 净重
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal NetWQty { get; set; }
- /// <summary>
- /// 皮重
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal TareWQty { get; set; }
- /// <summary>
- /// 总长
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal LengthQty { get; set; }
- /// <summary>
- /// 碳当量
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal CaQty { get; set; }
- /// <summary>
- /// 销售总量
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal SolderQty { get; set; }
- /// <summary>
- /// 暂定
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int ContUsageQty { get; set; }
- /// <summary>
- /// 批次号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BatchNo { get; set; }
- /// <summary>
- /// 生产时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime ProductTime { get; set; }
- /// <summary>
- /// 第一次入库时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime OneInTime { get; set; }
- /// <summary>
- /// 盘条条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string RodBarCode { get; set; }
- /// <summary>
- /// 工字轮条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string HWBarCode { get; set; }
- /// <summary>
- /// RFID条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string RFIDBarCode { get; set; }
- /// <summary>
- /// 材料号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string CLBarCode { get; set; }
- /// <summary>
- /// 工字轮条码类型
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string HWTypeCode { get; set; }
- /// <summary>
- /// 炉号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BoilerNo { get; set; }
- /// <summary>
- /// 包号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string PackNo { get; set; }
- /// <summary>
- /// 牌号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BrandNo { get; set; }
- /// <summary>
- /// 执行标准
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecStd { get; set; }
- /// <summary>
- /// 许可证号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string LicenceCode { get; set; }
- /// <summary>
- /// 改手盘标记
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsSurplus { get; set; }
- /// <summary>
- /// 返工标记
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsRework { get; set; }
- /// <summary>
- /// 是否黑盘
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsBlack { get; set; }
- /// <summary>
- /// 是否芯股
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsCore { get; set; }
- /// <summary>
- /// 快投标记
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsFast { get; set; }
- /// <summary>
- /// 是否异常
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsFail { get; set; }
- /// <summary>
- /// 异常原因
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true)]
- public string FailReason { get; set; }
- /// <summary>
- /// 单/双丝
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string SilkTypeCode { get; set; }
- /// <summary>
- /// 等级
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string Grade { get; set; }
- /// <summary>
- /// 是否退料
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsBack { get; set; }
- /// <summary>
- /// 退料原因
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true)]
- public string BackReason { get; set; }
- /// <summary>
- /// 是否扭转检测
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsTorsChk { get; set; }
- /// <summary>
- /// 扭转次数
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int TorsChkQty { get; set; }
- /// <summary>
- /// 扭转检测时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime TorsChkTime { get; set; }
- /// <summary>
- /// 正反面
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = true, ColumnDescription = "正反面")]
- public int SideNum { get; set; }
- /// <summary>
- /// 扭转检测结果值
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = true)]
- public decimal? TorsChkValue { get; set; }
- /// <summary>
- /// 扭转检测设备号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string TorsChkMachCode { get; set; }
- /// <summary>
- /// 工序订单号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ProcessDocsCode { get; set; }
- /// <summary>
- /// 生产机台号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ProductMachCode { get; set; }
- /// <summary>
- /// 生成产线号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ProductLineNo { get; set; }
- /// <summary>
- /// 货物大小
- /// </summary>
- [SugarColumn(IsNullable = true)]
- public int Size { get; set; }
- /// <summary>
- /// 托盘类型
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDescription = "托盘类型")]
- public FJPalletType PalletType { get; set; }
- /// <summary>
- /// 需要二次码垛的物料
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDescription = "循环码垛物料")]
- public bool Secondary { get; set; }
- }
- /// <summary>
- /// 条码表
- /// </summary>
- [SugarTable("Bill_InvInit")]
- public partial class BillInvinit : BaseModel
- {
- /// <summary>
- /// 仓库ID 关联仓库表 ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long WarehouseId { get; set; }
- /// <summary>
- /// 组盘ID
- /// 创建条码表时生成 同库存表组盘ID ContGrpId
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long ContGrpId { get; set; }
- /// <summary>
- /// 容器条码 同联容器表容器条码 ContBarCode
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ContGrpBarCode { get; set; }
- /// <summary>
- /// 箱条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BoxBarCode { get; set; }
- /// <summary>
- /// Bom单号 关联投料单 帘线工序工单号 BillCode
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BomDocsNo { get; set; }
- /// <summary>
- /// Bom物料ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long BomMatId { get; set; }
- /// <summary>
- /// Bom物料编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BomMatCode { get; set; }
- /// <summary>
- /// Bom物料
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = true)]
- public string BomMatName { get; set; }
- /// <summary>
- /// 垛形主表 ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long BomSetId { get; set; }
- /// <summary>
- /// 垛型编码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = true)]
- public string SetGrpCode { get; set; }
- /// <summary>
- /// 库存状态码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecStateCode { get; set; }
- /// <summary>
- /// 单据编号 关联单据表单据编号 DocsNo
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecDocsNo { get; set; }
- /// <summary>
- /// 单据行号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecDocsRowNo { get; set; }
- /// <summary>
- /// 单据类型编号 同单据表TypeNum
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecDocsTypeCode { get; set; }
- /// <summary>
- /// 出入库标识
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public FJInvInOutType InvInOut { get; set; }
- /// <summary>
- /// 执行人
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecWho { get; set; }
- /// <summary>
- /// 执行时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime ExecTime { get; set; }
- /// <summary>
- /// 行
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int PutRow { get; set; }
- /// <summary>
- /// 列
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int PutCol { get; set; }
- /// <summary>
- /// 层
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int PutLayer { get; set; }
- /// <summary>
- /// 入库条码号 FJ材料号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InvBarCode { get; set; }
- /// <summary>
- /// 库存状态
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InvStateCode { get; set; }
- /// <summary>
- /// 入库单号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InDocsNo { get; set; }
- /// <summary>
- /// 入库单行号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string InDocsRowNo { get; set; }
- /// <summary>
- /// 供应编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string SuppCode { get; set; }
- /// <summary>
- /// 供应商名称
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string SuppName { get; set; }
- /// <summary>
- /// 海关编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string CustCode { get; set; }
- /// <summary>
- /// 海关名称
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string CustName { get; set; }
- /// <summary>
- /// 物料ID
- /// </summary>
- [SugarColumn(ColumnDataType = "bigint", IsNullable = false)]
- public long MatId { get; set; }
- /// <summary>
- /// 物料编号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string MatCode { get; set; }
- /// <summary>
- /// 物料名称
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = true)]
- public string MatName { get; set; }
- /// <summary>
- /// 总重量
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal TolWQty { get; set; }
- /// <summary>
- /// 净重
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal NetWQty { get; set; }
- /// <summary>
- /// 皮重
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal TareWQty { get; set; }
- /// <summary>
- /// 总长
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal LengthQty { get; set; }
- /// <summary>
- /// 碳当量
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal CaQty { get; set; }
- /// <summary>
- /// 销售总量
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = false)]
- public decimal SolderQty { get; set; }
- /// <summary>
- /// 暂定
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int ContUsageQty { get; set; }
- /// <summary>
- /// 批次号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BatchNo { get; set; }
- /// <summary>
- /// 生产时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime ProductTime { get; set; }
- /// <summary>
- /// 第一次入库时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime OneInTime { get; set; }
- /// <summary>
- /// 盘条条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string RodBarCode { get; set; }
- /// <summary>
- /// 工字轮条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string HWBarCode { get; set; }
- /// <summary>
- /// RFID条码
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string RFIDBarCode { get; set; }
- /// <summary>
- /// 材料号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string CLBarCode { get; set; }
- /// <summary>
- /// 工字轮条码类型
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string HWTypeCode { get; set; }
- /// <summary>
- /// 炉号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BoilerNo { get; set; }
- /// <summary>
- /// 包号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string PackNo { get; set; }
- /// <summary>
- /// 牌号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string BrandNo { get; set; }
- /// <summary>
- /// 执行标准
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ExecStd { get; set; }
- /// <summary>
- /// 许可证号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string LicenceCode { get; set; }
- /// <summary>
- /// 改手盘标记
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsSurplus { get; set; }
- /// <summary>
- /// 返工标记
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsRework { get; set; }
- /// <summary>
- /// 是否黑盘
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsBlack { get; set; }
- /// <summary>
- /// 是否芯股
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsCore { get; set; }
- /// <summary>
- /// 快投标记
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsFast { get; set; }
- /// <summary>
- /// 是否异常
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsFail { get; set; }
- /// <summary>
- /// 异常原因
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true)]
- public string FailReason { get; set; }
- /// <summary>
- /// 单/双丝
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string SilkTypeCode { get; set; }
- /// <summary>
- /// 等级
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string Grade { get; set; }
- /// <summary>
- /// 是否退料
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsBack { get; set; }
- /// <summary>
- /// 退料原因
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true)]
- public string BackReason { get; set; }
- /// <summary>
- /// 是否扭转检测
- /// </summary>
- [SugarColumn(ColumnDataType = "bit", IsNullable = false)]
- public bool IsTorsChk { get; set; }
- /// <summary>
- /// 扭转次数
- /// </summary>
- [SugarColumn(ColumnDataType = "int", IsNullable = false)]
- public int TorsChkQty { get; set; }
- /// <summary>
- /// 扭转检测时间
- /// </summary>
- [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
- public DateTime TorsChkTime { get; set; }
- /// <summary>
- /// 扭转检测结果值
- /// </summary>
- [SugarColumn(ColumnDataType = "decimal", Length = 18, IsNullable = true)]
- public decimal? TorsChkValue { get; set; }
- /// <summary>
- /// 扭转检测设备号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string TorsChkMachCode { get; set; }
- /// <summary>
- /// 工序订单号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ProcessDocsCode { get; set; }
- /// <summary>
- /// 生产机台号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ProductMachCode { get; set; }
- /// <summary>
- /// 生成产线号
- /// </summary>
- [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
- public string ProductLineNo { get; set; }
- /// <summary>
- /// 货物大小
- /// </summary>
- [SugarColumn(IsNullable = false)]
- public int Size { get; set; }
- /// <summary>
- /// 托盘类型
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDescription = "托盘类型")]
- public FJPalletType PalletType { get; set; }
- /// <summary>
- /// 组盘类型
- /// </summary>
- [SugarColumn(IsNullable = true)]
- public FJContGrpType ContGrpType { get; set; }
- }
- /// <summary>
- /// 基础表实体
- /// </summary>
- public class BaseModel
- {
- public BaseModel()
- { }
- /// <summary>
- /// ID
- /// </summary>
- [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, ColumnDescription = "ID")]
- public virtual long Id { get; set; }
- /// <summary>
- /// 备注
- /// </summary>
- [SugarColumn(ColumnName = "Memo", Length = 500, IsNullable = true, ColumnDataType = "nvarchar", DefaultValue = "", ColumnDescription = "备注")]
- public virtual string Memo { get; set; }
- /// <summary>
- /// 创建用户
- /// </summary>
- [SugarColumn(ColumnName = "AddWho", Length = 50, ColumnDataType = "nvarchar", DefaultValue = "", IsNullable = false, ColumnDescription = "创建用户")]
- public virtual string AddWho { get; set; } = "";
- /// <summary>
- /// 更新用户
- /// </summary>
- [SugarColumn(ColumnName = "EditWho", Length = 50, ColumnDataType = "nvarchar", DefaultValue = "", IsNullable = false, ColumnDescription = "更新用户")]
- public virtual string EditWho { get; set; } = "";
- /// <summary>
- /// 创建时间
- /// </summary>
- [SugarColumn(ColumnName = "AddTime", DefaultValue = "1900-1-1", IsNullable = false, ColumnDescription = "创建时间")]
- public virtual DateTime AddTime { get; set; } = DateTime.Now;
- /// <summary>
- /// 更新时间
- /// </summary>
- [SugarColumn(ColumnName = "EditTime", DefaultValue = "1900-1-1", IsNullable = false, ColumnDescription = "更新时间")]
- public virtual DateTime EditTime { get; set; } = DateTime.Now;
- }
- /// <summary>
- /// 组盘类型
- /// </summary>
- public enum FJContGrpType
- {
- /// <summary>
- /// 物料盘
- /// </summary>
- [Description("物料盘")]
- Material = 1,
- /// <summary>
- /// 空盘
- /// </summary>
- [Description("空盘")]
- EmptyCon = 2,
- }
- /// <summary>
- /// 托盘类型
- /// </summary>
- public enum FJPalletType
- {
- /// <summary>
- /// 09使用的托盘
- /// </summary>
- [Description("09使用的托盘")]
- Pallet09 = 1,
- /// <summary>
- /// 非09使用的托盘
- /// </summary>
- [Description("非09使用的托盘")]
- PalletNo09 = 2,
- }
- /// <summary>
- /// 出入库类型
- /// </summary>
- public enum FJInvInOutType
- {
- /// <summary>
- /// 默认
- /// </summary>
- [Description("默认")]
- Default = 0,
- /// <summary>
- /// 入库
- /// </summary>
- [Description("入库")]
- In = 1,
- /// <summary>
- /// 出库
- /// </summary>
- [Description("出库")]
- Out = 2,
- }
- }
|