|
@@ -84,52 +84,66 @@ namespace MySystem
|
|
|
//查询商户是否存在
|
|
|
if (merchantadd != null)
|
|
|
{
|
|
|
- // merchantadd.Status = 1;
|
|
|
+ MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == mId);
|
|
|
merchantadd.StoreNo = dic["data"]["storeNo"].ToString();
|
|
|
merchantadd.HdStatus = 1; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
|
|
|
merchantadd.OutMchtNo = dic["data"]["outMchtNo"].ToString();
|
|
|
- MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == mId);
|
|
|
- if (merchant != null)
|
|
|
- {
|
|
|
- merchant.Status = 1;
|
|
|
- }
|
|
|
- //商户开通分账
|
|
|
- JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.OpenDivideAccounts(merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
|
|
|
- //开通失败
|
|
|
- if (Info["resultCode"].ToString() == "0")
|
|
|
+ if (merchantadd.BrandId == 1)
|
|
|
{
|
|
|
- merchantadd.Status = -1;
|
|
|
- merchantadd.WeChatRemark = Info["errorDesc"].ToString();
|
|
|
+ merchantadd.Status = 2;
|
|
|
+ merchantadd.QueryCount = 2;
|
|
|
+
|
|
|
+ merchant.Status = 2;
|
|
|
+ merchant.QueryCount = 2;
|
|
|
}
|
|
|
- //开通成功
|
|
|
- if (Info["resultCode"].ToString() == "1")
|
|
|
+ else
|
|
|
{
|
|
|
- merchantadd.OpenAct = 1;//是否开通分账(1 是 0 否)
|
|
|
- merchantadd.HdStatus = 2; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
|
|
|
- //分账接收方签约
|
|
|
- JsonData Infos = JsonMapper.ToObject(HaoDaHelper.Instance.DivideAccountsSign(AppConfig.Haoda.AcctNo, merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
|
|
|
- //失败
|
|
|
- if (Infos["resultCode"].ToString() == "0")
|
|
|
+ if (merchant != null)
|
|
|
+ {
|
|
|
+ merchant.Status = 1;
|
|
|
+ }
|
|
|
+ //商户开通分账
|
|
|
+ JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.OpenDivideAccounts(merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
|
|
|
+ //开通失败
|
|
|
+ if (Info["resultCode"].ToString() == "0")
|
|
|
{
|
|
|
- merchantadd.WeChatRemark = Infos["errorDesc"].ToString();
|
|
|
+ merchantadd.Status = -1;
|
|
|
+ merchantadd.WeChatRemark = Info["errorDesc"].ToString();
|
|
|
}
|
|
|
- //成功
|
|
|
- else
|
|
|
+ //开通成功
|
|
|
+ if (Info["resultCode"].ToString() == "1")
|
|
|
{
|
|
|
- merchantadd.HdStatus = 3; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
|
|
|
- if (!string.IsNullOrEmpty(merchantadd.ToAcctNo))
|
|
|
+ merchantadd.OpenAct = 1;//是否开通分账(1 是 0 否)
|
|
|
+ merchantadd.HdStatus = 2; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
|
|
|
+ //分账接收方签约
|
|
|
+ JsonData Infos = JsonMapper.ToObject(HaoDaHelper.Instance.DivideAccountsSign(AppConfig.Haoda.AcctNo, merchantadd.OutMchtNo, merchantadd.StoreNo, merchantadd.BrandId));
|
|
|
+ //失败
|
|
|
+ if (Infos["resultCode"].ToString() == "0")
|
|
|
{
|
|
|
- if (!merchantadd.ToAcctNo.Contains("," + AppConfig.Haoda.AcctNo + ","))
|
|
|
- {
|
|
|
- merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
|
|
|
- }
|
|
|
+ merchantadd.WeChatRemark = Infos["errorDesc"].ToString();
|
|
|
}
|
|
|
+ //成功
|
|
|
else
|
|
|
{
|
|
|
- merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
|
|
|
+ merchantadd.HdStatus = 3; //0 待审核 1 已通过 2 已开通分账 3 已添加接收方
|
|
|
+ if (!string.IsNullOrEmpty(merchantadd.ToAcctNo))
|
|
|
+ {
|
|
|
+ if (!merchantadd.ToAcctNo.Contains("," + AppConfig.Haoda.AcctNo + ","))
|
|
|
+ {
|
|
|
+ merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ merchantadd.ToAcctNo += "," + AppConfig.Haoda.AcctNo + ",";
|
|
|
+ }
|
|
|
+ merchantadd.HdPassDate = DateTime.Now;
|
|
|
}
|
|
|
- merchantadd.HdPassDate = DateTime.Now;
|
|
|
}
|
|
|
+
|
|
|
+ //开户意愿申请
|
|
|
+ RedisDbconn.Instance.AddList("AlipayForHaoDaQueue", mId);
|
|
|
+ RedisDbconn.Instance.AddList("WeChatForHaoDaQueue", mId);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
|
|
@@ -160,11 +174,6 @@ namespace MySystem
|
|
|
db1.SaveChanges();
|
|
|
}
|
|
|
db1.Dispose();
|
|
|
-
|
|
|
- //开户意愿申请
|
|
|
- RedisDbconn.Instance.AddList("AlipayForHaoDaQueue", mId);
|
|
|
- RedisDbconn.Instance.AddList("WeChatForHaoDaQueue", mId);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
//审核被拒绝
|