LotDataRecorder.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 LotDataRecorder
  10. {
  11. public static void StartLot(string guid, string carrierGuid, string cjGuid, string name, string portIn, string portOut, int totalWafer)
  12. {
  13. string sql =
  14. $"INSERT INTO \"lot_data\"(\"guid\", \"start_time\", \"carrier_data_guid\", \"cj_data_guid\",\"name\",\"input_port\",\"output_port\",\"total_wafer_count\")VALUES ('{guid}', '{DateTime.Now:yyyy/MM/dd HH:mm:ss.fff}', '{carrierGuid}', '{cjGuid}', '{name}', '{portIn}', '{portOut}', '{totalWafer}');";
  15. DB.Insert(sql);
  16. }
  17. public static void EndLot(string guid, int abortWafer, int unprocessedWafer)
  18. {
  19. string sql = $"UPDATE \"lot_data\" SET \"end_time\"='{DateTime.Now:yyyy/MM/dd HH:mm:ss.fff}', \"abort_wafer_count\"='{abortWafer}', \"unprocessed_wafer_count\"='{unprocessedWafer}' WHERE \"guid\"='{guid}';" ;
  20. DB.Insert(sql);
  21. }
  22. public static void InsertLotWafer(string lotGuid, string waferGuid)
  23. {
  24. string guid = Guid.NewGuid().ToString();
  25. string sql =
  26. $"INSERT INTO \"lot_wafer_data\"(\"guid\", \"create_time\", \"lot_data_guid\", \"wafer_data_guid\")VALUES ('{guid}', '{DateTime.Now:yyyy/MM/dd HH:mm:ss.fff}', '{lotGuid}', '{waferGuid}');";
  27. DB.Insert(sql);
  28. }
  29. }
  30. }