二楼出库工位处理系统.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //using ServiceCenter.Logs;
  2. //using ServiceCenter.SqlSugars;
  3. //using System.ComponentModel;
  4. //using WCS.Core;
  5. //using WCS.Entity;
  6. //using WCS.WorkEngineering.Extensions;
  7. //using WCS.WorkEngineering.Protocol.Station;
  8. //using WCS.WorkEngineering.WebApi.Controllers;
  9. //using WCS.WorkEngineering.Worlds;
  10. //using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
  11. //namespace WCS.WorkEngineering.Systems
  12. //{
  13. // /// <summary>
  14. // /// 二楼出库工位处理系统
  15. // /// </summary>
  16. // [BelongTo(typeof(MainWorld))]
  17. // [Description("二楼出库工位处理系统")]
  18. // public class 二楼出库工位处理系统 : DeviceSystem<Station>
  19. // {
  20. // protected override bool ParallelDo => true;
  21. // protected override bool SaveLogsToFile => true;
  22. // public override void Do(Station obj)
  23. // {
  24. // if (!obj.Data3.Status.HasFlag(StationStatus.PH_Status)) throw new KnownException("无光电", LogLevelEnum.Low);
  25. // SqlSugarHelper.Do(db =>
  26. // {
  27. // var task = db.Default.Queryable<WCS_TaskInfo>().First(v => v.ID == obj.Data.TaskNumber && v.Status == Entity.TaskStatus.ConveyorExecution) ?? throw new KnownException("无可执行任务", LogLevelEnum.Mid);
  28. // var agv = db.Default.Queryable<WCS_AgvTaskInfo>().SplitTable(v => v.Take(2)).First(v => v.ID == task.AgvTaskID && v.Status == AGVTaskStatus.NewBuild) ?? throw new KnownException("未找到对应的AGV任务", LogLevelEnum.Mid);
  29. // var res = IwmsApi.满轮出库(task.MatCode, task.AddrTo, task.ID.ToString(), task.BarCode, task.InvBarCode, task.IsSurplus, task.IsRework, task.IsFast, task.Grade, task.WorkBench);
  30. // agv.Status = AGVTaskStatus.Confirm;
  31. // agv.AgvID = res.data;
  32. // agv.Station = obj.Entity.Code;
  33. // agv.Position = obj.Entity.Code;
  34. // db.Default.Updateable(agv).SplitTable().ExecuteCommand();
  35. // task.Status = Entity.TaskStatus.AGVExecution;
  36. // db.Default.Updateable(task).ExecuteCommand();
  37. // task.AddWCS_TASK_DTL(db, obj.Entity.Code, "AGV", $"任务已下发AGV,AGVID:{agv.AgvID}");
  38. // });
  39. // }
  40. // public override bool Select(Device dev)
  41. // {
  42. // //return dev.Code == "1026";
  43. // return dev.HasFlag(DeviceFlags.二楼出库口);
  44. // }
  45. // }
  46. //}