123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- // using System;
- // using System.Collections.Generic;
- // using System.Linq;
- // using Microsoft.AspNetCore.Mvc;
- // using Microsoft.AspNetCore.Http;
- // using Microsoft.Extensions.Logging;
- // using Microsoft.Extensions.Options;
- // using Microsoft.AspNetCore.Authorization;
- // using MySystem.MainModels;
- // using LitJson;
- // using Library;
- // namespace MySystem.Areas.Api.Controllers.v1
- // {
- // [Area("Api")]
- // [Route("Api/v1/[controller]/[action]")]
- // public class MerchantAmountSummayController : BaseController
- // {
- // public MerchantAmountSummayController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
- // {
- // }
- // #region 已激活商户-达标信息列表
- // [Authorize]
- // public JsonResult List(string value)
- // {
- // value = DesDecrypt(value);
- // JsonData data = JsonMapper.ToObject(value);
- // List<Dictionary<string, object>> dataList = ListDo(value);
- // return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
- // }
- // private List<Dictionary<string, object>> ListDo(string value)
- // {
- // JsonData data = JsonMapper.ToObject(value);
- // int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户
- // int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
- // int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
- // List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
- // // var query = MerchantDepositOrderService.Query(" and Status=1 and MerchantId=" + MerchantId + "");
- // // var query = maindb.MerchantDepositOrder.FirstOrDefault(m => m.Status == 1 && m.MerchantId == MerchantId);
- // var Status = 0;//活动交易状态
- // var IsJoin = 0;//是否参加活动(0 否 1 是)
- // if (query.Id == 0) IsJoin = 1;
- // var month = DateTime.Parse(query.CreateDate.ToString());
- // var TradeMonth = "";
- // decimal TradeAmount = 0.00M;
- // Dictionary<string, string> dic = new Dictionary<string, string>();
- // for (int i = 0; i < 10; i++)
- // {
- // month = month.AddMonths(i + 1);
- // TradeMonth = month.ToString("yyyy-MM");
- // var check = MerchantAmountSummayService.Query(" and IsAct=1 and TradeMonth='" + TradeMonth + "' and MerchantId=" + MerchantId + "");
- // if (check.Id > 0)
- // {
- // dic = MerchantAmountSummayService.Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "'");
- // TradeAmount = decimal.Parse(dic["TradeAmount"].ToString());
- // }
- // if (IsJoin == 0)
- // {
- // //未参与
- // Status = 3;
- // }
- // else
- // {
- // //考核中
- // if (DateTime.Now.ToString("yyyy-MM") == TradeMonth) Status = 1;
- // //待考核
- // if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(month.ToString("yyyyMM"))) Status = 0;
- // //已通过
- // if (TradeAmount >= 10000 && IsJoin != 3 && check.Id > 0) Status = 2;
- // //未通过
- // if (TradeAmount < 10000 && IsJoin != 3 && check.Id > 0) Status = -1;
- // Dictionary<string, object> curData = new Dictionary<string, object>();
- // curData.Add("TradeMonth", TradeMonth); //月份
- // curData.Add("TradeAmount", TradeAmount); //订单金额
- // curData.Add("Status", Status); //状态(-1 未通过 0 待考核 1 考核中 2 已通过 3 未参与)
- // dataList.Add(curData);
- // }
- // }
- // return dataList;
- // }
- // #endregion
- // #region 检查签名是否合法,合法返回1,不合法返回提示信息
- // /// <summary>
- // /// 检查签名是否合法,合法返回1,不合法返回提示信息
- // /// </summary>
- // /// <param name="value">请求的参数(json字符串)</param>
- // /// <param name="signField">要签名的字段</param>
- // /// <returns></returns>
- // private string CheckSign(string value, string[] signField)
- // {
- // JsonData json = JsonMapper.ToObject(value);
- // Dictionary<string, string> dic = new Dictionary<string, string>();
- // for (int i = 0; i < signField.Length; i++)
- // {
- // dic.Add(signField[i], json[signField[i]].ToString());
- // }
- // string sign = json["sign"].ToString(); //客户端签名字符串
- // return new Sign().sign(dic, sign);
- // }
- // #endregion
- // }
- // }
|