MerchantAmountSummayController.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 MySystem.MainModels;
  10. // using LitJson;
  11. // using Library;
  12. // namespace MySystem.Areas.Api.Controllers.v1
  13. // {
  14. // [Area("Api")]
  15. // [Route("Api/v1/[controller]/[action]")]
  16. // public class MerchantAmountSummayController : BaseController
  17. // {
  18. // public MerchantAmountSummayController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
  19. // {
  20. // }
  21. // #region 已激活商户-达标信息列表
  22. // [Authorize]
  23. // public JsonResult List(string value)
  24. // {
  25. // value = DesDecrypt(value);
  26. // JsonData data = JsonMapper.ToObject(value);
  27. // List<Dictionary<string, object>> dataList = ListDo(value);
  28. // return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  29. // }
  30. // private List<Dictionary<string, object>> ListDo(string value)
  31. // {
  32. // JsonData data = JsonMapper.ToObject(value);
  33. // int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户
  34. // int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
  35. // int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
  36. // List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  37. // // var query = MerchantDepositOrderService.Query(" and Status=1 and MerchantId=" + MerchantId + "");
  38. // // var query = maindb.MerchantDepositOrder.FirstOrDefault(m => m.Status == 1 && m.MerchantId == MerchantId);
  39. // var Status = 0;//活动交易状态
  40. // var IsJoin = 0;//是否参加活动(0 否 1 是)
  41. // if (query.Id == 0) IsJoin = 1;
  42. // var month = DateTime.Parse(query.CreateDate.ToString());
  43. // var TradeMonth = "";
  44. // decimal TradeAmount = 0.00M;
  45. // Dictionary<string, string> dic = new Dictionary<string, string>();
  46. // for (int i = 0; i < 10; i++)
  47. // {
  48. // month = month.AddMonths(i + 1);
  49. // TradeMonth = month.ToString("yyyy-MM");
  50. // var check = MerchantAmountSummayService.Query(" and IsAct=1 and TradeMonth='" + TradeMonth + "' and MerchantId=" + MerchantId + "");
  51. // if (check.Id > 0)
  52. // {
  53. // dic = MerchantAmountSummayService.Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "'");
  54. // TradeAmount = decimal.Parse(dic["TradeAmount"].ToString());
  55. // }
  56. // if (IsJoin == 0)
  57. // {
  58. // //未参与
  59. // Status = 3;
  60. // }
  61. // else
  62. // {
  63. // //考核中
  64. // if (DateTime.Now.ToString("yyyy-MM") == TradeMonth) Status = 1;
  65. // //待考核
  66. // if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(month.ToString("yyyyMM"))) Status = 0;
  67. // //已通过
  68. // if (TradeAmount >= 10000 && IsJoin != 3 && check.Id > 0) Status = 2;
  69. // //未通过
  70. // if (TradeAmount < 10000 && IsJoin != 3 && check.Id > 0) Status = -1;
  71. // Dictionary<string, object> curData = new Dictionary<string, object>();
  72. // curData.Add("TradeMonth", TradeMonth); //月份
  73. // curData.Add("TradeAmount", TradeAmount); //订单金额
  74. // curData.Add("Status", Status); //状态(-1 未通过 0 待考核 1 考核中 2 已通过 3 未参与)
  75. // dataList.Add(curData);
  76. // }
  77. // }
  78. // return dataList;
  79. // }
  80. // #endregion
  81. // #region 检查签名是否合法,合法返回1,不合法返回提示信息
  82. // /// <summary>
  83. // /// 检查签名是否合法,合法返回1,不合法返回提示信息
  84. // /// </summary>
  85. // /// <param name="value">请求的参数(json字符串)</param>
  86. // /// <param name="signField">要签名的字段</param>
  87. // /// <returns></returns>
  88. // private string CheckSign(string value, string[] signField)
  89. // {
  90. // JsonData json = JsonMapper.ToObject(value);
  91. // Dictionary<string, string> dic = new Dictionary<string, string>();
  92. // for (int i = 0; i < signField.Length; i++)
  93. // {
  94. // dic.Add(signField[i], json[signField[i]].ToString());
  95. // }
  96. // string sign = json["sign"].ToString(); //客户端签名字符串
  97. // return new Sign().sign(dic, sign);
  98. // }
  99. // #endregion
  100. // }
  101. // }