You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

3 years ago
  1. using Aborlen.Model;
  2. using FrameWork.Log;
  3. using SqlSugar;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using WorkStationBase;
  10. namespace Aborlen.WorkStation
  11. {
  12. public partial class WorkStation10 : StationBase
  13. {
  14. public void PalletNum(string stationCode, object value, DateTime triggerTime)
  15. {
  16. try
  17. {
  18. LogHelper.WriteLog(stationCode + "到位托盘号" + Convert.ToInt32(value));
  19. if (Convert.ToByte(value) != 0)
  20. {
  21. //托盘到达,更新条码验证规则 查询产品型号
  22. //查询订单
  23. var deploydata = Deploy_Data.Query().Where(p => p.tuopan_id == Convert.ToInt32(value) && p.process_state == 1).OrderBy(p => p.Id, SqlSugar.OrderByType.Desc);
  24. if (deploydata.Count() > 0)
  25. {
  26. PresentOrder = ProductOrder.Query().Where(p => p.plan_id == deploydata.First().plan_id).First();
  27. }
  28. else
  29. {
  30. PresentOrder = ProductOrder.Query().OrderBy(p => p.id, OrderByType.Desc).First();
  31. }
  32. ProductTypeCode = Convert.ToInt32(PresentOrder.product_id);
  33. }
  34. }
  35. catch (Exception ex)
  36. {
  37. LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex);
  38. }
  39. }
  40. }
  41. }