代理版本调试
This commit is contained in:
1 parent
0b325e7cd8
commit
8ff2508632
36 files changed
+1049
-342
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Model.ErpModel;
|
||||
using KJD_Web.Model.ShopModel;
|
||||
using KJD_Web.Model.WxModel;
|
||||
using KJD_Web.Utils;
|
||||
@@ -187,7 +188,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
mySql = new MysqlUtils(conn);
|
||||
sql = " SELECT app_key,id " +
|
||||
sql = " SELECT app_key,id,corporate_account_user_id,manage_user_id " +
|
||||
" FROM erp.o_shop" +
|
||||
" WHERE app_key in ('" + string.Join ("','", shopList.Select(s=>s.shop_id)) + "');";
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
@@ -202,10 +203,16 @@ namespace KJD_Web.BLL.WXXD
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
var erpDbId = row["id"].ParseToNullableLong();
|
||||
var erpCorporateUserId = row["corporate_account_user_id"].ParseToNullableLong();
|
||||
var erpManageUserId = row["manage_user_id"].ParseToNullableLong();
|
||||
var appKey = row["app_key"].ParseToString();
|
||||
var shop = shopList.FirstOrDefault(s => s.shop_id == appKey && !s.shop_id.IsNullOrEmpty());
|
||||
if (shop != null)
|
||||
{
|
||||
shop.erp_corporate_account_user_id = erpCorporateUserId;
|
||||
shop.erp_manage_user_id = erpManageUserId;
|
||||
shop.erp_shop_id = erpDbId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,6 +226,108 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取erp店铺对应账户的余额
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <param name="isAdmin"></param>
|
||||
/// <returns></returns>
|
||||
public string GetShopErpMerchant(string inputData, bool isAdmin = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var timeCalc = DateTime.Now;
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
var corporate_account_user_id = RegexUtils.GetStringQuery(ref inputData, "corporate_account_user_id")?.Replace("'", "\\'");
|
||||
var manage_user_id = RegexUtils.GetStringQuery(ref inputData, "manage_user_id")?.Replace("'", "\\'");
|
||||
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
|
||||
if (corporate_account_user_id.IsNullOrEmpty() && manage_user_id.IsNullOrEmpty())
|
||||
return "{\"code\":500,\"msg\":\"未指定商户\"}";
|
||||
|
||||
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
|
||||
|
||||
if (page_size == 0)
|
||||
page_size = 200;
|
||||
|
||||
var manage_user_ids = new List<string>();
|
||||
if (!manage_user_id.IsNullOrEmpty())
|
||||
manage_user_ids.Add(manage_user_id);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql;
|
||||
|
||||
if (!string.IsNullOrEmpty(corporate_account_user_id))
|
||||
{
|
||||
sql = "SELECT manage_user_id FROM erp.o_shop_group WHERE corporate_account_user_id = '" + corporate_account_user_id + "';";
|
||||
var manage_user_id_tb = mySql.ExecuteDataTable(sql);
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\",\"data\":null}";
|
||||
}
|
||||
if (manage_user_id_tb == null)
|
||||
{
|
||||
mySql.Close();
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":[],\"count\":-2,\"seconds\":" + seconds + "}";
|
||||
}
|
||||
manage_user_ids.AddRange(manage_user_id_tb.Rows.Cast<DataRow>().Select(t => t["manage_user_id"].ToString()));
|
||||
if (manage_user_ids.Count == 0)
|
||||
{
|
||||
mySql.Close();
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":[],\"count\":-2,\"seconds\":" + seconds + "}";
|
||||
}
|
||||
}
|
||||
|
||||
sql = "select * FROM erp.o_user_account u where u.user_id in ('" + string.Join("','", manage_user_ids) + "')";
|
||||
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
|
||||
mySql.Close();
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\",\"data\":null}";
|
||||
}
|
||||
if (dt != null)
|
||||
{
|
||||
List<ErpMerchantInfo> erpAccountInfo = new List<ErpMerchantInfo>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
ErpMerchantInfo shop = new ErpMerchantInfo
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
account_name = row["account_name"].ToString(),
|
||||
account_status = row["account_status"].ParseToInt(),
|
||||
account_type = row["account_type"].ParseToInt(),
|
||||
balance = row["balance"].ParseToDecimal(),
|
||||
create_by = row["create_by"].ParseToNullableLong(),
|
||||
create_time = row["create_time"].ParseToString().ParseToDateTime(),
|
||||
frozen_amount = row["frozen_amount"].ParseToDecimal(),
|
||||
recharge_amount_total = row["recharge_amount_total"].ParseToDecimal(),
|
||||
update_by = row["update_by"].ParseToNullableLong(),
|
||||
update_time = row["update_time"].ParseToString().ParseToDateTime(),
|
||||
user_id = row["user_id"].ParseToLong(),
|
||||
withdrawn_amount = row["withdrawn_amount"].ParseToDecimal(),
|
||||
withdraw_account_image_url = row["withdraw_account_image_url"].ParseToString(),
|
||||
};
|
||||
erpAccountInfo.Add(shop);
|
||||
}
|
||||
erpAccountInfo = erpAccountInfo.OrderByDescending(s => s.balance).ToList();
|
||||
var count = -1;
|
||||
var data = JsonUtils.SerializeObjectToString(erpAccountInfo);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string SubSaGetSelectProdShop(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
<Compile Include="BLL\WXXD\WXProductManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXShopManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXUserManage.cs" />
|
||||
<Compile Include="Model\ErpModel\ErpMerchantInfo.cs" />
|
||||
<Compile Include="Model\JSTDownProdSkuInfo.cs" />
|
||||
<Compile Include="Model\PddModel\BuyerLoginInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDMaterialInfo.cs" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.ErpModel
|
||||
{
|
||||
public class ErpMerchantInfo
|
||||
{
|
||||
public long id { get; set; }
|
||||
/// <summary>
|
||||
/// 唯一用户标识
|
||||
/// </summary>
|
||||
public long user_id { get; set; }
|
||||
/// <summary>
|
||||
/// 账户类型,1:分销商账户,2:供应商账户
|
||||
/// </summary>
|
||||
public int? account_type { get; set; }
|
||||
/// <summary>
|
||||
/// 账户名称
|
||||
/// </summary>
|
||||
public string account_name { get; set; }
|
||||
/// <summary>
|
||||
/// 账户状态(1-正常 2-冻结 3-注销)
|
||||
/// </summary>
|
||||
public int account_status { get; set; }
|
||||
/// <summary>
|
||||
/// 账户累计充值金额
|
||||
/// </summary>
|
||||
public decimal recharge_amount_total { get; set; }
|
||||
/// <summary>
|
||||
/// 可用余额
|
||||
/// </summary>
|
||||
public decimal balance { get; set; }
|
||||
/// <summary>
|
||||
/// 冻结金额
|
||||
/// </summary>
|
||||
public decimal frozen_amount { get; set; }
|
||||
/// <summary>
|
||||
/// 提现账户收款图片
|
||||
/// </summary>
|
||||
public string withdraw_account_image_url { get; set; }
|
||||
/// <summary>
|
||||
/// 已提现金额
|
||||
/// </summary>
|
||||
public decimal? withdrawn_amount { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime create_time { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public DateTime update_time { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public long? create_by { get; set; }
|
||||
/// <summary>
|
||||
/// 修改人
|
||||
/// </summary>
|
||||
public long? update_by { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,8 @@ namespace KJD_Web.Model.ShopModel
|
||||
//public DateTime mdy_time { get; set; }
|
||||
public bool? is_point_shop_expire { get; set; } = false;
|
||||
public long? erp_shop_id { get; internal set; }
|
||||
public long? erp_corporate_account_user_id { get; internal set; }
|
||||
public long? erp_manage_user_id { get; internal set; }
|
||||
}
|
||||
|
||||
public class AuthInfo
|
||||
|
||||
@@ -61,6 +61,21 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取店铺erp端账户
|
||||
/// </summary>
|
||||
[WebMethod]
|
||||
public void get_shop_erp_merchant()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().GetShopErpMerchant(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_one_login_name_shop()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user