using MySystem.Models.Main;
using Library;
using MySystem.Service.Main;
using System.Collections.Generic;
namespace MySystem
{
///
/// 商户服务费退还记录工具类
///
public class MerchantDepositBackUtil
{
#region 商户激活—商户服务费退还
///
/// 商户激活—商户服务费退还
///
/// 商户Id
/// 退还方式
/// 短信验证码
/// 退还账号
///
public static string AddMerchantDepositBackDo(int MerchantId, int ReturnWay, string MobileCode, string ReturnNo)
{
var query = MerchantAddInfoService.Query(MerchantId);
MobileCodeCheck mobilecheck = RedisDbconn.Instance.Get("MobileCodeCheck:" + query.ServicePhone);
if (mobilecheck == null)
{
return "短信验证码不正确";
}
if (mobilecheck.CheckCode != MobileCode)
{
return "短信验证码不正确";
}
string checks = RedisDbconn.Instance.Get("MerchantDepositBack:" + MerchantId);
if (checks == "1")
{
return "已申请退押,请勿重复申请";
}
RedisDbconn.Instance.Clear("MobileCodeCheck:" + query.ServicePhone);
Dictionary Obj = new Dictionary();
RedisDbconn.Instance.Set("MerchantDepositBack:" + MerchantId, "1");
RedisDbconn.Instance.SetExpire("MerchantDepositBack:" + MerchantId, 10);
Dictionary fields = new Dictionary();
fields.Add("MerchantId", MerchantId); //商户Id
fields.Add("ReturnWay", ReturnWay); //退还方式
AppResultJson resultJson = MerchantDepositBackService.Add(fields);
return "success";
}
#endregion
}
}