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.

87 lines
2.6 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 WorkStation12 : StationBase
  13. {
  14. /// <summary>
  15. /// 扫描条码
  16. /// </summary>
  17. /// <param name="stationCode"></param>
  18. /// <param name="value"></param>
  19. /// <param name="triggerTime"></param>
  20. public void BarCode(string stationCode, object value, DateTime triggerTime)
  21. {
  22. //try
  23. //{
  24. // string barcode = value.ToString();
  25. // if (barcode.Contains(PresentOrder.yfas_rule))
  26. // {
  27. // //判断数据库是否存在当前条码 如果存在 则不放行提示手动打印
  28. // if (Deploy_Data.Query().Where(p => p.print_pid == barcode).Count() > 0)
  29. // {
  30. // SendMsg.SendMsgToStation("OP110", "AlarmMsg", "不合格下线工位扫描的条码系统中已存在!");
  31. // return;
  32. // }
  33. // //已存在,更新上线时间
  34. // string sql = $" update Deploy_Data set print_pid ='{barcode}',ng_pid='{barcode}',print_time='{DateTime.Now}',process_state=4 where tuopan_id ='{Read(2180, triggerTime)}' and process_state<4 and plan_id='{PresentOrder.plan_id}'";
  35. // SqlSugarAdo.ExecuteCommand(sql);
  36. // //更新合格数量
  37. // int NokAccount = Deploy_Data.Query().Where(p => p.plan_id == PresentOrder.plan_id &&p.all_result==2&& p.process_state == 4).Count();
  38. // sql = $" update ProductOrder set nok_account ='{NokAccount}'where plan_id='{PresentOrder.plan_id}'";
  39. // SqlSugarAdo.ExecuteCommand(sql);
  40. // //产品合格 修改序列号状态
  41. // SqlSugarAdo.ExecuteCommand($"update ProductSerialCodeRecord set WorkComplete=2 where PalletNum='{Read(2180, triggerTime)}' and WorkComplete <2");
  42. // //写入扫描完成
  43. // Write(1080, (byte)1);
  44. // NgProductCode = barcode;
  45. // SendMsg.SendMsgToStation("OP110", "NgProductCode", NgProductCode);
  46. // SendMsg.SendMsgToStation("OP110", "AlarmMsg", "");
  47. // }
  48. //}
  49. //catch (Exception ex)
  50. //{
  51. // LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex);
  52. //}
  53. }
  54. }
  55. }