Program.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using HTEXLib.COMM.Helpers;
  2. using TEAMModelOS.SDK.Extension;
  3. using TEAMModelOS.SDK.Models;
  4. using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
  5. namespace TEAMModelOS.TEST
  6. {
  7. public class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. string s = @"{
  12. ""events"":[
  13. {""Time"":0.0003,""EventId"":589825,""Event"":""ActStart"",""ActStartTime"":""0""},
  14. {""Time"":0.6862,""Pgid"":""230919091004e7c2a32f7a5feb169508580427428204301"",""EventId"":524289,""Event"":""EzsStartRecord"",""VdoFileName"":""video_e7c2a32f7a5feb169508582860049958634"",""DeviceTypeName"":""HiEncoder""},
  15. {""Time"":125.0722,""Pgid"":""230919091230e7c2a32f7a5feb169508595074975887597"",""EventId"":917530,""Event"":""FastPgPush"",""PushPgNo"":2},
  16. {""Time"":125.8639,""Pgid"":""230919091230e7c2a32f7a5feb169508595074975887597"",""EventId"":786435,""Event"":""PopQuesLoad"",""PopOpitonCount"":9},
  17. {""Time"":199.7944,""Pgid"":""230919091345e7c2a32f7a5feb169508602551991831623"",""EventId"":917530,""Event"":""FastPgPush"",""PushPgNo"":3},
  18. {""Time"":202.9378,""Pgid"":""230919091345e7c2a32f7a5feb169508602551991831623"",""EventId"":786435,""Event"":""PopQuesLoad"",""PopOpitonCount"":9},
  19. {""Time"":243.0507,""Pgid"":""230919091345e7c2a32f7a5feb169508602551991831623"",""EventId"":458762,""Event"":""PickupResult"",""PickupTypeId"":655368,""PickupType"":""PickupOption"",""PickupMemberId"":""[\r\n 17\r\n]"",""PickupCount"":1,""PickupOption"":3},
  20. {""Time"":353.2466,""Pgid"":""230919091618e7c2a32f7a5feb169508617880160233546"",""EventId"":917530,""Event"":""FastPgPush"",""PushPgNo"":4},
  21. {""Time"":365.1775,""Pgid"":""230919091618e7c2a32f7a5feb169508617880160233546"",""EventId"":786435,""Event"":""PopQuesLoad"",""PopOpitonCount"":9},
  22. {""Time"":436.9988,""Pgid"":""230919091618e7c2a32f7a5feb169508617880160233546"",""EventId"":458762,""Event"":""PickupResult"",""PickupTypeId"":655368,""PickupType"":""PickupOption"",""PickupMemberId"":""[\r\n 31\r\n]"",""PickupCount"":1,""PickupOption"":3},
  23. {""Time"":1846.4325,""EventId"":589826,""Event"":""ActEnd"",""ActPeriod"":1846}
  24. ],
  25. ""PgIdList"":[""230919091004e7c2a32f7a5feb169508580427428204301"",""230919091230e7c2a32f7a5feb169508595074975887597"",""230919091345e7c2a32f7a5feb169508602551991831623"",""230919091618e7c2a32f7a5feb169508617880160233546"",""230919092216e7c2a32f7a5feb169508653678181046471"",""230919092644e7c2a32f7a5feb169508680433102606359"",""230919092932e7c2a32f7a5feb169508697228939345777"",""230919093259e7c2a32f7a5feb169508717901847926536"",""230919093524e7c2a32f7a5feb169508732428838481413""]
  26. }";
  27. TimeLineData timeLineData = s.ToObject<TimeLineData>();
  28. List<TimeLineEvent> timeLineEvents = timeLineData.events.FindAll(z => !string.IsNullOrWhiteSpace(z.Event) && z.Event.Equals("PickupResult"));
  29. if (timeLineEvents.IsNotEmpty())
  30. {
  31. foreach (var timeLineEvent in timeLineEvents)
  32. {
  33. var memberIds = timeLineEvent.PickupMemberId.ToObject<List<int>>();
  34. }
  35. }
  36. List<string> groupNames = new List<string>() { "組別4", "組別2", "組別3", "組別4", "組別1", "組別1" };
  37. groupNames =groupNames.OrderBy(x => x).ToList();
  38. }
  39. }
  40. }