MerchantDepositBackUtil.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using MySystem.MainModels;
  2. using Library;
  3. using MySystem.Service.Main;
  4. using System.Collections.Generic;
  5. namespace MySystem
  6. {
  7. /// <summary>
  8. /// 商户服务费退还记录工具类
  9. /// </summary>
  10. public class MerchantDepositBackUtil
  11. {
  12. #region 商户激活—商户服务费退还
  13. /// <summary>
  14. /// 商户激活—商户服务费退还
  15. /// </summary>
  16. /// <param name="MerchantId">商户Id</param>
  17. /// <param name="ReturnWay">退还方式</param>
  18. /// <param name="MobileCode">短信验证码</param>
  19. /// <param name="ReturnNo">退还账号</param>
  20. /// <returns></returns>
  21. public static string AddMerchantDepositBackDo(int MerchantId, int ReturnWay, string MobileCode, string ReturnNo)
  22. {
  23. var query = new MerchantAddInfoService().Query(MerchantId);
  24. MobileCodeCheck mobilecheck = RedisDbconn.Instance.Get<MobileCodeCheck>("MobileCodeCheck:" + query.ServicePhone);
  25. if (mobilecheck == null)
  26. {
  27. return "短信验证码不正确";
  28. }
  29. if (mobilecheck.CheckCode != MobileCode)
  30. {
  31. return "短信验证码不正确";
  32. }
  33. string checks = RedisDbconn.Instance.Get<string>("MerchantDepositBack:" + MerchantId);
  34. if (checks == "1")
  35. {
  36. return "已申请退押,请勿重复申请";
  37. }
  38. RedisDbconn.Instance.Clear("MobileCodeCheck:" + query.ServicePhone);
  39. Dictionary<string, object> Obj = new Dictionary<string, object>();
  40. RedisDbconn.Instance.Set("MerchantDepositBack:" + MerchantId, "1");
  41. RedisDbconn.Instance.SetExpire("MerchantDepositBack:" + MerchantId, 10);
  42. Dictionary<string, object> fields = new Dictionary<string, object>();
  43. fields.Add("MerchantId", MerchantId); //商户Id
  44. fields.Add("ReturnWay", ReturnWay); //退还方式
  45. new MerchantDepositBackService().Add(fields);
  46. return "success";
  47. }
  48. #endregion
  49. }
  50. }