| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- 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 System.Web;
- using MySystem.Models.Main1;
- using MySystem.Service.Main1;
- using LitJson;
- using Library;
- using MySystem.Service.KxsMain;
- namespace MySystem.Areas.Api.Controllers.v1.Main1
- {
- [Area("Api")]
- [Route("/v1/QrCodePlateMain/[controller]/[action]")]
- public class UsersController : BaseController
- {
- public UsersController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 重置交易额-直连重置创客个人交易额
- [Authorize]
- public JsonResult DirectResetUserPersonalAmount(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- AppResultJson result = DirectResetUserPersonalAmountDo(value);
- return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
- }
- private AppResultJson DirectResetUserPersonalAmountDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string MakerCode = data["MakerCode"].ToString(); //创客编号
- string TradeDate = data["TradeDate"].ToString(); //交易时间
- if (string.IsNullOrEmpty(data["MakerCode"].ToString()) || string.IsNullOrEmpty(data["TradeDate"].ToString()))
- {
- return new AppResultJson() { Status = "-1", Info = "创客编号和交易时间不能为空" };
- }
- var user = UsersService.QueryByMakerCode(MakerCode);
- if (user.Id == 0)
- {
- return new AppResultJson() { Status = "-1", Info = "未找到" + MakerCode + "相关信息" };
- }
- string[] datelist = TradeDate.Split(new string[] { " - " }, StringSplitOptions.None);
- string start = DateTime.Parse(datelist[0]).ToString("yyyyMMdd");
- string end = DateTime.Parse(datelist[1]).ToString("yyyyMMdd");
- string info = "{\"UserId\":\"" + user.Id + "\",\"StartDate\":\"" + start + "\",\"EndDate\": \"" + end + "\"}";
- RedisDbconn.Instance.AddList("ResetUserSelfStatDataQueue", info);
- Dictionary<string, object> Obj = new Dictionary<string, object>();
- return new AppResultJson() { Status = "1", Info = "", Data = Obj };
- }
- #endregion
- #region 重置交易额-银联重置创客个人交易额
- [Authorize]
- public JsonResult UnionPayResetUserPersonalAmount(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- AppResultJson result = UnionPayResetUserPersonalAmountDo(value);
- return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
- }
- private AppResultJson UnionPayResetUserPersonalAmountDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string MakerCode = data["MakerCode"].ToString(); //创客编号
- string TradeDate = data["TradeDate"].ToString(); //交易时间
- if (string.IsNullOrEmpty(data["MakerCode"].ToString()) || string.IsNullOrEmpty(data["TradeDate"].ToString()))
- {
- return new AppResultJson() { Status = "-1", Info = "创客编号和交易时间不能为空" };
- }
- var user = UsersService.QueryByMakerCode(MakerCode);
- if (user.Id == 0)
- {
- return new AppResultJson() { Status = "-1", Info = "未找到" + MakerCode + "相关信息" };
- }
- string[] datelist = TradeDate.Split(new string[] { " - " }, StringSplitOptions.None);
- string start = DateTime.Parse(datelist[0]).ToString("yyyyMMdd");
- string end = DateTime.Parse(datelist[1]).ToString("yyyyMMdd");
- string info = "{\"UserId\":\"" + user.Id + "\",\"StartDate\":\"" + start + "\",\"EndDate\": \"" + end + "\"}";
- RedisDbconn.Instance.AddList("ResetUserSelfStatDataQueue2", info);
- Dictionary<string, object> Obj = new Dictionary<string, object>();
- return new AppResultJson() { Status = "1", Info = "", Data = Obj };
- }
- #endregion
- #region 重置交易额-直连重置创客团队交易额
- [Authorize]
- public JsonResult DirectResetUserTeamAmount(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- AppResultJson result = DirectResetUserTeamAmountDo(value);
- return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
- }
- private AppResultJson DirectResetUserTeamAmountDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string MakerCode = data["MakerCode"].ToString(); //创客编号
- string TradeDate = data["TradeDate"].ToString(); //交易时间
- if (string.IsNullOrEmpty(data["MakerCode"].ToString()) || string.IsNullOrEmpty(data["TradeDate"].ToString()))
- {
- return new AppResultJson() { Status = "-1", Info = "创客编号和交易时间不能为空" };
- }
- var user = UsersService.QueryByMakerCode(MakerCode);
- if (user.Id == 0)
- {
- return new AppResultJson() { Status = "-1", Info = "未找到" + MakerCode + "相关信息" };
- }
- string[] datelist = TradeDate.Split(new string[] { " - " }, StringSplitOptions.None);
- string start = DateTime.Parse(datelist[0]).ToString("yyyyMMdd");
- string end = DateTime.Parse(datelist[1]).ToString("yyyyMMdd");
- string info = "{\"UserId\":\"" + user.Id + "\",\"StartDate\":\"" + start + "\",\"EndDate\": \"" + end + "\"}";
- RedisDbconn.Instance.AddList("ResetUserTeamStatDataQueue", info);
- Dictionary<string, object> Obj = new Dictionary<string, object>();
- return new AppResultJson() { Status = "1", Info = "", Data = Obj };
- }
- #endregion
- #region 重置交易额-银联重置创客团队交易额
- [Authorize]
- public JsonResult UnionPayResetUserTeamAmount(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- AppResultJson result = UnionPayResetUserTeamAmountDo(value);
- return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
- }
- private AppResultJson UnionPayResetUserTeamAmountDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string MakerCode = data["MakerCode"].ToString(); //创客编号
- string TradeDate = data["TradeDate"].ToString(); //交易时间
- if (string.IsNullOrEmpty(data["MakerCode"].ToString()) || string.IsNullOrEmpty(data["TradeDate"].ToString()))
- {
- return new AppResultJson() { Status = "-1", Info = "创客编号和交易时间不能为空" };
- }
- var user = UsersService.QueryByMakerCode(MakerCode);
- if (user.Id == 0)
- {
- return new AppResultJson() { Status = "-1", Info = "未找到" + MakerCode + "相关信息" };
- }
- string[] datelist = TradeDate.Split(new string[] { " - " }, StringSplitOptions.None);
- string start = DateTime.Parse(datelist[0]).ToString("yyyyMMdd");
- string end = DateTime.Parse(datelist[1]).ToString("yyyyMMdd");
- string info = "{\"UserId\":\"" + user.Id + "\",\"StartDate\":\"" + start + "\",\"EndDate\": \"" + end + "\"}";
- RedisDbconn.Instance.AddList("ResetUserTeamStatDataQueue2", info);
- Dictionary<string, object> Obj = new Dictionary<string, object>();
- return new AppResultJson() { Status = "1", Info = "", Data = Obj };
- }
- #endregion
- }
- }
|