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.

RemoteService.cs 1.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using HKCardOUT.Helper;
  2. using Logic.RemoteModel;
  3. using Newtonsoft.Json.Linq;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Markup;
  10. using XExten.Advance.HttpFramework.MultiCommon;
  11. using XExten.Advance.HttpFramework.MultiFactory;
  12. using XExten.Advance.LinqFramework;
  13. namespace HKCardOUT.Logic
  14. {
  15. public class RemoteService
  16. {
  17. /// <summary>
  18. /// 判断卡状态
  19. /// </summary>
  20. /// <param name="input"></param>
  21. public static int CheckCardStuatas(string CardNo)
  22. {
  23. return IHttpMultiClient.HttpMulti.AddNode(t =>
  24. {
  25. t.NodePath = ApiRoute.CheckCardStatus + CardNo;
  26. }).Build().RunStringFirst().ToModel<JObject>()["data"]["cardState"].ToString().AsInt();
  27. }
  28. /// <summary>
  29. /// 同步消费记录
  30. /// </summary>
  31. /// <param name="CardNo"></param>
  32. /// <param name="Money"></param>
  33. public static bool SyncSaleLog(string CardNo, decimal Money)
  34. {
  35. var data = IHttpMultiClient.HttpMulti.AddNode(t =>
  36. {
  37. t.ReqType = MultiType.POST;
  38. t.JsonParam = (new { Money, Type = -1, CardNum = CardNo }).ToJson();
  39. t.NodePath = ApiRoute.SyncSaleLog;
  40. }).Build().RunStringFirst();
  41. return bool.Parse(data.ToModel<JObject>()["data"].ToString());
  42. }
  43. /// <summary>
  44. /// 获取店铺信息
  45. /// </summary>
  46. public static void PullShopInfo()
  47. {
  48. var data = IHttpMultiClient.HttpMulti.AddNode(t =>
  49. {
  50. t.NodePath = ApiRoute.PullShopInfo;
  51. }).Build().RunStringFirst()
  52. .ToModel<JObject>()["data"].ToJson().ToModel<StoreInfoResponse>();
  53. DataBus.StoreInfo = data;
  54. }
  55. }
  56. }