WorkSpaceController.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.Extensions.Logging;
  7. using Microsoft.Extensions.Options;
  8. using Microsoft.AspNetCore.Authorization;
  9. using System.Web;
  10. using MySystem.Models.Main;
  11. using LitJson;
  12. using Library;
  13. using System.Data;
  14. using MySystem.Service.Main;
  15. namespace MySystem.Areas.Api.Controllers.v1
  16. {
  17. [Area("Api")]
  18. [Route("/v1/[controller]/[action]")]
  19. public class WorkSpaceController : BaseController
  20. {
  21. public WorkSpaceController(IHttpContextAccessor accessor) : base(accessor)
  22. {
  23. }
  24. #region 工作台-主界面统计数据
  25. // [Authorize]
  26. public JsonResult IndexStat(string value)
  27. {
  28. value = DesDecrypt(value);
  29. value = value.Replace("null", "\"\"");
  30. JsonData data = JsonMapper.ToObject(value);
  31. Dictionary<string, object> Obj = IndexStatDo(value);
  32. return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
  33. }
  34. public Dictionary<string, object> IndexStatDo(string value)
  35. {
  36. JsonData data = JsonMapper.ToObject(value);
  37. string TimeType = data["TimeType"].ToString(); //时间范围
  38. int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id
  39. var Info = WorkSpaceUtil.IndexStat(TimeType, MerchantId);
  40. return Info;
  41. }
  42. #endregion
  43. #region 工作台-商户活动参数
  44. // [Authorize]
  45. public JsonResult Detail(string value)
  46. {
  47. value = DesDecrypt(value);
  48. value = value.Replace("null", "\"\"");
  49. JsonData data = JsonMapper.ToObject(value);
  50. Dictionary<string, object> Obj = DetailDo(value);
  51. return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
  52. }
  53. public Dictionary<string, object> DetailDo(string value)
  54. {
  55. JsonData data = JsonMapper.ToObject(value);
  56. int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id
  57. var Info = WorkSpaceUtil.Detail(MerchantId);
  58. return Info;
  59. }
  60. #endregion
  61. }
  62. }