|
@@ -39,7 +39,7 @@ public class HaoDaExtQueryAuthHelper
|
|
|
// {
|
|
|
// Thread.Sleep(10000);
|
|
|
// }
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and `Status`=1", AppConfig.Base.SqlConnStr);
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and `Status`=1 and WeChatMerchantId!='' and WeChatMerchantId is not null", AppConfig.Base.SqlConnStr);
|
|
|
foreach(DataRow dr in dt.Rows)
|
|
|
{
|
|
|
WeChatAddInfo(int.Parse(dr["Id"].ToString()));
|
|
@@ -59,14 +59,17 @@ public class HaoDaExtQueryAuthHelper
|
|
|
string result = WeChatFunctionForHD.Instance.QueryAuthMerchant(info.WeChatMerchantId);
|
|
|
LogHelper.Instance.WriteLog(result, "获取微信商户开户意愿确认状态");
|
|
|
JsonData jsonObj = JsonMapper.ToObject(result);
|
|
|
- if (jsonObj["authorize_state"].ToString() == "AUTHORIZE_STATE_AUTHORIZED")
|
|
|
+ if(result.Contains("authorize_state"))
|
|
|
{
|
|
|
- LogHelper.Instance.WriteLog("starts", "获取微信商户开户意愿确认状态");
|
|
|
- MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
|
|
|
- info.Status = 2;
|
|
|
- merchant.Status = 2;
|
|
|
- db.SaveChanges();
|
|
|
- LogHelper.Instance.WriteLog("startsend", "获取微信商户开户意愿确认状态");
|
|
|
+ if (jsonObj["authorize_state"].ToString() == "AUTHORIZE_STATE_AUTHORIZED")
|
|
|
+ {
|
|
|
+ LogHelper.Instance.WriteLog("starts", "获取微信商户开户意愿确认状态");
|
|
|
+ MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
|
|
|
+ info.Status = 2;
|
|
|
+ merchant.Status = 2;
|
|
|
+ db.SaveChanges();
|
|
|
+ LogHelper.Instance.WriteLog("startsend", "获取微信商户开户意愿确认状态");
|
|
|
+ }
|
|
|
}
|
|
|
// else
|
|
|
// {
|
|
@@ -105,7 +108,7 @@ public class HaoDaExtQueryAuthHelper
|
|
|
// {
|
|
|
// Thread.Sleep(10000);
|
|
|
// }
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and `QueryCount`=1", AppConfig.Base.SqlConnStr);
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select Id from MerchantAddInfo where HdStatus=3 and `QueryCount`=1 and AliMerchantId!='' and AliMerchantId is not null", AppConfig.Base.SqlConnStr);
|
|
|
foreach(DataRow dr in dt.Rows)
|
|
|
{
|
|
|
AlipayAddInfo(int.Parse(dr["Id"].ToString()));
|