JobDataRecorder.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using Aitex.Core.RT.DBCore;
  5. using Aitex.Core.RT.Log;
  6. using Aitex.Sorter.Common;
  7. namespace MECF.Framework.Common.DBCore
  8. {
  9. public class JobDataRecorder
  10. {
  11. public static void StartCJ(string guid, string carrierGuid, string name, string portIn, string portOut, int totalWafer)
  12. {
  13. string sql = string.Format(
  14. "INSERT INTO \"cj_data\"(\"guid\", \"start_time\", \"carrier_data_guid\", \"name\",\"input_port\",\"output_port\",\"total_wafer_count\")VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}');",
  15. guid,
  16. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  17. carrierGuid,
  18. name,
  19. portIn,
  20. portOut,
  21. totalWafer);
  22. DB.Insert(sql);
  23. }
  24. public static void EndCJ(string guid, int abortWafer, int unprocessedWafer)
  25. {
  26. string sql = string.Format("UPDATE \"cj_data\" SET \"end_time\"='{0}', \"abort_wafer_count\"='{1}', \"unprocessed_wafer_count\"='{2}' WHERE \"guid\"='{3}';",
  27. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  28. abortWafer,
  29. unprocessedWafer,
  30. guid);
  31. DB.Insert(sql);
  32. }
  33. public static void StartPJ(string guid, string carrierGuid, string cjGuid, string name, string portIn, string portOut, int totalWafer)
  34. {
  35. string sql = string.Format(
  36. "INSERT INTO \"pj_data\"(\"guid\", \"start_time\", \"carrier_data_guid\", \"cj_data_guid\",\"name\",\"input_port\",\"output_port\",\"total_wafer_count\")VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');",
  37. guid,
  38. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  39. carrierGuid,
  40. cjGuid,
  41. name,
  42. portIn,
  43. portOut,
  44. totalWafer);
  45. DB.Insert(sql);
  46. }
  47. public static void EndPJ(string guid, int abortWafer, int unprocessedWafer)
  48. {
  49. string sql = string.Format("UPDATE \"pj_data\" SET \"end_time\"='{0}', \"abort_wafer_count\"='{2}', \"unprocessed_wafer_count\"='{3}' WHERE \"guid\"='{1}';",
  50. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  51. guid,abortWafer, unprocessedWafer);
  52. DB.Insert(sql);
  53. }
  54. }
  55. }