GetFormulaComputeExcutor.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.SqlClient;
  4. using System.Linq;
  5. using System.Text;
  6. using JLHHJSvr.BLL;
  7. using JLHHJSvr.Com;
  8. using JLHHJSvr.Com.Model;
  9. using JLHHJSvr.DBA.DBModle;
  10. using LJLib.DAL.SQL;
  11. using LJLib.Net.SPI.Server;
  12. namespace JLHHJSvr.Excutor
  13. {
  14. internal sealed class GetFormulaComputeExcutor : ExcutorBase<GetFormulaComputeRequest, GetFormulaComputeResponse>
  15. {
  16. protected override void ExcuteInternal(GetFormulaComputeRequest request, object state, GetFormulaComputeResponse rslt)
  17. {
  18. var tokendata = BllHelper.GetToken(request.token);
  19. if (tokendata == null)
  20. {
  21. rslt.ErrMsg = "会话已经中断,请重新登录";
  22. return;
  23. }
  24. using (var con = new SqlConnection(GlobalVar.ConnectionString))
  25. using (var cmd = con.CreateCommand())
  26. {
  27. con.Open();
  28. rslt.values = new List<decimal>();
  29. try {
  30. foreach(var iformula in request.formulas)
  31. {
  32. //var res = LJExprParser.Parse(iformula);
  33. //rslt.values.Add(res.Result.DecimalValue);
  34. }
  35. }
  36. catch (Exception ex)
  37. {
  38. rslt.ErrMsg = ex.ToString();
  39. }
  40. }
  41. }
  42. }
  43. }