FAJobDataRecorder.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 FAJobDataRecorder
  10. {
  11. public static void CreatePJ(string guid, string pjId,string status)
  12. {
  13. string sql = string.Format(
  14. "INSERT INTO \"process_job_data\"(\"guid\", \"process_begin_time\", \"process_end_time\", \"control_job_id\",\"process_status\")VALUES ('{0}', '{1}', '{2}', '{3}', '{4}');",
  15. guid,
  16. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  17. "",
  18. pjId,
  19. status);
  20. DB.Insert(sql);
  21. }
  22. public static void UpdatePJStatus(string guid, string status)
  23. {
  24. string sql = string.Format("UPDATE \"process_job_data\" SET \"process_end_time\"='{0}', \"process_status\"='{1}' WHERE \"guid\"='{2}';",
  25. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  26. status,
  27. guid);
  28. DB.Insert(sql);
  29. }
  30. public static void StartPJ(string guid, string carrierGuid, string cjGuid, string name, string portIn, string portOut, int totalWafer)
  31. {
  32. string sql = string.Format(
  33. "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}');",
  34. guid,
  35. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  36. carrierGuid,
  37. cjGuid,
  38. name,
  39. portIn,
  40. portOut,
  41. totalWafer);
  42. DB.Insert(sql);
  43. }
  44. public static void EndPJ(string guid, int abortWafer, int unprocessedWafer)
  45. {
  46. string sql = string.Format("UPDATE \"pj_data\" SET \"end_time\"='{0}', \"abort_wafer_count\"='{2}', \"unprocessed_wafer_count\"='{3}' WHERE \"guid\"='{1}';",
  47. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  48. guid,abortWafer, unprocessedWafer);
  49. DB.Insert(sql);
  50. }
  51. }
  52. }