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.

67 lines
2.4 KiB

  1. namespace CounsellorBL.BLStructure.SYS
  2. {
  3. using Newtonsoft.Json.Linq;
  4. using OT.COM.ArsenalDB;
  5. using OT.COM.SignalerMessage;
  6. using SoldierData.EnterprizeV4;
  7. using System;
  8. using OT.COM.LogisticsUtil;
  9. using CounsellorBL.Helper;
  10. using Newtonsoft.Json;
  11. public class ADIntegrationLogService : SingleDataTableTemplate<tb_sys_adintegrationlog>
  12. {
  13. public override string MainTable => typeof(tb_sys_adintegrationlog).Name;
  14. public ADIntegrationLogService()
  15. {
  16. dgReadCommandGenerator = readCommandGenerator;
  17. }
  18. protected string readCommandGenerator(CRequestMessage i_crmInput, JArray i_jaData, tb_sys_session i_sSessionUser, out Command o_c,
  19. [System.Runtime.CompilerServices.CallerLineNumber] int i_nCodeLine = 0,
  20. [System.Runtime.CompilerServices.CallerMemberName] string i_sMemberName = "",
  21. [System.Runtime.CompilerServices.CallerFilePath] string i_sSourcePath = "")
  22. {
  23. Command cRes = null;
  24. string sMsg;
  25. try
  26. {
  27. do
  28. {
  29. sMsg = ScheduleRange.ParseLogStartEnd(tb_sys_adintegrationlog.CN_CREATE_DATE, i_jaData, out ScheduleRange sr);
  30. if (sMsg != null)
  31. {
  32. break;
  33. }
  34. QueryJsonElementCollection lBlocks = new QueryJsonElementCollection();
  35. QueryJsonElement qjeA = lBlocks.GetInst<tb_sys_adintegrationlog>();
  36. qjeA.displaycols = EntityBase.GetAllColumnName(typeof(tb_sys_adintegrationlog));
  37. qjeA.wherecols = WhereNode.GenNode<tb_sys_adintegrationlog>(f => f.create_date >= sr.Start && f.create_date < sr.End);
  38. lBlocks.Add(qjeA);
  39. sMsg = MakeSelectJoinByBlocks(lBlocks, out cRes);
  40. }
  41. while (false);
  42. }
  43. catch (Exception ex)
  44. {
  45. LogHelper.DBLog(Util.GetLastExceptionMsg(ex), i_nCodeLine, i_sMemberName, i_sSourcePath);
  46. sMsg = $"{nameof(readCommandGenerator)} unknwon exception. i_crmInput={JsonConvert.SerializeObject(i_crmInput)}. Call from {i_sMemberName} {i_sSourcePath}({i_nCodeLine}).";
  47. #if DEBUG
  48. System.Diagnostics.Debug.WriteLine(sMsg);
  49. #endif
  50. }
  51. o_c = cRes;
  52. return sMsg;
  53. }
  54. }
  55. }