GeneralHelper.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using DBHelper;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using WCS.Core;
  8. using WCS.Entity;
  9. using WCS.Entity.Protocol;
  10. namespace WCS.Service.Helpers
  11. {
  12. /// <summary>
  13. /// 通用帮助内
  14. /// </summary>
  15. public class GeneralHelper
  16. {
  17. /// <summary>
  18. /// 托盘排出
  19. /// </summary>
  20. public static void DischargeOfTray(Device<IStation521, IStation520, IRobotStation> device,bool needUnBind=true)
  21. {
  22. DB.Do(db =>
  23. {
  24. var t = db.Default.Set<WCS_TASK>().Find(device.Data.TASKNUM);
  25. if (t != null && needUnBind)
  26. {
  27. t.ADDRTO = "2202";
  28. db.Default.SaveChanges();
  29. WMS.UnBound(t.BARCODE);
  30. }
  31. else if (t != null && !needUnBind)
  32. {
  33. t.ADDRTO = "2202";
  34. db.Default.SaveChanges();
  35. }
  36. device.Data3.PalletType = 0;
  37. device.Data3.MaxQty = 0;
  38. device.Data3.DocId = 0;
  39. device.Data2.TASKNUM = device.Data.TASKNUM;
  40. device.Data2.GOODSSIZE = device.Data.GOODSSIZE;
  41. device.Data2.GOODSEND = 2202;
  42. device.Data2.CONFIRM = true;
  43. });
  44. }
  45. }
  46. }