|
@@ -86,14 +86,16 @@ namespace MySystem
|
|
merchantForMobile.MerchantId = MerchantId;
|
|
merchantForMobile.MerchantId = MerchantId;
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
//微信
|
|
//微信
|
|
- if (Kind == 0 || Kind == 2)
|
|
|
|
|
|
+ if ((Kind == 0 || Kind == 2) && AddInfo.Status <= 0)
|
|
{
|
|
{
|
|
string result = WeChatFunction.Instance.MerchantCreate(AddInfo, merchant);
|
|
string result = WeChatFunction.Instance.MerchantCreate(AddInfo, merchant);
|
|
if (result.Contains("\"applyment_id\":"))
|
|
if (result.Contains("\"applyment_id\":"))
|
|
{
|
|
{
|
|
JsonData jsonObj = JsonMapper.ToObject(result);
|
|
JsonData jsonObj = JsonMapper.ToObject(result);
|
|
AddInfo.ApplymentId = jsonObj["applyment_id"].ToString();
|
|
AddInfo.ApplymentId = jsonObj["applyment_id"].ToString();
|
|
|
|
+ AddInfo.WeChatRemark = "";
|
|
AddInfo.Status = 0;
|
|
AddInfo.Status = 0;
|
|
|
|
+ merchant.Status = 0;
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
List<MerchantSign> signs = RedisDbconn.Instance.GetList<MerchantSign>("MerchantSignList", 1, 10000000);
|
|
List<MerchantSign> signs = RedisDbconn.Instance.GetList<MerchantSign>("MerchantSignList", 1, 10000000);
|
|
bool op = signs.Any(m => m.BusinessCode == BusinessCode);
|
|
bool op = signs.Any(m => m.BusinessCode == BusinessCode);
|
|
@@ -108,7 +110,6 @@ namespace MySystem
|
|
}
|
|
}
|
|
signs.Clear();
|
|
signs.Clear();
|
|
AddInfo.ApplymentId = AddInfo.ApplymentId;
|
|
AddInfo.ApplymentId = AddInfo.ApplymentId;
|
|
- AddInfo.Status = AddInfo.Status;
|
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
else if (result.Contains("\"message\":"))
|
|
else if (result.Contains("\"message\":"))
|
|
@@ -116,31 +117,22 @@ namespace MySystem
|
|
JsonData jsonObj = JsonMapper.ToObject(result);
|
|
JsonData jsonObj = JsonMapper.ToObject(result);
|
|
AddInfo.Status = -1;
|
|
AddInfo.Status = -1;
|
|
merchant.Status = -1;
|
|
merchant.Status = -1;
|
|
- string Season = function.CheckNull(AddInfo.SeoDescription);
|
|
|
|
- if (string.IsNullOrEmpty(Season))
|
|
|
|
- {
|
|
|
|
- Season = "WeChat:" + jsonObj["message"].ToString() + ";";
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- Season = Regex.Replace(Season, "WeChat:.*?;", "");
|
|
|
|
- Season += "WeChat:" + jsonObj["message"].ToString() + ";";
|
|
|
|
- }
|
|
|
|
- AddInfo.SeoDescription = Season;
|
|
|
|
- AddInfo.SeoDescription = AddInfo.SeoDescription;
|
|
|
|
- AddInfo.Status = AddInfo.Status;
|
|
|
|
|
|
+ AddInfo.WeChatRemark = jsonObj["message"].ToString();
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//支付宝
|
|
//支付宝
|
|
- if (Kind == 0 || Kind == 1)
|
|
|
|
|
|
+ if ((Kind == 0 || Kind == 1) && AddInfo.QueryCount <= 0)
|
|
{
|
|
{
|
|
- bool checkAlipay = true;
|
|
|
|
string content = AlipayFunction.Instance.GetBatchNo(AddInfo.IdCardName, AddInfo.MobilePhone, AddInfo.ContactEmail);
|
|
string content = AlipayFunction.Instance.GetBatchNo(AddInfo.IdCardName, AddInfo.MobilePhone, AddInfo.ContactEmail);
|
|
JsonData json = JsonMapper.ToObject(content);
|
|
JsonData json = JsonMapper.ToObject(content);
|
|
if (json["alipay_open_agent_create_response"]["code"].ToString() == "10000")
|
|
if (json["alipay_open_agent_create_response"]["code"].ToString() == "10000")
|
|
{
|
|
{
|
|
|
|
+ AddInfo.AlipayRemark = "";
|
|
|
|
+ AddInfo.QueryCount = 0;
|
|
|
|
+ merchant.QueryCount = 0;
|
|
|
|
+ db.SaveChanges();
|
|
string batch_no = json["alipay_open_agent_create_response"]["batch_no"].ToString();
|
|
string batch_no = json["alipay_open_agent_create_response"]["batch_no"].ToString();
|
|
string Qualifications = AddInfo.Qualifications;
|
|
string Qualifications = AddInfo.Qualifications;
|
|
if (!string.IsNullOrEmpty(Qualifications))
|
|
if (!string.IsNullOrEmpty(Qualifications))
|
|
@@ -155,6 +147,8 @@ namespace MySystem
|
|
json = JsonMapper.ToObject(content);
|
|
json = JsonMapper.ToObject(content);
|
|
if (json["alipay_open_agent_confirm_response"]["code"].ToString() == "10000")
|
|
if (json["alipay_open_agent_confirm_response"]["code"].ToString() == "10000")
|
|
{
|
|
{
|
|
|
|
+ // AddInfo.AlipayAuthToken = json["alipay_open_agent_confirm_response"]["app_auth_token"].ToString();
|
|
|
|
+ db.SaveChanges();
|
|
RedisDbconn.Instance.AddList("AlipaySignQueue", new MerchantSign()
|
|
RedisDbconn.Instance.AddList("AlipaySignQueue", new MerchantSign()
|
|
{
|
|
{
|
|
BusinessCode = batch_no,
|
|
BusinessCode = batch_no,
|
|
@@ -194,36 +188,25 @@ namespace MySystem
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- checkAlipay = false;
|
|
|
|
|
|
+ AddInfo.AlipayRemark = json["alipay_open_agent_confirm_response"]["sub_msg"].ToString();
|
|
|
|
+ AddInfo.QueryCount = -1;
|
|
|
|
+ merchant.QueryCount = -1;
|
|
|
|
+ db.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- checkAlipay = false;
|
|
|
|
|
|
+ AddInfo.AlipayRemark = json["alipay_open_agent_facetoface_sign_response"]["sub_msg"].ToString();
|
|
|
|
+ AddInfo.QueryCount = -1;
|
|
|
|
+ merchant.QueryCount = -1;
|
|
|
|
+ db.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- checkAlipay = false;
|
|
|
|
- }
|
|
|
|
- if (!checkAlipay)
|
|
|
|
- {
|
|
|
|
- JsonData jsonObj = JsonMapper.ToObject(content);
|
|
|
|
|
|
+ AddInfo.AlipayRemark = json["alipay_open_agent_facetoface_sign_response"]["sub_msg"].ToString();
|
|
AddInfo.QueryCount = -1;
|
|
AddInfo.QueryCount = -1;
|
|
- merchant.Status = -1;
|
|
|
|
- string Season = function.CheckNull(AddInfo.SeoDescription);
|
|
|
|
- if (string.IsNullOrEmpty(Season))
|
|
|
|
- {
|
|
|
|
- Season = "Alipay:" + jsonObj["alipay_open_agent_create_response"]["sub_msg"].ToString() + ";";
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- Season = Regex.Replace(Season, "Alipay:.*?;", "");
|
|
|
|
- Season = "Alipay:" + jsonObj["alipay_open_agent_create_response"]["sub_msg"].ToString() + ";" + Season;
|
|
|
|
- }
|
|
|
|
- AddInfo.SeoDescription = Season;
|
|
|
|
- AddInfo.SeoDescription = AddInfo.SeoDescription;
|
|
|
|
- AddInfo.QueryCount = AddInfo.QueryCount;
|
|
|
|
|
|
+ merchant.QueryCount = -1;
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|