| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using DBHelper;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WCS.Core;
- using WCS.Entity;
- using WCS.Entity.Protocol;
- using WCS.Service.Extensions;
- using WCS.Service.Helpers;
- using WCS.Service.Log;
- namespace WCS.Service.Works.Station
- {
- //[WorkTitle(typeof(ProductHandler), "合流入库")]
- //internal class 合流入库 : DeviceWork<Device<IStation520, IStation521,IStation523>>
- //{
- // protected override void Do(Device<IStation520, IStation521,IStation523> dev)
- // {
- // if (Ltc.Do(dev, v => v.Data2.VoucherNo != v.Data.VoucherNo)) throw new WarnException($"等待任务执行--凭证号不一致");
- // if (Ltc.Do(dev,v => v.Data3.Status.HasFlag(StationStatus.运行状态位))) throw new WarnException($"设备运行中");
- // if (Ltc.Do(dev, v => v.Data2.Status.HasFlag(IstationStatus.光电状态) == false)) return;
- // if (Ltc.Do(dev, v => v.Data2.Tasknum < 10000)) return;
-
- // var bcr = dev.Entity.BCR();
- // var barcode = bcr.Content.Trim('\r');
- // if (barcode == "")
- // {
- // InfoLog.INFO_WarnDb($"{dev.Entity.CODE}--扫码失败,内容为空", dev.Entity.CODE, WCS_EXCEPTIONTYPE.设备异常);
- // return;
- // };
- // var res = WMS.GetSingleOrDouble(barcode,dev.Entity.CODE);
- // if (res == null) throw new WarnException($"{dev.Entity.CODE}: WMS未返回结果");
- // DB.Do(db =>
- // {
- // if (!db.Default.Set<WCS_TASK>().Any(v => v.ID == dev.Data2.Tasknum)) throw new Exception($"任务号不存在");
- // dev.Data.Tasknum = dev.Data2.Tasknum;
- // dev.Data.Goodscode = res.Root;
- // dev.Data.VoucherNo++;
- // });
- // }
- // protected override bool SelectDevice(WCS_DEVICE dev)
- // {
- // return new string[] { "3047","3163" }.Contains(dev.CODE);
- // }
- //}
- }
|