移除KJD WebService

This commit is contained in:
chfei committed 2026-08-25 09:21:40 +08:00
1 parent b512ee992f
commit fe20449503
147 files changed
-39677

No files matched your search

Binary file not shown.
Binary file not shown.
-25
View File
@@ -1,25 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36221.1 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KJD_WebService", "KJD_WebService\KJD_WebService.csproj", "{A6C03FE1-142A-4C97-99A9-67FD915836B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A6C03FE1-142A-4C97-99A9-67FD915836B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6C03FE1-142A-4C97-99A9-67FD915836B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6C03FE1-142A-4C97-99A9-67FD915836B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6C03FE1-142A-4C97-99A9-67FD915836B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {373F414C-6CDF-49C0-B074-A7D07D7B82B7}
EndGlobalSection
EndGlobal
@@ -1,2 +0,0 @@
*
!.gitignore
@@ -1,851 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
namespace KJD_Web.BLL.BXX
{
public class BXXPriceManage
{
public string AddPrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
int original_price = RegexUtils.GetStringQuery(ref inputData, "original_price").ParseToInt();
int markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times").ParseToInt();
int extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price").ParseToInt();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(ext_code) from bxx.price_markup where ext_code=@ext_code";
string sql = "insert into bxx.price_markup " +
"(ext_code,original_price,markup_times,extra_price,notes) " +
"values (@ext_code,@original_price,@markup_times,@extra_price,@notes);";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetPriceList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
string start_original_price = RegexUtils.GetStringQuery(ref inputData, "start_original_price");
string end_original_price = RegexUtils.GetStringQuery(ref inputData, "end_original_price");
string start_markup_times = RegexUtils.GetStringQuery(ref inputData, "start_markup_times");
string end_markup_times = RegexUtils.GetStringQuery(ref inputData, "end_markup_times");
string start_extra_price = RegexUtils.GetStringQuery(ref inputData, "start_extra_price");
string end_extra_price = RegexUtils.GetStringQuery(ref inputData, "end_extra_price");
var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code"));
var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes"));
var in_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_ext_code"));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_original_price", Value = start_original_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_original_price", Value = end_original_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_markup_times", Value = start_markup_times.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_markup_times", Value = end_markup_times.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_extra_price", Value = start_extra_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_extra_price", Value = end_extra_price.ParseToInt(), });
//paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = "'" + in_ext_code?.Replace(",", "','") + "'", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = in_ext_code.ParseToString() });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from bxx.price_markup p where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like @search_ext_code";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and p.notes like @search_notes";
if (!string.IsNullOrWhiteSpace(start_original_price))
where += " and p.original_price >= @start_original_price";
if (!string.IsNullOrWhiteSpace(end_original_price))
where += " and p.original_price <= @end_original_price";
if (!string.IsNullOrWhiteSpace(start_markup_times))
where += " and p.markup_times >= @start_markup_times";
if (!string.IsNullOrWhiteSpace(end_markup_times))
where += " and p.markup_times <= @end_markup_times";
if (!string.IsNullOrWhiteSpace(start_extra_price))
where += " and p.extra_price >= @start_extra_price";
if (!string.IsNullOrWhiteSpace(end_extra_price))
where += " and p.extra_price <= @end_extra_price";
if (!string.IsNullOrEmpty(in_ext_code))
where += " and p.ext_code in ('" + in_ext_code?.Replace(",", "','") + "')";
sql += where;
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from bxx.price_markup p where 1=1";
//where子句
sql += where;
sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<DBPriceResultParam> priceList = new List<DBPriceResultParam>();
foreach (DataRow row in dt.Rows)
{
DBPriceResultParam price = new DBPriceResultParam
{
id = row["id"].ParseToInt(),
extra_price = row["extra_price"].ParseToInt(),
markup_times = row["markup_times"].ParseToInt(),
original_price = row["original_price"].ParseToInt(),
notes = row["notes"].ParseToString(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
};
priceList.Add(price);
}
var data = JsonUtils.SerializeObjectToString(priceList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelDbPrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from bxx.price_markup where id='" + id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyDBPrice(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"));
string original_price = RegexUtils.GetStringQuery(ref inputData, "original_price");
string markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times");
string extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@db_id", Value = db_id, });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(ext_code) from bxx.price_markup where ext_code=@ext_code and id!=@db_id";
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
string sql = "update bxx.price_markup set";
if (notes != null)
sql += " notes=@notes,";
if (ext_code != null)
sql += " ext_code=@ext_code,";
if (original_price != null)
sql += " original_price=@original_price,";
if (markup_times != null)
sql += " markup_times=@markup_times,";
if (extra_price != null)
sql += " extra_price=@extra_price,";
sql = sql.TrimEnd(',');
sql += " where id=@db_id;";
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddPurchasePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name");
string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id")).ParseToString();
string skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "skc_id")).ParseToString();
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString();
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(spu_id) from bxx.product_purchase_price where spu_id=@spu_id";
string sql = "insert into bxx.product_purchase_price " +
"(shop_id,shop_name,spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,discount,price_text,sku_purchase_price_json,notes) " +
"values (@shop_id,@shop_name,@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@discount,@price_text,@sku_purchase_price_json,@notes);";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyPurchasePrice(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name");
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString();
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@db_id", Value = db_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.product_purchase_price set";
if (shop_id != null)
sql += " shop_id=@shop_id,";
if (shop_name != null)
sql += " shop_name=@shop_name,";
if (cat_id != null)
sql += " cat_id=@cat_id,";
if (cat_name != null)
sql += " cat_name=@cat_name,";
if (ext_code != null)
sql += " ext_code=@ext_code,";
if (product_name != null)
sql += " product_name=@product_name,";
if (main_img != null)
sql += " main_img=@main_img,";
if (discount != null)
sql += " discount=@discount,";
if (price_text != null)
sql += " price_text=@price_text,";
if (sku_purchase_price_json != null)
sql += " sku_purchase_price_json=@sku_purchase_price_json,";
if (notes != null)
sql += " notes=@notes,";
sql = sql.TrimEnd(',');
sql += " where id=@db_id;";
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetPurchasePriceList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var search_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_spu_id"));
var search_skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_skc_id"));
var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code"));
var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes"));
var in_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_spu_id"));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_spu_id", Value = "%" + search_spu_id + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_skc_id", Value = "%" + search_skc_id + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_spu_id", Value = in_spu_id.ParseToString() });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from bxx.product_purchase_price p where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_spu_id))
where += " and p.spu_id like @search_spu_id";
if (!string.IsNullOrWhiteSpace(search_skc_id))
where += " and p.skc_id like @search_skc_id";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like @search_ext_code";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and p.notes like @search_notes";
if (!string.IsNullOrEmpty(in_spu_id))
where += " and p.spu_id in ('" + in_spu_id?.Replace(",", "','") + "')";
sql += where;
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from bxx.product_purchase_price p where 1=1";
//where子句
sql += where;
sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<ProductPurchasePriceResultParam> purchasePriceList = new List<ProductPurchasePriceResultParam>();
foreach (DataRow row in dt.Rows)
{
ProductPurchasePriceResultParam price = new ProductPurchasePriceResultParam
{
id = row["id"].ParseToInt(),
shop_id = row["shop_id"].ParseToString(),
shop_name = row["shop_name"].ParseToString(),
cat_id = row["cat_id"].ParseToString(),
cat_name = row["cat_name"].ParseToString(),
main_img = row["main_img"].ParseToString(),
discount = row["discount"].ParseToInt(),
price_text = row["price_text"].ParseToString(),
product_name = row["product_name"].ParseToString(),
skc_id = row["skc_id"].ParseToString(),
sku_purchase_price_json = row["sku_purchase_price_json"].ParseToString(),
spu_id = row["spu_id"].ParseToString(),
notes = row["notes"].ParseToString(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
};
purchasePriceList.Add(price);
}
var data = JsonUtils.SerializeObjectToString(purchasePriceList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelPurchasePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from bxx.product_purchase_price where id='" + id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddExtCodePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
var ext_code_price = RegexUtils.GetStringQuery(ref inputData, "ext_code_price")?.ParseToInt();
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(ext_code))
{
return "{\"code\":500,\"msg\":\"没有货号\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@ext_code_price", Value = ext_code_price, });
string sql= "select count(ext_code) from bxx.ext_code_price where ext_code=@ext_code";
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
if (count.ParseToInt() > 0)
{
sql = "update bxx.ext_code_price set ext_code_price=@ext_code_price where ext_code=@ext_code";
}
else
{
sql = "insert into bxx.ext_code_price (ext_code,ext_code_price) values (@ext_code,@ext_code_price);";
}
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetExtCodePriceList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
string start_ext_price = RegexUtils.GetStringQuery(ref inputData, "start_ext_price");
string end_ext_price = RegexUtils.GetStringQuery(ref inputData, "end_ext_price");
var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code"));
var in_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_ext_code"));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_ext_price", Value = start_ext_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_ext_price", Value = end_ext_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = in_ext_code.ParseToString() });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from bxx.ext_code_price p where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like @search_ext_code";
if (!string.IsNullOrWhiteSpace(start_ext_price))
where += " and p.ext_code_price >= @start_ext_price";
if (!string.IsNullOrWhiteSpace(end_ext_price))
where += " and p.ext_code_price <= @end_ext_price";
if (!string.IsNullOrEmpty(in_ext_code))
where += " and p.ext_code in ('" + in_ext_code?.Replace(",", "','") + "')";
sql += where;
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from bxx.ext_code_price p where 1=1";
//where子句
sql += where;
sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<DBExtCodePriceResult> priceList = new List<DBExtCodePriceResult>();
foreach (DataRow row in dt.Rows)
{
DBExtCodePriceResult price = new DBExtCodePriceResult
{
id = row["id"].ParseToInt(),
ext_code_price = row["ext_code_price"].ParseToInt(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
};
priceList.Add(price);
}
var data = JsonUtils.SerializeObjectToString(priceList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelDbExtCodePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from bxx.ext_code_price where id='" + id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyDBExtCodePrice(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"));
string ext_code_price = RegexUtils.GetStringQuery(ref inputData, "original_price");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@ext_code_price", Value = ext_code_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@db_id", Value = db_id, });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
//string sqlExist = "select count(ext_code) from bxx.ext_code_price where ext_code=@ext_code and id!=@db_id";
//var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
//if (has != "0")
//{
// mySql.Close();
// return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
//}
string sql = "update bxx.ext_code_price set";
if (ext_code != null)
sql += " ext_code=@ext_code,";
if (ext_code_price != null)
sql += " ext_code_price=@ext_code_price,";
sql = sql.TrimEnd(',');
sql += " where id=@db_id;";
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
File diff suppressed because it is too large. Load diff
@@ -1,745 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using MySqlX.XDevAPI.Common;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
namespace KJD_Web.BLL.BXX
{
public class BXXProductThirdManage
{
public string AddProduct(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
string from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id");
string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id");
string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id");
string cat_id = RegexUtils.GetStringQuery(ref inputData, "cat_id");
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"));
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"));
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"));
string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"));
string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"));
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"));
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
var json_ids = RegexUtils.GetMatchRegex(ref product_json, "(\"id\":\\d{8,14})"); // 取商品json数据里不同签名的部分
var product_json_replace = product_json;
foreach (Match json_id in json_ids)
{
product_json_replace = product_json_replace.Replace(json_id.Value, "\"id\":0");
}
var product_md5 = EncrypUtil.GetMd5(product_json_replace + size_json);
sql = "select id from bxx.third_product where product_md5='" + product_md5 + "';";
var rst = mySql.ExecuteFirstInt(sql).ParseToLong();
if (rst <= 0)
{
//sql = "insert into bxx.third_product (from_shop_id,spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " +
// "values ('" + from_shop_id + "','" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" +
// ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + product_md5 + "','" +
// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
//rst = mySql.ExecuteInsertId(sql);
sql = "insert into bxx.third_product (from_shop_id,spu_id,skc_id,cat_id,cat_name,product_name," +
"ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " +
"values (@from_shop_id,@spu_id,@skc_id,@cat_id,@cat_name,@product_name," +
"@ext_code,@main_img,@product_json,@size_json,@notes,@product_md5," +
"@add_time,@mdy_time);";
string add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string mdy_time = add_time;
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@from_shop_id", Value = from_shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_json", Value = product_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@size_json", Value = size_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes.ParseToString(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_md5", Value = product_md5, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@add_time", Value = add_time, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@mdy_time", Value = mdy_time, });
rst = mySql.ExecuteInsertId(sql, paramLst.ToArray());
mySql.Close();
}
if (rst > 0)
{
return "{\"code\":200,\"msg\":\"success\",\"id\":" + rst + "}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetProductList(string inputData, bool isDetail = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'");
var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'");
var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'");
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from bxx.third_product where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_spu))
where += " and spu_id like '%" + search_spu + "%'";
if (!string.IsNullOrWhiteSpace(search_skc))
where += " and skc_id like '%" + search_skc + "%'";
if (!string.IsNullOrWhiteSpace(search_cat))
where += " and cat_name like '%" + search_cat + "%'";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and ext_code like '%" + search_ext_code + "%'";
if (!string.IsNullOrWhiteSpace(search_prod_name))
where += " and product_name like '%" + search_prod_name + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and notes like '%" + search_notes + "%'";
if (!string.IsNullOrEmpty(search_db_ids))
where += " and id in (" + search_db_ids + ")";
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
if (isDetail)
sql = "select * from bxx.third_product where 1=1";
else
sql = "select id,from_shop_id,spu_id,skc_id,cat_id,cat_name,change_cat_id,change_cat_name,ext_code,product_name,main_img,notes," +
"add_time,mdy_time from bxx.third_product where 1=1";
sql += where;
sql += " order by id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<DBProductResultParam> productLst = new List<DBProductResultParam>();
foreach (DataRow row in dt.Rows)
{
DBProductResultParam prod = new DBProductResultParam
{
id = Convert.ToInt32(row["id"]),
from_shop_id = row["from_shop_id"].ToString(),
skc_id = row["skc_id"].ToString(),
spu_id = row["spu_id"].ToString(),
cat_id = row["cat_id"].ToString(),
cat_name = row["cat_name"].ToString(),
change_cat_id = row["change_cat_id"].ToString(),
change_cat_name = row["change_cat_name"].ToString(),
product_name = row["product_name"].ToString(),
main_img = row["main_img"].ToString(),
ext_code = row["ext_code"].ToString(),
//product_json = row["product_json"].ToString(),
//size_json = row["size_json"].ToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
notes = row["notes"].ToString(),
};
if (isDetail)
{
prod.product_json = row["product_json"].ToString();
prod.size_json = row["size_json"].ToString();
}
productLst.Add(prod);
}
var data = JsonUtils.SerializeObjectToString(productLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelDbProd(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from bxx.third_product where id='"
+ id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyProductCategory(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
string change_cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "change_cat_id"))?.Replace("'", "\\'");
string change_cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "change_cat_name"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.third_product set";
if (change_cat_id != null)
sql += " change_cat_id='" + change_cat_id + "',";
if (change_cat_name != null)
sql += " change_cat_name='" + change_cat_name + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + ";";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddUserSelectProduct(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var out_product_Id = RegexUtils.GetStringQuery(ref inputData, "out_product_id")?.Replace("'", "\\'");
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
var shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account")?.Replace("'", "\\'");
var user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'");
var sub_user_name = RegexUtils.GetStringQuery(ref inputData, "sub_user_name")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var add_product_remaining = RegexUtils.GetStringQuery(ref inputData, "add_product_remaining").ParseToInt();
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(shop_id))
{
return "{\"code\":500,\"msg\":\"没有店铺信息\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "insert into bxx.third_product_select (out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,add_time,mdy_time) " +
"values ('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" +
notes + "','" + status + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
if (add_product_remaining > 0)
{
add_product_remaining = add_product_remaining - 1;
sql += "\r\n";
sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
//sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
sql += "INSERT INTO bxx.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" +
"ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)";
}
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyUserSelectProductStatus(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'");
var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'");
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'");
long l_draft_id = draft_id.ParseToLong();
long l_spu_map_table_id = l_draft_id % 128;
long l_select_map_table_id = id.ParseToLong() % 64;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
// 使用事务一次提交多个sql操作
//sql += "set @@autocommit=0;\r\n";
sql += "START TRANSACTION;\r\n";
if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id))
{
sql += "insert into kjd_map.spu_map_" + l_spu_map_table_id +
" (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');\r\n";
sql += "insert into kjd_map.product_third_select_map_" + l_select_map_table_id +
" (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n";
}
sql += "update bxx.third_product_select set";
if (draft_id != null)
sql += " draft_id='" + draft_id + "',";
if (status != null)
sql += " status='" + status + "',";
if (status == "已上传")
sql += " add_times=add_times+1,";
sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + ";\r\n";
var rst = mySql.ExecuteNonQuery(sql);
string errMsg = mySql.Message;
if (string.IsNullOrEmpty(errMsg))
sql = "COMMIT;";
else
sql = "ROLLBACK;";
mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + errMsg + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetUserSelectProductList(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'");
var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'");
var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account");
var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'");
var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'");
var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'");
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'");
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(s.id) from bxx.third_product_select s " +
"left join bxx.third_product p on s.out_product_id=p.id " +
"left join bxx.user u on s.operate_sub_sa_name=u.user_name " +
"where 1=1";
string where = "";
if (!isAdmin)
where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')";
if (!string.IsNullOrEmpty(operate_sub_sa_name))
{
where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'";
}
if (no_sub_sa == "true")
where += " and s.operate_sub_sa_name is null";
if (!string.IsNullOrEmpty(search_db_ids))
where += " and s.id in (" + search_db_ids + ")";
if (!string.IsNullOrEmpty(shop_ids))
where += " and s.shop_id in (" + shop_ids + ")";
if (!string.IsNullOrWhiteSpace(status))
where += " and s.status = '" + status + "'";
if (!string.IsNullOrWhiteSpace(search_shop_id))
where += " and s.shop_id like '%" + search_shop_id + "%'";
if (!string.IsNullOrWhiteSpace(search_shop_account))
where += " and s.shop_account like @search_shop_account";
if (!string.IsNullOrWhiteSpace(search_notes))
{
//核价成功 重复 核价成功(重复)
if (search_notes == "无备注")
where += " and s.notes = ''";
else if (search_notes == "重复")
where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'";
else if (search_notes == "核价成功")
where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes not like '%重复%'";
else if (search_notes == "核价成功(重复)")
where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes like '%重复%'";
else
where += " and s.notes like '%" + search_notes + "%'";
}
if (!string.IsNullOrWhiteSpace(search_user_notes))
where += " and s.user_notes like '%" + search_user_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_spu))
where += " and p.spu_id like '%" + search_spu + "%'";
if (!string.IsNullOrWhiteSpace(search_skc))
where += " and p.skc_id like '%" + search_skc + "%'";
if (!string.IsNullOrWhiteSpace(search_cat))
where += " and p.cat_name like '%" + search_cat + "%'";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like '%" + search_ext_code + "%'";
if (!string.IsNullOrWhiteSpace(search_prod_name))
where += " and p.product_name like @search_prod_name";
if (!string.IsNullOrEmpty(search_sub_sa_name))
{
where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'";
where += " or u.nick_name like '%" + operate_sub_sa_name + "%')";
}
sql += where;
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_shop_account", Value = "%" + search_shop_account + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_prod_name", Value = "%" + search_prod_name + "%", });
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
//if (isDetail)
//sql = "select * from bxx.third_product_select where 1=1";
//else
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
"s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
"s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," +
"p.from_shop_id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.change_cat_id,p.change_cat_name,p.ext_code,p.product_name,p.main_img," +
"u.nick_name as operate_sub_sa_nick " +
"from bxx.third_product_select s left join bxx.third_product p on s.out_product_id=p.id " +
"left join bxx.user u on u.user_name=s.operate_sub_sa_name " +
"where 1=1";
sql += where; // where子句
sql += " order by id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<ProductSelectResultParam> productLst = new List<ProductSelectResultParam>();
foreach (DataRow row in dt.Rows)
{
ProductSelectResultParam prodSelect = new ProductSelectResultParam()
{
id = row["id"].ParseToInt(),
out_product_Id = row["out_product_Id"].ParseToString(),
shop_account = row["shop_account"].ParseToString(),
shop_id = row["shop_id"].ParseToString(),
status = row["status"].ParseToString(),
sub_user_name = row["sub_user_name"].ParseToString(),
user_name = row["user_name"].ParseToString(),
cat_id = row["cat_id"].ParseToString(),
cat_name = row["cat_name"].ParseToString(),
change_cat_id = row["change_cat_id"].ParseToString(),
change_cat_name = row["change_cat_name"].ParseToString(),
product_name = row["product_name"].ParseToString(),
main_img = row["main_img"].ParseToString(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
notes = row["notes"].ParseToString(),
draft_id = row["draft_id"].ParseToString(),
add_times = row["add_times"].ParseToInt(),
skc_id = row["skc_id"].ToString(),
spu_id = row["spu_id"].ToString(),
operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
fission_product_name = row["fission_product_name"].ToString(),
user_notes = row["user_notes"].ToString(),
from_shop_id = row["from_shop_id"].ToString(),
//product_json = row["product_json"].ToString(),
//size_json = row["size_json"].ToString(),
};
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
productLst.Add(prodSelect);
}
var data = JsonUtils.SerializeObjectToString(productLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelSelectProd(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from bxx.third_product_select where id='"
+ id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
/// <summary>
/// 设置上传商品的二级超管
/// </summary>
/// <returns></returns>
public string SetSelectProductSubSa(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
}
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id))
{
return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.third_product_select set";
if (operate_sub_sa_name != null)
sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.TrimEnd(',');
if (!string.IsNullOrEmpty(id))
sql += " where id in (" + id + ")";
else if (!string.IsNullOrEmpty(shop_id))
sql += " where shop_id in ('" + shop_id.Replace(",","','") + "')";
else
sql += " where 1=2";
if(!string.IsNullOrEmpty(status))
sql += " and status='" + status + "';";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyProductSelectNotes(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes"));
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"));
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.third_product_select set";
if (notes != null)
sql += " notes=@notes,";
if (user_notes != null)
sql += " user_notes=@user_notes,";
if (fission_product_name != null)
sql += " fission_product_name=@fission_product_name,";
sql = sql.TrimEnd(',');
sql += " where id=@id;";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
File diff suppressed because it is too large. Load diff
@@ -1,887 +0,0 @@
using KJD_Web.BLL.WXXD;
using KJD_Web.Model;
using KJD_Web.Model.PddModel;
using KJD_Web.Model.ShopModel;
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web;
using System.Web.UI.WebControls;
namespace KJD_Web.BLL.BXX
{
public class BXXUserManage
{
public string CheckUserLogin(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData, true))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from bxx.user where user_name='"
+ mobile + "' and password='" + password + "'";
var dt = mySql.ExecuteDataTable(sql);
if (!string.IsNullOrEmpty(mySql.Message))
{
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
if (dt == null)
dt = new DataTable();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["user_name"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
company_name = row["company_name"].ToString(),
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
authority = row["authority"].ToString(),
forbidden_page = row["forbidden_page"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
};
if (string.IsNullOrEmpty(user.company_name))
{
user.company_name = "-";
}
if (user.group_id != "3" && !string.IsNullOrEmpty(user.parent_user_name))
{
sql = "select authority from bxx.user where user_name='" + user.parent_user_name + "'";
var rst = mySql.ExecuteFirst(sql);
if (mySql.Message.IsNullOrEmpty())
{
user.parent_authority = rst;
}
}
var data = JsonUtils.SerializeObjectToString(user);
mySql.Close();
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
mySql.Close();
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "company"))?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from bxx.user where user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into bxx.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,authority,forbidden_page,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" + authority + "','" + forbidden_page + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\""+ mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"子账户创建成功!\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var group = RegexUtils.GetStringQuery(ref inputData, "group");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from bxx.user where parent_user_name='"
+ user_name + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["mobile"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
forbidden_page = row.Table.Columns.Contains("forbidden_page") ? row["forbidden_page"].ParseToString() : "",
};
if (string.IsNullOrEmpty(user.mobile))
{
user.mobile = row["user_name"].ToString();
}
userList.Add(user);
}
var data = JsonUtils.SerializeObjectToString(userList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//sql = "select * from bxx.user where parent_user_name='"
// + user_name + "'";
sql = "update bxx.user set";
if (!string.IsNullOrEmpty(nick_name))
sql += " nick_name='" + nick_name + "',";
if (!string.IsNullOrEmpty(user_name))
sql += " user_name='" + user_name + "',";
if (!string.IsNullOrEmpty(mobile))
sql += " mobile='" + mobile + "',";
if (!string.IsNullOrEmpty(password))
sql += " password='" + password + "',";
if (!string.IsNullOrEmpty(group_id))
sql += " group_id=" + group_id + ",";
if (!string.IsNullOrEmpty(card_id))
sql += " card_id='" + card_id + "',";
if (!string.IsNullOrEmpty(notes))
sql += " notes='" + notes + "',";
if (authority != null)
sql += " authority='" + authority + "',";
if (forbidden_page != null)
sql += " forbidden_page='" + forbidden_page + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var id = RegexUtils.GetStringQuery(ref inputData, "id");
if (string.IsNullOrWhiteSpace(id))
return "{\"code\":500,\"msg\":\"id不能为空\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from bxx.user where id='"
+ id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败,请稍后重试\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetAllUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "select * from bxx.user where group_id=3";
string sql = "select * from bxx.user where 1=1";
if (!string.IsNullOrEmpty(group_id))
sql += " and group_id=" + group_id;
if (!string.IsNullOrEmpty(sa_level))
sql += " and sa_level=" + sa_level;
if (!string.IsNullOrEmpty(search))
sql += " and (user_name like '%" + search +
"%' or nick_name like '%" + search +
"%' or company_name like '%" + search + "%')";
sql += " order by id desc";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["mobile"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
forbidden_page = row.Table.Columns.Contains("forbidden_page") ? row["forbidden_page"].ParseToString() : "",
};
if (string.IsNullOrEmpty(user.mobile))
{
user.mobile = row["user_name"].ToString();
}
userList.Add(user);
}
var data = JsonUtils.SerializeObjectToString(userList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); ;
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from bxx.user where user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into bxx.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,authority,add_time,mdy_time,forbidden_page) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" + authority + "','" + forbidden_page + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//sql = "select * from bxx.user where parent_user_name='"
// + user_name + "'";
sql = "update bxx.user set";
if (!string.IsNullOrEmpty(nick_name))
sql += " nick_name='" + nick_name + "',";
if (!string.IsNullOrEmpty(user_name))
sql += " user_name='" + user_name + "',";
if (!string.IsNullOrEmpty(mobile))
sql += " mobile='" + mobile + "',";
if (!string.IsNullOrEmpty(company_name))
sql += " company_name='" + company_name + "',";
if (!string.IsNullOrEmpty(password))
sql += " password='" + password + "',";
if (!string.IsNullOrEmpty(group_id))
sql += " group_id=" + group_id + ",";
if (!string.IsNullOrEmpty(card_id))
sql += " card_id='" + card_id + "',";
if (!string.IsNullOrEmpty(notes))
sql += " notes='" + notes + "',";
if (!string.IsNullOrEmpty(sa_level))
sql += " sa_level=" + sa_level + ",";
if (authority != null)
sql += " authority='" + authority + "',";
if (forbidden_page != null)
sql += " forbidden_page='" + forbidden_page + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string ChangePassword(string inputData)
{
var userName = RegexUtils.GetStringJson(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringJson(ref inputData, "password")?.Replace("'", "\\'");
var newPassword = RegexUtils.GetStringJson(ref inputData, "new_password")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select user_id,password from pepdtp.user where user_id='"
+ userName + "' and password='" + password + "'";
var dw = mySql.ExecuteDataTableRow(sql);
if (dw != null)
{
UserLoginResultParam user = new UserLoginResultParam
{
user_name = dw["user_id"].ToString(),
password = dw["password"].ToString(),
};
sql = "update pepdtp.user set password = '" + newPassword + "' where user_id='" + userName + "'";
var result = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (result)
{
return "{\"code\":0,\"msg\":\"密码修改成功!\"}";
}
else
return "{\"code\":19999,\"msg\":\"密码修改失败!请稍后再试。\"}";
}
else
{
mySql.Close();
return "{\"code\":1,\"msg\":\"原密码错误。\"}";
}
}
public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU=";
public string GetPackageSign(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'");
var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'");
var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'");
int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
string c2 = RegexUtils.GetStringQuery(ref inputData, "c2");
if (EncrypUtil.Encryption(r2) != c2)
return "{\"code\":2,\"msg\":\"不合法的输入内容\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from bxx.user where user_name='"
+ mobile + "' and password='" + password + "'";
sql = "select * from bxx.user where user_name='" + mobile + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt == null || dt.Rows.Count <=0)
{
return "{\"code\":1,\"msg\":\"用户不存在\"}";
}
string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower();
return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateScm121Cookie(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var id = (RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'")).ParseToInt();
if (id == 0)
id = 1;
var cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cookie"))?.Replace("'", "\\'");
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.scm121_user set cookie='" + cookie + "' WHERE id=" + id + ";";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst && string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"msg\":\"success\"}";
}
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetScm121Cookie(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var id = (RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'")).ParseToInt();
if (id == 0)
id = 1;
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select cookie from bxx.scm121_user WHERE id=" + id + ";";
var rst = mySql.ExecuteDataTableRow(sql);
mySql.Close();
if (string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"cookie\":" + rst["cookie"] + "}";
}
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddBuyer(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
string buyer_id = RegexUtils.GetStringQuery(ref inputData, "buyer_id")?.Replace("'", "\\'");
string buyer_name = RegexUtils.GetStringQuery(ref inputData, "buyer_name")?.Replace("'", "\\'");
string buyer_nick = RegexUtils.GetStringQuery(ref inputData, "buyer_nick")?.Replace("'", "\\'");
string cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cookie"))?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(buyer_name))
{
return "{\"code\":501,\"msg\":\"没有买手登录名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select exists (select 1 from bxx.shop where buyer_id='" + buyer_id + "' and user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"买手" + buyer_name + " " + buyer_nick + "已存在\"}";
}
sql = "insert into bxx.buyer (user_name,buyer_id,buyer_name,buyer_nick,cookie,notes) " +
"values ('" + user_name + "','" + buyer_id + "','" + buyer_name + "','" + buyer_nick + "','" + cookie + "','" + notes + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string MdyBuyer(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
string buyer_id = RegexUtils.GetStringQuery(ref inputData, "buyer_id")?.Replace("'", "\\'");
string buyer_name = RegexUtils.GetStringQuery(ref inputData, "buyer_name")?.Replace("'", "\\'"); ;
string buyer_nick = RegexUtils.GetStringQuery(ref inputData, "buyer_nick")?.Replace("'", "\\'"); ;
string cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cookie"))?.Replace("'", "\\'"); ;
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
string status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "status"))?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(buyer_id))
{
return "{\"code\":501,\"msg\":\"没有买手号\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.buyer set";
if (buyer_name != null)
sql += " buyer_name='" + buyer_name + "',";
if (buyer_nick != null)
sql += " buyer_nick='" + buyer_nick + "',";
if (cookie != null)
sql += " cookie='" + cookie + "',";
if (notes != null)
sql += " notes='" + notes + "',";
if (status != null)
sql += " status='" + status + "',";
sql = sql.TrimEnd(',');
sql += " where buyer_id='" + buyer_id + "' and user_name='" + user_name + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string MdyBuyerCookie(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
string user_name = RegexUtils.GetStringQuery(ref inputData, "buyer_user_name")?.Replace("'", "\\'");
string buyer_id = RegexUtils.GetStringQuery(ref inputData, "buyer_id")?.Replace("'", "\\'");
string cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cookie"))?.Replace("'", "\\'");
string status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "status"))?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(buyer_id))
{
return "{\"code\":501,\"msg\":\"没有买手号\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update bxx.buyer set";
if (cookie != null)
sql += " cookie='" + cookie + "',";
if (status != null)
sql += " status='" + status + "',";
sql = sql.TrimEnd(',');
sql += " where buyer_id='" + buyer_id + "';";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string GetBuyer(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes");
var search_buyer_id = RegexUtils.GetStringQuery(ref inputData, "search_buyer_id");
var search_buyer_name = RegexUtils.GetStringQuery(ref inputData, "search_buyer_name");
var search_buyer_nick = RegexUtils.GetStringQuery(ref inputData, "search_buyer_nick");
var buyer_ids = RegexUtils.GetStringQuery(ref inputData, "buyer_ids")?.Replace("'", "");
if (!string.IsNullOrWhiteSpace(buyer_ids))
{
List<string> shopIdLst = buyer_ids.Split(',').ToList();
buyer_ids = "'" + string.Join("','", shopIdLst) + "'";
}
var buyer_names = RegexUtils.GetStringQuery(ref inputData, "buyer_names");
if (!string.IsNullOrWhiteSpace(buyer_names))
{
List<string> shopNameLst = buyer_names.Split(',').ToList();
buyer_names = "'" + string.Join("','", shopNameLst) + "'";
}
var buyer_nicks = RegexUtils.GetStringQuery(ref inputData, "buyer_nicks");
if (!string.IsNullOrWhiteSpace(buyer_nicks))
{
List<string> shopNotesLst = buyer_nicks.Split(',').ToList();
buyer_nicks = "'" + string.Join("','", shopNotesLst) + "'";
}
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
if (page_size == 0)
page_size = 50;
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT COUNT(s.id) FROM bxx.buyer s WHERE 1=1";
//where子句
string where = "";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and s.notes like '%" + search_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_buyer_id))
where += " and s.buyer_id like '%" + search_buyer_id + "%'";
if (!string.IsNullOrWhiteSpace(search_buyer_name))
where += " and s.buyer_name like '%" + search_buyer_name + "%'";
if (!string.IsNullOrWhiteSpace(search_buyer_nick))
where += " and s.buyer_nick like '%" + search_buyer_nick + "%'";
if (!string.IsNullOrWhiteSpace(buyer_ids))
where += " and s.buyer_id in (" + buyer_ids + ")";
if (!string.IsNullOrWhiteSpace(buyer_names))
where += " and s.buyer_name in (" + buyer_names + ")";
if (!string.IsNullOrWhiteSpace(buyer_nicks))
where += " and s.buyer_nick in (" + buyer_nicks + ")";
if (!string.IsNullOrWhiteSpace(user_name))
where += " and s.user_name='" + user_name + "'";
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT s.*";
sql += " FROM bxx.buyer s WHERE 1=1";
sql += where; // where 子句
sql += " ORDER BY s.id DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
List<BuyerLoginInfo> buyerList = new List<BuyerLoginInfo>();
foreach (DataRow row in dt.Rows)
{
BuyerLoginInfo shop = new BuyerLoginInfo
{
id = Convert.ToInt32(row["id"]),
cookie = row["cookie"].ToString(),
user_name = row["user_name"].ToString(),
notes = row["notes"].ToString(),
add_time = row["add_time"].ParseToString().ParseToDateTime(),
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
buyer_id = row["buyer_id"].ToString(),
buyer_name = row["buyer_name"].ToString(),
buyer_nick = row["buyer_nick"].ToString(),
status = row["status"].ToString(),
};
buyerList.Add(shop);
}
var data = JsonUtils.SerializeObjectToString(buyerList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string DelBuyer(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var buyer_id = RegexUtils.GetStringQuery(ref inputData, "buyer_id");
if (string.IsNullOrEmpty(buyer_id))
{
return "{\"code\":500,\"msg\":\"没有买手号\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "DELETE FROM bxx.buyer WHERE user_name='" + user_name + "' and buyer_id='" + buyer_id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":501,\"msg\":" + mySql.Message + "}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
}
}
@@ -1,782 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Model.ShopModel;
using KJD_Web.Utils;
using MySqlX.XDevAPI;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Security;
namespace KJD_Web.BLL.DYXD
{
public class DYShopManage
{
public string GetShop(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id");
var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name");
var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes");
var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
if (!string.IsNullOrWhiteSpace(shop_ids))
{
List<string> shopIdLst = shop_ids.Split(',').ToList();
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
}
var shop_names = RegexUtils.GetStringQuery(ref inputData, "shop_names");
if (!string.IsNullOrWhiteSpace(shop_names))
{
List<string> shopNameLst = shop_names.Split(',').ToList();
shop_names = "'" + string.Join("','", shopNameLst) + "'";
}
var shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes");
if (!string.IsNullOrWhiteSpace(shop_notes))
{
List<string> shopNotesLst = shop_notes.Split(',').ToList();
shop_notes = "'" + string.Join("','", shopNotesLst) + "'";
}
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
if (page_size == 0)
page_size = 50;
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT COUNT(s.id) FROM dyxd.shop s WHERE 1=1";
//where子句
string where = "";
if (isAdmin)
where += " and (s.cookie='' or s.shop_id!='')";
if (!isAdmin)
where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')";
if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'";
if (!string.IsNullOrWhiteSpace(search_user_name))
where += " and s.user_name like '%" + search_user_name + "%'";
if (!string.IsNullOrWhiteSpace(search_login_name))
where += " and s.login_name like '%" + search_login_name + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and s.notes like '%" + search_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_id))
where += " and s.shop_id like '%" + search_id + "%'";
if (!string.IsNullOrWhiteSpace(search_name))
where += " and s.shop_account like '%" + search_name + "%'";
if (!string.IsNullOrWhiteSpace(shop_ids))
where += " and s.shop_id in (" + shop_ids + ")";
if (!string.IsNullOrWhiteSpace(shop_names))
where += " and s.shop_account in (" + shop_names + ")";
if (!string.IsNullOrWhiteSpace(shop_notes))
where += " and s.notes in (" + shop_notes + ")";
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.pddid,s.shop_id,s.shop_account,s.sub_user_name," +
"s.user_name,s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month," +
"s.add_time,s.mdy_time,s.add_sub_sa_time,s.operate_sub_sa_name";
//sql += " FROM dyxd.shop s WHERE 1=1";
sql += " FROM dyxd.shop s LEFT JOIN dyxd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
sql += where; // where 子句
sql += " ORDER BY s.id DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
List<ShopParam> shopList=new List<ShopParam>();
foreach (DataRow row in dt.Rows)
{
ShopParam shop = new ShopParam
{
id = Convert.ToInt32(row["id"]),
login_name = row["login_name"].ToString(),
login_pass = row["login_pass"].ToString(),
cookie = row["cookie"].ToString(),
cookie2 = row["cookie2"].ToString(),
anti_contents = row["anti_contents"].ToString(),
shop_id = row["shop_id"].ToString(),
shop_account = row["shop_account"].ToString(),
sub_user_name = row["sub_user_name"].ToString(),
user_name = row["user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
login_status = row["login_status"].ToString(),
login_status2 = row["login_status2"].ToString(),
add_product_remaining = row["add_product_remaining"].ParseToInt(),
add_product_month = row["add_product_month"].ParseToInt(),
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
pddid = row["pddid"].ParseToString(),
};
shopList.Add(shop);
}
//sql = "\r\nINSERT INTO dyxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
//foreach (var shop in shopList)
//{
// sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),";
//}
//sql = sql.TrimEnd(',') + " \r\n";
//sql += "ON DUPLICATE KEY UPDATE " +
// "shop_account=VALUES(shop_account)," +
// "add_product_remaining=VALUES(add_product_remaining)," +
// "add_product_month=VALUES(add_product_month);";
//var result = mySql.ExecuteNonQuery(sql);
//mySql.Close();
int month = DateTime.Now.Month;
var shopMonthList = shopList.Where(s => s.add_product_month != month);
if (shopMonthList.Count() > 0)
{
int remainCount = 300;
var shopMonthIdList = shopMonthList.Select(s => s.id);
mySql = new MysqlUtils(conn);
string ids = string.Join(",", shopMonthIdList);
sql = "";
sql += "update dyxd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month +
" where 1=1 and id in (" + ids + ");";
sql += "\r\nINSERT INTO dyxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
foreach (var shop in shopMonthList)
{
sql+= "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),";
}
sql = sql.TrimEnd(',') + " \r\n";
sql += "ON DUPLICATE KEY UPDATE " +
"shop_account=VALUES(shop_account)," +
"add_product_remaining=VALUES(add_product_remaining)," +
"add_product_month=VALUES(add_product_month);";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
foreach (var shop in shopMonthList)
{
shop.add_product_month = month;
shop.add_product_remaining = remainCount;
}
}
}
var data = JsonUtils.SerializeObjectToString(shopList);
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string SubSaGetSelectProdShop(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id");
var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name");
var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes");
var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
if (!string.IsNullOrWhiteSpace(shop_ids))
{
List<string> shopIdLst = shop_ids.Split(',').ToList();
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
}
var shop_names = RegexUtils.GetStringQuery(ref inputData, "shop_names");
if (!string.IsNullOrWhiteSpace(shop_names))
{
List<string> shopNameLst = shop_names.Split(',').ToList();
shop_names = "'" + string.Join("','", shopNameLst) + "'";
}
var shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes");
if (!string.IsNullOrWhiteSpace(shop_notes))
{
List<string> shopNotesLst = shop_notes.Split(',').ToList();
shop_notes = "'" + string.Join("','", shopNotesLst) + "'";
}
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
if (page_size == 0)
page_size = 50;
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT COUNT(s.id) FROM dyxd.shop s WHERE 1=1";
//where子句
string where = "";
if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
where += " and (s.shop_id in (SELECT DISTINCT shop_id From dyxd.product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "') or " +
"s.shop_id in (SELECT DISTINCT shop_id From dyxd.third_product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "'))";
where += " and (s.cookie='' or s.shop_id!='')";
//if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
// where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'";
if (!string.IsNullOrWhiteSpace(search_user_name))
where += " and s.user_name like '%" + search_user_name + "%'";
if (!string.IsNullOrWhiteSpace(search_login_name))
where += " and s.login_name like '%" + search_login_name + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and s.notes like '%" + search_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_id))
where += " and s.shop_id like '%" + search_id + "%'";
if (!string.IsNullOrWhiteSpace(search_name))
where += " and s.shop_account like '%" + search_name + "%'";
if (!string.IsNullOrWhiteSpace(shop_ids))
where += " and s.shop_id in (" + shop_ids + ")";
if (!string.IsNullOrWhiteSpace(shop_names))
where += " and s.shop_account in (" + shop_names + ")";
if (!string.IsNullOrWhiteSpace(shop_notes))
where += " and s.notes in (" + shop_notes + ")";
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," +
"s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," +
"s.add_sub_sa_time,s.operate_sub_sa_name";
sql += " FROM dyxd.shop s LEFT JOIN dyxd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
sql += where; // where 子句
sql += " ORDER BY s.id DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
List<ShopParam> shopList = new List<ShopParam>();
foreach (DataRow row in dt.Rows)
{
ShopParam shop = new ShopParam
{
id = Convert.ToInt32(row["id"]),
login_name = row["login_name"].ToString(),
login_pass = row["login_pass"].ToString(),
cookie = row["cookie"].ToString(),
cookie2 = row["cookie2"].ToString(),
anti_contents = row["anti_contents"].ToString(),
shop_id = row["shop_id"].ToString(),
shop_account = row["shop_account"].ToString(),
sub_user_name = row["sub_user_name"].ToString(),
user_name = row["user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
login_status = row["login_status"].ToString(),
login_status2 = row["login_status2"].ToString(),
add_product_remaining = row["add_product_remaining"].ParseToInt(),
add_product_month = row["add_product_month"].ParseToInt(),
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
};
shopList.Add(shop);
}
//sql = "\r\nINSERT INTO dyxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
//foreach (var shop in shopList)
//{
// sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),";
//}
//sql = sql.TrimEnd(',') + " \r\n";
//sql += "ON DUPLICATE KEY UPDATE " +
// "shop_account=VALUES(shop_account)," +
// "add_product_remaining=VALUES(add_product_remaining)," +
// "add_product_month=VALUES(add_product_month);";
//var result = mySql.ExecuteNonQuery(sql);
//mySql.Close();
int month = DateTime.Now.Month;
var shopMonthList = shopList.Where(s => s.add_product_month != month);
if (shopMonthList.Count() > 0)
{
int remainCount = 300;
var shopMonthIdList = shopMonthList.Select(s => s.id);
mySql = new MysqlUtils(conn);
string ids = string.Join(",", shopMonthIdList);
sql = "";
sql += "update dyxd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month +
" where 1=1 and id in (" + ids + ");";
sql += "\r\nINSERT INTO dyxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
foreach (var shop in shopMonthList)
{
sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),";
}
sql = sql.TrimEnd(',') + " \r\n";
sql += "ON DUPLICATE KEY UPDATE " +
"shop_account=VALUES(shop_account)," +
"add_product_remaining=VALUES(add_product_remaining)," +
"add_product_month=VALUES(add_product_month);";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
foreach (var shop in shopMonthList)
{
shop.add_product_month = month;
shop.add_product_remaining = remainCount;
}
}
}
var data = JsonUtils.SerializeObjectToString(shopList);
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string UpdateAddProdRemaining(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var remainCount = RegexUtils.GetStringQuery(ref inputData, "remain_count");
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
if (!string.IsNullOrWhiteSpace(shop_ids))
{
List<string> shopIdLst = shop_ids.Split(',').ToList();
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql += "update dyxd.shop_add_prod_count set add_product_remaining=" + remainCount +
" where 1=1 and shop_id in (" + shop_ids + ");";
var rst = mySql.ExecuteNonQuery(sql);
var msg = mySql.Message;
mySql.Close();
if (rst)
return "{\"code\":200,\"msg\":\"success\"}";
else
return "{\"code\":50000,\"msg\":\"" + msg + "\"}";
}
else
{
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
//获取一个手机登录号码下的所有店铺(以便有则更新,无则新增)
public string GetOneLoginNameShop(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select id,login_name,login_pass,cookie,cookie2,anti_contents,shop_id,shop_account,sub_user_name,user_name from dyxd.shop where user_name='"
+ user_name + "' and login_name='" + login_name + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<ShopParam> shopList = new List<ShopParam>();
foreach (DataRow row in dt.Rows)
{
ShopParam shop = new ShopParam
{
id = Convert.ToInt32(row["id"]),
login_name = row["login_name"].ToString(),
login_pass = row["login_pass"].ToString(),
cookie = row["cookie"].ToString(),
cookie2 = row["cookie2"].ToString(),
anti_contents = row["anti_contents"].ToString(),
shop_id = row["shop_id"].ToString(),
shop_account = row["shop_account"].ToString(),
sub_user_name = row["sub_user_name"].ToString(),
user_name = row["user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
login_status = row["login_status"].ToString(),
};
shopList.Add(shop);
}
var data = JsonUtils.SerializeObjectToString(shopList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
//获取一个手机登录号码下特定ID的店铺
public string GetOneIdShop(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select id,login_name,login_pass,cookie,cookie2,anti_contents,shop_id,shop_account,sub_user_name,user_name from dyxd.shop where user_name='"
+ user_name + "' and login_name='" + login_name + "' and shop_id='" + shop_id + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<ShopParam> shopList = new List<ShopParam>();
foreach (DataRow row in dt.Rows)
{
ShopParam shop = new ShopParam
{
id = Convert.ToInt32(row["id"]),
login_name = row["login_name"].ToString(),
login_pass = row["login_pass"].ToString(),
cookie = row["cookie"].ToString(),
cookie2 = row["cookie2"].ToString(),
anti_contents = row["anti_contents"].ToString(),
shop_id = row["shop_id"].ToString(),
shop_account = row["shop_account"].ToString(),
sub_user_name = row["sub_user_name"].ToString(),
user_name = row["user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
login_status = row["login_status"].ToString(),
};
shopList.Add(shop);
}
var data = JsonUtils.SerializeObjectToString(shopList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string AddShop(string inputData, bool isAdmin=false)
{
if (!string.IsNullOrEmpty(inputData))
{
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (isAdmin)
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name");
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass");
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(login_name))
{
return "{\"code\":501,\"msg\":\"没有店铺登录名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
if (string.IsNullOrEmpty(shop_id))
sql = "select exists (select 1 from dyxd.shop where login_name='" + login_name + "' and user_name='" + user_name + "')";
else
sql = "select exists (select 1 from dyxd.shop where login_name='" + login_name + "' and user_name='" + user_name +
"' and shop_id='" + shop_id + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist>0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"店铺" + login_name +" " + shop_account + "已存在\"}";
}
sql = "insert into dyxd.shop (login_name,login_pass,cookie,cookie2,anti_contents,shop_account,shop_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " +
"values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + anti_contents + "','" + shop_account + "','" + shop_id + "','" +
sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string MdyShop(string inputData, bool isAdmin=false)
{
if (!string.IsNullOrEmpty(inputData))
{
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (isAdmin)
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name");
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass");
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id");
string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status"));
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(login_name))
{
return "{\"code\":501,\"msg\":\"没有店铺登录名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update dyxd.shop set";
if (login_pass != null)
sql += " login_pass='" + login_pass + "',";
if (cookie != null)
sql += " cookie='" + cookie + "',";
if (cookie2 != null)
sql += " cookie2='" + cookie2 + "',";
if (anti_contents != null)
sql += " anti_contents='" + anti_contents + "',";
if (new_shop_id != null)
sql += " shop_id='" + new_shop_id + "',";
if (shop_account != null)
sql += " shop_account='" + shop_account + "',";
if (sub_user_name != null)
sql += " sub_user_name='" + sub_user_name + "',";
if (group_name != null)
sql += " group_name='" + group_name + "',";
if (notes != null)
sql += " notes='" + notes + "',";
if (login_status != null)
sql += " login_status='" + login_status + "',";
sql = sql.TrimEnd(',');
sql += " where login_name='" + login_name + "' and (user_name='" + user_name + "' or sub_user_name like '%" + user_name + "%')";
if (!string.IsNullOrEmpty(old_shop_id))
sql += " and shop_id='" + old_shop_id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string MdyCookieAndLoginStatus(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status"));
string login_status2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status2"));
string pddid = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pddid"));
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(login_name))
{
return "{\"code\":500,\"msg\":\"店铺没有登录名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update dyxd.shop set";
if (cookie != null)
sql += " cookie='" + cookie + "',";
if (cookie2 != null)
sql += " cookie2='" + cookie2 + "',";
if (login_status != null)
sql += " login_status='" + login_status + "',";
if (login_status2 != null)
sql += " login_status2='" + login_status2 + "',";
if (pddid != null)
sql += " pddid='" + pddid + "',";
sql = sql.TrimEnd(',');
sql += " where login_name='" + login_name + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string DelShop(string inputData, bool isAdmin=false)
{
if (!string.IsNullOrEmpty(inputData))
{
var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (isAdmin)
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name");
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(login_name))
{
return "{\"code\":501,\"msg\":\"没有店铺登录名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from dyxd.shop where user_name='" + user_name + "' and login_name='" + login_name + "'";
if (!string.IsNullOrEmpty(shop_id))
sql += " and shop_id='" + shop_id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
/// <summary>
/// 设置店铺的二级超管
/// </summary>
/// <returns></returns>
public string SetShopSubSa(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
}
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
var login_name = RegexUtils.GetStringQuery(ref inputData, "shop_login_name")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(login_name))
{
return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update dyxd.shop set";
if (operate_sub_sa_name != null)
sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.TrimEnd(',');
if (!string.IsNullOrEmpty(id))
sql += " where id in (" + id + ")";
else if (!string.IsNullOrEmpty(login_name))
sql += " where login_name in ('" + login_name.Replace(",", "','") + "')";
else
sql += " where 1=2";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -1,475 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web;
using System.Web.UI.WebControls;
namespace KJD_Web.BLL.DYXD
{
public class DYUserManage
{
public string CheckUserLogin(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
if (version < (System.Configuration.ConfigurationManager.ConnectionStrings["LimitVersion"]?.ConnectionString).ParseToInt())
return "{\"code\":1,\"msg\":\"当前版本过于陈旧,请立即升级新版\"}";
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from dyxd.user where user_name='"
+ mobile + "' and password='" + password + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["user_name"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
company_name = row["company_name"].ToString(),
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
};
if (string.IsNullOrEmpty(user.company_name))
{
user.company_name = "-";
}
var data = JsonUtils.SerializeObjectToString(user);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "company"))?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from dyxd.user where user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into dyxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\""+ mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"子账户创建成功!\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var group = RegexUtils.GetStringQuery(ref inputData, "group");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from dyxd.user where parent_user_name='"
+ user_name + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["mobile"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
};
if (string.IsNullOrEmpty(user.mobile))
{
user.mobile = row["user_name"].ToString();
}
userList.Add(user);
}
var data = JsonUtils.SerializeObjectToString(userList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//sql = "select * from dyxd.user where parent_user_name='"
// + user_name + "'";
sql = "update dyxd.user set";
if (!string.IsNullOrEmpty(nick_name))
sql += " nick_name='" + nick_name + "',";
if (!string.IsNullOrEmpty(user_name))
sql += " user_name='" + user_name + "',";
if (!string.IsNullOrEmpty(mobile))
sql += " mobile='" + mobile + "',";
if (!string.IsNullOrEmpty(password))
sql += " password='" + password + "',";
if (!string.IsNullOrEmpty(group_id))
sql += " group_id=" + group_id + ",";
if (!string.IsNullOrEmpty(card_id))
sql += " card_id='" + card_id + "',";
if (!string.IsNullOrEmpty(notes))
sql += " notes='" + notes + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var id = RegexUtils.GetStringQuery(ref inputData, "id");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from dyxd.user where id='"
+ id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败,请稍后重试\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetAllUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "select * from dyxd.user where group_id=3";
string sql = "select * from dyxd.user where 1=1";
if (!string.IsNullOrEmpty(group_id))
sql += " and group_id=" + group_id;
if (!string.IsNullOrEmpty(sa_level))
sql += " and sa_level=" + sa_level;
if (!string.IsNullOrEmpty(search))
sql += " and (user_name like '%" + search +
"%' or nick_name like '%" + search +
"%' or company_name like '%" + search + "%')";
sql += " order by id desc";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["mobile"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
};
if (string.IsNullOrEmpty(user.mobile))
{
user.mobile = row["user_name"].ToString();
}
userList.Add(user);
}
var data = JsonUtils.SerializeObjectToString(userList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); ;
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from dyxd.user where user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into dyxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//sql = "select * from dyxd.user where parent_user_name='"
// + user_name + "'";
sql = "update dyxd.user set";
if (!string.IsNullOrEmpty(nick_name))
sql += " nick_name='" + nick_name + "',";
if (!string.IsNullOrEmpty(user_name))
sql += " user_name='" + user_name + "',";
if (!string.IsNullOrEmpty(mobile))
sql += " mobile='" + mobile + "',";
if (!string.IsNullOrEmpty(company_name))
sql += " company_name='" + company_name + "',";
if (!string.IsNullOrEmpty(password))
sql += " password='" + password + "',";
if (!string.IsNullOrEmpty(group_id))
sql += " group_id=" + group_id + ",";
if (!string.IsNullOrEmpty(card_id))
sql += " card_id='" + card_id + "',";
if (!string.IsNullOrEmpty(notes))
sql += " notes='" + notes + "',";
if (!string.IsNullOrEmpty(sa_level))
sql += " sa_level=" + sa_level + ",";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string ChangePassword(string inputData)
{
var userName = RegexUtils.GetStringJson(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringJson(ref inputData, "password")?.Replace("'", "\\'");
var newPassword = RegexUtils.GetStringJson(ref inputData, "new_password")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select user_id,password from pepdtp.user where user_id='"
+ userName + "' and password='" + password + "'";
var dw = mySql.ExecuteDataTableRow(sql);
if (dw != null)
{
UserLoginResultParam user = new UserLoginResultParam
{
user_name = dw["user_id"].ToString(),
password = dw["password"].ToString(),
};
sql = "update pepdtp.user set password = '" + newPassword + "' where user_id='" + userName + "'";
var result = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (result)
{
return "{\"code\":0,\"msg\":\"密码修改成功!\"}";
}
else
return "{\"code\":19999,\"msg\":\"密码修改失败!请稍后再试。\"}";
}
else
{
mySql.Close();
return "{\"code\":1,\"msg\":\"原密码错误。\"}";
}
}
public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU=";
public string GetPackageSign(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'");
var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'");
var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'");
int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
string c2 = RegexUtils.GetStringQuery(ref inputData, "c2");
if (EncrypUtil.Encryption(r2) != c2)
return "{\"code\":2,\"msg\":\"不合法的输入内容\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from dyxd.user where user_name='"
+ mobile + "' and password='" + password + "'";
sql = "select * from dyxd.user where user_name='" + mobile + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt == null || dt.Rows.Count <=0)
{
return "{\"code\":1,\"msg\":\"用户不存在\"}";
}
string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower();
return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -1,668 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Security;
namespace KJD_Web.BLL
{
public class OrderManage
{
public List<string> year_mounth_lst = new List<string>() { "202510", "202511", "202512",
"202601", "202602", "202603", "202604", "202605", "202606", "202607", "202608", "202609", "202610", "202611", "202612",
"202701", "202702", "202703", "202704", "202705", "202706", "202707", "202708", "202709", "202710", "202711", "202712",
"202801", "202802", "202803", "202804", "202805", "202806", "202807", "202808", "202809", "202810", "202811", "202812",
"202901", "202902", "202903", "202904", "202905", "202906", "202907", "202908", "202909", "202910", "202911", "202912",
"203001", "203002", "203003", "203004", "203005", "203006", "203007", "203008", "203009", "203010", "203011", "203012",
"203101", "203102", "203103", "203104", "203105", "203106", "203107", "203108", "203109", "203110", "203111", "203112",
"203201", "203202", "203203", "203204", "203205", "203206", "203207", "203208", "203209", "203210", "203211", "203212",
"203301", "203302", "203303", "203304", "203305", "203306", "203307", "203308", "203309", "203310", "203311", "203312" };
public string AddOrder(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"请输入店铺\"}";
string order_data = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_data"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_data))
return "{\"code\":500,\"msg\":\"请输入订单参数\"}";
//string orderPurchaseTime = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_data"))?.Replace("'", "\\'");
//if (string.IsNullOrEmpty(order_data))
// return "{\"code\":500,\"msg\":\"请输入订单创建时间\"}";
JObject jObj = null;
try
{
jObj = JObject.Parse(order_data);
}
catch
{
return "{\"code\":500,\"msg\":\"数据格式错误\"}";
}
//long table_id = shop_id.ParseToLong() % 128;
string table_id = "999999";
try
{
table_id = TimeUtils.StampMillisecondsToDateTime(long.Parse(jObj["purchaseTime"].ToString())).ToString("yyyyMM");
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "insert into kjd_order.order_" + table_id + " (";
foreach (var item in jObj)
{
if (item.Key.ParseToString() != "id" && JsonConvert.SerializeObject(item.Value) != "null" &&
item.Key.ParseToString() != "add_time" && item.Key.ParseToString() != "mdy_time")
sql += item.Key + ",";
}
sql = sql.Trim(',');
sql += ")";
sql += "values (";
foreach (var item in jObj)
{
if (item.Key.ParseToString() != "id" && JsonConvert.SerializeObject(item.Value) != "null" &&
item.Key.ParseToString() != "add_time" && item.Key.ParseToString() != "mdy_time")
sql += "'" + item.Value.ParseToString().Replace("\\'", "'").Replace("'", "\\'") + "',";
}
sql = sql.Trim(',');
sql += ");";
var rst = mySql.ExecuteInsertId(sql);
mySql.Close();
if (rst > 0)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetOrderList(string inputData, bool isDetail = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
//if (string.IsNullOrEmpty(shop_id))
// return "{\"code\":500,\"msg\":\"请输入查询店铺\",\"data\":[],\"count\":" + 0 + "}";
var upload_order_status = RegexUtils.GetStringQuery(ref inputData, "upload_order_status")?.Replace("'", "\\'");
//var start_time = RegexUtils.GetStringQuery(ref inputData, "start_time")?.Replace("'", "\\'");
var start_time = TimeUtils.DateTimeToTimestampMilliseconds(DateTime.Now.Date.AddDays(-30));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string startTimeStr = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "startTime"))?.Replace("'", "\\'");
string endTimeStr = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "endTime"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(endTimeStr))
{
var datetime = DateTime.Now;
startTimeStr = datetime.AddMonths(-1).ToString("yyyyMM");
endTimeStr = datetime.ToString("yyyyMM");
}
var startIndex = year_mounth_lst.IndexOf(startTimeStr);
var endIndex = year_mounth_lst.IndexOf(endTimeStr);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
//long table_id = shop_id.ParseToLong() % 128;
//sql = "select count(id) from kjd_order.order_" + table_id + " o where 1=1";
string sql = "";
sql += " SELECT count(*) FROM ( ";
for (int i = startIndex; i<=endIndex; i++)
{
if (i > startIndex)
sql += " UNION ALL ";
sql += " SELECT id,purchaseTime,supplierId,upLoadStatus FROM kjd_order.order_" + year_mounth_lst[i];
}
sql += " ) AS o WHERE 1=1";
string where = "";
if (start_time > 0)
where += " and o.purchaseTime > " + start_time;
if (!string.IsNullOrWhiteSpace(shop_id))
where += " and o.supplierId = '" + shop_id + "'";
if (!string.IsNullOrEmpty(upload_order_status))
where += " and upLoadStatus >= " + upload_order_status;
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
//sql = "SELECT * FROM kjd_order.order_" + table_id + " o where 1=1"; // p.is_del=0
sql = " SELECT * FROM ( ";
for (int i = startIndex; i <= endIndex; i++)
{
if (i > startIndex)
sql += " UNION ALL ";
sql += " SELECT * FROM kjd_order.order_" + year_mounth_lst[i];
}
sql += " ) AS o WHERE 1=1";
//where子句
sql += where;
sql += " ORDER BY o.purchaseTime desc";
//sql += " ORDER BY o.select_total_count desc, p.id desc";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<TemuDBOrderInfo> orderLst = new List<TemuDBOrderInfo>();
foreach (DataRow row in dt.Rows)
{
TemuDBOrderInfo prod = new TemuDBOrderInfo
{
id = Convert.ToInt32(row["id"]),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
notes = row["notes"].ParseToString(),
availableSaleDays = row["availableSaleDays"].ParseToNullableDecimal(),
barCodeMd5 = row["barCodeMd5"].ParseToString(),
category = row["category"].ParseToString(),
className = row["className"].ParseToString(),
costPrice = row["costPrice"].ParseToNullableInt(),
currencyType = row["currencyType"].ParseToString(),
deliverQuantity = row["deliverQuantity"].ParseToInt(),
deliverTime = row["deliverTime"].ParseToNullableLong(),
deliveryFee = row["deliveryFee"].ParseToNullableInt(),
deliveryOrderSn = row["deliveryOrderSn"].ParseToString(),
expectLatestArrivalTimeOrDefault = row["expectLatestArrivalTimeOrDefault"].ParseToLong(),
expectLatestDeliverTimeOrDefault = row["expectLatestDeliverTimeOrDefault"].ParseToLong(),
extCode = row["extCode"].ParseToString(),
jiaTongCode = row["jiaTongCode"].ParseToString(),
markFee = row["markFee"].ParseToNullableInt(),
originalPurchaseOrderSn = row["originalPurchaseOrderSn"].ParseToString(),
productId = row["productId"].ParseToString(),
productName = row["productName"].ParseToString(),
productSkcPicture = row["productSkcPicture"].ParseToString(),
productSkcId = row["productSkcId"].ParseToString(),
productSkuId = row["productSkuId"].ParseToString(),
productSn = row["productSn"].ParseToString(),
purchaseQuantity = row["purchaseQuantity"].ParseToInt(),
purchaseTime = row["purchaseTime"].ParseToLong(),
qcResult = row["qcResult"].ParseToNullableInt(),
realReceiveAuthenticQuantity = row["realReceiveAuthenticQuantity"].ParseToInt(),
receiveTime = row["receiveTime"].ParseToNullableLong(),
receiveWarehouseId = row["receiveWarehouseId"].ParseToString(),
receiveWarehouseName = row["receiveWarehouseName"].ParseToString(),
shippingMarkMd5 = row["shippingMarkMd5"].ParseToString(),
status = row["status"].ParseToInt(),
subPurchaseOrderSn = row["subPurchaseOrderSn"].ParseToString(),
supplierId = row["supplierId"].ParseToString(),
supplierName = row["supplierName"].ParseToString(),
supplierPrice = row["supplierPrice"].ParseToInt(),
thumbUrlList = row["thumbUrlList"].ParseToString(),
upLoadStatus = row["upLoadStatus"].ParseToInt(),
upProductId = row["upProductId"].ParseToString(),
warehouseGroupId = row["warehouseGroupId"].ParseToString(),
};
orderLst.Add(prod);
}
var data = JsonUtils.SerializeObjectToString(orderLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateOrderStatus1(string inputData, bool isDetail = false)
{
//作废
//if (!string.IsNullOrEmpty(inputData))
//{
// var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
// string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
// if (time1 != EncrypUtil.Encryption(time))
// return "{\"code\":50000,\"msg\":\"校验失败\"}";
// var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
// var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
// var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
// if (string.IsNullOrEmpty(shop_id))
// return "{\"code\":500,\"msg\":\"请输入查询店铺\"}";
// var product_id = RegexUtils.GetStringQuery(ref inputData, "product_id")?.Replace("'", "\\'");
// if (string.IsNullOrEmpty(product_id))
// return "{\"code\":500,\"msg\":\"请输入商品编号\"}";
// int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
// int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
// string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
// MysqlUtils mySql = new MysqlUtils(conn);
// long table_id = shop_id.ParseToLong() % 128;
// string sql = "update kjd_order.order_" + table_id + " o set o.upLoadStatus=1";
// string where = "";
// where += " and o.supplierId = '" + shop_id + "'";
// where += " and o.productId = '" + product_id + "'";
// where += " and o.upLoadStatus < 1";
// sql += where;
// var rst = mySql.ExecuteNonQuery(sql);
// mySql.Close();
// if (rst)
// {
// return "{\"code\":200,\"msg\":\"success\"}";
// }
// else
// {
// return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
// }
//}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddOrderCodeFile(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"请输入店铺\"}";
string file_md5 = RegexUtils.GetStringQuery(ref inputData, "file_md5")?.Replace("'", "\\'");
string file_base64 = RegexUtils.GetStringQuery(ref inputData, "file_base64")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(file_md5) || string.IsNullOrEmpty(file_base64))
return "{\"code\":500,\"msg\":\"请输入文件信息\"}";
//long table_id = shop_id.ParseToLong() % 128;
string purchaseTime = RegexUtils.GetStringQuery(ref inputData, "purchaseTime")?.Replace("'", "\\'");
string table_id = "999999";
try
{
table_id = TimeUtils.StampMillisecondsToDateTime(long.Parse(purchaseTime)).ToString("yyyyMM");
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"请输入正确的时间:" + ex.Message + "\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select count(fileCodeMd5) from kjd_order.order_code_" + table_id + " where fileCodeMd5='" + file_md5 + "';";
var rowCount = mySql.ExecuteRowCount(sql);
if (!string.IsNullOrEmpty(mySql.Message))
{
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
else if (rowCount > 0)
{
mySql.Close();
return "{\"code\":200,\"msg\":\"success\"}";
}
sql = "insert into kjd_order.order_code_" + table_id + " (supplierId,fileCodeMd5,fileCodeBase64)";
sql += " values ('" + shop_id + "','" + file_md5 + "','" + file_base64 + "')";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string SaveOrderCodeFileLink(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"请输入店铺\"}";
var sub_order_sn = RegexUtils.GetStringQuery(ref inputData, "sub_order_sn")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(sub_order_sn))
return "{\"code\":500,\"msg\":\"请输入子单号\"}";
string jia_tong_code = RegexUtils.GetStringQuery(ref inputData, "jia_tong_code")?.Replace("'", "\\'"); // 佳同码
string bar_code_md5 = RegexUtils.GetStringQuery(ref inputData, "bar_code_md5")?.Replace("'", "\\'"); // 商品条码md5
string shipping_mark_md5 = RegexUtils.GetStringQuery(ref inputData, "shipping_mark_md5")?.Replace("'", "\\'"); // 箱唛md5
if (string.IsNullOrEmpty(jia_tong_code) && string.IsNullOrEmpty(bar_code_md5) && string.IsNullOrEmpty(shipping_mark_md5))
return "{\"code\":500,\"msg\":\"请输入文件信息\"}";
//long table_id = shop_id.ParseToLong() % 128;
string purchaseTime = RegexUtils.GetStringQuery(ref inputData, "purchaseTime")?.Replace("'", "\\'"); // 佳同码
string table_id = "999999";
try
{
table_id = TimeUtils.StampMillisecondsToDateTime(long.Parse(purchaseTime)).ToString("yyyyMM");
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"请输入正确的时间:" + ex.Message + "\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "update kjd_order.order_" + table_id;
sql += " set";
if (jia_tong_code != null)
sql += " jiaTongCode='" + jia_tong_code + "',";
if (bar_code_md5 != null)
sql += " barCodeMd5='" + bar_code_md5 + "',";
if (shipping_mark_md5 != null)
sql += " shippingMarkMd5='" + shipping_mark_md5 + "',";
sql = sql.TrimEnd(',');
sql += " where subPurchaseOrderSn='" + sub_order_sn + "';";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string getOrderCodeFile(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"请输入店铺\"}";
string file_md5 = RegexUtils.GetStringQuery(ref inputData, "file_md5")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(file_md5))
return "{\"code\":500,\"msg\":\"请输入文件信息\"}";
//long table_id = shop_id.ParseToLong() % 128;
string purchaseTime = RegexUtils.GetStringQuery(ref inputData, "purchaseTime")?.Replace("'", "\\'");
string table_id = "999999";
try
{
table_id = TimeUtils.StampMillisecondsToDateTime(long.Parse(purchaseTime)).ToString("yyyyMM");
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"请输入正确的时间:" + ex.Message + "\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select fileCodeMd5,fileCodeBase64 from kjd_order.order_code_" + table_id + " where fileCodeMd5='" + file_md5 + "';";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
else
{
string file_md5_rst = "";
string file_base64_rst = "";
if (dt.Rows.Count > 0)
{
file_md5_rst = dt.Rows[0]["fileCodeMd5"].ParseToString();
file_base64_rst = dt.Rows[0]["fileCodeBase64"].ParseToString();
}
return "{\"code\":200,\"msg\":\"success\",\"data\":\"{\"file_md5\":\"" + file_md5_rst + "\",\"file_base64\":\"" + file_base64_rst + "\"}\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UploadOrder(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"请输入店铺\"}";
string subPurchaseOrderSn = RegexUtils.GetStringQuery(ref inputData, "subPurchaseOrderSn")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(subPurchaseOrderSn))
return "{\"code\":500,\"msg\":\"请输入订单编号\"}";
string feeStr = RegexUtils.GetStringQuery(ref inputData, "fee")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(feeStr))
return "{\"code\":500,\"msg\":\"请输入费用\"}";
decimal fee = feeStr.ParseToDecimal();
//long table_id = shop_id.ParseToLong() % 128;
string purchaseTime = RegexUtils.GetStringQuery(ref inputData, "purchaseTime")?.Replace("'", "\\'");
string table_id = "999999";
try
{
table_id = TimeUtils.StampMillisecondsToDateTime(long.Parse(purchaseTime)).ToString("yyyyMM");
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"请输入正确的时间:" + ex.Message + "\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select authorized_amount from kjd.user where user_name='" + user_name + "'";
var value = mySql.ExecuteFirst(sql);
if (!string.IsNullOrEmpty(mySql.Message))
{
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
if (value.IsNullOrEmpty())
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户不存\"}";
}
if (value.ParseToDecimal() < fee)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"授权金不足\"}";
}
sql = "update kjd_order.order_" + table_id + " set upLoadStatus=2 where upLoadStatus < 2 and subPurchaseOrderSn in('" + subPurchaseOrderSn + "');";
var rst = mySql.ExecuteAffectedRows(sql);
if (!string.IsNullOrEmpty(mySql.Message))
{
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
if (rst == 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"订单不存在或已上传\"}";
}
sql = "update kjd.user set authorized_amount=authorized_amount-" + fee + " where user_name='" + user_name + "';";
rst = mySql.ExecuteAffectedRows(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
if(rst == 0)
{
return "{\"code\":500,\"msg\":\"订单已提交但扣费失败\"}";
}
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateOrderStatus(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"请输入店铺\"}";
string subPurchaseOrderSn = RegexUtils.GetStringQuery(ref inputData, "subPurchaseOrderSn")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(subPurchaseOrderSn))
return "{\"code\":500,\"msg\":\"请输入订单编号\"}";
string new_status = RegexUtils.GetStringQuery(ref inputData, "new_status")?.Replace("'", "\\'");
string old_status = RegexUtils.GetStringQuery(ref inputData, "old_status")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(new_status))
return "{\"code\":500,\"msg\":\"请输入订单状态\"}";
//long table_id = shop_id.ParseToLong() % 128;
string purchaseTime = RegexUtils.GetStringQuery(ref inputData, "purchaseTime")?.Replace("'", "\\'");
string table_id = "999999";
try
{
table_id = TimeUtils.StampMillisecondsToDateTime(long.Parse(purchaseTime)).ToString("yyyyMM");
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"请输入正确的时间:" + ex.Message + "\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "update kjd_order.order_" + table_id + " set upLoadStatus=" + new_status + " where 1=1";
if (!string.IsNullOrEmpty(old_status))
sql += " and upLoadStatus=" + old_status;
sql += " and subPurchaseOrderSn in('" + subPurchaseOrderSn + "');";
var rst = mySql.ExecuteAffectedRows(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
else
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -1,600 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
namespace KJD_Web.BLL
{
public class PriceManage
{
public string AddPrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
int original_price = RegexUtils.GetStringQuery(ref inputData, "original_price").ParseToInt();
int markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times").ParseToInt();
int extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price").ParseToInt();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(ext_code) from kjd.price_markup where ext_code=@ext_code";
string sql = "insert into kjd.price_markup " +
"(ext_code,original_price,markup_times,extra_price,notes) " +
"values (@ext_code,@original_price,@markup_times,@extra_price,@notes);";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetPriceList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
string start_original_price = RegexUtils.GetStringQuery(ref inputData, "start_original_price");
string end_original_price = RegexUtils.GetStringQuery(ref inputData, "end_original_price");
string start_markup_times = RegexUtils.GetStringQuery(ref inputData, "start_markup_times");
string end_markup_times = RegexUtils.GetStringQuery(ref inputData, "end_markup_times");
string start_extra_price = RegexUtils.GetStringQuery(ref inputData, "start_extra_price");
string end_extra_price = RegexUtils.GetStringQuery(ref inputData, "end_extra_price");
var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code"));
var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes"));
var in_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_ext_code"));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_original_price", Value = start_original_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_original_price", Value = end_original_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_markup_times", Value = start_markup_times.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_markup_times", Value = end_markup_times.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_extra_price", Value = start_extra_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_extra_price", Value = end_extra_price.ParseToInt(), });
//paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = "'" + in_ext_code?.Replace(",", "','") + "'", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = in_ext_code.ParseToString() });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from kjd.price_markup p where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like @search_ext_code";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and p.notes like @search_notes";
if (!string.IsNullOrWhiteSpace(start_original_price))
where += " and p.original_price >= @start_original_price";
if (!string.IsNullOrWhiteSpace(end_original_price))
where += " and p.original_price <= @end_original_price";
if (!string.IsNullOrWhiteSpace(start_markup_times))
where += " and p.markup_times >= @start_markup_times";
if (!string.IsNullOrWhiteSpace(end_markup_times))
where += " and p.markup_times <= @end_markup_times";
if (!string.IsNullOrWhiteSpace(start_extra_price))
where += " and p.extra_price >= @start_extra_price";
if (!string.IsNullOrWhiteSpace(end_extra_price))
where += " and p.extra_price <= @end_extra_price";
if (!string.IsNullOrEmpty(in_ext_code))
where += " and p.ext_code in ('" + in_ext_code?.Replace(",", "','") + "')";
sql += where;
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from kjd.price_markup p where 1=1";
//where子句
sql += where;
sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<DBPriceResultParam> priceList = new List<DBPriceResultParam>();
foreach (DataRow row in dt.Rows)
{
DBPriceResultParam price = new DBPriceResultParam
{
id = row["id"].ParseToInt(),
extra_price = row["extra_price"].ParseToInt(),
markup_times = row["markup_times"].ParseToInt(),
original_price = row["original_price"].ParseToInt(),
notes = row["notes"].ParseToString(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
};
priceList.Add(price);
}
var data = JsonUtils.SerializeObjectToString(priceList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelDbPrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from kjd.price_markup where id='" + id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyDBPrice(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"));
string original_price = RegexUtils.GetStringQuery(ref inputData, "original_price");
string markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times");
string extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@db_id", Value = db_id, });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(ext_code) from kjd.price_markup where ext_code=@ext_code and id!=@db_id";
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
string sql = "update kjd.price_markup set";
if (notes != null)
sql += " notes=@notes,";
if (ext_code != null)
sql += " ext_code=@ext_code,";
if (original_price != null)
sql += " original_price=@original_price,";
if (markup_times != null)
sql += " markup_times=@markup_times,";
if (extra_price != null)
sql += " extra_price=@extra_price,";
sql = sql.TrimEnd(',');
sql += " where id=@db_id;";
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddPurchasePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name");
string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id")).ParseToString();
string skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "skc_id")).ParseToString();
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString();
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(spu_id) from kjd.product_purchase_price where spu_id=@spu_id";
string sql = "insert into kjd.product_purchase_price " +
"(shop_id,shop_name,spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,discount,price_text,sku_purchase_price_json,notes) " +
"values (@shop_id,@shop_name,@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@discount,@price_text,@sku_purchase_price_json,@notes);";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyPurchasePrice(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name");
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString();
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@db_id", Value = db_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update kjd.product_purchase_price set";
if (shop_id != null)
sql += " shop_id=@shop_id,";
if (shop_name != null)
sql += " shop_name=@shop_name,";
if (cat_id != null)
sql += " cat_id=@cat_id,";
if (cat_name != null)
sql += " cat_name=@cat_name,";
if (ext_code != null)
sql += " ext_code=@ext_code,";
if (product_name != null)
sql += " product_name=@product_name,";
if (main_img != null)
sql += " main_img=@main_img,";
if (discount != null)
sql += " discount=@discount,";
if (price_text != null)
sql += " price_text=@price_text,";
if (sku_purchase_price_json != null)
sql += " sku_purchase_price_json=@sku_purchase_price_json,";
if (notes != null)
sql += " notes=@notes,";
sql = sql.TrimEnd(',');
sql += " where id=@db_id;";
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetPurchasePriceList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var search_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_spu_id"));
var search_skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_skc_id"));
var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code"));
var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes"));
var in_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_spu_id"));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_spu_id", Value = "%" + search_spu_id + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_skc_id", Value = "%" + search_skc_id + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_spu_id", Value = in_spu_id.ParseToString() });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from kjd.product_purchase_price p where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_spu_id))
where += " and p.spu_id like @search_spu_id";
if (!string.IsNullOrWhiteSpace(search_skc_id))
where += " and p.skc_id like @search_skc_id";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like @search_ext_code";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and p.notes like @search_notes";
if (!string.IsNullOrEmpty(in_spu_id))
where += " and p.spu_id in ('" + in_spu_id?.Replace(",", "','") + "')";
sql += where;
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from kjd.product_purchase_price p where 1=1";
//where子句
sql += where;
sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<ProductPurchasePriceResultParam> purchasePriceList = new List<ProductPurchasePriceResultParam>();
foreach (DataRow row in dt.Rows)
{
ProductPurchasePriceResultParam price = new ProductPurchasePriceResultParam
{
id = row["id"].ParseToInt(),
shop_id = row["shop_id"].ParseToString(),
shop_name = row["shop_name"].ParseToString(),
cat_id = row["cat_id"].ParseToString(),
cat_name = row["cat_name"].ParseToString(),
main_img = row["main_img"].ParseToString(),
discount = row["discount"].ParseToInt(),
price_text = row["price_text"].ParseToString(),
product_name = row["product_name"].ParseToString(),
skc_id = row["skc_id"].ParseToString(),
sku_purchase_price_json = row["sku_purchase_price_json"].ParseToString(),
spu_id = row["spu_id"].ParseToString(),
notes = row["notes"].ParseToString(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
};
purchasePriceList.Add(price);
}
var data = JsonUtils.SerializeObjectToString(purchasePriceList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelPurchasePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from kjd.product_purchase_price where id='" + id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,225 +0,0 @@
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.BLL
{
public class ToolManage
{
//mysql workbench 存储过程,可以使用分隔符重定义
// string 存储过程1 = @"
//DELIMITER $
//DROP PROCEDURE IF EXISTS add_spu_map;
//CREATE PROCEDURE add_spu_map()
//BEGIN
//insert into kjd_map.spu_map_0 (draft_id,from_spu_id,shop_id) values(9122600878,727585921,'3049342434562');
//update kjd.third_product_select set draft_id='9122600878', status='已上传', add_times=add_times+1, mdy_time='2025-08-06 11:54:50' where id=6532;
//END $
//DELIMITER ;
//CALL add_spu_map();";
//腾讯云服务器存储过程,不能使用分隔符重定义
// string 存储过程2 = @"
//DROP PROCEDURE IF EXISTS add_spu_map;
//CREATE PROCEDURE add_spu_map()
//BEGIN
//insert into kjd_map.spu_map_1 (draft_id,from_spu_id,shop_id) values(9122600878,727585921,'3049342434562');
//update kjd.third_product_select set draft_id='9122600878', status='已上传', add_times=add_times+1, mdy_time='2025-08-06 11:54:50' where id=6532;
//END ;
//CALL add_spu_map();";
public void CreateTable()
{
//string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
//MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "";
//for (int i = 0; i < 128; i++)
//{
// sql = @"drop table if exists bxx_relation.out_prod_relation_" + i.ParseToString().PadLeft(4, '0') + ";\r\n";
// sql += @"CREATE TABLE bxx_relation.out_prod_relation_" + i.ParseToString().PadLeft(4, '0') + @" (
// `id` int NOT NULL AUTO_INCREMENT,
// `up_spu_id` varchar(50) NOT NULL COMMENT '源商品id信息,此字段为分表依据',
// `up_goods_name` varchar(255) NOT NULL COMMENT '源商品标题',
// `from_site` varchar(10) NOT NULL COMMENT '商品来源平台如pdd,tb,1688,vd(微店)等',
// `goods_id` varchar(50) NOT NULL COMMENT '映射商品id信息',
// `shop_id` varchar(50) NOT NULL COMMENT '上传到的店铺id',
// `price_min` int NOT NULL COMMENT '最低价,单位分',
// `price_max` int NOT NULL COMMENT '最高价,单位分',
// `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
// PRIMARY KEY(`id`),
// KEY `index_add_time` (`add_time`) USING BTREE,
// KEY `index_up_spu_id` (`up_spu_id`) USING BTREE,
// KEY `index_shop_id` (`shop_id`) USING BTREE,
// KEY `index_price_min` (`price_min`) USING BTREE,
// KEY `index_price_max` (`price_max`) USING BTREE
// ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '记录拼多多关联数据信息'";
// var rst = mySql.ExecuteNonQuery(sql);
//}
//mySql.Close();
//string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
//MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "";
//for (int i = 0; i < 1024; i++)
//{
// sql = @"drop table if exists wxxd_product_up_map.product_up_map_" + i.ParseToString().PadLeft(4, '0') + ";\r\n";
// sql += @"
//CREATE TABLE wxxd_product_up_map.product_up_map_" + i.ParseToString().PadLeft(4, '0') + @" (
// `id` int NOT NULL AUTO_INCREMENT,
// `up_secret_spu_id` varchar(50) NOT NULL COMMENT '加密源商品id信息,此字段为分表依据,对应商品货号字段',
// `up_spu_id` varchar(50) NOT NULL COMMENT '源商品id信息',
// `shop_id` varchar(50) NOT NULL COMMENT '上传到的店铺id',
// `price_min` int NOT NULL COMMENT '最低价',
// `price_max` int NOT NULL COMMENT '最高价',
// `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
// PRIMARY KEY(`id`),
// KEY `index_add_time` (`add_time`) USING BTREE,
// KEY `index_up_secret_spu_id_shop_id` (`up_secret_spu_id`, `shop_id`) USING BTREE
//) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '记录微信商品上传到哪些店铺的信息'";
// var rst = mySql.ExecuteNonQuery(sql);
//}
//mySql.Close();
// string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
// MysqlUtils mySql = new MysqlUtils(conn);
// string sql = "";
// string sql1 = "";
// for (int i = 0; i < 64; i++)
// {
// //sql = @"drop table if exists kjd_map.spu_map_" + i + ";\r\n";
// sql = @"CREATE TABLE IF NOT EXISTS kjd_map.jit_product_select_map_" + i + @" (
// `id` int NOT NULL AUTO_INCREMENT,
// `product_id` bigint NOT NULL COMMENT '草稿箱/商品Id',
// `product_select_db_id` bigint NOT NULL COMMENT '选品上传数据库Id',
// `shop_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上传的店铺',
// PRIMARY KEY (`id`)
//) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '上传商品kjd库Id与商品DraftId映射关系';";
// sql += @"
//ALTER TABLE
// kjd_map.jit_product_select_map_" + i + @"
//ADD
// COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP";
// var rst = mySql.ExecuteNonQuery(sql);
// }
// mySql.Close();
// string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
// MysqlUtils mySql = new MysqlUtils(conn);
// string sql = "";
// for (int i = 0; i < 128; i++)
// {
// //sql = @"drop table if exists kjd_map.spu_map_" + i + ";\r\n";
// sql = @"CREATE TABLE IF NOT EXISTS kjd_order.order_code_" + i + @" (
// `id` int unsigned NOT NULL AUTO_INCREMENT,
// `supplierId` varchar(25) COLLATE utf8mb4_general_ci NOT NULL,
// `subPurchaseOrderSn` varchar(25) COLLATE utf8mb4_general_ci DEFAULT NULL,
// `jiaTongCode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
// `barCodeMd5` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL,
// `barCodeBase64` longtext COLLATE utf8mb4_general_ci,
// `shippingMark​Md5` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL,
// `shippingMarkBase64` longtext COLLATE utf8mb4_general_ci,
// `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
// `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
// PRIMARY KEY (`id`),
// UNIQUE KEY `index_subPurchaseOrderSn` (`subPurchaseOrderSn`) USING BTREE
//) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci";
// sql = "ALTER TABLE\r\n kjd_order.order_code_" + i + "\r\nMODIFY\r\n COLUMN `jiaTongCode` varchar (50) NULL COMMENT '佳同码'\r\nAFTER\r\n `subPurchaseOrderSn`";
// var rst = mySql.ExecuteNonQuery(sql);
// }
// mySql.Close();
//string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
//MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "";
// for (int i = 1; i <= 12; i++)
// {
// //sql = @"drop table if exists kjd_order.order_code_" + i + ";\r\n";
// sql = @"CREATE TABLE IF NOT EXISTS kjd_order.order_2026" + i.ToString("D2") + @" (
// `id` int NOT NULL AUTO_INCREMENT,
// `supplierId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店铺Id',
// `supplierName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店铺名称',
// `originalPurchaseOrderSn` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '备母货单号',
// `subPurchaseOrderSn` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '备货单号',
// `productName` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `productId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品编号',
// `upProductId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上家编号',
// `productSkcId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `productSkcPicture` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主图',
// `productSn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货号',
// `status` int NOT NULL COMMENT '状态 1待发货 2已送货 7已入库 8已作废',
// `productSkuId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `extCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'sku货号',
// `className` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'sku规格',
// `currencyType` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `supplierPrice` int NOT NULL COMMENT '申报价格',
// `costPrice` int DEFAULT NULL COMMENT '成本价',
// `deliveryFee` int DEFAULT NULL COMMENT '车队费',
// `markFee` int DEFAULT NULL COMMENT '贴标费',
// `purchaseQuantity` int NOT NULL COMMENT '备货件数',
// `deliverQuantity` int NOT NULL COMMENT '送货件数',
// `realReceiveAuthenticQuantity` int NOT NULL COMMENT '入库件数',
// `availableSaleDays` decimal(10, 0) DEFAULT NULL COMMENT '可售天数',
// `qcResult` int DEFAULT NULL COMMENT '抽检结果 1合格 2不合格',
// `thumbUrlList` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'sku图片',
// `purchaseTime` bigint NOT NULL COMMENT '备货单创建时间',
// `deliverTime` bigint DEFAULT NULL COMMENT '发货时间',
// `receiveTime` bigint DEFAULT NULL COMMENT '收货时间',
// `expectLatestDeliverTimeOrDefault` bigint NOT NULL COMMENT '最迟发货时间',
// `expectLatestArrivalTimeOrDefault` bigint NOT NULL COMMENT '最迟到货时间',
// `deliveryOrderSn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货单号',
// `receiveWarehouseId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '实际收货仓库Id',
// `receiveWarehouseName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '实际收货仓库',
// `warehouseGroupId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓组Id',
// `jiaTongCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '佳同码',
// `barCodeMd5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '商品条码MD5',
// `shippingMarkMd5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '箱唛文件MD5',
// `notes` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
// `upLoadStatus` int NOT NULL DEFAULT '0' COMMENT '是否上传订单(上传后扣除用户授权金额,产生扣费记录)',
// `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
// `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
// PRIMARY KEY (`id`),
// UNIQUE KEY `index_subPurchaseOrderSn` (`subPurchaseOrderSn`) USING BTREE
//) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单推送表'";
// //sql = @"drop table if exists kjd_order.order_code_" + i + ";\r\n";
// sql = @"CREATE TABLE IF NOT EXISTS kjd_order.order_code_2026" + i.ToString("D2") + @" (
// `id` int unsigned NOT NULL AUTO_INCREMENT,
// `supplierId` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `fileCodeMd5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `fileCodeBase64` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
// `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
// `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
// PRIMARY KEY (`id`),
// UNIQUE KEY `index_fileCodeMd5` (`fileCodeMd5`) USING BTREE
//) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nADD\r\n COLUMN `upLoadStatus` int NOT NULL DEFAULT 0 COMMENT '是否上传订单(上传后扣除用户授权金额,产生扣费记录)',\r\nMODIFY\r\n COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP\r\nAFTER\r\n `upLoadStatus`,\r\nMODIFY\r\n COLUMN `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\nAFTER\r\n `add_time`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nADD\r\n COLUMN `extCode` varchar (50) NOT NULL COMMENT 'sku货号',\r\nMODIFY\r\n COLUMN `className` varchar (100) NOT NULL COMMENT 'sku规格'\r\nAFTER\r\n `extCode`,\r\nMODIFY\r\n COLUMN `currencyType` varchar (10) NOT NULL\r\nAFTER\r\n `className`,\r\nMODIFY\r\n COLUMN `supplierPrice` int NOT NULL COMMENT '申报价格'\r\nAFTER\r\n `currencyType`,\r\nMODIFY\r\n COLUMN `purchaseQuantity` int NOT NULL COMMENT '备货件数'\r\nAFTER\r\n `supplierPrice`,\r\nMODIFY\r\n COLUMN `deliverQuantity` int NOT NULL COMMENT '送货件数'\r\nAFTER\r\n `purchaseQuantity`,\r\nMODIFY\r\n COLUMN `realReceiveAuthenticQuantity` int NOT NULL COMMENT '入库件数'\r\nAFTER\r\n `deliverQuantity`,\r\nMODIFY\r\n COLUMN `availableSaleDays` decimal (10, 0) NOT NULL COMMENT '可售天数'\r\nAFTER\r\n `realReceiveAuthenticQuantity`,\r\nMODIFY\r\n COLUMN `qcResult` int NULL COMMENT '抽检结果 1合格 2不合格'\r\nAFTER\r\n `availableSaleDays`,\r\nMODIFY\r\n COLUMN `thumbUrlList` varchar (500) NULL COMMENT 'sku图片'\r\nAFTER\r\n `qcResult`,\r\nMODIFY\r\n COLUMN `purchaseTime` bigint NOT NULL COMMENT '备货单创建时间'\r\nAFTER\r\n `thumbUrlList`,\r\nMODIFY\r\n COLUMN `deliverTime` bigint NULL COMMENT '发货时间'\r\nAFTER\r\n `purchaseTime`,\r\nMODIFY\r\n COLUMN `receiveTime` bigint NULL COMMENT '收货时间'\r\nAFTER\r\n `deliverTime`,\r\nMODIFY\r\n COLUMN `expectLatestDeliverTimeOrDefault` bigint NOT NULL COMMENT '最迟发货时间'\r\nAFTER\r\n `receiveTime`,\r\nMODIFY\r\n COLUMN `expectLatestArrivalTimeOrDefault` bigint NOT NULL COMMENT '最迟到货时间'\r\nAFTER\r\n `expectLatestDeliverTimeOrDefault`,\r\nMODIFY\r\n COLUMN `deliveryOrderSn` varchar (50) NULL COMMENT '发货单号'\r\nAFTER\r\n `expectLatestArrivalTimeOrDefault`,\r\nMODIFY\r\n COLUMN `receiveWarehouseId` varchar (25) NULL COMMENT '实际收货仓库Id'\r\nAFTER\r\n `deliveryOrderSn`,\r\nMODIFY\r\n COLUMN `receiveWarehouseName` varchar (50) NULL COMMENT '实际收货仓库'\r\nAFTER\r\n `receiveWarehouseId`,\r\nMODIFY\r\n COLUMN `warehouseGroupId` varchar (25) NULL COMMENT '仓组Id'\r\nAFTER\r\n `receiveWarehouseName`,\r\nMODIFY\r\n COLUMN `jiaTongCode` varchar (50) NULL COMMENT '佳同码'\r\nAFTER\r\n `warehouseGroupId`,\r\nMODIFY\r\n COLUMN `barCodeMd5` varchar (32) NULL COMMENT '商品条码MD5'\r\nAFTER\r\n `jiaTongCode`,\r\nMODIFY\r\n COLUMN `shippingMark​Md5` varchar (32) NULL COMMENT '箱唛文件MD5'\r\nAFTER\r\n `barCodeMd5`,\r\nMODIFY\r\n COLUMN `notes` varchar (50) NULL COMMENT '备注'\r\nAFTER\r\n `shippingMark​Md5`,\r\nMODIFY\r\n COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP\r\nAFTER\r\n `notes`,\r\nMODIFY\r\n COLUMN `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\nAFTER\r\n `add_time`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nMODIFY\r\n COLUMN `extCode` varchar (50) NOT NULL COMMENT 'sku货号'\r\nAFTER\r\n `productSkuId`,\r\nMODIFY\r\n COLUMN `className` varchar (100) NOT NULL COMMENT 'sku规格'\r\nAFTER\r\n `extCode`,\r\nMODIFY\r\n COLUMN `currencyType` varchar (10) NOT NULL\r\nAFTER\r\n `className`,\r\nMODIFY\r\n COLUMN `supplierPrice` int NOT NULL COMMENT '申报价格'\r\nAFTER\r\n `currencyType`,\r\nMODIFY\r\n COLUMN `purchaseQuantity` int NOT NULL COMMENT '备货件数'\r\nAFTER\r\n `supplierPrice`,\r\nMODIFY\r\n COLUMN `deliverQuantity` int NOT NULL COMMENT '送货件数'\r\nAFTER\r\n `purchaseQuantity`,\r\nMODIFY\r\n COLUMN `realReceiveAuthenticQuantity` int NOT NULL COMMENT '入库件数'\r\nAFTER\r\n `deliverQuantity`,\r\nMODIFY\r\n COLUMN `availableSaleDays` decimal (10, 0) NOT NULL COMMENT '可售天数'\r\nAFTER\r\n `realReceiveAuthenticQuantity`,\r\nMODIFY\r\n COLUMN `qcResult` int NULL COMMENT '抽检结果 1合格 2不合格'\r\nAFTER\r\n `availableSaleDays`,\r\nMODIFY\r\n COLUMN `thumbUrlList` varchar (500) NULL COMMENT 'sku图片'\r\nAFTER\r\n `qcResult`,\r\nMODIFY\r\n COLUMN `purchaseTime` bigint NOT NULL COMMENT '备货单创建时间'\r\nAFTER\r\n `thumbUrlList`,\r\nMODIFY\r\n COLUMN `deliverTime` bigint NULL COMMENT '发货时间'\r\nAFTER\r\n `purchaseTime`,\r\nMODIFY\r\n COLUMN `receiveTime` bigint NULL COMMENT '收货时间'\r\nAFTER\r\n `deliverTime`,\r\nMODIFY\r\n COLUMN `expectLatestDeliverTimeOrDefault` bigint NOT NULL COMMENT '最迟发货时间'\r\nAFTER\r\n `receiveTime`,\r\nMODIFY\r\n COLUMN `expectLatestArrivalTimeOrDefault` bigint NOT NULL COMMENT '最迟到货时间'\r\nAFTER\r\n `expectLatestDeliverTimeOrDefault`,\r\nMODIFY\r\n COLUMN `deliveryOrderSn` varchar (50) NULL COMMENT '发货单号'\r\nAFTER\r\n `expectLatestArrivalTimeOrDefault`,\r\nMODIFY\r\n COLUMN `receiveWarehouseId` varchar (25) NULL COMMENT '实际收货仓库Id'\r\nAFTER\r\n `deliveryOrderSn`,\r\nMODIFY\r\n COLUMN `receiveWarehouseName` varchar (50) NULL COMMENT '实际收货仓库'\r\nAFTER\r\n `receiveWarehouseId`,\r\nMODIFY\r\n COLUMN `warehouseGroupId` varchar (25) NULL COMMENT '仓组Id'\r\nAFTER\r\n `receiveWarehouseName`,\r\nMODIFY\r\n COLUMN `jiaTongCode` varchar (50) NULL COMMENT '佳同码'\r\nAFTER\r\n `warehouseGroupId`,\r\nMODIFY\r\n COLUMN `barCodeMd5` varchar (32) NULL COMMENT '商品条码MD5'\r\nAFTER\r\n `jiaTongCode`,\r\nMODIFY\r\n COLUMN `shippingMark​Md5` varchar (32) NULL COMMENT '箱唛文件MD5'\r\nAFTER\r\n `barCodeMd5`,\r\nMODIFY\r\n COLUMN `notes` varchar (50) NULL COMMENT '备注'\r\nAFTER\r\n `shippingMark​Md5`,\r\nMODIFY\r\n COLUMN `upLoadStatus` int NOT NULL DEFAULT '0' COMMENT '是否上传订单(上传后扣除用户授权金额,产生扣费记录)'\r\nAFTER\r\n `notes`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nADD\r\n COLUMN `costPrice` int NULL COMMENT '成本价',\r\nADD\r\n COLUMN `deliveryFee` int NULL COMMENT '车队费',\r\nADD\r\n COLUMN `markFee` int NULL COMMENT '贴标费',\r\nMODIFY\r\n COLUMN `purchaseQuantity` int NOT NULL COMMENT '备货件数'\r\nAFTER\r\n `markFee`,\r\nMODIFY\r\n COLUMN `deliverQuantity` int NOT NULL COMMENT '送货件数'\r\nAFTER\r\n `purchaseQuantity`,\r\nMODIFY\r\n COLUMN `realReceiveAuthenticQuantity` int NOT NULL COMMENT '入库件数'\r\nAFTER\r\n `deliverQuantity`,\r\nMODIFY\r\n COLUMN `availableSaleDays` decimal (10, 0) NOT NULL COMMENT '可售天数'\r\nAFTER\r\n `realReceiveAuthenticQuantity`,\r\nMODIFY\r\n COLUMN `qcResult` int NULL COMMENT '抽检结果 1合格 2不合格'\r\nAFTER\r\n `availableSaleDays`,\r\nMODIFY\r\n COLUMN `thumbUrlList` varchar (500) NULL COMMENT 'sku图片'\r\nAFTER\r\n `qcResult`,\r\nMODIFY\r\n COLUMN `purchaseTime` bigint NOT NULL COMMENT '备货单创建时间'\r\nAFTER\r\n `thumbUrlList`,\r\nMODIFY\r\n COLUMN `deliverTime` bigint NULL COMMENT '发货时间'\r\nAFTER\r\n `purchaseTime`,\r\nMODIFY\r\n COLUMN `receiveTime` bigint NULL COMMENT '收货时间'\r\nAFTER\r\n `deliverTime`,\r\nMODIFY\r\n COLUMN `expectLatestDeliverTimeOrDefault` bigint NOT NULL COMMENT '最迟发货时间'\r\nAFTER\r\n `receiveTime`,\r\nMODIFY\r\n COLUMN `expectLatestArrivalTimeOrDefault` bigint NOT NULL COMMENT '最迟到货时间'\r\nAFTER\r\n `expectLatestDeliverTimeOrDefault`,\r\nMODIFY\r\n COLUMN `deliveryOrderSn` varchar (50) NULL COMMENT '发货单号'\r\nAFTER\r\n `expectLatestArrivalTimeOrDefault`,\r\nMODIFY\r\n COLUMN `receiveWarehouseId` varchar (25) NULL COMMENT '实际收货仓库Id'\r\nAFTER\r\n `deliveryOrderSn`,\r\nMODIFY\r\n COLUMN `receiveWarehouseName` varchar (50) NULL COMMENT '实际收货仓库'\r\nAFTER\r\n `receiveWarehouseId`,\r\nMODIFY\r\n COLUMN `warehouseGroupId` varchar (25) NULL COMMENT '仓组Id'\r\nAFTER\r\n `receiveWarehouseName`,\r\nMODIFY\r\n COLUMN `jiaTongCode` varchar (50) NULL COMMENT '佳同码'\r\nAFTER\r\n `warehouseGroupId`,\r\nMODIFY\r\n COLUMN `barCodeMd5` varchar (32) NULL COMMENT '商品条码MD5'\r\nAFTER\r\n `jiaTongCode`,\r\nMODIFY\r\n COLUMN `shippingMark​Md5` varchar (32) NULL COMMENT '箱唛文件MD5'\r\nAFTER\r\n `barCodeMd5`,\r\nMODIFY\r\n COLUMN `notes` varchar (50) NULL COMMENT '备注'\r\nAFTER\r\n `shippingMark​Md5`,\r\nMODIFY\r\n COLUMN `upLoadStatus` int NOT NULL DEFAULT '0' COMMENT '是否上传订单(上传后扣除用户授权金额,产生扣费记录)'\r\nAFTER\r\n `notes`,\r\nMODIFY\r\n COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP\r\nAFTER\r\n `upLoadStatus`,\r\nMODIFY\r\n COLUMN `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\nAFTER\r\n `add_time`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nMODIFY\r\n COLUMN `originalPurchaseOrderSn` varchar (25) NOT NULL COMMENT '备母货单号'\r\nAFTER\r\n `supplierId`,\r\nMODIFY\r\n COLUMN `subPurchaseOrderSn` varchar (25) NOT NULL COMMENT '备货单号'\r\nAFTER\r\n `originalPurchaseOrderSn`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nMODIFY\r\n COLUMN `availableSaleDays` decimal (10, 0) NULL COMMENT '可售天数'\r\nAFTER\r\n `realReceiveAuthenticQuantity`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nADD\r\n COLUMN `upProductId` varchar (25) NOT NULL COMMENT '上家编号',\r\nMODIFY\r\n COLUMN `productSkcId` varchar (25) NOT NULL\r\nAFTER\r\n `upProductId`,\r\nMODIFY\r\n COLUMN `productSkcPicture` varchar (250) NOT NULL COMMENT '主图'\r\nAFTER\r\n `productSkcId`,\r\nMODIFY\r\n COLUMN `productSn` varchar (50) NULL COMMENT '货号'\r\nAFTER\r\n `productSkcPicture`,\r\nMODIFY\r\n COLUMN `status` int NOT NULL COMMENT '状态 1待发货 2已送货 7已入库 8已作废'\r\nAFTER\r\n `productSn`,\r\nMODIFY\r\n COLUMN `productSkuId` varchar (25) NOT NULL\r\nAFTER\r\n `status`,\r\nMODIFY\r\n COLUMN `extCode` varchar (50) NOT NULL COMMENT 'sku货号'\r\nAFTER\r\n `productSkuId`,\r\nMODIFY\r\n COLUMN `className` varchar (100) NOT NULL COMMENT 'sku规格'\r\nAFTER\r\n `extCode`,\r\nMODIFY\r\n COLUMN `currencyType` varchar (10) NOT NULL\r\nAFTER\r\n `className`,\r\nMODIFY\r\n COLUMN `supplierPrice` int NOT NULL COMMENT '申报价格'\r\nAFTER\r\n `currencyType`,\r\nMODIFY\r\n COLUMN `costPrice` int NULL COMMENT '成本价'\r\nAFTER\r\n `supplierPrice`,\r\nMODIFY\r\n COLUMN `deliveryFee` int NULL COMMENT '车队费'\r\nAFTER\r\n `costPrice`,\r\nMODIFY\r\n COLUMN `markFee` int NULL COMMENT '贴标费'\r\nAFTER\r\n `deliveryFee`,\r\nMODIFY\r\n COLUMN `purchaseQuantity` int NOT NULL COMMENT '备货件数'\r\nAFTER\r\n `markFee`,\r\nMODIFY\r\n COLUMN `deliverQuantity` int NOT NULL COMMENT '送货件数'\r\nAFTER\r\n `purchaseQuantity`,\r\nMODIFY\r\n COLUMN `realReceiveAuthenticQuantity` int NOT NULL COMMENT '入库件数'\r\nAFTER\r\n `deliverQuantity`,\r\nMODIFY\r\n COLUMN `availableSaleDays` decimal (10, 0) NULL COMMENT '可售天数'\r\nAFTER\r\n `realReceiveAuthenticQuantity`,\r\nMODIFY\r\n COLUMN `qcResult` int NULL COMMENT '抽检结果 1合格 2不合格'\r\nAFTER\r\n `availableSaleDays`,\r\nMODIFY\r\n COLUMN `thumbUrlList` varchar (500) NULL COMMENT 'sku图片'\r\nAFTER\r\n `qcResult`,\r\nMODIFY\r\n COLUMN `purchaseTime` bigint NOT NULL COMMENT '备货单创建时间'\r\nAFTER\r\n `thumbUrlList`,\r\nMODIFY\r\n COLUMN `deliverTime` bigint NULL COMMENT '发货时间'\r\nAFTER\r\n `purchaseTime`,\r\nMODIFY\r\n COLUMN `receiveTime` bigint NULL COMMENT '收货时间'\r\nAFTER\r\n `deliverTime`,\r\nMODIFY\r\n COLUMN `expectLatestDeliverTimeOrDefault` bigint NOT NULL COMMENT '最迟发货时间'\r\nAFTER\r\n `receiveTime`,\r\nMODIFY\r\n COLUMN `expectLatestArrivalTimeOrDefault` bigint NOT NULL COMMENT '最迟到货时间'\r\nAFTER\r\n `expectLatestDeliverTimeOrDefault`,\r\nMODIFY\r\n COLUMN `deliveryOrderSn` varchar (50) NULL COMMENT '发货单号'\r\nAFTER\r\n `expectLatestArrivalTimeOrDefault`,\r\nMODIFY\r\n COLUMN `receiveWarehouseId` varchar (25) NULL COMMENT '实际收货仓库Id'\r\nAFTER\r\n `deliveryOrderSn`,\r\nMODIFY\r\n COLUMN `receiveWarehouseName` varchar (50) NULL COMMENT '实际收货仓库'\r\nAFTER\r\n `receiveWarehouseId`,\r\nMODIFY\r\n COLUMN `warehouseGroupId` varchar (25) NULL COMMENT '仓组Id'\r\nAFTER\r\n `receiveWarehouseName`,\r\nMODIFY\r\n COLUMN `jiaTongCode` varchar (50) NULL COMMENT '佳同码'\r\nAFTER\r\n `warehouseGroupId`,\r\nMODIFY\r\n COLUMN `barCodeMd5` varchar (32) NULL COMMENT '商品条码MD5'\r\nAFTER\r\n `jiaTongCode`,\r\nMODIFY\r\n COLUMN `shippingMark​Md5` varchar (32) NULL COMMENT '箱唛文件MD5'\r\nAFTER\r\n `barCodeMd5`,\r\nMODIFY\r\n COLUMN `notes` varchar (50) NULL COMMENT '备注'\r\nAFTER\r\n `shippingMark​Md5`,\r\nMODIFY\r\n COLUMN `upLoadStatus` int NOT NULL DEFAULT '0' COMMENT '是否上传订单(上传后扣除用户授权金额,产生扣费记录)'\r\nAFTER\r\n `notes`,\r\nMODIFY\r\n COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP\r\nAFTER\r\n `upLoadStatus`,\r\nMODIFY\r\n COLUMN `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\nAFTER\r\n `add_time`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nMODIFY\r\n COLUMN `upProductId` varchar (25) NULL COMMENT '上家编号'\r\nAFTER\r\n `productId`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + "\r\nADD\r\n COLUMN `supplierName` varchar (50) NOT NULL COMMENT '店铺名称',\r\nMODIFY\r\n COLUMN `originalPurchaseOrderSn` varchar (25) NOT NULL COMMENT '备母货单号'\r\nAFTER\r\n `supplierName`,\r\nMODIFY\r\n COLUMN `subPurchaseOrderSn` varchar (25) NOT NULL COMMENT '备货单号'\r\nAFTER\r\n `originalPurchaseOrderSn`,\r\nMODIFY\r\n COLUMN `productName` varchar (1000) NOT NULL\r\nAFTER\r\n `subPurchaseOrderSn`,\r\nMODIFY\r\n COLUMN `category` varchar (50) NOT NULL\r\nAFTER\r\n `productName`,\r\nMODIFY\r\n COLUMN `productId` varchar (25) NOT NULL COMMENT '商品编号'\r\nAFTER\r\n `category`,\r\nMODIFY\r\n COLUMN `upProductId` varchar (25) NULL COMMENT '上家编号'\r\nAFTER\r\n `productId`,\r\nMODIFY\r\n COLUMN `productSkcId` varchar (25) NOT NULL\r\nAFTER\r\n `upProductId`,\r\nMODIFY\r\n COLUMN `productSkcPicture` varchar (250) NOT NULL COMMENT '主图'\r\nAFTER\r\n `productSkcId`,\r\nMODIFY\r\n COLUMN `productSn` varchar (50) NULL COMMENT '货号'\r\nAFTER\r\n `productSkcPicture`,\r\nMODIFY\r\n COLUMN `status` int NOT NULL COMMENT '状态 1待发货 2已送货 7已入库 8已作废'\r\nAFTER\r\n `productSn`,\r\nMODIFY\r\n COLUMN `productSkuId` varchar (25) NOT NULL\r\nAFTER\r\n `status`,\r\nMODIFY\r\n COLUMN `extCode` varchar (50) NOT NULL COMMENT 'sku货号'\r\nAFTER\r\n `productSkuId`,\r\nMODIFY\r\n COLUMN `className` varchar (100) NOT NULL COMMENT 'sku规格'\r\nAFTER\r\n `extCode`,\r\nMODIFY\r\n COLUMN `currencyType` varchar (10) NOT NULL\r\nAFTER\r\n `className`,\r\nMODIFY\r\n COLUMN `supplierPrice` int NOT NULL COMMENT '申报价格'\r\nAFTER\r\n `currencyType`,\r\nMODIFY\r\n COLUMN `costPrice` int NULL COMMENT '成本价'\r\nAFTER\r\n `supplierPrice`,\r\nMODIFY\r\n COLUMN `deliveryFee` int NULL COMMENT '车队费'\r\nAFTER\r\n `costPrice`,\r\nMODIFY\r\n COLUMN `markFee` int NULL COMMENT '贴标费'\r\nAFTER\r\n `deliveryFee`,\r\nMODIFY\r\n COLUMN `purchaseQuantity` int NOT NULL COMMENT '备货件数'\r\nAFTER\r\n `markFee`,\r\nMODIFY\r\n COLUMN `deliverQuantity` int NOT NULL COMMENT '送货件数'\r\nAFTER\r\n `purchaseQuantity`,\r\nMODIFY\r\n COLUMN `realReceiveAuthenticQuantity` int NOT NULL COMMENT '入库件数'\r\nAFTER\r\n `deliverQuantity`,\r\nMODIFY\r\n COLUMN `availableSaleDays` decimal (10, 0) NULL COMMENT '可售天数'\r\nAFTER\r\n `realReceiveAuthenticQuantity`,\r\nMODIFY\r\n COLUMN `qcResult` int NULL COMMENT '抽检结果 1合格 2不合格'\r\nAFTER\r\n `availableSaleDays`,\r\nMODIFY\r\n COLUMN `thumbUrlList` varchar (500) NULL COMMENT 'sku图片'\r\nAFTER\r\n `qcResult`,\r\nMODIFY\r\n COLUMN `purchaseTime` bigint NOT NULL COMMENT '备货单创建时间'\r\nAFTER\r\n `thumbUrlList`,\r\nMODIFY\r\n COLUMN `deliverTime` bigint NULL COMMENT '发货时间'\r\nAFTER\r\n `purchaseTime`,\r\nMODIFY\r\n COLUMN `receiveTime` bigint NULL COMMENT '收货时间'\r\nAFTER\r\n `deliverTime`,\r\nMODIFY\r\n COLUMN `expectLatestDeliverTimeOrDefault` bigint NOT NULL COMMENT '最迟发货时间'\r\nAFTER\r\n `receiveTime`,\r\nMODIFY\r\n COLUMN `expectLatestArrivalTimeOrDefault` bigint NOT NULL COMMENT '最迟到货时间'\r\nAFTER\r\n `expectLatestDeliverTimeOrDefault`,\r\nMODIFY\r\n COLUMN `deliveryOrderSn` varchar (50) NULL COMMENT '发货单号'\r\nAFTER\r\n `expectLatestArrivalTimeOrDefault`,\r\nMODIFY\r\n COLUMN `receiveWarehouseId` varchar (25) NULL COMMENT '实际收货仓库Id'\r\nAFTER\r\n `deliveryOrderSn`,\r\nMODIFY\r\n COLUMN `receiveWarehouseName` varchar (50) NULL COMMENT '实际收货仓库'\r\nAFTER\r\n `receiveWarehouseId`,\r\nMODIFY\r\n COLUMN `warehouseGroupId` varchar (25) NULL COMMENT '仓组Id'\r\nAFTER\r\n `receiveWarehouseName`,\r\nMODIFY\r\n COLUMN `jiaTongCode` varchar (50) NULL COMMENT '佳同码'\r\nAFTER\r\n `warehouseGroupId`,\r\nMODIFY\r\n COLUMN `barCodeMd5` varchar (32) NULL COMMENT '商品条码MD5'\r\nAFTER\r\n `jiaTongCode`,\r\nMODIFY\r\n COLUMN `shippingMark​Md5` varchar (32) NULL COMMENT '箱唛文件MD5'\r\nAFTER\r\n `barCodeMd5`,\r\nMODIFY\r\n COLUMN `notes` varchar (50) NULL COMMENT '备注'\r\nAFTER\r\n `shippingMark​Md5`,\r\nMODIFY\r\n COLUMN `upLoadStatus` int NOT NULL DEFAULT '0' COMMENT '是否上传订单(上传后扣除用户授权金额,产生扣费记录)'\r\nAFTER\r\n `notes`,\r\nMODIFY\r\n COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP\r\nAFTER\r\n `upLoadStatus`,\r\nMODIFY\r\n COLUMN `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\nAFTER\r\n `add_time`";
// // sql = "ALTER TABLE\r\n kjd_order.order_" + i + " CHANGE COLUMN `shippingMark​Md5` `shippingMarkMd5` varchar (32) NULL COMMENT '箱唛文件MD5'";
// // sql = "ALTER TABLE\r\n kjd_order.order_code_" + i + " DROP COLUMN `subPurchaseOrderSn`,\r\n DROP COLUMN `jiaTongCode`,\r\n DROP COLUMN `shippingMark​Md5`,\r\n DROP COLUMN `shippingMarkBase64`,\r\n CHANGE COLUMN `barCodeMd5` `fileCodeMd5` varchar (32) NOT NULL,\r\n CHANGE COLUMN `barCodeBase64` `fileCodeBase64` longtext NOT NULL,\r\nMODIFY\r\n COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP\r\nAFTER\r\n `fileCodeBase64`,\r\nMODIFY\r\n COLUMN `mdy_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\nAFTER\r\n `add_time`,\r\n DROP INDEX `index_subPurchaseOrderSn`,\r\nADD\r\n UNIQUE `index_fileCodeMd5` USING btree (`fileCodeMd5`)";
// var rst = mySql.ExecuteNonQuery(sql);
//}
//mySql.Close();
}
}
}
@@ -1,223 +0,0 @@
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
namespace KJD_Web.BLL
{
public class UpdateManage
{
public string GetUpdate(string inputData)
{
//string time1 = Encryption(time);
//return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString;
var UpdateFiles = ""; //System.Configuration.ConfigurationManager.ConnectionStrings["UpdateFiles"].ConnectionString;
var UpdateExe = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExe"].ConnectionString;
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString;
serverVersion = "1115";
UpdateFiles = "http://weidian.e57.cn/kjd_update/Update1115.zip";
if (version > LowVersion.ParseToInt())
{
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateFiles + "\"}";
}
else if (version > 0)
{
return "{\"code\":501,\"msg\":\"版本过低已无法直接升级,请联系管理员获取最新安装包\"}";
}
else
{
return "{\"code\":502,\"msg\":\"get update version failed\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string GetUpdateNew(string inputData)
{
//string time1 = Encryption(time);
//return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var path = RegexUtils.GetStringQuery(ref inputData, "path");
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString;
var UpdateNewUrl = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateNewUrl"].ConnectionString;
var UpdateExe = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExe"].ConnectionString;
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString;
int MaxVersion = 999999;
if (version <= 1200)
MaxVersion = 1200;
if (version <= 1159)
MaxVersion = 1159;
if (version > LowVersion.ParseToInt())
{
if (path != null)
{
try
{
var fileDir = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateFileDir"].ConnectionString;
if (path == "29wx")
{
var file = Directory.GetFiles(fileDir);
var versionTmp = 0;
foreach (var f in file)
{
var v = Path.GetFileName(f).Replace("Update29wx", "").Replace(".zip", "").ParseToInt();
if (v > versionTmp && v <= serverVersion.ParseToInt() && v <= MaxVersion)
{
versionTmp = v;
}
}
if (versionTmp > 0)
{
serverVersion = versionTmp.ToString();
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
}
}
if (path == "29pdd")
{
var file = Directory.GetFiles(fileDir);
var versionTmp = 0;
foreach (var f in file)
{
var v = Path.GetFileName(f).Replace("Update29pdd", "").Replace(".zip", "").ParseToInt();
if (v > versionTmp && v <= serverVersion.ParseToInt() && v <= MaxVersion)
{
versionTmp = v;
}
}
if (versionTmp > 0)
{
serverVersion = versionTmp.ToString();
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
}
}
}
catch (Exception ex)
{
//return "{\"code\":500,\"msg\":\"升级文件查询失败\"}";
}
}
if (serverVersion.ParseToInt() > MaxVersion)
serverVersion = MaxVersion.ParseToString();
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
}
else if (version > 0)
{
return "{\"code\":501,\"msg\":\"版本过低已无法直接升级,请联系管理员获取最新安装包\"}";
}
else
{
return "{\"code\":502,\"msg\":\"get update version failed\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string GetWxFindOrderUpdate(string inputData)
{
//string time1 = Encryption(time);
//return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var path = RegexUtils.GetStringQuery(ref inputData, "path");
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString;
var UpdateFileNewUrl = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateWxFindOrderUrl"].ConnectionString;
var UpdateExe = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExe"].ConnectionString;
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["WxFindOrderLowVersion"].ConnectionString;
if (version > LowVersion.ParseToInt())
{
//if (path != null)
{
try
{
var fileDir = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateWxFindOrderFileDir"].ConnectionString;
//if (path == "29wx")
{
var file = Directory.GetFiles(fileDir);
var versionTmp = 0;
foreach (var f in file)
{
var v = Path.GetFileName(f).Replace("WxFindOrderUpdate", "").Replace(".zip", "").ParseToInt();
if (v > versionTmp && v <= serverVersion.ParseToInt())
{
versionTmp = v;
}
}
if (versionTmp > 0)
{
serverVersion = versionTmp.ToString();
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateFileNewUrl + "WxFindOrderUpdate" + serverVersion + ".zip\"}";
}
}
}
catch (Exception ex)
{
//return "{\"code\":500,\"msg\":\"升级文件查询失败\"}";
}
}
if (serverVersion.ParseToInt() > 1159)
serverVersion = 1159.ToString();
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateFileNewUrl + "WxFindOrderUpdate" + serverVersion + ".zip\"}";
}
else if (version > 0)
{
return "{\"code\":501,\"msg\":\"版本过低已无法直接升级,请联系管理员获取最新安装包\"}";
}
else
{
return "{\"code\":502,\"msg\":\"get update version failed\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
}
}
@@ -1,549 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web;
using System.Web.UI.WebControls;
namespace KJD_Web.BLL
{
public class UserManage
{
public string CheckUserLogin(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from kjd.user where user_name='"
+ mobile + "' and password='" + password + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["user_name"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
company_name = row["company_name"].ToString(),
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
authorized_amount = row.Table.Columns.Contains("authorized_amount") ? row["authorized_amount"].ParseToInt() : 0,
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
forbidden_page = row.Table.Columns.Contains("forbidden_page") ? row["forbidden_page"].ParseToString() : "",
};
if (string.IsNullOrEmpty(user.company_name))
{
user.company_name = "-";
}
var data = JsonUtils.SerializeObjectToString(user);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "company"))?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from kjd.user where user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into kjd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,authority,forbidden_page,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" + authority + "','" + forbidden_page + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\""+ mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"子账户创建成功!\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var group = RegexUtils.GetStringQuery(ref inputData, "group");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from kjd.user where parent_user_name='"
+ user_name + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["mobile"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
forbidden_page = row.Table.Columns.Contains("forbidden_page") ? row["forbidden_page"].ParseToString() : "",
};
if (string.IsNullOrEmpty(user.mobile))
{
user.mobile = row["user_name"].ToString();
}
userList.Add(user);
}
var data = JsonUtils.SerializeObjectToString(userList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateSubUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//sql = "select * from kjd.user where parent_user_name='"
// + user_name + "'";
sql = "update kjd.user set";
if (!string.IsNullOrEmpty(nick_name))
sql += " nick_name='" + nick_name + "',";
if (!string.IsNullOrEmpty(user_name))
sql += " user_name='" + user_name + "',";
if (!string.IsNullOrEmpty(mobile))
sql += " mobile='" + mobile + "',";
if (!string.IsNullOrEmpty(password))
sql += " password='" + password + "',";
if (!string.IsNullOrEmpty(group_id))
sql += " group_id=" + group_id + ",";
if (!string.IsNullOrEmpty(card_id))
sql += " card_id='" + card_id + "',";
if (!string.IsNullOrEmpty(notes))
sql += " notes='" + notes + "',";
if (!string.IsNullOrEmpty(authority))
sql += " authority='" + authority + "',";
if (!string.IsNullOrEmpty(forbidden_page))
sql += " forbidden_page='" + forbidden_page + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var id = RegexUtils.GetStringQuery(ref inputData, "id");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from kjd.user where id='"
+ id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败,请稍后重试\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetAllUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var user_name_in = RegexUtils.GetStringQuery(ref inputData, "user_name_in")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "select * from kjd.user where group_id=3";
string sql = "select * from kjd.user where 1=1";
if (!string.IsNullOrEmpty(group_id))
sql += " and group_id=" + group_id;
if (!string.IsNullOrEmpty(sa_level))
sql += " and sa_level=" + sa_level;
if (!string.IsNullOrEmpty(user_name_in))
sql += " AND user_name IN(" + user_name_in + ")";
if (!string.IsNullOrEmpty(search))
sql += " and (user_name like '%" + search +
"%' or nick_name like '%" + search +
"%' or company_name like '%" + search + "%')";
sql += " order by id desc";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
foreach (DataRow row in dt.Rows)
{
UserLoginResultParam user = new UserLoginResultParam
{
id = Convert.ToInt32(row["id"]),
user_name = row["user_name"].ToString(),
nick_name = row["nick_name"].ToString(),
mobile = row["mobile"].ToString(),
password = row["password"].ToString(),
group_id = row["group_id"].ToString(),
card_id = row["card_id"].ToString(),
parent_user_name = row["parent_user_name"].ToString(),
company_name = row["company_name"].ToString(),
notes = row["notes"].ToString(),
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
authorized_amount = row.Table.Columns.Contains("authorized_amount") ? row["authorized_amount"].ParseToInt() : 0,
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
forbidden_page = row.Table.Columns.Contains("forbidden_page") ? row["forbidden_page"].ParseToString() : "",
};
if (string.IsNullOrEmpty(user.mobile))
{
user.mobile = row["user_name"].ToString();
}
userList.Add(user);
}
var data = JsonUtils.SerializeObjectToString(userList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); ;
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var authorized_amount = RegexUtils.GetStringQuery(ref inputData, "authorized_amount")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from kjd.user where user_name='" + user_name + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into kjd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level," +
"authorized_amount,authority,forbidden_page,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "'," + sa_level + "," + authorized_amount + ",'" + authority + "','" + forbidden_page + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateUser(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var authorized_amount = RegexUtils.GetStringQuery(ref inputData, "authorized_amount")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
var forbidden_page = RegexUtils.GetStringQuery(ref inputData, "forbidden_page")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//sql = "select * from kjd.user where parent_user_name='"
// + user_name + "'";
sql = "update kjd.user set";
if (!string.IsNullOrEmpty(nick_name))
sql += " nick_name='" + nick_name + "',";
if (!string.IsNullOrEmpty(user_name))
sql += " user_name='" + user_name + "',";
if (!string.IsNullOrEmpty(mobile))
sql += " mobile='" + mobile + "',";
if (!string.IsNullOrEmpty(company_name))
sql += " company_name='" + company_name + "',";
if (!string.IsNullOrEmpty(password))
sql += " password='" + password + "',";
if (!string.IsNullOrEmpty(group_id))
sql += " group_id=" + group_id + ",";
if (!string.IsNullOrEmpty(card_id))
sql += " card_id='" + card_id + "',";
if (!string.IsNullOrEmpty(notes))
sql += " notes='" + notes + "',";
if (!string.IsNullOrEmpty(sa_level))
sql += " sa_level=" + sa_level + ",";
if (!string.IsNullOrEmpty(authorized_amount))
sql += " authorized_amount=" + authorized_amount + ",";
if (authority != null)
sql += " authority='" + authority + "',";
if (forbidden_page != null)
sql += " forbidden_page='" + forbidden_page + "',";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string ChangePassword(string inputData)
{
var userName = RegexUtils.GetStringJson(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringJson(ref inputData, "password")?.Replace("'", "\\'");
var newPassword = RegexUtils.GetStringJson(ref inputData, "new_password")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select user_id,password from pepdtp.user where user_id='"
+ userName + "' and password='" + password + "'";
var dw = mySql.ExecuteDataTableRow(sql);
if (dw != null)
{
UserLoginResultParam user = new UserLoginResultParam
{
user_name = dw["user_id"].ToString(),
password = dw["password"].ToString(),
};
sql = "update pepdtp.user set password = '" + newPassword + "' where user_id='" + userName + "'";
var result = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (result)
{
return "{\"code\":0,\"msg\":\"密码修改成功!\"}";
}
else
return "{\"code\":19999,\"msg\":\"密码修改失败!请稍后再试。\"}";
}
else
{
mySql.Close();
return "{\"code\":1,\"msg\":\"原密码错误。\"}";
}
}
public string GetUserAmount(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"请输入用户\"}";
}
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select authorized_amount from kjd.user where user_name=" + user_name;
var rst = mySql.ExecuteFirst(sql);
mySql.Close();
if (!string.IsNullOrEmpty(rst))
{
return "{\"code\":200,\"msg\":\"success\",\"data\":" + rst + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU=";
public string GetPackageSign(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'");
var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'");
var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'");
int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
string c2 = RegexUtils.GetStringQuery(ref inputData, "c2");
if (EncrypUtil.Encryption(r2) != c2)
return "{\"code\":2,\"msg\":\"不合法的输入内容\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from kjd.user where user_name='"
+ mobile + "' and password='" + password + "'";
sql = "select * from kjd.user where user_name='" + mobile + "'";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt == null || dt.Rows.Count <=0)
{
return "{\"code\":1,\"msg\":\"用户不存在\"}";
}
string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower();
return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string IsGetReturnPackage(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
string c2 = RegexUtils.GetStringQuery(ref inputData, "c2");
if (EncrypUtil.Encryption(r2) != c2)
return "{\"code\":2,\"msg\":\"不合法的输入内容\"}";
var isGetReturn = System.Configuration.ConfigurationManager.ConnectionStrings["GetReturnPackage"]?.ConnectionString;
return "{\"code\":200, \"is_get\":\"" + isGetReturn + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -1,877 +0,0 @@
using KJD_Web.Model.WxModel;
using KJD_Web.Utils;
using KJD_WebService.Model;
using MySql.Data.MySqlClient;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Web;
using System.Web.Security;
using System.Web.Services.Description;
namespace KJD_Web.BLL.WXXD
{
public class WXExpressOptimizeManage
{
public string GetWayBill(string inputData, bool isNoUserName = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var timeCalc = DateTime.Now;
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
//var delivery_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_id"))?.Replace("'", "\\'");
//var delivery_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_name"))?.Replace("'", "\\'");
//var waybill_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "waybill_id"))?.Replace("'", "\\'");
//if (string.IsNullOrEmpty(delivery_id) || string.IsNullOrEmpty(delivery_name) || string.IsNullOrEmpty(waybill_id))
//{
// return "{\"code\":500,\"msg\":\"运单号信息不完整\"}";
//}
var status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "status"))?.Replace("'", "\'");
var order_ids = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_ids"))?.Replace("'", "\'");
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_name"))?.Replace("'", "\'");
if (!isNoUserName && user_name.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"用户名不能为空\"}";
}
if (isNoUserName && order_ids.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"订单号不能为空\"}";
}
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
//string tableName = "wxxd.express_optimize";
//sql = "select exists (SELECT table_name FROM information_schema.tables WHERE table_schema = 'wxxd' AND table_name = 'express_optimize')";
//var existTable = mySql.ExecuteFirstInt(sql);
//if (existTable == 0)
// sql = "select count(*) from wxxd.express_optimize where 1=1";
//else
sql = "select count(*) from wxxd.express_optimize where 1=1";
string where = "";
if (!isNoUserName)
where += " AND user_name='" + user_name + "'";
if (status != null)
where += " AND status in (" + status + ")";
if (order_ids != null)
where += " AND order_id in ('" + order_ids.Replace(",", "','") + "')";
sql += where;
var count = 0;
count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from wxxd.express_optimize where 1=1";
sql += where;
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
if (dt != null)
{
try
{
List<WxOptimizeExpressInfo> WxOptimizeExpressInfoLst = new List<WxOptimizeExpressInfo>();
foreach (DataRow row in dt.Rows)
{
WxOptimizeExpressInfoLst.Add(new WxOptimizeExpressInfo()
{
id = row["id"].ParseToInt(),
delivery_id = row["delivery_id"].ParseToString(),
delivery_name = row["delivery_name"].ParseToString(),
order_id = row["order_id"].ParseToString(),
bind_order_id = row["bind_order_id"].ParseToString(),
shop_id = row["shop_id"].ParseToString(),
status = row["status"].ParseToInt(),
waybill_id = row["waybill_id"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
use_time = row["use_time"].ParseToString().ParseToDateTimeNullable(),
waybill_pickup_time = row["waybill_pickup_time"].ParseToString().ParseToDateTimeNullable(),
});
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(WxOptimizeExpressInfoLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
/// <summary>
/// 添加运单
/// </summary>
/// <param name="inputData"></param>
/// <returns></returns>
public string AddWaybill(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var delivery_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_id"))?.Replace("'", "\\'");
var delivery_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_name"))?.Replace("'", "\\'");
var waybill_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "waybill_id"))?.Replace("'", "\\'");
var bind_order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "bind_order_id"))?.Replace("'", "\\'");
var waybill_pickup_time = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "waybill_pickup_time")).ParseToDateTimeNullable();
if (string.IsNullOrEmpty(delivery_id) || string.IsNullOrEmpty(delivery_name) || string.IsNullOrEmpty(waybill_id))
{
return "{\"code\":500,\"msg\":\"运单号信息不完整\"}";
}
if (waybill_pickup_time == null && bind_order_id.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"揽收时间和绑定订单编号不能同时为空\"}";
}
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_name"))?.ParseToString();
if (user_name.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"请输入用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "SELECT EXISTS (SELECT 1 FROM wxxd.express_optimize WHERE waybill_id='" + waybill_id + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.Close();
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
}
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"运单号已存在\"}";
}
sql = "INSERT INTO wxxd.express_optimize (user_name,delivery_id,delivery_name,waybill_id,";
if (!bind_order_id.IsNullOrEmpty())
sql += "bind_order_id,";
if (waybill_pickup_time != null)
sql += "waybill_pickup_time,";
sql = sql.Trim(',');
sql += ") VALUES ('" + user_name + "','" + delivery_id + "','" + delivery_name + "','" + waybill_id + "',";
if (!bind_order_id.IsNullOrEmpty())
sql += "'" + bind_order_id + "',";
if (waybill_pickup_time != null)
sql += "'" + waybill_pickup_time.Value.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.Trim(',');
sql += ");";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst)
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelWaybill(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var waybill_ids = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "waybill_ids"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(waybill_ids))
{
return "{\"code\":500,\"msg\":\"运单号信息不完整\"}";
}
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_name"))?.ParseToString();
if (user_name.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"请输入用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "DELETE FROM wxxd.express_optimize WHERE waybill_id in ('" + waybill_ids.Replace(",", "','") + "') and status=0";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (!rst || !mySql.Message.IsNullOrEmpty())
return "{\"code\":501,\"msg\":\"删除失败 " + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
/// <summary>
/// 选择并使用运单
/// </summary>
/// <param name="inputData"></param>
/// <returns></returns>
public string SelectAndSetWaybill(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_name"))?.ParseToString();
if (user_name.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"请输入用户名\"}";
}
var shop_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_id"))?.Replace("'", "\\'");
var order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_id) || string.IsNullOrEmpty(shop_id))
{
return "{\"code\":500,\"msg\":\"缺少订单信息\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn, true);
string sql = "";
sql = "select * from wxxd.express_optimize where order_id='" + order_id + "' and status = 1";
var dt = mySql.ExecuteDataTable(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流信息查询失败 " + mySql.Message + "\"}";
}
if (dt?.Rows?.Count == 0)
{
sql = "UPDATE wxxd.express_optimize SET order_id='" + order_id + "',status=1 WHERE user_name='" + user_name +
"' AND status=0 AND (order_id IS NULL OR order_id='') LIMIT 1";
var cnt = mySql.ExecuteAffectedRows(sql);
if (cnt == 0 || !mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流信息提取失败 " + mySql.Message + "\"}";
}
sql = "SELECT * FROM wxxd.express_optimize WHERE user_name='" + user_name + "' AND order_id='" + order_id + "' AND status = 1";
dt = mySql.ExecuteDataTable(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流信息提取失败 " + mySql.Message + "\"}";
}
if (dt?.Rows?.Count == 0)
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流信息提取失败 " + mySql.Message + "\"}";
}
}
var waybill_id = dt.Rows[0]["waybill_id"].ToString();
// todo E57调用接口处理
mySql.Close();
mySql = new MysqlUtils(conn, true);
sql = " UPDATE wxxd.express_optimize SET shop_id='" + shop_id + "',status=2,use_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' " +
" WHERE user_name='" + user_name + "' AND status=1 AND order_id='" + order_id + "' AND waybill_id='" + waybill_id + "'";
var rst = mySql.ExecuteAffectedRows(sql);
if (rst == 0 || !mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"修改物流信息失败 " + mySql.Message + "\"}";
}
else
{
mySql.Commit();
mySql.Close();
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string SelectWaybill(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_name"))?.ParseToString();
if (user_name.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"请输入用户名\"}";
}
var shop_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_id"))?.Replace("'", "\\'");
var order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
var order_time = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_time")).ParseToDateTimeNullable();
if (string.IsNullOrEmpty(order_id) || string.IsNullOrEmpty(shop_id))
{
return "{\"code\":500,\"msg\":\"缺少订单信息\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn, true);
try
{
string sql = "";
sql = "select * from wxxd.express_optimize WHERE user_name='" + user_name + "' AND order_id='" + order_id + "' and status = 1 LIMIT 1";
var dt = mySql.ExecuteDataTable(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流查询失败 " + mySql.Message + "\"}";
}
if (dt?.Rows?.Count == 0)
{
// 获取事先绑定的订单运单
sql = " UPDATE wxxd.express_optimize SET order_id='" + order_id + "',status=1" +
" WHERE user_name='" + user_name + "' AND status=0 AND bind_order_id='" + order_id + "'" +
" ORDER BY RAND() LIMIT 1";
var cnt = mySql.ExecuteAffectedRows(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流提取失败 " + mySql.Message + "\"}";
}
// 根据订单时间提取指定时间段内的运单号
if (cnt == 0 && order_time != null)
{
// 第一天的订单用第二天的物流发货
var start_time = order_time.Value.Date.AddHours(24).ToString("yyyy-MM-dd HH:mm:ss");
var end_time = order_time.Value.Date.AddHours(48).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
sql = " UPDATE wxxd.express_optimize SET order_id='" + order_id + "',status=1" +
" WHERE user_name='" + user_name + "' AND status=0 AND (order_id IS NULL OR order_id='') AND (bind_order_id IS NULL OR bind_order_id='')" +
" AND waybill_pickup_time between '" + start_time + "' and '" + end_time + "'" +
" ORDER BY RAND() LIMIT 1";
cnt = mySql.ExecuteAffectedRows(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流提取失败 " + mySql.Message + "\"}";
}
}
// 挑选最早入库的运单号
//if (cnt == 0 && order_time == null)
//{
// sql = " UPDATE wxxd.express_optimize SET order_id='" + order_id + "',status=1" +
// " WHERE user_name='" + user_name + "' AND status=0 AND (order_id IS NULL OR order_id='') AND (bind_order_id IS NULL OR bind_order_id='')" +
// " LIMIT 1";
// cnt = mySql.ExecuteAffectedRows(sql);
// if (!mySql.Message.IsNullOrEmpty())
// {
// mySql.RollBack();
// mySql.Close();
// return "{\"code\":501,\"msg\":\"物流提取失败 " + mySql.Message + "\"}";
// }
//}
if (cnt == 0)
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"没有可用的运单号\"}";
}
sql = "SELECT * FROM wxxd.express_optimize WHERE user_name='" + user_name + "' AND order_id='" + order_id + "' AND status = 1";
dt = mySql.ExecuteDataTable(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流提取失败 " + mySql.Message + "\"}";
}
if (dt?.Rows?.Count == 0)
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流提取失败 " + mySql.Message + "\"}";
}
}
var waybill_id = dt.Rows[0]["waybill_id"].ToString();
var delivery_id = dt.Rows[0]["delivery_id"].ParseToString();
var delivery_name = dt.Rows[0]["delivery_name"].ParseToString();
mySql.Commit();
mySql.Close();
return "{\"code\":200,\"msg\":\"success\",\"data\":{\"waybill_id\":\"" + waybill_id +
"\",\"delivery_id\":\"" + delivery_id + "\",\"delivery_name\":\"" + delivery_name + "\"}}";
}
catch (Exception ex)
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"物流提取失败 " + ex.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string UpdateUsedWaybill(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_name"))?.ParseToString();
if (user_name.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"请输入用户名\"}";
}
var shop_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_id"))?.Replace("'", "\\'");
var order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
var waybill_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "waybill_id"))?.Replace("'", "\\'");
var is_rollback = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "is_rollback"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_id) || string.IsNullOrEmpty(shop_id) || string.IsNullOrEmpty(waybill_id))
{
return "{\"code\":500,\"msg\":\"缺少订单信息\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn, true);
var sql = " UPDATE wxxd.express_optimize SET shop_id='" + shop_id + "',status=2,use_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' " +
" WHERE user_name='" + user_name + "' AND status=1 AND order_id='" + order_id + "' AND waybill_id='" + waybill_id + "'";
if (is_rollback == "true")
sql = " UPDATE wxxd.express_optimize SET shop_id='',order_id='',status=0,use_time=NULL" +
" WHERE user_name='" + user_name + "' AND status=1 AND order_id='" + order_id + "' AND waybill_id='" + waybill_id + "'";
var rst = mySql.ExecuteAffectedRows(sql);
if (rst == 0 || !mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"修改物流信息失败 " + mySql.Message + "\"}";
}
// 记录修改结果,暂时注释
if (is_rollback != "true")
{
//var relation_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "relation_id"))?.Replace("'", "\\'");
//var optimize_rst = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "optimize_rst"))?.Replace("'", "\\'");
//var delivery_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_name"))?.Replace("'", "\\'");
//if (optimize_rst != null)
//{
// sql = "select exists (select 1 from wxxd.express_optimize where order_id='" + order_id + "')";
// var exist = mySql.ExecuteFirstInt(sql);
// if (exist > 0)
// {
// sql = " UPDATE wxxd.express_optimize_rst SET ";
// if (shop_id != null)
// sql += " shop_id=@shop_id,";
// if (relation_id != null)
// sql += " relation_id=@relation_id,";
// if (optimize_rst != null)
// sql += " optimize_rst=@optimize_rst,";
// if (waybill_id != null)
// sql += " waybill_id=@waybill_id,";
// if (delivery_name != null)
// sql += " delivery_name=@delivery_name,";
// sql = sql.TrimEnd(',');
// sql += " WHERE order_id=@order_id";
// }
// else
// {
// sql = " insert into wxxd.express_optimize_rst (shop_id,order_id,";
// if (relation_id != null)
// sql += "relation_id,";
// if (optimize_rst != null)
// sql += "optimize_rst,";
// if (waybill_id != null)
// sql += "waybill_id,";
// if (delivery_name != null)
// sql += "delivery_name,";
// sql = sql.TrimEnd(',');
// sql += ") ";
// sql += " values (@shop_id,@order_id,";
// if (relation_id != null)
// sql += "@relation_id,";
// if (optimize_rst != null)
// sql += "@optimize_rst,";
// if (waybill_id != null)
// sql += "@waybill_id,";
// if (delivery_name != null)
// sql += "@delivery_name,";
// sql = sql.TrimEnd(',');
// sql += ");";
// }
// List<MySqlParameter> paramLst = new List<MySqlParameter>();
// paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
// paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@relation_id", Value = relation_id, });
// paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@optimize_rst", Value = optimize_rst, });
// paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@waybill_id", Value = waybill_id, });
// paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@delivery_name", Value = delivery_name, });
// paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@order_id", Value = order_id, });
// var rows = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
//}
}
mySql.Commit();
mySql.Close();
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddMdyExpressOptimizeRst(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var shop_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_id"))?.Replace("'", "\\'");
var order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
var optimize_rst = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "optimize_rst"))?.Replace("'", "\\'");
var waybill_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "waybill_id"))?.Replace("'", "\\'");
var delivery_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_name"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_id))
{
return "{\"code\":500,\"msg\":\"请输入订单编号\"}";
}
if (string.IsNullOrEmpty(optimize_rst))
{
return "{\"code\":500,\"msg\":\"请输入补发结果\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from wxxd.express_optimize_rst where order_id='" + order_id + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.Close();
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
}
if (exist > 0)
{
sql = " UPDATE wxxd.express_optimize_rst SET ";
if (shop_id != null)
sql += " shop_id=@shop_id,";
if (optimize_rst != null)
sql += " optimize_rst=@optimize_rst,";
if (waybill_id != null)
sql += " waybill_id=@waybill_id,";
if (delivery_name != null)
sql += " delivery_name=@delivery_name,";
sql = sql.TrimEnd(',');
sql += " WHERE order_id=@order_id";
}
else
{
sql = " insert into wxxd.express_optimize_rst (shop_id,order_id,";
if (optimize_rst != null)
sql += "optimize_rst,";
if (waybill_id != null)
sql += "waybill_id,";
if (delivery_name != null)
sql += "delivery_name,";
sql = sql.TrimEnd(',');
sql += ") ";
sql += " values (@shop_id,@order_id,";
if (optimize_rst != null)
sql += "@optimize_rst,";
if (waybill_id != null)
sql += "@waybill_id,";
if (delivery_name != null)
sql += "@delivery_name,";
sql = sql.TrimEnd(',');
sql += ");";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@optimize_rst", Value = optimize_rst, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@waybill_id", Value = waybill_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@delivery_name", Value = delivery_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@order_id", Value = order_id, });
var rows = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
mySql.Close();
if (!mySql.Message.IsNullOrEmpty())
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + rows + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetExpressOptimizeRst(string inputData, bool isNoUserName = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var timeCalc = DateTime.Now;
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var order_ids = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_ids"))?.Replace("'", "\'");
if (isNoUserName && order_ids.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"订单号不能为空\"}";
}
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select count(*) from wxxd.express_optimize_rst where 1=1";
string where = "";
if (order_ids != null)
where += " AND order_id in ('" + order_ids.Replace(",", "','") + "')";
sql += where;
var count = 0;
count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from wxxd.express_optimize_rst where 1=1";
sql += where;
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
if (dt != null)
{
try
{
List<WxOptimizeRstInfo> WxOptimizeRstInfoLst = new List<WxOptimizeRstInfo>();
foreach (DataRow row in dt.Rows)
{
WxOptimizeRstInfoLst.Add(new WxOptimizeRstInfo()
{
id = row["id"].ParseToInt(),
waybill_id = row["waybill_id"].ParseToString(),
delivery_name = row["delivery_name"].ParseToString(),
order_id = row["order_id"].ParseToString(),
optimize_rst = row["optimize_rst"].ParseToString(),
shop_id = row["shop_id"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
});
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(WxOptimizeRstInfoLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddMdyExpressOptimizeRemark(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var shop_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_id"))?.Replace("'", "\\'");
var order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
var remark = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "remark"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_id))
{
return "{\"code\":500,\"msg\":\"请输入订单编号\"}";
}
if (remark == null)
{
return "{\"code\":500,\"msg\":\"请输入备注内容\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select exists (select 1 from wxxd.express_optimize_remark where order_id='" + order_id + "')";
var exist = mySql.ExecuteFirstInt(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.Close();
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
}
if (exist > 0)
{
sql = " UPDATE wxxd.express_optimize_remark SET ";
if (shop_id != null)
sql += " shop_id=@shop_id,";
if (remark != null)
sql += " remark=@remark,";
sql = sql.TrimEnd(',');
sql += " WHERE order_id=@order_id";
}
else
{
sql = " insert into wxxd.express_optimize_remark (shop_id,order_id,";
if (remark != null)
sql += "remark,";
sql = sql.TrimEnd(',');
sql += ") ";
sql += " values (@shop_id,@order_id,";
if (remark != null)
sql += "@remark,";
sql = sql.TrimEnd(',');
sql += ");";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@remark", Value = remark, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@order_id", Value = order_id, });
var rows = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
mySql.Close();
if (!mySql.Message.IsNullOrEmpty())
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
else
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + rows + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetExpressOptimizeRemark(string inputData, bool isNoUserName = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var timeCalc = DateTime.Now;
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var order_ids = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_ids"))?.Replace("'", "\'");
if (isNoUserName && order_ids.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"订单号不能为空\"}";
}
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select count(*) from wxxd.express_optimize_remark where 1=1";
string where = "";
if (order_ids != null)
where += " AND order_id in ('" + order_ids.Replace(",", "','") + "')";
sql += where;
var count = 0;
count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from wxxd.express_optimize_remark where 1=1";
sql += where;
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
if (dt != null)
{
try
{
List<WxOptimizeRemarkInfo> WxOptimizeRemarkInfoLst = new List<WxOptimizeRemarkInfo>();
foreach (DataRow row in dt.Rows)
{
WxOptimizeRemarkInfoLst.Add(new WxOptimizeRemarkInfo()
{
id = row["id"].ParseToInt(),
order_id = row["order_id"].ParseToString(),
remark = row["remark"].ParseToString(),
shop_id = row["shop_id"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
});
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(WxOptimizeRemarkInfoLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -1,139 +0,0 @@
using KJD_Web.Model.WxModel;
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
namespace KJD_Web.BLL.WXXD
{
public class WXOemManage
{
public string AddMdyOem(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var oem_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "oem_id")?.Replace("'", "\\'"));
var oem_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "oem_name")?.Replace("'", "\\'"));
var oem_owner = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "oem_owner")?.Replace("'", "\\'"));
if (oem_id.IsNullOrEmpty() || oem_name.IsNullOrEmpty())
return "{\"code\":500,\"msg\":\"oem信息不能为空\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "INSERT INTO wxxd.oem (oem_id,oem_name,oem_owner) VALUES('" + oem_id + "','" + oem_name + "','" + oem_owner + "')" +
"ON DUPLICATE KEY UPDATE oem_name=VALUES(oem_name),oem_owner=VALUES(oem_owner);";
var rst = mySql.ExecuteAffectedRows(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + rst + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelOem(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var id = (RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"));
var oem_id = (RegexUtils.GetStringQuery(ref inputData, "oem_id")?.Replace("'", "\\'"));
if (oem_id.IsNullOrEmpty() && id.IsNullOrEmpty())
return "{\"code\":500,\"msg\":\"oem信息不能为空\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "UPDATE wxxd.oem SET is_del=1 WHERE id=" + id + " or oem_id='" + oem_id + "'";
var rst = mySql.ExecuteAffectedRows(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetOem(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var timeCalc = DateTime.Now;
var oem_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "oem_id")?.Replace("'", "\\'"));
var oem_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "oem_name")?.Replace("'", "\\'"));
var oem_owner = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "oem_owner")?.Replace("'", "\\'"));
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT * FROM wxxd.oem WHERE is_del=0";
string where = "";
if (!string.IsNullOrEmpty(oem_id))
where += " and oem_id in ('" + oem_id.Replace(",", "','") + "')";
if (!string.IsNullOrEmpty(oem_name))
where += " and oem_name in ('" + oem_name.Replace(",", "','") + "')";
if (!string.IsNullOrEmpty(oem_owner))
where += " and oem_owner in ('" + oem_owner.Replace(",", "','") + "')";
sql += where;
sql += " ORDER BY add_time DESC;";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message) || dt == null)
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
try
{
List<oem> productLst = new List<oem>();
foreach (DataRow row in dt.Rows)
{
oem prod = new oem
{
id = row["id"].ParseToInt(),
oem_icon = null,
oem_id = row["oem_id"].ParseToString(),
add_time = row["add_time"].ParseToString().ParseToDateTime(),
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
oem_img = null,
oem_name = row["oem_name"].ParseToString(),
oem_owner = row["oem_owner"].ParseToString(),
};
productLst.Add(prod);
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + -1 + ",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,301 +0,0 @@
using KJD_Web.Model;
using KJD_Web.Model.WxModel;
using KJD_Web.Upload.Prod;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using Mysqlx.Crud;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.ApplicationServices;
using System.Web.Security;
using System.Web.UI.WebControls;
namespace KJD_Web.BLL.WXXD
{
public class WXShopRevenueStatisticsManage
{
public WXShopRevenueStatisticsManage()
{
}
public string GetShopOrderAmountRange(string inputData)
{
Result ret = Result.ArgumentNull();
if (!string.IsNullOrEmpty(inputData))
{
try
{
// todo 获取当前用户微信店铺,或指定某一个店铺,某一段时间
// 获取店铺下时间范围内的所有订单涉及到的金额
// 直接返回
if (!WXUserManage.GetSign(inputData))
throw new ArgumentException("校验失败");
var timeCalc = DateTime.Now;
string shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");//所有店铺信息
if (string.IsNullOrEmpty(shop_ids))
throw new ArgumentException("请选择店铺");
List<string> shopIdLst = shop_ids.Split(',').ToList();
if (shopIdLst.Count > 0)
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
string start_Time = RegexUtils.GetStringQuery(ref inputData, "start_time")?.Replace("'", "");
string end_Time = RegexUtils.GetStringQuery(ref inputData, "end_time")?.Replace("'", "");
DateTime startTime = DateTime.Now.AddDays(-7);
DateTime endTime = DateTime.Now;
if (!string.IsNullOrEmpty(start_Time))
startTime = TimeUtils.StampMillisecondsToDateTime(start_Time.ParseToLong());
if (!string.IsNullOrEmpty(end_Time))
endTime = TimeUtils.StampMillisecondsToDateTime(end_Time.ParseToLong());
if (endTime <= startTime)
throw new ArgumentException("结束时间必须大于开始时间");
if (endTime > startTime.AddMonths(3))
throw new ArgumentException("时间范围不能超过3个月");
int startTimestamp = TimeUtils.DateTimeToTimestampSeconds(startTime);
int endTimestamp = TimeUtils.DateTimeToTimestampSeconds(endTime);
StringBuilder sb = new StringBuilder();
sb.Append("SELECT ");
sb.Append("A.shop_name, ");
sb.Append("A.create_time, ");
sb.Append("A.order_id, ");
sb.Append("A.`status`, ");
sb.Append("A.product_price, ");
sb.Append("A.order_price, ");
sb.Append("A.purchase_price, ");
sb.Append("A.freight, ");
sb.Append("A.predict_commission_fee, ");
sb.Append("A.commission_amount, ");
sb.Append("A.discounted_price, ");
sb.Append("A.profit, ");
sb.Append("A.purchase_status, ");
sb.Append("A.out_amount, ");
sb.Append("B.refund_status, ");
sb.Append("c.`status` as refund_status_string, ");
sb.Append("IFNULL(C.refund_amount, 0) AS refund_amount ");
sb.Append("FROM erp.oms_wei_order AS A ");
sb.Append("INNER JOIN erp.`oms_wei_order_item` AS B ON A.`order_id` = B.`order_id` ");
sb.Append("LEFT JOIN ( SELECT order_id,`status`,refund_amount,id FROM erp.`oms_wei_refund` WHERE id IN ( SELECT MAX(id) FROM erp.`oms_wei_refund` GROUP BY order_id)) AS C ON A.order_id = C.order_id ");
sb.Append("WHERE A.create_time BETWEEN " + startTimestamp + " AND " + endTimestamp + " ");
sb.Append("AND A.`status` > 10 ");
sb.Append("AND A.shop_id IN (" + shop_ids + ") ");
sb.Append("ORDER BY A.create_time asc");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
DataTable dt = mySql.ExecuteDataTable(sb.ToString());
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
throw new Exception(mySql.Message);
// out_amount 为空或为0的订单,从中转仓订单表(GetTransitOrderTable)补全外采金额
// external_procurement:0=未查到,1=从 GetTransitOrderTable 查询到
Dictionary<string, int> transitOutAmountMap = new Dictionary<string, int>();
if (dt != null && dt.Rows.Count > 0)
{
HashSet<string> needLookupOrderIds = new HashSet<string>();
foreach (DataRow row in dt.Rows)
{
int? rowOutAmount = row["out_amount"].ParseToInt();
if (rowOutAmount == null || rowOutAmount.Value == 0)
{
string orderId = row["order_id"].ParseToString();
if (!string.IsNullOrEmpty(orderId))
needLookupOrderIds.Add(orderId);
}
}
if (needLookupOrderIds.Count > 0)
{
WXOrderManage wxOrderManage = new WXOrderManage();
const int chunkSize = 100;
const int transitPageSize = 500;
List<string> needLookupList = needLookupOrderIds.ToList();
for (int i = 0; i < needLookupList.Count; i += chunkSize)
{
int takeCount = Math.Min(chunkSize, needLookupList.Count - i);
string chunkOrderIds = string.Join(",", needLookupList.GetRange(i, takeCount));
int pageIndex = 1;
while (true)
{
int count = -1;
var transitList = wxOrderManage.GetTransitOrderTable(pageIndex, transitPageSize, chunkOrderIds, null, null, null, null, "true", out count);
if (transitList == null || transitList.Count == 0)
break;
foreach (var transit in transitList)
{
if (transit != null && !string.IsNullOrEmpty(transit.order_no) && needLookupOrderIds.Contains(transit.order_no))
{
if (!transitOutAmountMap.ContainsKey(transit.order_no))
transitOutAmountMap[transit.order_no] = transit.out_amount ?? 0;
}
}
if (transitList.Count < transitPageSize)
break;
pageIndex++;
}
}
}
}
List<WXOrderAmountInfo> orderList = new List<WXOrderAmountInfo>();
if (dt != null)
{
foreach (DataRow row in dt.Rows)
orderList.Add(BuildOrderAmountInfo(row, transitOutAmountMap));
}
// 买手号退款金额:退款订单(refund_status>1)且非外采时,从买手售后表补全退款金额
FillBuyerRefundAmount(orderList, conn);
ret.Code = 200;
ret.Msg = "success";
ret.Data = orderList;
}
catch (Exception ex)
{
ret.Code = 500;
ret.Msg = ex.Message;
}
}
return JsonUtils.SerializeObjectToString(ret, new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
NullValueHandling = NullValueHandling.Ignore
});
}
/// <summary>
/// 将订单行转换为金额详情:out_amount 为空或0时从中转仓订单表补全,并计算利润
/// </summary>
private WXOrderAmountInfo BuildOrderAmountInfo(DataRow row, Dictionary<string, int> transitOutAmountMap)
{
string orderId = row["order_id"].ParseToString();
int outAmount = row["out_amount"].ParseToInt();
int externalProcurement = 0;
if (outAmount == 0)
{
int transitAmount;
if (transitOutAmountMap.TryGetValue(orderId, out transitAmount))
{
externalProcurement = 1;
outAmount = transitAmount;
}
}
int orderPrice = row["order_price"].ParseToInt();
int predictCommissionFee = row["predict_commission_fee"].ParseToInt();
int commissionAmount = row["commission_amount"].ParseToInt();
int refund_status = row["refund_status"].ParseToInt();
int refund_amount = row["refund_amount"].ParseToInt();
// 利润 = 订单金额 - 外采金额 - 平台服务费 - 达人佣金(为空按0处理)
int profit = orderPrice - outAmount - predictCommissionFee - commissionAmount;
if (refund_status > 1 && refund_amount > 0) //退款利润计算
{
profit = orderPrice - refund_amount;
}
return new WXOrderAmountInfo
{
shop_name = row["shop_name"].ParseToString(),
create_time = row["create_time"].ParseToInt(),
order_id = orderId,
status = row["status"].ParseToInt(),
product_price = row["product_price"].ParseToInt(),
order_price = orderPrice,
purchase_price = row["purchase_price"].ParseToInt(),
freight = row["freight"].ParseToInt(),
predict_commission_fee = predictCommissionFee,
commission_amount = commissionAmount,
discounted_price = row["discounted_price"].ParseToInt(),
profit = profit,
purchase_status = row["purchase_status"].ParseToInt(),
out_amount = outAmount,
refund_status = row["refund_status"].ParseToInt(),
refund_status_string = row["refund_status_string"].ParseToString(),
refund_amount = row["refund_amount"].ParseToInt(),
external_procurement = externalProcurement
};
}
/// <summary>
/// 买手号退款金额:退款订单(refund_status>1)且非外采时,从买手售后表(wxxd.order_pdd_buyer_after_sale)查询退款金额(refundAmount)填入
/// </summary>
private void FillBuyerRefundAmount(List<WXOrderAmountInfo> orderList, string conn)
{
if (orderList == null || orderList.Count == 0)
return;
// 退款订单(refund_status>1)且非外采(out_amount、external_procurement都为0)的订单才查询买手号退款金额
HashSet<string> needLookupOrderIds = new HashSet<string>();
foreach (WXOrderAmountInfo order in orderList)
{
if (order.refund_status > 1 && order.external_procurement == 1 && order.out_amount > 0)
{
if (!string.IsNullOrEmpty(order.order_id))
needLookupOrderIds.Add(order.order_id);
}
}
if (needLookupOrderIds.Count == 0)
return;
Dictionary<string, Tuple<int, string>> buyerRefundAmountMap = new Dictionary<string, Tuple<int, string>>();
MysqlUtils mySql = new MysqlUtils(conn);
try
{
const int chunkSize = 100;
List<string> needLookupList = needLookupOrderIds.ToList();
for (int i = 0; i < needLookupList.Count; i += chunkSize)
{
int takeCount = Math.Min(chunkSize, needLookupList.Count - i);
string chunkOrderIds = string.Join("','", needLookupList.GetRange(i, takeCount));
string sql = "SELECT WX_ORDER_ID,refundAmount,statusText FROM wxxd.order_pdd_buyer_after_sale a " +
"WHERE a.WX_ORDER_ID IN ('" + chunkOrderIds + "') AND a.id = ( SELECT MAX(b.id) FROM wxxd.order_pdd_buyer_after_sale b WHERE b.WX_ORDER_ID = a.WX_ORDER_ID) ORDER BY a.WX_ORDER_ID;";
DataTable buyerDt = mySql.ExecuteDataTable(sql);
if (buyerDt != null)
{
foreach (DataRow row in buyerDt.Rows)
{
string wxOrderId = row["WX_ORDER_ID"].ParseToString();
int refundAmount = row["refundAmount"].ParseToInt();
string statusText = row["statusText"].ParseToString();
if (!string.IsNullOrEmpty(wxOrderId) && !buyerRefundAmountMap.ContainsKey(wxOrderId))
buyerRefundAmountMap[wxOrderId] = new Tuple<int, string>(refundAmount, statusText);
}
}
}
}
finally
{
mySql.Close();
}
if (!string.IsNullOrEmpty(mySql.Message))
throw new Exception(mySql.Message);
foreach (WXOrderAmountInfo order in orderList)
{
Tuple<int, string> buyerRefundAmount;
if (buyerRefundAmountMap.TryGetValue(order.order_id, out buyerRefundAmount))
{
order.buyer_refund_amount = buyerRefundAmount.Item1;
order.buyer_refund_status = buyerRefundAmount.Item2;
}
}
}
}
}
File diff suppressed because it is too large. Load diff
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="BXXPriceService.asmx.cs" Class="KJD_Web.BXXPriceService" %>
@@ -1,198 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// PriceService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class BXXPriceService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_price_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().GetPriceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().AddPrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().DelDbPrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_db_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().MdyDBPrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_purchase_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().MdyPurchasePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_purchase_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().AddPurchasePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_purchase_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().DelPurchasePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_purchase_price_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().GetPurchasePriceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//AddExtCodePrice
[WebMethod]
public void add_ext_code_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().AddExtCodePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_ext_code_price_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().GetExtCodePriceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_ext_code_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().DelDbExtCodePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_db_ext_code_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXPriceManage().MdyDBExtCodePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="BXXProductService.asmx.cs" Class="KJD_Web.BXXProductService" %>
@@ -1,581 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.BLL.WXXD;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ProductService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class BXXProductService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_product_spu_id_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductSpuIdLst(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//AddProdDownSku
[WebMethod]
public void add_prod_down_sku()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddProdDownSku(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_prod_down_sku_lst_by_sku_codes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProdDownSkuLstBySkuCodes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_list_random()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductListRandom(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_prod_wx_complate()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddProdWXComplate(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_prod_wx_complate_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProdWXComplateList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_replace_img_list_random()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetSkuReplaceImgListRandom(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_violation_prod()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyViolationProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_best_sale_prod()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyBestSaleProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().DelDbProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//[WebMethod]
//public void mdy_product()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// //result = new BXXProductManage().MdyShop(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
//[WebMethod]
//public void mdy_product_notes()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// result = new BXXProductManage().MdyProductNotes(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
[WebMethod]
public void mdy_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyDBProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_groups()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductGroups(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product_groups()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddProductGroup(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_product_groups()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().DelProductGroup(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddProductNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_product_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().DelProductNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_pdd_product_cates()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductMainCates(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_cates()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductCates(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_sku_img_replace()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddSkuImgReplace(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_sku_img_replace()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdySkuImgReplace(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_img_replace_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetSkuImgReplaceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_img_replace_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetSkuImgReplaceList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
//AddSkuImg
[WebMethod]
public void add_sku_img()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddSkuImg(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_wx_tokens()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXShopManage().E57GetWxTokens(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_api_get_all_cate()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().WxApiGetWxAllCate(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_api_category_classify()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().WxApiCategoryClassify(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_api_upload_image()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().WxApiUploadImage(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//AddJSTSku
[WebMethod]
public void add_jst_sku()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddJSTSku(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_jst_sku()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyJSTSku(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_jst_sku_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetJSTSkuList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_random_company_product_config()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().SetRandomCompanyProductConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_random_company_product_config()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetRandomCompanyProductConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
/// <summary>
/// 拼多多关联新增
/// </summary>
[WebMethod]
public void add_relation()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddRelation(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
/// <summary>
/// 拼多多关联获取
/// </summary>
[WebMethod]
public void get_relation()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetRelation(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_mdy_jst_product_ban()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddMdyJstProductBan(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_jst_product_coid_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetJstProductCoidList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_jst_product_ban_platform_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetJstProductBanPlatformList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="BXXProductThirdService.asmx.cs" Class="KJD_Web.BXXProductThirdService" %>
@@ -1,221 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ProductThirdService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class BXXProductThirdService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().GetProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().GetProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().AddProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().DelDbProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//[WebMethod]
//public void mdy_product()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// //result = new ProductThridManage().MdyShop(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
//[WebMethod]
//public void mdy_product_notes()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// result = new BXXProductThirdManage().MdyProductNotes(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
[WebMethod]
public void mdy_product_category()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().MdyProductCategory(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().AddUserSelectProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_user_select_product_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().MdyUserSelectProductStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().GetUserSelectProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().GetUserSelectProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().DelSelectProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_select_product_sub_sa()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().SetSelectProductSubSa(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_product_select_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductThirdManage().MdyProductSelectNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="BXXShopService.asmx.cs" Class="KJD_Web.BXXShopService" %>
@@ -1,335 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.BLL.WXXD;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ShopService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class BXXShopService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_pdd_client_info()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetPddClientInfo(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_shop_client_info()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetShopClientInfo(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//WXAddMdyShopClientInfo
[WebMethod]
public void add_mdy_shop_client_info()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().AddMdyShopClientInfo(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_shop_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_one_login_name_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetOneLoginNameShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().AddShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().DelShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_anti_content()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyAntiContent(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_shop_cookie_and_login_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyCookieAndLoginStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_get_shop_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void sub_sa_get_select_prod_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().SubSaGetSelectProdShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_add_prod_remaining()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().UpdateAddProdRemaining(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_mdy_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_add_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().AddShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_del_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().DelShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_shop_sub_sa()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().SetShopSubSa(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void e57_get_wx_tokens()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXShopManage().E57GetWxTokens(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void e57_get_pdd_shop_token()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().E57GetPddShopToken(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().AddWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_weidian_shop_cookie()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyWeiDianShopCookie(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().DelWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="BXXUserService.asmx.cs" Class="KJD_Web.BXXUserService" %>
@@ -1,258 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// UserService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class BXXUserService : System.Web.Services.WebService
{
[WebMethod]
public string hello_world()
{
return "Hello World";
}
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void user_login()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().CheckUserLogin(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_package_sign()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().GetPackageSign(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void change_password()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().ChangePassword(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sub_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().GetSubUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_sub_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().UpdateSubUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_sub_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().AddSubUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void delete_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().DelUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_all_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().GetAllUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().UpdateUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().AddUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_scm121_cookie()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().UpdateScm121Cookie(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_scm121_cookie()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().GetScm121Cookie(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//AddBuyer
[WebMethod]
public void add_buyer()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().AddBuyer(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_buyer()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().MdyBuyer(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_buyer_cookie()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().MdyBuyerCookie(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_buyer()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().GetBuyer(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_buyer()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXUserManage().DelBuyer(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="DYShopService.asmx.cs" Class="KJD_Web.DYShopService" %>
@@ -1,208 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.BLL.DYXD;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ShopService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class DYShopService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_shop_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().GetShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_one_login_name_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().GetOneLoginNameShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().AddShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().DelShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().MdyShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_shop_cookie_and_login_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().MdyCookieAndLoginStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_get_shop_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().GetShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void sub_sa_get_select_prod_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().SubSaGetSelectProdShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_add_prod_remaining()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().UpdateAddProdRemaining(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_mdy_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().MdyShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_add_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().AddShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_del_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().DelShop(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_shop_sub_sa()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYShopManage().SetShopSubSa(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="DYUserService.asmx.cs" Class="KJD_Web.DYUserService" %>
@@ -1,178 +0,0 @@
using KJD_Web.BLL.BXX;
using KJD_Web.BLL.DYXD;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// UserService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class DYUserService : System.Web.Services.WebService
{
[WebMethod]
public string hello_world()
{
return "Hello World";
}
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void user_login()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().CheckUserLogin(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_package_sign()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().GetPackageSign(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void change_password()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().ChangePassword(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sub_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().GetSubUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_sub_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().UpdateSubUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_sub_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().AddSubUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void delete_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().DelUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_all_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().GetAllUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().UpdateUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new DYUserManage().AddUser(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
-1
View File
@@ -1 +0,0 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="KJD_Web.Global" Language="C#" %>
-199
View File
@@ -1,199 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using KJD_Web.Utils;
namespace KJD_Web
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
string hPath = Request.Url.LocalPath.ToString();
if (!hPath.Contains(".asmx") && hPath.Contains("/user/"))
{
hPath = hPath.Replace("/user/", "/UserService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/shop/"))
{
hPath = hPath.Replace("/shop/", "/ShopService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
{
hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/order/"))
{
hPath = hPath.Replace("/order/", "/OrderService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/product/"))
{
hPath = hPath.Replace("/product/", "/ProductService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/product_third/"))
{
hPath = hPath.Replace("/product_third/", "/ProductThirdService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/price/"))
{
hPath = hPath.Replace("/price/", "/PriceService.asmx/");
Context.RewritePath(hPath);
}
if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_user/"))
{
hPath = hPath.Replace("/bxx_user/", "/BXXUserService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_shop/"))
{
hPath = hPath.Replace("/bxx_shop/", "/BXXShopService.asmx/");
Context.RewritePath(hPath);
}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
//{
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
// Context.RewritePath(hPath);
//}
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product/"))
{
hPath = hPath.Replace("/bxx_product/", "/BXXProductService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product_third/"))
{
hPath = hPath.Replace("/bxx_product_third/", "/BXXProductThirdService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_price/"))
{
hPath = hPath.Replace("/bxx_price/", "/BXXPriceService.asmx/");
Context.RewritePath(hPath);
}
if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_user/"))
{
hPath = hPath.Replace("/dyxd_user/", "/DYUserService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_shop/"))
{
hPath = hPath.Replace("/dyxd_shop/", "/DYShopService.asmx/");
Context.RewritePath(hPath);
}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
//{
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
// Context.RewritePath(hPath);
//}
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product/"))
{
hPath = hPath.Replace("/dyxd_product/", "/DYProductService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product_third/"))
{
hPath = hPath.Replace("/dyxd_product_third/", "/DYProductThirdService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_price/"))
{
hPath = hPath.Replace("/dyxd_price/", "/DYPriceService.asmx/");
Context.RewritePath(hPath);
}
if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_user/"))
{
hPath = hPath.Replace("/wxxd_user/", "/WXUserService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop/"))
{
hPath = hPath.Replace("/wxxd_shop/", "/WXShopService.asmx/");
Context.RewritePath(hPath);
}
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
//{
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
// Context.RewritePath(hPath);
//}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product/"))
{
hPath = hPath.Replace("/wxxd_product/", "/WXProductService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product_third/"))
{
hPath = hPath.Replace("/wxxd_product_third/", "/WXProductThirdService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_price/"))
{
hPath = hPath.Replace("/wxxd_price/", "/WXPriceService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_order/"))
{
hPath = hPath.Replace("/wxxd_order/", "/WXOrderService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop_revenue_statistics/"))
{
hPath = hPath.Replace("/wxxd_shop_revenue_statistics/", "/WXShopRevenueStatistics.asmx/");
Context.RewritePath(hPath);
}
// 请求录制:捕获请求链接与请求内容,用于迁移后的回放校验
//try { ApiRequestLogger.BeginRequest(Context); } catch { }
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_EndRequest(object sender, EventArgs e)
{
// 请求录制:合并响应内容并落盘
//try { ApiRequestLogger.EndRequest(Context); } catch { }
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Session_End(object sender, EventArgs e)
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}
}
@@ -1,341 +0,0 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A6C03FE1-142A-4C97-99A9-67FD915836B6}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KJD_Web</RootNamespace>
<AssemblyName>KJD_WebService</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort>44313</IISExpressSSLPort>
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="MySql.Data">
<HintPath>..\Dll\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dll\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Content Include="WXOrderService.asmx" />
<Content Include="Upload\Prod\WXProdHot.aspx" />
<Content Include="Upload\Prod\WXProd.aspx" />
<Content Include="WXProductService.asmx" />
<Content Include="WXShopService.asmx" />
<Content Include="DYShopService.asmx" />
<Content Include="WXShopRevenueStatistics.asmx" />
<Content Include="WXUserService.asmx" />
<Content Include="DYUserService.asmx" />
<Content Include="Global.asax" />
<Content Include="BXXPriceService.asmx" />
<Content Include="PriceService.asmx" />
<Content Include="BXXProductService.asmx" />
<Content Include="BXXProductThirdService.asmx" />
<Content Include="OrderService.asmx" />
<Content Include="ProductThirdService.asmx" />
<Content Include="ProductService.asmx" />
<Content Include="BXXShopService.asmx" />
<Content Include="ShopService.asmx" />
<Content Include="UpdateService.asmx" />
<Content Include="ToolService.asmx" />
<Content Include="BXXUserService.asmx" />
<Content Include="UserService.asmx" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="BLL\BXX\BXXPriceManage.cs" />
<Compile Include="BLL\BXX\BXXProductManage.cs" />
<Compile Include="BLL\BXX\BXXProductThirdManage.cs" />
<Compile Include="BLL\BXX\BXXShopManage.cs" />
<Compile Include="BLL\BXX\BXXUserManage.cs" />
<Compile Include="BLL\DYXD\DYShopManage.cs" />
<Compile Include="BLL\DYXD\DYUserManage.cs" />
<Compile Include="BLL\KJD\OrderManage.cs" />
<Compile Include="BLL\KJD\PriceManage.cs" />
<Compile Include="BLL\KJD\ProductThirdManage.cs" />
<Compile Include="BLL\KJD\ProductManage.cs" />
<Compile Include="BLL\KJD\ShopManage.cs" />
<Compile Include="BLL\KJD\ToolManage.cs" />
<Compile Include="BLL\KJD\UpdateManage.cs" />
<Compile Include="BLL\KJD\UserManage.cs" />
<Compile Include="BLL\WXXD\WXExpressOptimizeManage.cs" />
<Compile Include="BLL\WXXD\WXOemManage.cs" />
<Compile Include="BLL\WXXD\WXOrderManage.cs" />
<Compile Include="BLL\WXXD\WXProductManage.cs" />
<Compile Include="BLL\WXXD\WXShopManage.cs" />
<Compile Include="BLL\WXXD\WXShopRevenueStatisticsManage.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" />
<Compile Include="Model\PddModel\PDDProductDecorationInfo.cs" />
<Compile Include="Model\PddModel\PDDSizeSpecInfo.cs" />
<Compile Include="Model\PddModel\PDDProductDetailInfo.cs" />
<Compile Include="Model\PddModel\PDDProductInfo.cs" />
<Compile Include="Model\PddModel\PDDProductPropertyInfo.cs" />
<Compile Include="Model\Result.cs" />
<Compile Include="Model\ShopModel\JSTListProductSkuInfo.cs" />
<Compile Include="Model\WXAddressInfo.cs" />
<Compile Include="Model\WxModel\distrib_return_order_info.cs" />
<Compile Include="Model\WxModel\oem.cs" />
<Compile Include="Model\WxModel\oms_wei_external_procurement_after_sale_info.cs" />
<Compile Include="Model\WxModel\oms_wei_external_procurement_log.cs" />
<Compile Include="Model\WxModel\oms_wei_order.cs" />
<Compile Include="Model\WxModel\oms_wei_order_item.cs" />
<Compile Include="Model\WxModel\oms_wei_refund.cs" />
<Compile Include="Model\WxModel\order_item_ext.cs" />
<Compile Include="Model\WxModel\order_pdd_buyer_after_sale.cs" />
<Compile Include="Model\WxModel\order_pdd_buyer_order.cs" />
<Compile Include="Model\WxModel\user_operate_task_status_info.cs" />
<Compile Include="Model\WxModel\user_payment_record_info.cs" />
<Compile Include="Model\WxModel\user_points_record_info.cs" />
<Compile Include="Model\WxModel\WXBuyUrlNotesInfo.cs" />
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
<Compile Include="Model\WxModel\WXGetEditProductInfoLite.cs" />
<Compile Include="Model\WxModel\WxOptimizeExpressInfo.cs" />
<Compile Include="Model\WxModel\WXOrderAmountInfo.cs" />
<Compile Include="Model\WxModel\WXOrderDecryptAddressInfo.cs" />
<Compile Include="Model\WxModel\wx_qualification_image_info.cs" />
<Compile Include="Model\WxProdSecretSpuIdShopIdMapParam.cs" />
<Compile Include="Model\WXShopDefaultAddressInfo.cs" />
<Compile Include="Utils\ApiRequestLogger.cs" />
<Compile Include="WXOrderService.asmx.cs">
<DependentUpon>WXOrderService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="Upload\Prod\BaseClass.cs" />
<Compile Include="Upload\Prod\BaseWxProd.cs" />
<Compile Include="Upload\Prod\WXProdHot.aspx.cs">
<DependentUpon>WXProdHot.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Upload\Prod\WXProdHot.aspx.designer.cs">
<DependentUpon>WXProdHot.aspx</DependentUpon>
</Compile>
<Compile Include="Upload\Prod\WXProd.aspx.cs">
<DependentUpon>WXProd.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Upload\Prod\WXProd.aspx.designer.cs">
<DependentUpon>WXProd.aspx</DependentUpon>
</Compile>
<Compile Include="Utils\HttpUtils.cs" />
<Compile Include="Utils\RandomUtils.cs" />
<Compile Include="WXProductService.asmx.cs">
<DependentUpon>WXProductService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="WXShopService.asmx.cs">
<DependentUpon>WXShopService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="DYShopService.asmx.cs">
<DependentUpon>DYShopService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="WXShopRevenueStatistics.asmx.cs">
<DependentUpon>WXShopRevenueStatistics.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="WXUserService.asmx.cs">
<DependentUpon>WXUserService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="DYUserService.asmx.cs">
<DependentUpon>DYUserService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Model\CommentParam.cs" />
<Compile Include="Model\DBPriceResultParam.cs" />
<Compile Include="Model\DBProdDbIdMapProductIdResultParam.cs" />
<Compile Include="Model\OrderParam.cs" />
<Compile Include="Model\DBProductResultParam.cs" />
<Compile Include="Model\ProductPurchasePriceResultParam.cs" />
<Compile Include="Model\ProductSelectResultParam.cs" />
<Compile Include="Model\ShopModel\JitCardCodeParam.cs" />
<Compile Include="Model\ShopModel\ShopParam.cs" />
<Compile Include="Model\ShopModel\sku_img_replace.cs" />
<Compile Include="Model\SkuImgResult.cs" />
<Compile Include="Model\TemuDBOrderInfo.cs" />
<Compile Include="Model\UserLoginResultParam.cs" />
<Compile Include="BXXPriceService.asmx.cs">
<DependentUpon>BXXPriceService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="PriceService.asmx.cs">
<DependentUpon>PriceService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="BXXProductService.asmx.cs">
<DependentUpon>BXXProductService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="BXXProductThirdService.asmx.cs">
<DependentUpon>BXXProductThirdService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="OrderService.asmx.cs">
<DependentUpon>OrderService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="ProductThirdService.asmx.cs">
<DependentUpon>ProductThirdService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProductService.asmx.cs">
<DependentUpon>ProductService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="BXXShopService.asmx.cs">
<DependentUpon>BXXShopService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="ShopService.asmx.cs">
<DependentUpon>ShopService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="UpdateService.asmx.cs">
<DependentUpon>UpdateService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="ToolService.asmx.cs">
<DependentUpon>ToolService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="BXXUserService.asmx.cs">
<DependentUpon>BXXUserService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="UserService.asmx.cs">
<DependentUpon>UserService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="Utils\EncrypUtil.cs" />
<Compile Include="Utils\Extension\Extension.Convert.cs" />
<Compile Include="Utils\Extension\Extension.Enum.cs" />
<Compile Include="Utils\Extension\Extension.Exception.cs" />
<Compile Include="Utils\Extension\Extension.Linq.cs" />
<Compile Include="Utils\Extension\Extension.Validate.cs" />
<Compile Include="Utils\Helper\HtmlHelper.cs" />
<Compile Include="Utils\Helper\JsonHelper.cs" />
<Compile Include="Utils\Helper\ReflectionHelper.cs" />
<Compile Include="Utils\Helper\RegexHelper.cs" />
<Compile Include="Utils\HtmlUtils.cs" />
<Compile Include="Utils\JsonUtils.cs" />
<Compile Include="Utils\MySqlUtils.cs" />
<Compile Include="Utils\RegexUtils.cs" />
<Compile Include="Utils\TimeUtils.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Properties\PublishProfiles\IISProfile.pubxml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>49977</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:9000/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class CommentParam
{
public int id { get; set; }
public string user_id { get; set; }
public string comment { get; set; }
public DateTime add_time { get; set; }
}
}
@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class DBPriceResultParam
{
public int id { get; set; }
public string ext_code { get; set; }
public int original_price { get; set; }
public int markup_times { get; set; }
public int extra_price { get; set; }
public string notes { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
public class DBExtCodePriceResult
{
public int id { get; set; }
public string ext_code { get; set; }
public int ext_code_price { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class DBProdDbIdMapProductIdResultParam
{
public long id { get; set; }
public long product_select_db_id { get; set; }
public long product_id { get; set; }
public long shop_id { get; set; }
public DateTime add_time { get; set; }
}
public class DBProdDraftIdMapUpSpuIdResultParam
{
public long id { get; set; }
public long draft_id { get; set; }
public long from_spu_id { get; set; }
public long shop_id { get; set; }
public DateTime add_time { get; set; }
public decimal? cost_price { get; set; }
public decimal? delivery_fee { get; set; }
public decimal? mark_fee { get; set; }
}
}
@@ -1,115 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class DBProductResultParamLite
{
public int id { get; set; }
public string spu_id { get; set; }
public string secret_spu_id { get; set; }
}
/// <summary>
/// 选品数据库商品
/// </summary>
public class DBProductResultParam
{
public int id { get; set; }
public string from_shop_id { get; set; } = "";
public string from_shop_name { get; set; } = "";
public string offline_supplier_id { get; set; }
public string offline_supplier_name { get; set; }
public string spu_id { get; set; }
public string skc_id { get; set; }
public string main_cat_id { get; set; }
public string cat_id { get; set; }
public string main_cat_name { get; set; }
public string cat_name { get; set; }
public string wx_cat_1 { get; set; }
public string wx_cat_2 { get; set; }
public string wx_cat_3 { get; set; }
public string wx_cat_leaf { get; set; }
/// <summary>
/// 母店价格
/// </summary>
public string price_text { get; set; }
/// <summary>
/// jit成本价格
/// </summary>
public string cost_price { get; set; }
/// <summary>
/// jit快递费
/// </summary>
public string delivery_fee { get; set; }
/// <summary>
/// jit贴单费
/// </summary>
public string mark_fee { get; set; }
/// <summary>
/// 变更类目ID(针对旧类目可能不可再提交商品)
/// </summary>
public string change_cat_id { get; set; }
/// <summary>
/// 变更类目名称(针对旧类目可能不可再提交商品)
/// </summary>
public string change_cat_name { get; set; }
public string ext_code { get; set; }
public string secret_spu_id { get; set; }
/// <summary>
/// 拼多多 设置类目价格
/// </summary>
public int? ext_code_price { get; set; }
public string product_name { get; set; }
public string product_json { get; set; }
public string size_json { get; set; }
public string sku_edit_json { get; set; }
/// <summary>
/// 微信推单商品和sku加密code信息
/// </summary>
public string sku_secret_json { get; set; }
public string wx_img_map_json { get; set; }
//public int sku_img_replace_id { get; set; }
//public string sku_img_replace_base64 { get; set; }
//public string sku_img_replace_url { get; set; }
public string main_img { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string group { get; set; }
public string notes { get; set; }
/// <summary>
/// 店铺选品次数
/// </summary>
public int select_count { get; set; } = 0;
/// <summary>
/// 被选中的总次数
/// </summary>
public int select_total_count { get; set; }
public string fission_imgs { get; set; }
public string fission_words { get; set; }
public string head_words { get; set; }
public string end_words { get; set; }
public int product_get_type { get; set; }
public string product_get_type_text { get; set; }
public int? view_uv { get; set; }
public int sale_count { get; set; }
public string sale_count_text { get; set; }
public string wx_safe_status { get; set; }
public string special_prod_type { get; set; }
public int send_to_out_server { get; set; }
public string real_coid { get; set; }
public string real_spu_id { get; set; }
public string has_wx_format { get; set; }
public string problem_prod_data { get; set; }
public int is_relation { get; set; }
public string add_user_name { get; set; }
}
public class KJDDBProduct : DBProductResultParam
{
}
}
@@ -1,64 +0,0 @@
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; }
}
}
@@ -1,61 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class JSTDownProdSkuInfo
{
public int id { get; set; }
public List<string> itemMainImage { get; set; } // Array[5],
public string itemName { get; set; } // "光流沙咕卡麻将砖块转砖带灯创意礼物男孩女孩网红",
public string styleCode { get; set; } // "725068475481",
public string itemCode { get; set; } // "ysk00407C_3R",
public string colourSpec { get; set; } // "方形带灯翠绿色;无规格",
public decimal? supplyPrice { get; set; } // 2.93,
public object oldSupplyPrice { get; set; } // null,
public object priceDate { get; set; } // null,
public List<object> perfectPlatformList { get; set; } // Array[19],
public string shelvesType { get; set; } // "DISTRIBUTION",
public string supplierName { get; set; } // "努正供应链",
public List<object> itemShelvesInfos { get; set; } // [],
public string shelvesTime { get; set; } // "2026-01-30 18:50:50",
public string itemSource { get; set; } // "GYL",
public string itemSourceText { get; set; } // "供应链",
public string supplierCoId { get; set; } // "14204696",
public string spuId { get; set; } // "BEC902FFA8B542A6A9F16BF5964DEA4F",
public string coId { get; set; } // "14791477",
public string partnerSkuId { get; set; } // "21B50E4CA5264A078933C956F0250FD9",
public string partnerSpuId { get; set; } // "9573273974C1472E9CEC10D227218E89",
public bool? deleted { get; set; } // false,
public bool? isPartner { get; set; } // true,
public bool? partnerCanSee { get; set; } // false,
public bool? haveBaseData { get; set; } // false,
public object baseDataId { get; set; } // null,
public string itemStatus { get; set; } // "distribution",
public bool? privateStatus { get; set; } // false,
public string categoryId { get; set; } // "",
public string categoryName { get; set; } // "",
public object regulatePriceMin { get; set; } // null,
public object regulatePriceMax { get; set; } // null,
public object lastRegulatePriceMin { get; set; } // null,
public object lastRegulatePriceMax { get; set; } // null,
public object regulatePriceChangeTime { get; set; } // null,
public bool? showLastRegulatePrice { get; set; } // false,
public string supplierId { get; set; } // "8323D6C2837B42AF8CB37F2A262DCA98",
/// <summary>
/// sku状态 FOR_SHELVED:该商品已被供应商设置成不可分销
/// </summary>
public string drpItemStatus { get; set; } // "FOR_SHELVED",
public string lastOperator { get; set; } // "老马",
public string itemSpuIdMd5 { get; set; } // "BEC902FFA8B542A6A9F16BF5964DEA4F"
public string secret_spu_id { get; set; }
public string secret_sku_id { get; set; }
/// <summary>
/// 产品库中是否存在
/// </summary>
public int is_in_product_db { get; set; }
public DateTime? add_time { get; set; }
}
}
@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class OrderParam
{
public int id { get; set; }
public string order_id { get; set; }
public string order_info { get; set; }
}
}
@@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.PddModel
{
public class BuyerLoginInfo
{
public int id { get; set; }
public string user_name { get; set; }
public string buyer_id { get; set; }
public string buyer_name { get; set; }
public string buyer_nick { get; set; }
public string cookie { get; set; }
public string status { get; set; }
public string notes { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model
{
public class PDDMaterialInfo
{
public long? latest_material_id { get; set; }
public string latest_material { get; set; }
public int? check_status { get; set; }
public object check_comment { get; set; }
public string online_material { get; set; }
}
}
@@ -1,65 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model
{
public class PDDProductDecorationInfo
{
public long? goods_id { get; set; }
public long? goods_commit_id { get; set; }
public long? mall_id { get; set; }
public List<PDDProdfloorItem> floor_list { get; set; } = new List<PDDProdfloorItem>();
public long? create_time { get; set; }
public long? update_time { get; set; }
}
public class PDDProdfloorItem
{
public long? floor_id { get; set; }
public string key { get; set; }
public string type { get; set; }
public int? priority { get; set; }
public List<PDDProdContentItem> content_list { get; set; }
public object check_status { get; set; }
public object check_id { get; set; }
public object check_name { get; set; }
public object comment { get; set; }
public object if_have_template { get; set; }
public object floor_status { get; set; }
public object template_id { get; set; }
public object template_type { get; set; }
public object template_json { get; set; }
}
public class PDDProdContentItem
{
public string img_url { get; set; }
public long? file_id { get; set; }
public int? height { get; set; }
public int? width { get; set; }
public int? file_status { get; set; }
public object goods_id { get; set; }
public object goods_name { get; set; }
public object show_price { get; set; }
public object status { get; set; }
public object min_on_sale_group_price { get; set; }
public string text { get; set; }
public object hot_zone_list { get; set; }
public text_module_detail_item text_module_details { get; set; }
public object activity_sn { get; set; }
public object combine_buy_element_dtolist { get; set; }
}
public class text_module_detail_item
{
public int? font_size { get; set; }
public string font_color { get; set; }
public int font_family { get; set; }
public string align { get; set; }
public string background_color { get; set; }
}
}
@@ -1,331 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model
{
public class PDDProductDetailInfo
{
public long? id { get; set; }
public long? goods_id { get; set; }
public int? check_status { get; set; }
public int? commit_deleted { get; set; }
public string owner { get; set; }
public int? is_shop { get; set; }
public string goods_sn { get; set; }
public string out_goods_sn { get; set; }
public int? is_folt { get; set; }
public string warm_tips { get; set; }
public object fabric { get; set; }
public object fabric_content { get; set; }
public long? cost_template_id { get; set; }
public int? cat_id { get; set; }
public long? mall_id { get; set; }
public string goods_name { get; set; }
public string tiny_name { get; set; }
public string goods_desc { get; set; }
public string share_desc { get; set; }
public List<object> list_desc { get; set; }
public int? market_price { get; set; }
public string thumb_url { get; set; }
public string image_url { get; set; }
public string hd_thumb_url { get; set; }
public List<object> allowed_region { get; set; }
public int? region_limit { get; set; }
public int? goods_type { get; set; }
public object country { get; set; }
public int? country_id { get; set; }
public string goods_name_prefix { get; set; }
public int? origin_country_id { get; set; }
public string origin_country_name { get; set; }
public object size_spec_id { get; set; }
public object size_parent_spec_id { get; set; }
public string warehouse { get; set; }
public int? event_type { get; set; }
public int? is_app { get; set; }
public int? is_pre_sale { get; set; }
public int? pre_sale_time { get; set; }
public int? is_sku_pre_sale { get; set; }
public int? is_refundable { get; set; }
public int? is_customs { get; set; }
public int? is_wms { get; set; }
public string customs { get; set; }
public int? is_bangdan { get; set; }
public long? shipment_limit_second { get; set; }
public int? quick_refund { get; set; }
public group_item groups { get; set; }
public commit_extension_item commit_extension { get; set; }
public List<gallery_item> galleries { get; set; }
public List<object> goods_commit_check { get; set; }
public mall_info_item mall_info { get; set; }
public List<sku_item> sku { get; set; }
public object reject_status { get; set; }
public object reject_reason { get; set; }
public object paper_net_weight { get; set; }
public object paper_length { get; set; }
public object paper_width { get; set; }
public object paper_plies_num { get; set; }
public int? second_hand { get; set; }
public int? source { get; set; }
public bool is_card_secret { get; set; }
public bool is_only_for_remote_area { get; set; }
public int? invoice_status { get; set; }
public object invoice_mode { get; set; }
public object client_id { get; set; }
public int? quan_guo_lian_bao { get; set; }
public int? zhi_huan_bu_xiu { get; set; }
public object song_huo_ru_hu { get; set; }
public object shang_men_an_zhuang { get; set; }
public object song_huo_an_zhuang { get; set; }
public object mai_jia_zi_ti { get; set; }
public object sf_markup_template_sn { get; set; }
public long? min_group_price { get; set; }
public long? max_group_price { get; set; }
public int? must_check_type { get; set; }
public object goods_property_list { get; set; }
public object is_small_group { get; set; }
public int? submit_time { get; set; }
public int? oversea_type { get; set; }
public object oversea_goods { get; set; }
public int? is_general_trade { get; set; }
public int? bad_fruit_claim { get; set; }
public string bad_claim_text { get; set; }
public int? allergy_refund { get; set; }
public int? lack_of_weight_claim { get; set; }
public int? delivery_one_day { get; set; }
public object delivery_type { get; set; }
public int? goods_pattern { get; set; }
public int? customizable { get; set; }
public int? is_group_pre_sale { get; set; }
public object elec_goods_attributes { get; set; }
public schedule_sale_item schedule_sale { get; set; }
public object goods_trade_attr { get; set; }
public object goods_travel_attr { get; set; }
public object sku_type { get; set; }
public int? is_goods_decoration { get; set; }
public List<object> goods_srv_templates { get; set; }
public object card_verification_list { get; set; }
public object transport_type_list { get; set; }
public object out_source_type { get; set; }
public object out_source_goods_id { get; set; }
public object is_all_weight_same { get; set; }
public bool? is_spring_festival_open_tag { get; set; }
public int? two_pieces_discount { get; set; }
public instruction_vo_item instruction_vo { get; set; }
public object local_service_id_list { get; set; }
public object shop_group_id { get; set; }
public object shop_group_name { get; set; }
public int? is_refundable_fifteen_day { get; set; }
public int? is_warranty_one_year { get; set; }
public long? created_at { get; set; }
public int? privacy_delivery { get; set; }
public object invoice_mode_sub_type { get; set; }
public bool? is_two_num_group { get; set; }
public extend_warranty_dto_item extend_warranty_dto { get; set; }
public int? is_sku_shipment { get; set; }
public List<object> qualification_id_list { get; set; }
public int? is_certificate_provide { get; set; }
public int? thawed_refund { get; set; }
public int? damage_claim { get; set; }
public int? is_wp_service { get; set; }
public int? is_size_change_casually { get; set; }
public string owner_name { get; set; }
public bool? show_activity_price { get; set; }
public object appeal_status { get; set; }
public object can_appeal { get; set; }
public List<int?> cat_ids { get; set; }
public List<string> cats { get; set; }
public bool? is_draft { get; set; }
public int? third_type { get; set; }
public int? estimate_quantity { get; set; }
public int? last_commit_check_status { get; set; }
public bool? is_deposit { get; set; }
public object gold_price_template_id { get; set; }
public object gold_price_type { get; set; }
public int? processing_charges { get; set; }
public object processing_charges_type { get; set; }
public object is_gold_price_matched { get; set; }
public object shoes_template_id { get; set; }
public object spu_id { get; set; }
public object spu_version { get; set; }
public object is_goods_copy { get; set; }
public int? promised_delivery_seconds { get; set; }
public int? community_group_buying { get; set; }
public int? purchase_info_supply { get; set; }
public int? same_city_template_id { get; set; }
public object goods_certificate { get; set; }
public int? is_customized { get; set; }
public string name_prefix { get; set; }
public object business_source_type { get; set; }
public object creator_name { get; set; }
public object reason { get; set; }
public object app_id { get; set; }
public object app_name { get; set; }
public int? user_source { get; set; }
public object check_type { get; set; }
}
public class group_item
{
public int? single_price { get; set; }
public int? group_price { get; set; }
public object carnival_price { get; set; }
public int? customer_num { get; set; }
public int? buy_limit { get; set; } //999999
public int? order_limit { get; set; } //999999
public string regular_limit { get; set; }
public object regular_limit_duration { get; set; }
public object min_num_of_order { get; set; }
public int? community_group_buying { get; set; } = 0;
}
public class commit_extension_item
{
public int? id { get; set; }
public int? goods_commit_id { get; set; }
public int? start_production_date { get; set; }
public int? end_production_date { get; set; }
public string production_license { get; set; }
public string production_standard_number { get; set; }
public int? shelf_life { get; set; }
public string out_goods_sn { get; set; }
public object created_at { get; set; }
public object updated_at { get; set; }
}
public class gallery_item
{
public string url { get; set; }
public int? width { get; set; }
public int? height { get; set; }
// 图片类型 1 主图 2 详情图 3视频
public int? type { get; set; }
public object source { get; set; }
public object status { get; set; }
public object video_url { get; set; }
public object file_id { get; set; }
public object is_deleted { get; set; }
public object check_comment { get; set; }
public object origin_url { get; set; }
}
public class mall_info_item {
public string mall_name { get; set; }
}
public class sku_edit_item : sku_item
{
public string thumb_md5 { get; set; }
}
public class sku_item
{
public long? id { get; set; }
public long? sku_id { get; set; }
public object sku_sn { get; set; }
public int? carnival_price { get; set; }
public int? init_quantity { get; set; }
public int? is_onsale { get; set; }
public int? limit_quantity { get; set; } = 999999; // 999999 max
public int? multi_price { get; set; }
public object multi_price_in_yuan { get; set; }
public int? price { get; set; }
public object price_in_yuan { get; set; }
public int? quantity { get; set; }
public int? reserve_quantity { get; set; }
public int? weight { get; set; }
public string thumb_url { get; set; }
public long? thumb_url_file_id { get; set; }
public object thumb_url_status { get; set; }
public object thumb_url_is_deleted { get; set; }
public int? quantity_delta { get; set; }
public List<spec_item> spec { get; set; }
// 货号
public string out_sku_sn { get; set; }
public object batch_id { get; set; }
public int? priority { get; set; }
public int? ware_id { get; set; }
public object ware_biz_type { get; set; } // null
public object advice_price { get; set; }
public object length { get; set; }
public oversea_sku_item oversea_sku { get; set; }
public object cspu_id { get; set; }
public object child_skus { get; set; }
public long? ref_sku_commit_id { get; set; }
public object start_time { get; set; }
public object end_time { get; set; }
public object sku_srv_templates { get; set; }
public object calendar_rule_id { get; set; }
public object hot_live_group { get; set; }
public int? pre_sale_time { get; set; }
public object out_source_sku_id { get; set; }
public object dd_grocery_sku_params { get; set; }
public object sku_extended_attribute_dtos { get; set; }
public object sku_basic_property_dtos { get; set; }
public object spec_note_map { get; set; }
public object delivery_schedule_dtos { get; set; }
public List<object> shipment_limit_second_list { get; set; }
public string sku69_code { get; set; }
}
public class spec_item
{
public long? parent_id { get; set; }
public string parent_name { get; set; }
public long? spec_id { get; set; }
public string spec_name { get; set; }
public object spec_note { get; set; }
public object bundle_spec_list { get; set; }
public object sku_combination { get; set; }
public object is_custom { get; set; }
}
public class oversea_sku_item
{
public object specifications { get; set; }
public object measurement_code { get; set; }
public object measurement_unit { get; set; }
public object taxation { get; set; }
public object record_id_list { get; set; }
}
public class schedule_sale_item
{
public int? sale_type { get; set; }
public object sale_time_fixed { get; set; }
public object sale_time { get; set; }
public object price_show { get; set; }
public object price_desc { get; set; }
}
public class instruction_vo_item
{
public object template_id { get; set; }
public int? template_status { get; set; }
public object template_name { get; set; }
public object rejected_reason { get; set; }
}
public class extend_warranty_dto_item
{
public int? extend_warranty { get; set; }
public object extend_warranty_year { get; set; }
public object extend_warranty_range { get; set; }
}
}
@@ -1,33 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model
{
public class PDDProductInfo
{
public PDDProductDetailInfo detail { get; set; }
public PDDSizeSpecInfo size { get; set; }
public PDDProductDecorationInfo decoration { get; set; }
public PDDProductPropertyInfo property { get; set; }
/// <summary>
/// 白底图
/// </summary>
public PDDMaterialInfo material1 { get; set; }
/// <summary>
/// 长图
/// </summary>
public PDDMaterialInfo material3 { get; set; }
public object source_json { get; set; }
public string sale_count { get; set; }
public string sale_count_text { get; set; }
public string chance_id { get; set; }
public string chance_refere { get; set; } // 记录机会商品提交的refere
public string chance_tab { get; set; } // 记录机会商品提交的tab
}
}
@@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model
{
public class PDDProductPropertyInfo
{
public List<goods_propertie_item> goods_properties { get; set; }
public object sku_properties { get; set; }
}
public class goods_propertie_item
{
public string name { get; set; }
public int? ref_pid { get; set; }
public List<value_item> values { get; set; }
/// <summary>
/// 对应微信输入类型
/// </summary>
//public int? wx_input_type { get; set; }
}
public class value_item
{
public long? vid { get; set; }
public string value { get; set; }
public string unit { get; set; }
public string raw_value { get; set; }
public table_info_vo_info table_info_vo { get; set; }
}
public class table_info_vo_info
{
public List<table_value_info> table_value_list { get; set; }
}
public class table_value_info
{
public string value { get; set; } // "100.0",
public string unit { get; set; } // "%",
public int? column_type { get; set; } // 1
}
}
@@ -1,119 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model
{
//public class PDDSizeSpecInfo
//{
// public long? id { get; set; }
// public int? extendType { get; set; }
//}
//public class SizeContentItem
//{
// public string picUrl { get; set; }
//}
public class GroupsItem
{
/// <summary>
///
/// </summary>
public int? id { get; set; }
/// <summary>
/// 中国码
/// </summary>
public string name { get; set; }
/// <summary>
///
/// </summary>
public bool? required { get; set; }
}
public class ElementItem
{
/// <summary>
///
/// </summary>
public int? id { get; set; }
/// <summary>
/// 肩宽(cm)
/// </summary>
public string name { get; set; }
/// <summary>
///
/// </summary>
public bool? required { get; set; }
}
public class MetaItem
{
/// <summary>
///
/// </summary>
public List<GroupsItem> groups { get; set; }
/// <summary>
///
/// </summary>
public List<ElementItem> elements { get; set; }
/// <summary>
///
/// </summary>
public List<string> batchableElementIds { get; set; }
}
public class RecordItem
{
/// <summary>
///
/// </summary>
public Dictionary<string, string> values { get; set; }
}
public class ContentItem
{
/// <summary>
///
/// </summary>
public MetaItem meta { get; set; }
/// <summary>
///
/// </summary>
public List<RecordItem> records { get; set; }
/// <summary>
///
/// </summary>
public string picUrl { get; set; }
}
public class PDDSizeSpecInfo
{
/// <summary>
///
/// </summary>
public long? id { get; set; }
/// <summary>
///
/// </summary>
public int? extendType { get; set; }
/// <summary>
///
/// </summary>
public ContentItem content { get; set; }
/// <summary>
///
/// </summary>
public int? classId { get; set; }
/// <summary>
///
/// </summary>
public bool? reusable { get; set; }
/// <summary>
///
/// </summary>
public int? status { get; set; }
}
}
@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class ProductPurchasePriceResultParam
{
public int id { get; set; }
public string shop_id { get; set; }
public string shop_name { get; set; }
public string spu_id { get; set; }
public string skc_id { get; set; }
public string cat_id { get; set; }
public string cat_name { get; set; }
public string ext_code { get; set; }
public string product_name { get; set; }
public string main_img { get; set; }
public int discount { get; set; }
public string price_text { get; set; }
public string sku_purchase_price_json { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string notes { get; set; }
}
}
@@ -1,47 +0,0 @@
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
/// <summary>
/// 用户选品结果
/// </summary>
public class ProductSelectResultParam
{
public long id { get; set; }
public string out_product_Id { get; set; }
public string shop_id { get; set; }
public string shop_account { get; set; }
public string user_name { get; set; }
public string sub_user_name { get; set; }
public string notes { get; set; }
public string user_notes { get; set; }
public string status { get; set; }
public string draft_id { get; set; }
public int add_times { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string operate_sub_sa_name { get; set; }
public string operate_sub_sa_nick { get; set; }
public DateTime? add_sub_sa_time { get; set; }
public string fission_product_name { get; set; }
#region 外键连接属性
public string from_shop_id { get; set; } = "";
public string cat_id { get; set; }
public string cat_name { get; set; }
public string change_cat_id { get; set; }
public string change_cat_name { get; set; }
public string group { get; set; }
public string ext_code { get; set; }
public string product_name { get; set; }
public string main_img { get; set; }
public string spu_id { get; set; }
public string skc_id { get; set; }
public int product_get_type { get; set; }
#endregion
}
}
-47
View File
@@ -1,47 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class Result
{
public Result()
{
}
public Result(int code, string msg)
{
Code = code;
Msg = msg;
}
public int Code { get; set; }
public string Msg { get; set; }
public object Data { get; set; }
public static Result Success(string msg)
{
return new Result
{
Code = 200,
Msg = msg
};
}
public static Result Failure(string msg)
{
return new Result
{
Code = 500,
Msg = msg
};
}
//参数不合法
public static Result ArgumentNull()
{
return new Result { Code = 19999, Msg = "输入为空" };
}
}
}
@@ -1,47 +0,0 @@
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.ShopModel
{
public class JSTListProductSkuInfo
{
public long id { get; set; }
public string skuId { get; set; } // "F51114C9251A4AC1A03D91256FB48EF5",
public string itemSpuId { get; set; } // "16306F9EA78643A6B8389036BFC6131B",
public string pic { get; set; } // "https://images.sursung.com/prod/item/11625838/20260213/7D4666188669485C95B31A53CE621EAB_s392918_h800_w800.jpg",
public string itemName { get; set; } // "汉服发带唐风发饰古风国风头饰女马面裙配饰",
/// <summary>
/// spu货号
/// </summary>
public string styleCode { get; set; } // "633881130581",
/// <summary>
/// sku货号
/// </summary>
public string itemCode { get; set; } // "sp01351C",
public string color { get; set; } // "葡萄花鸟复原蓝",
public string spec { get; set; } // "无规格",
public decimal? salePrice { get; set; } // 7,
//public object weight { get; set; } // null,
//public object stockLastTime { get; set; } // null,
//public object regulatePriceMin { get; set; } // null,
//public object regulatePriceMax { get; set; } // null
public decimal? supplyPrice { get; set; }
public int? stock { get; set; }
public decimal? weight { get; set; }
public DateTime stockTime { get; set; }
public string coid { get; set; }
public string supplierId { get; set; }
public string supplierName { get; set; }
public string status { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.ShopModel
{
public class JitCardCodeParam
{
public int id { get; set; }
public string card_code_id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime add_time { get; set; }
/// <summary>
/// 激活时间
/// </summary>
public DateTime? active_time { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public DateTime? expire_time { get; set; }
public string shop_id { get; set; }
public string shop_account { get; set; }
public string notes { get; set; }
}
}
@@ -1,91 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.ShopModel
{
public class ShopParam
{
public int id { get; set; }
public string login_name { get; set; }
public string login_pass { get; set; }
public string cookie { get; set; }
public string cookie2 { get; set; }
/// <summary>
/// 拼多多AntiContents
/// </summary>
public string anti_contents { get; set; }
/// <summary>
/// 拼多多Id
/// </summary>
public string pddid { get; set; }
/// <summary>
/// 拼多多mall_id
/// </summary>
public string mall_id { get; set; }
/// <summary>
/// 微店网页token
/// </summary>
public string wd_token { get; set; }
/// <summary>
/// 微信openId
/// </summary>
public string openid { get; set; }
public string shop_id { get; set; }
public string shop_account { get; set; }
public string sub_user_name { get; set; }
public string sub_nick_name { get; set; }
public string user_name { get; set; }
public string company_name { get; set; }
/// <summary>
/// 备注
/// </summary>
public string notes { get; set; }
public string group_name { get; set; }
public string login_status { get; set; }
public string login_status2 { get; set; }
public int add_product_remaining { get; set; }
public int add_product_month { get; set; }
public string operate_sub_sa_name { get; set; }
/// <summary>
/// temu推广直通车用户Id
/// </summary>
public string ad_seller_unique_id { get; set; }
/// <summary>
/// temu推广直通车链接地址(含信息)
/// </summary>
public string ad_url { get; set; }
/// <summary>
/// temu推广直通车cookie
/// </summary>
public string ad_cookie { get; set; }
/// <summary>
/// temu推广直通车登录状态
/// </summary>
public string ad_login_status { get; set; }
public DateTime? jit_expire_time { get; set; }
public int? expire_time { get; set; }
public DateTime add_time { get; set; }
//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
{
public int id { get; set; }
public string ShopId { get; set; } = "";
public string AccessToken { get; set; } = "";
public string RefreshToken { get; set; } = "";
public string AppKey { get; set; } = "";
public string AppSecret { get; set; } = "";
public DateTime ExpiresTime { get; set; }
public DateTime UpdateTime { get; set; } = DateTime.MinValue;
public string ApiAuthStatus { get; set; } = "未授权";
}
}
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.ShopModel
{
public class sku_img_replace
{
public int id { get; set; }
public string img_md5 { get; set; }
public string img_base64 { get; set; }
public string img_url { get; set; }
public string img_type { get; set; }
public string img_group { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class SkuImgResult
{
public int id { get; set; }
public int img_base64_db_id { get; set; }
public string img_md5 { get; set; }
public string img_url { get; set; }
public string product_id { get; set; }
public string spec_id { get; set; }
public string spec_name { get; set; }
public string original_img_url { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public DateTime base64_mdy_time { get; set; }
public string img_base64 { get; set; }
public int use_count { get; set; }
}
}
@@ -1,57 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class TemuDBOrderInfo
{
public int? id { get; set; }
public string supplierId { get; set; } // '店铺Id',
public string supplierName { get; set; }
public string originalPurchaseOrderSn { get; set; } // '备货单号',
public string subPurchaseOrderSn { get; set; } // '备货母单号',
public string productName { get; set; }
public string category { get; set; }
public string productId { get; set; } // '商品编号',
public string upProductId { get; set; } // 上家商品编号
public string productSkcId { get; set; } //
public string productSkcPicture { get; set; } //'主图',
public string productSn { get; set; } // '货号',
public int status { get; set; } = 1; // '状态 1待发货 2已送货 7已入库 8已作废',
public string productSkuId { get; set; } // CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
/// <summary>
/// 订单sku货号
/// </summary>
public string extCode { get; set; } // 'sku货号',
public string className { get; set; } // 'sku规格',
public string currencyType { get; set; } // 价格单位
public int supplierPrice { get; set; } // '申报价格',
public int? costPrice { get; set; } // '成本价',
public int? deliveryFee { get; set; } // '车队费',
public int? markFee { get; set; } // '贴标费',
public int purchaseQuantity { get; set; } // '备货件数',
public int deliverQuantity { get; set; } // '送货件数',
public int realReceiveAuthenticQuantity { get; set; } // '入库件数',
public decimal? availableSaleDays { get; set; } // '可售天数',
public int? qcResult { get; set; } // '抽检结果 1合格 2不合格',
public string thumbUrlList { get; set; } // 'sku图片',
public long purchaseTime { get; set; } // '备货单创建时间',
public long? deliverTime { get; set; } // '发货时间',
public long? receiveTime { get; set; } // '收货时间',
public long expectLatestDeliverTimeOrDefault { get; set; } // '最迟发货时间',
public long expectLatestArrivalTimeOrDefault { get; set; } // '最迟到货时间',
public string deliveryOrderSn { get; set; } // '发货单号',
public string receiveWarehouseId { get; set; } // '实际收货仓库Id',
public string receiveWarehouseName { get; set; } // '实际收货仓库',
public string warehouseGroupId { get; set; } // '仓组Id',
public string jiaTongCode { get; set; } // '佳同码',
public string barCodeMd5 { get; set; } // '商品条码MD5',
public string shippingMark​Md5 { get; set; } // '箱唛文件MD5',
public string notes { get; set; } // '备注',
public int upLoadStatus { get; set; } = 0; // '是否上传订单(上传后扣除用户授权金额,产生扣费记录)',
public DateTime add_time { get; set; } //
public DateTime mdy_time { get; set; } //
}
}
@@ -1,109 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class UserLoginResultParam
{
public int id { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string user_name { get; set; }
/// <summary>
/// 父用户名
/// </summary>
public string parent_user_name { get; set; }
/// <summary>
/// 贴牌编号
/// </summary>
public string oem_id { get; set; }
public string oem_name { get; set; }
public bool is_oem_owner { get; set; }
/// <summary>
/// 手机号(真实登录id,与用户名相同)
/// </summary>
public string mobile { get; set; }
public string password { get; set; }
public string nick_name { get; set; }
public string group_id { get; set; }
public bool is_import { get; set; }
public string company_name { get; set; }
public string card_id { get; set; }
private int _is_sa = 0;
public int is_sa
{
get { return Math.Max(_sa_level, _is_sa); }
set { _is_sa = value; }
}
private int _sa_level = 0;
public int sa_level
{
get { return Math.Max(_sa_level, _is_sa); }
set { _sa_level = value; }
}
public decimal authorized_amount { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
/// <summary>
/// 备注
/// </summary>
public string notes { get; set; }
/// <summary>
/// 用户的功能操作权限
/// </summary>
public string authority { get; set; }
/// <summary>
/// 父账户的功能操作权限
/// </summary>
public string parent_authority { get; set; }
/// <summary>
/// 子账号被禁止展示的功能页面
/// </summary>
public string forbidden_page { get; set; }
/// <summary>
/// 用户积分点数
/// </summary>
public int points { get; set; }
/// <summary>
/// 单店铺续费1个月消耗的点数
/// </summary>
public int shop_points_per_month { get; set; }
/// <summary>
/// 当前余额
/// </summary>
public decimal balance { get; set; }
/// <summary>
/// 历史充值总额
/// </summary>
public decimal recharge_amount_total { get; set; }
/// <summary>
/// 每单运费金额
/// </summary>
public decimal? postage_per_order { get; set; }
/// <summary>
/// 每单退货运费金额
/// </summary>
public decimal? refund_postage_per_order { get; set; }
/// <summary>
/// 每一单礼物额外收取费用
/// </summary>
public decimal? gift_oem_amount_per_order { get; set; }
}
}
@@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class WXAddressInfo
{
public int id { get; set; }
public string supplier_name { get; set; }
public string coid { get; set; }
public string after_sale_json { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string type { get; set; }
}
}
@@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class WXShopDefaultAddressInfo
{
public int? id { get; set; }
public string user_id { get; set; }
public string shop_id { get; set; }
public string province_name { get; set; }
public string city_name { get; set; }
public string county_name { get; set; }
public string detail_info { get; set; }
public string tel_number { get; set; }
public string user_name { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class WXBuyUrlNotesInfo
{
public int id { get; set; }
public string spu_code { get; set; }
public string user_name { get; set; }
public string buy_url_notes { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
public class WXBuyMapInfo
{
public long id { get; set; }
public string user_name { get; set; }
public string spu_code { get; set; }
public string sku_code { get; set; }
public string map_url { get; set; }
public string map_goods_name { get; set; }
/// <summary>
/// sku规格名称
/// </summary>
public string map_spec_name { get; set; }
public string map_goods_id { get; set; }
public string map_sku_id { get; set; }
/// <summary>
/// 发货地(省,市)
/// </summary>
public string map_send_address { get; set; }
public string transit_warehouse_id { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,169 +0,0 @@
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model.WxModel
{
public class WXClientProductInfoLite
{
public wx_client_prod_key product_key { get; set; }
public wx_client_prod_info info { get; set; }
public List<WXProductSkuInfoLite> productSkus { get; set; }
}
public class wx_client_prod_info
{
public string title { get; set; } // "2026新款情侣棒球帽立体C字母刺绣显脸小时尚百搭休闲韩版大头围鸭舌帽",
public string sub_title { get; set; } // "2025新款C字母立体刺绣棒球帽",
/// <summary>
/// 主图列表
/// </summary>
public List<string> head_img { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64f0a5760000484b151963b6bb81bc1e000000a000004f50", ...]
public List<wx_client_category> category { get; set; } // { "cat_id": "6093" }
/// <summary>
/// 商品详情(图)
/// </summary>
public wx_client_prod_detail detail { get; set; }
/// <summary>
/// 商品属性
/// </summary>
public List<wx_client_param> param { get; set; }
/// <summary>
/// 品牌id
/// </summary>
public string brand_id { get; set; } // "10250056"
public wx_client_sku_id_list sku_id_list { get; set; }
public wx_sku sku_list { get; set; }
public List<wx_client_product_sale_attr> product_sale_attrs { get; set; }
/// <summary>
/// 总销量
/// </summary>
public string total_sold_num { get; set; } // "46631"
public wx_client_service_desc service_desc { get; set; }
public wx_client_express_info express_info { get; set; }
public List<wx_client_head_video_info> headVideoInfo { get; set; }
public object afterSaleInfo { get; set; }
public List<object> deliveryExpressFee { get; set; }
public List<object> templateInfo { get; set; }
public string spuCode { get; set; }
}
public class wx_client_express_info
{
public string template_id { get; set; } // "243911370004",
public string product_id { get; set; } // "10000066623849",
public int? piece { get; set; } // 1,
public int? weight { get; set; } // 0,
public int? price { get; set; } // 5980
}
public class wx_client_service_desc
{
public string desc { get; set; } // "(麻烦阿姐阿哥们,带纸箱邮寄过去的一定记得用纸盒邮寄回,袋子邮寄的,带袋子寄回,拒收到付件,拒收自提件)"
}
public class wx_client_sku_id_list
{
public List<string> sku_ids { get; set; } //[ "1597139289", "1597121531", "1597127451", "1597113890", "1597119654" ]
}
public class wx_client_prod_key
{
public string product_id { get; set; } // "10000066623849",
public string appid { get; set; } // "wx62cca7dc2354b687"
}
public class wx_client_head_video_info
{
public string videoUrl { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f100001.mp4?wdis_k=7cdc03c564ae62499c03d8034036e65c4405cd2d&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
public string videoHeadImg { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f1400_0.jpeg?wdis_k=7f202df2767ca6d4b8cec6f52d1706ea8e497708&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
public int? videoLen { get; set; } // 24,
public string videoSize { get; set; } // "0",
public int? videoSource { get; set; } // 0,
public int? videoFormat { get; set; } // 0,
public string playableVideoUrl { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f100001.mp4?wdis_k=7cdc03c564ae62499c03d8034036e65c4405cd2d&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
public int? videoWidth { get; set; } // 1080,
public int? videoHeight { get; set; } // 1080,
public string videoH265Url { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f100003.mp4?wdis_k=057570644d9b72ff0c62e85b1c54cf0f0a8b42f6&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
public int? videoH265Width { get; set; } // 720,
public int? videoH265Height { get; set; } // 720
}
public class wx_client_product_sale_attr
{
public string key { get; set; } // "颜色"
public List<wx_client_product_sale_attr_item> items { get; set; }
public bool? has_img { get; set; }
}
public class wx_client_product_sale_attr_item
{
public string value { get; set; } // "卡其色"
public string img_url { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64eb0fd5000f2ca50a23b45f3567b01e000000a100004f50"
public List<string> sku_ids { get; set; } // [ "1597139289" ]
}
public class wx_sku
{
public List<wx_client_sku_info> sku_info { get; set; }
public string min_price_sku_id { get; set; } // "1597139289"
public string default_selected_sku_id { get; set; } // "1597139289"
}
public class wx_client_sku_info
{
public string sku_id { get; set; } // "1597139289",
public int? price { get; set; } // 5980,
public bool? is_discounted { get; set; } // true,
public int? discounted_price { get; set; } // 2990,
public int? origin_price { get; set; } // 5980,
}
public class wx_client_prod_detail
{
/// <summary>
/// 详情图
/// </summary>
public List<string> detail_img { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64f21d2b00009e7a156bc7cd6d63b01e000000a000004f50", ...]
public List<string> detailImg { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64f21d2b00009e7a156bc7cd6d63b01e000000a000004f50", ...]
public List<string> detail_img_real { get { return detail_img == null ? detailImg : detail_img; } }
public string desc { get; set; } // "纯萃美2025新款情侣棒球帽立体C字母刺绣显脸小时尚百搭休闲网红款韩版大头围硬顶鸭舌帽男女同款"
///// <summary>
/////
///// </summary>
//public List<string> detailImg { get; set; }
///// <summary>
///// 纯萃美2025新款情侣棒球帽立体C字母刺绣显脸小时尚百搭休闲网红款韩版大头围硬顶鸭舌帽男女同款
///// </summary>
//public string desc { get; set; }
}
public class wx_client_param
{
public List<wx_client_category> categorys { get; set; }
}
public class wx_client_category
{
public string catIdStr { get { return cat_id.IsNullOrEmpty() ? catId : cat_id; } } // "0",
public string cat_id { get; set; } // "0",
public string catId { get; set; } // "0",
public string name { get; set; } // "主要材质", "C字母刺绣"
public string f_cat_id { get; set; } // "0",
public string brand_cat { get; set; } // "0",
public wx_client_cat_info cat_info { get; set; }
}
public class wx_client_cat_info
{
public int? is_required { get; set; } // 1,
public int? is_customize { get; set; } // 0,
public int? input_type { get; set; } // 1
}
}
@@ -1,191 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KJD_WebService.Model.WxModel
{
public class WXGetEditProductInfoLite
{
public WXProductInfo product { get; set; }
public WXAfterSaleAddressInfo address { get; set; }
}
public class WXAfterSaleAddressInfo
{
public string addressId { get; set; } // "69496256002",
public string name { get; set; } // "",
public WXAddressInfo addressInfo { get; set; }
}
public class WXAddressInfo
{
public string userName { get; set; } // "王总",
public string postalCode { get; set; } // "",
public string provinceName { get; set; } // "安徽省",
public string cityName { get; set; } // "合肥市",
public string countyName { get; set; } // "肥西县",
public string detailInfo { get; set; } // "蜀山区长江西路某某号某某单元",
public string telNumber { get; set; } // "18388888888",
public int? lat { get; set; } // 0,
public int? lng { get; set; } // 0
}
public class WXProductInfo
{
public List<WXProductSkuInfoLite> productSkus { get; set; }
public WXProductKeyInfo productKey { get; set; }
public WXProductInfoInfo info { get; set; }
public int? status { get; set; } // 5
public string createTime { get; set; } // "1772529740",
public string updateTime { get; set; } // "1772533190",
public int? version { get; set; } // 8,
public int? editStatus { get; set; } // 4,
public string editTime { get; set; } // "1772533189",
public int source { get; set; } // 1
}
public class WXProductSkuInfoLite
{
public WXSkuKeyInfoLite skuKey { get; set; }
public WXProductSkuInfoInfoLite productSkuInfo { get; set; }
}
public class WXProductSkuInfoInfoLite
{
public List<WXSaleParamInfoLite> saleParam { get; set; }
public string thumbImg { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a1ae000e63741a5ddf35d5b71715000000a000004f50"
public string skuCode { get; set; } // ""
public int? salePrice { get; set; } // 5880
public WXStockInfoLite stockInfo { get; set; }
public WXRealStockInfoLite realStockInfo { get; set; }
}
public class WXRealStockInfoLite
{
public int? stockNum { get; set; } // 999
public int? totalNum { get; set; } // 999
}
public class WXStockInfoLite
{
public string stockNum { get; set; } // "9999999"
}
public class WXSaleParamInfoLite
{
public List<WXProductCategoryInfoLite> categorys { get; set; }
}
public class WXSkuKeyInfoLite
{
public string skuId { get; set; } // "8767785131",
}
public class WXProductKeyInfo
{
public string productId { get; set; } // "10000538778988"
}
public class WXProductInfoInfo
{
// 主图
public List<string> headImg { get; set; } = new List<string>();
public List<WXProductCategoryInfoLite> category { get; set; } = new List<WXProductCategoryInfoLite>();
public List<WXProductParamInfo> param { get; set; } = new List<WXProductParamInfo>();
public List<WXQualificationInfo> qualificationList { get; set; }
public List<WXProductHeadimgInfo> productHeadimgInfo { get; set; }
public List<WXHeadImgInfo> headImgInfos { get; set; }
public string title { get; set; } // "歪歪马震动棒 成人情趣用品"
public string subTitle { get; set; } // "",
public string brand { get; set; } // "",
public string model { get; set; } // "",
public WXProductDetailInfo detail { get; set; }
public string brandId { get; set; } // "10655917"
public string listingTime { get; set; } // "1772533190"
public string spuCode { get; set; } // "2028756820870602753"
public WXAfterSaleInfo afterSaleInfo { get; set; }
public string lastEditDraftTime { get; set; } // "1772532559"
public string shortTitle { get; set; } // "歪歪马脉冲震动成人情趣棒"
public string aiGenShortTitle { get; set; } // "歪歪马脉冲震动成人情趣棒"
public string uniqueId { get; set; } // "4411405439658180613"
}
public class WXAfterSaleInfo
{
public string afterSaleAddressId;
}
public class WXProductDetailInfo
{
public List<string> detailImg { get; set; } = new List<string>(); // [ "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a8460000683300254e4c8c4fab15000000a100004f50", ... ],
public List<object> detailVideos { get; set; } = new List<object>();
public List<object> detailVideoInfo { get; set; } = new List<object>();
public List<object> carouselImg { get; set; } = new List<object>();
public string desc { get; set; } = "";
}
public class WXHeadImgInfo
{
public string imgUrl { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a8420006d56e0003583092a31715000000a100004f50",
public int? imgWidth { get; set; } // 800,
public int? imgHeight { get; set; } // 800
}
public class WXProductHeadimgInfo
{
public List<object> colors { get; set; } = new List<object>(); // []
public string imgUrl { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a8420006d56e0003583092a31715000000a100004f50"
public WXMainColors mainColors { get; set; }
}
public class WXMainColors
{
public int? red { get; set; } // 255,
public int? green { get; set; } // 255,
public int? blue { get; set; } // 255
}
public class WXQualificationInfo
{
public List<string> qualificationUrl { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a84a0008442e2a4a8f7179bc1715000000a000004f50"]
public string qualificationId { get; set; } // "50000115"
public int? showCertType { get; set; } // 0
}
public class WXProductParamInfo
{
public List<WXProductParamCategoryInfo> categorys { get; set; } = new List<WXProductParamCategoryInfo>();
}
public class WXProductParamCategoryInfo
{
public string name { get; set; } // [0] "name": "长度" [1] "name": "20 cm",
public int? catType { get; set; } = 0;
public WXProductParamCategoryCatInfo catInfo { get; set; }
}
public class WXProductParamCategoryCatInfo
{
public int? isRequired { get; set; } // 1,
public int? isCustomize { get; set; } // 0,
public int? inputType { get; set; } // 1-单选 2-文本
public long? catGroup { get; set; } // 4294967295,
}
public class WXProductCategoryInfoLite
{
public string catId { get; set; } // "10000577"
public string name { get; set; } // "情趣用品" // 可能为空或没有此字段
public string fCatId { get; set; } // "10000575"
public WXProductCategoryInfoInfoLite catInfo { get; set; }
public bool? leaf { get; set; } // false
}
public class WXProductCategoryInfoInfoLite
{
public int? catLevel { get; set; } // 2
public long? catGroup { get; set; } // 4294967295
}
}
@@ -1,94 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
/// <summary>
/// 微信订单金额详情
/// </summary>
public class WXOrderAmountInfo
{
/// <summary>
/// 店铺名称
/// </summary>
public string shop_name { get; set; }
/// <summary>
/// 下单时间(秒级时间戳)
/// </summary>
public int create_time { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string order_id { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public int status { get; set; }
/// <summary>
/// 商品总价(分)
/// </summary>
public int product_price { get; set; }
/// <summary>
/// 订单金额(分)
/// </summary>
public int order_price { get; set; }
/// <summary>
/// 采购价(分)
/// </summary>
public int purchase_price { get; set; }
/// <summary>
/// 运费(分)
/// </summary>
public int freight { get; set; }
/// <summary>
/// 平台服务费(预计技术服务费,分)
/// </summary>
public int predict_commission_fee { get; set; }
/// <summary>
/// 达人佣金(分)
/// </summary>
public int commission_amount { get; set; }
/// <summary>
/// 优惠金额(分)
/// </summary>
public int discounted_price { get; set; }
/// <summary>
/// 利润 = 订单金额 - 外采金额 - 平台服务费 - 达人佣金(分)
/// </summary>
public int profit { get; set; }
/// <summary>
/// 采购状态
/// </summary>
public int purchase_status { get; set; }
/// <summary>
/// 外采金额(分),out_amount 为空或0时从中转仓订单表补全
/// </summary>
public int out_amount { get; set; }
/// <summary>
/// 售后状态(订单明细 refund_status)
/// </summary>
public int refund_status { get; set; }
/// <summary>
/// 售后状态(退款单 status)
/// </summary>
public string refund_status_string { get; set; }
/// <summary>
/// 售后退款金额(分),无退款默认0
/// </summary>
public int refund_amount { get; set; }
/// <summary>
/// 是否外采:0=未从中转仓订单表查到,1=查到
/// </summary>
public int external_procurement { get; set; }
/// <summary>
/// 买手号退款金额(分):退款订单且非外采时,从买手售后表(order_pdd_buyer_after_sale)补全,无退款默认0
/// </summary>
public int buyer_refund_amount { get; set; }
/// <summary>
/// 买手号退款状态
/// </summary>
public string buyer_refund_status { get; set; }
}
}
@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class WXOrderDecryptAddressInfo
{
public int id { get; set; }
public string shop_id { get; set; }
public string order_id { get; set; }
public string order_address { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class WxOptimizeExpressInfo
{
public int id { get; set; }
public string delivery_id { get; set; }
public string delivery_name { get; set; }
public string waybill_id { get; set; }
public int status { get; set; }
public string order_id { get; set; }
public string bind_order_id { get; set; }
public string shop_id { get; set; }
public DateTime add_time { get; set; }
public DateTime? use_time { get; set; }
public DateTime? waybill_pickup_time { get; set; }
}
public class WxOptimizeRstInfo
{
public int id { get; set; }
public string shop_id { get; set; }
public string order_id { get; set; }
public string optimize_rst { get; set; }
public string waybill_id { get; set; }
public string delivery_name { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
public class WxOptimizeRemarkInfo
{
public int id { get; set; }
public string shop_id { get; set; }
public string order_id { get; set; }
public string remark { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,48 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class distrib_return_order_info
{
/// <summary>
/// 退货主订单唯一ID
/// </summary>
public long id { get; set; }
public string order_code { get; set; } // varchar 255 退货订单编码
public string order_code_source { get; set; } // varchar 255 原始订单来源编码
public string logistics_code { get; set; } // varchar 50 物流系统编码(如SF、ZTO)
public string logistics_express_no { get; set; } // varchar 100 物流单号
public string platform { get; set; } // varchar 50 中转仓平台来源(如OTHER、JD、PDD)
public string shop_name { get; set; } // varchar 255 店铺名称
public string sender_name { get; set; } // varchar 100 发件人姓名(冗余字段,便于快速查询,不依赖JSON解析)
public string sender_phone { get; set; } // varchar 20 发件人电话(冗余字段,便于快速查询,不依赖JSON解析)
public string sender_info { get; set; } // json 发货人信息(JSON格式:姓名、电话、省市区地址)
public string receiver_name { get; set; } // varchar 100 收货人姓名
public string receiver_phone { get; set; } // varchar 20 收货人电话
public string receiver_province { get; set; } // varchar 100 收货省份
public string receiver_city { get; set; } // varchar 100 收货城市
public string receiver_area { get; set; } // varchar 100 收货区县
public string receiver_address { get; set; } // 收货详细地址
public DateTime created_at { get; set; } // 记录创建时间
public DateTime updated_at { get; set; } // 记录更新时间
public DateTime warehouse_in_time { get; set; } // 入库时间(仓库接收退货商品的时间)
public DateTime warehouse_out_time { get; set; } // 出库时间(仓库发出补货或处理后商品的时间)
public int? warehouse_status { get; set; } // 出入库状态:0待处理、1已入库、2创建异常、3处理中
public int? return_order_status { get; set; } // 退货订单创建与处理状态
public int? first_weight_fee { get; set; } // 首重费用
public int? additional_weight_fee { get; set; } // 超重费用
public int? order_void_status { get; set; } // 订单作废状态:0=正常,1=已作废,2=作废失败
public string real_logistics_code { get; set; } // 255 下游物流公司
public string real_logistics_express_code { get; set; } // 255 下游物流单号
public string response_msg { get; set; } //
public string ext_field1 { get; set; } // 备用扩展字段1
public string ext_field2 { get; set; } // 备用扩展字段2
public string platform_code { get; set; } // 退货订单平台来源
public string platform_order_no { get; set; } // 平台订单号
public string after_sale_no { get; set; } // 售后单号
public int? postage { get; set; } // 订单初始费用(分)
}
}
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oem
{
public int id { get; set; }
public string oem_id { get; set; }
public string oem_name { get; set; }
public string oem_owner { get; set; }
public string oem_icon { get; set; }
public string oem_img { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,100 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oms_wei_external_procurement_after_sale_info
{
public long id { get; set; }
public string order_no { get; set; }
/// <summary>
/// 订单唯一值:OrderCode (外采单号)
/// </summary>
public string order_code { get; set; }
/// <summary>
/// 中转仓售后订单号
/// </summary>
public string external_order_no { get; set; }
/// <summary>
/// 售后订单号
/// </summary>
public string after_sale_no { get; set; }
/// <summary>
/// 1=转寄,2=换货, 3=退货
/// </summary>
public int? return_or_exchange { get; set; }
/// <summary>
/// 退款地址-省
/// </summary>
public string refund_province { get; set; }
/// <summary>
/// 退款地址-市
/// </summary>
public string refund_city { get; set; }
/// <summary>
/// 退款地址-县/区
/// </summary>
public string refund_county { get; set; }
public string refund_detail_address { get; set; }
/// <summary>
/// 退款的快递单号
/// </summary>
public string refund_waybill { get; set; }
/// <summary>
/// 退货的快递公司
/// </summary>
public string return_express_company { get; set; }
/// <summary>
/// 收货人姓名
/// </summary>
public string recipient_name { get; set; }
/// <summary>
/// 收货人电话
/// </summary>
public string recipient_phone { get; set; }
/// <summary>
/// 原始消息/扩展信息(JSON)
/// </summary>
public string raw_message { get; set; }
/// <summary>
/// 售后处理状态,0未处理,1处理中,2已完成,9异常
/// </summary>
public int? status { get; set; }
public DateTime? created_time { get; set; }
public DateTime? updated_time { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string create_user { get; set; }
/// <summary>
/// 更新人
/// </summary>
public string update_user { get; set; }
/// <summary>
/// 账户名
/// </summary>
public string account_user { get; set; }
/// <summary>
/// 1=入库 2=出库
/// </summary>
public int? warehouse_status { get; set; }
/// <summary>
/// 入库时间
/// </summary>
public DateTime? inbound_time { get; set; }
/// <summary>
/// 出库时间
/// </summary>
public DateTime? outbound_time { get; set; }
/// <summary>
/// 下游快递单号
/// </summary>
public string downstream_waybill { get; set; }
/// <summary>
/// 下游快递公司编码
/// </summary>
public string downstream_express_code { get; set; }
}
}
@@ -1,75 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oms_wei_external_procurement_log
{
public long id { get; set; }
public string out_order_no { get; set; }
public string order_no { get; set; }
public string order_sku_id { get; set; }
public string buyer_account { get; set; }
public int? out_amount { get; set; }
public string purchaser_note { get; set; }
public string express_1_company { get; set; }
public string express_1_waybill { get; set; }
public string express_2_company { get; set; }
public string express_2_waybill { get; set; }
public string refund_status { get; set; }
public DateTime pickup_time { get; set; }
/// <summary>
/// 中转仓状态:0 未使用,1 已创建,2 创建失败
/// </summary>
public int? transfer_warehouse_status { get; set; }
public string raw_message { get; set; }
public DateTime created_time { get; set; }
public DateTime updated_time { get; set; }
public string platform { get; set; }
public string order_platform_code { get; set; }
public string order_code { get; set; }
/// <summary>
/// 1正常取号 2提前取号
/// </summary>
public int? pre_allocated_order_no { get; set; }
public int? is_transfer_ship { get; set; }
/// <summary>
/// 溯源码
/// </summary>
public string random_code { get; set; }
/// <summary>
/// 1, "拒收" 2, "拦截" 3, "取消" 4, "订单作废"
/// </summary>
public int? transfer_refund_status { get; set; }
/// <summary>
/// 订单作废状态:0=正常,1=已作废,2=作废失败
/// </summary>
public int? order_void_status { get; set; }
/// <summary>
/// 0: 未使用, 1: 已入库, 2: 出库
/// </summary>
public int? warehouse_status { get; set; }
/// <summary>
/// 中转入库时间
/// </summary>
public DateTime? inbound_time { get; set; }
/// <summary>
/// 中转出库时间
/// </summary>
public DateTime? outbound_time { get; set; }
/// <summary>
/// 申请拒收状态 0未申请 1申请成功 2申请失败
/// </summary>
public int has_reject { get; set; }
/// <summary>
/// 拦截到仓时间
/// </summary>
public DateTime? blocked_arrival_time { get; set; }
/// <summary>
/// 拒收时间
/// </summary>
public DateTime? rejected_time { get; set; }
}
}
@@ -1,245 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oms_wei_order
{
public long id { get; set; }
public long shop_id { get; set; }
public string shop_name { get; set; }
/// <summary>
/// 商户ID
/// </summary>
public long merchant_id { get; set; }
public string order_id { get; set; }
/// <summary>
/// 买家身份标识
/// </summary>
public string openid { get; set; }
public int create_time { get; set; }
public int update_time { get; set; }
public string unionid { get; set; }
/// <summary>
/// 状态10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
/// </summary>
public int? status { get; set; }
/// <summary>
/// 售后信息json
/// </summary>
public string aftersale_detail { get; set; }
/// <summary>
/// 支付信息
/// </summary>
public string pay_info { get; set; }
/// <summary>
/// 额外信息
/// </summary>
public string ext_info { get; set; }
/// <summary>
/// 商品总价
/// </summary>
public int? product_price { get; set; }
/// <summary>
/// 订单金额,单位为分,order_price=original_order_price-discounted_price-deduction_price-change_down_price
/// </summary>
public int? order_price { get; set; }
/// <summary>
/// 采购价,单位为分
/// </summary>
public int? purchase_price { get; set; }
/// <summary>
/// 采购时间
/// </summary>
public int? purchase_time { get; set; }
/// <summary>
/// 运费,单位为分
/// </summary>
public int? freight { get; set; }
/// <summary>
/// 平台服务费(微信小店:预计技术服务费),单位为分
/// </summary>
public int? predict_commission_fee { get; set; }
/// <summary>
/// 达人佣金(微信小店:分账金额),单位为分
/// </summary>
public int? commission_amount { get; set; }
/// <summary>
/// 优惠券优惠金额,单位为分
/// </summary>
public int? discounted_price { get; set; }
/// <summary>
/// 利润(实付金额-采购价-平台服务费-达人佣金,达人佣金、采购价为空值则为0)
/// </summary>
public int? profit { get; set; }
/// <summary>
/// 采购状态,默认值为:0未采购,推送仓库时修改为1采购
/// </summary>
public int? purchase_status { get; set; }
/// <summary>
/// 延迟发货时间(微信小店:商品发货时效,超时此时间未发货即为发货超时)
/// </summary>
public int? delivery_deadline { get; set; }
/// <summary>
/// 发货时间
/// </summary>
public int? delivery_time { get; set; }
/// <summary>
/// 收货人姓名
/// </summary>
public string user_name { get; set; }
/// <summary>
/// 邮编
/// </summary>
public string postal_code { get; set; }
public string province_name { get; set; }
public string city_name { get; set; }
/// <summary>
/// 区
/// </summary>
public string county_name { get; set; }
/// <summary>
/// 详细地址
/// </summary>
public string detail_info { get; set; }
public string tel_number { get; set; }
/// <summary>
/// 门牌号码
/// </summary>
public string house_number { get; set; }
/// <summary>
/// 虚拟发货订单联系方式(deliver_method=1时返回)
/// </summary>
public string virtual_order_tel_number { get; set; }
/// <summary>
/// 额外的联系方式信息(虚拟号码相关)
/// </summary>
public string tel_number_ext_info { get; set; }
/// <summary>
/// 0:不使用虚拟号码,1:使用虚拟号码
/// </summary>
public int? use_tel_number { get; set; }
/// <summary>
/// 标识当前店铺下一个唯一的用户收货地址
/// </summary>
public string hash_code { get; set; }
/// <summary>
/// 发货物流信息JSON
/// </summary>
public string delivery_product_info { get; set; }
/// <summary>
/// 发货完成时间,秒级时间戳
/// </summary>
public int? ship_done_time { get; set; }
/// <summary>
/// 电子面单代发时的订单密文
/// </summary>
public string ewaybill_order_code { get; set; }
/// <summary>
/// 结算信息json
/// </summary>
public string settle_info { get; set; }
/// <summary>
/// 订单审核状态(0待审核1已审核)
/// </summary>
public int? audit_status { get; set; }
/// <summary>
/// 订单审核时间
/// </summary>
public DateTime audit_time { get; set; }
/// <summary>
/// erp发货快递公司
/// </summary>
public string erp_send_company { get; set; }
/// <summary>
/// erp发货快递单号
/// </summary>
public string erp_send_code { get; set; }
/// <summary>
/// erp发货状态
/// </summary>
public int? erp_send_status { get; set; }
/// <summary>
/// erp发货时间
/// </summary>
public DateTime erp_send_time { get; set; }
/// <summary>
/// 旗帜颜色备注,1:灰旗,2:红旗,3:橙旗,4:绿旗,5:天蓝旗,6:紫旗
/// </summary>
public int? colour_flag { get; set; }
/// <summary>
/// 旗帜备注时间
/// </summary>
public DateTime colour_flag_update_time { get; set; }
/// <summary>
/// 供应商备注异常单
/// </summary>
public string supplier_remark_exception { get; set; }
/// <summary>
/// 礼物单状态,默认值0:不存在礼物单,1:礼物单已发货,2:礼物单信息已更正
/// </summary>
public int? gift_order_status { get; set; }
/// <summary>
/// 店铺备注:取微信ext_info.merchant_notes
/// </summary>
public string shop_remark { get; set; }
/// <summary>
/// 软件备注
/// </summary>
public string soft_remark { get; set; }
/// <summary>
/// 外采金额(单位:分,整数存储)
/// </summary>
public int? out_amount { get; set; }
/// <summary>
/// 外采账户
/// </summary>
public string out_account { get; set; }
/// <summary>
/// 外采订单号
/// </summary>
public string out_order_no { get; set; }
/// <summary>
/// 外采快递公司
/// </summary>
public string out_express_company { get; set; }
/// <summary>
/// 外采快递单号
/// </summary>
public string out_express_no { get; set; }
/// <summary>
/// 外采是否发货(0 未发货,1 已发货)
/// </summary>
public int? out_shipped { get; set; }
/// <summary>
/// 判断是否优化过发货0 未优化, 1已优化
/// </summary>
public int? is_shipment_optimized { get; set; }
/// <summary>
/// 判断是否优随机使用快递单号0 未使用, 1已使用
/// </summary>
public int? is_express_no_used { get; set; }
/// <summary>
/// 外采订单售后状态
/// </summary>
public string out_after_sale_status { get; set; }
/// <summary>
/// 是否支持运费险:0-不支持,1-支持
/// </summary>
public int? has_freight_insurance { get; set; }
/// <summary>
/// 运费险金额(单位:元)
/// </summary>
public decimal? freight_insurance_amount { get; set; }
/// <summary>
/// 是否外采礼物单:0-否,1-是(外采订单)
/// </summary>
public int? external_gift { get; set; }
/// <summary>
/// 中转仓的状态 0未使用,1已创建,2创建失败(购买失败),3已创建未有上游快递单号,4已创建有上游快递单号
/// </summary>
public decimal? transfer_warehouse_status { get; set; }
}
}
@@ -1,153 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oms_wei_order_item
{
/// <summary>
/// 订单商品表数据库id
/// </summary>
public long id { get; set; }
public long shop_id { get; set; }
/// <summary>
/// 商户ID
/// </summary>
public long merchant_id { get; set; }
/// <summary>
/// 订单id(平台订单id)
/// </summary>
public string order_id { get; set; }
/// <summary>
/// 商品spuid
/// </summary>
public string product_id { get; set; }
public string sku_id { get; set; }
/// <summary>
/// sku小图
/// </summary>
public string thumb_img { get; set; }
/// <summary>
/// sku数量
/// </summary>
public int? sku_cnt { get; set; }
/// <summary>
/// 售卖单价(单位:分)
/// </summary>
public int? sale_price { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string title { get; set; }
/// <summary>
/// 正在售后/退款流程中的 sku 数量
/// </summary>
public int? on_aftersale_sku_cnt { get; set; }
/// <summary>
/// 完成售后/退款的 sku 数量
/// </summary>
public int? finish_aftersale_sku_cnt { get; set; }
/// <summary>
/// 商品编码
/// </summary>
public string sku_code { get; set; }
/// <summary>
/// 市场单价(单位:分)
/// </summary>
public int? market_price { get; set; }
/// <summary>
/// sku属性JSON
/// </summary>
public string sku_attrs { get; set; }
/// <summary>
/// sku实付总价,取estimate_price和change_price中较小值
/// </summary>
public int? real_price { get; set; }
/// <summary>
/// 商品外部spuid
/// </summary>
public string out_product_id { get; set; }
/// <summary>
/// 采购价
/// </summary>
public int? purchase_price { get; set; }
/// <summary>
/// 运费
/// </summary>
public int? freight { get; set; }
/// <summary>
/// 商品外部skuid
/// </summary>
public string out_sku_id { get; set; }
/// <summary>
/// 是否有优惠金额,非必填,默认为false
/// </summary>
public string is_discounted { get; set; }
/// <summary>
/// 优惠后sku总价,非必填,is_discounted为true时有值
/// </summary>
public int? estimate_price { get; set; }
/// <summary>
/// 是否修改过价格,非必填,默认为false
/// </summary>
public string is_change_price { get; set; }
/// <summary>
/// 改价后sku总价,非必填,is_change_price为true时有值
/// </summary>
public int? change_price { get; set; }
/// <summary>
/// 订单内商品维度平台券优惠金额(利润需要计算这个金额在内)
/// </summary>
public int? cash_coupon_discounted_price { get; set; }
/// <summary>
/// 区域库存id
/// </summary>
public string out_warehouse_id { get; set; }
/// <summary>
/// 退货地址
/// </summary>
public string return_address { get; set; }
/// <summary>
/// 商品发货信息JSON
/// </summary>
public string sku_deliver_info { get; set; }
/// <summary>
/// 商品额外服务信息JSON
/// </summary>
public string extra_service { get; set; }
/// <summary>
/// 是否使用了会员积分抵扣
/// </summary>
public string use_deduction { get; set; }
/// <summary>
/// 会员积分抵扣金额,单位为分
/// </summary>
public int? deduction_price { get; set; }
/// <summary>
/// 达人佣金(微信小店:分账金额),单位为分
/// </summary>
public int? predict_commission_fee { get; set; }
/// <summary>
/// 达人佣金(微信小店:分账金额),单位为分
/// </summary>
public int? commission_amount { get; set; }
/// <summary>
/// 商品优惠券信息,逐步替换 order.order_detail.coupon_info
/// </summary>
public string order_product_coupon_info_list { get; set; }
/// <summary>
/// 商品id(o_goods外键)
/// </summary>
public long? erp_goods_id { get; set; }
/// <summary>
/// 商品skuid(o_goods_sku外键)
/// </summary>
public long? erp_goods_sku_id { get; set; }
/// <summary>
/// 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 11 已取消
/// </summary>
public int? refund_status { get; set; }
}
}
@@ -1,151 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oms_wei_refund
{
public long id { get; set; }
public long? shop_id { get; set; }
public string after_sale_order_id { get; set; }
/// <summary>
/// 售后单当前状态,参考:
/// USER_CANCELD 用户取消申请
/// MERCHANT_PROCESSING 商家受理中
/// MERCHANT_REJECT_REFUND 商家拒绝退款
/// MERCHANT_REJECT_RETURN 商家拒绝退货退款
/// USER_WAIT_RETURN 待买家退货
/// RETURN_CLOSED 退货退款关闭
/// MERCHANT_WAIT_RECEIPT 待商家收货
/// MERCHANT_OVERDUE_REFUND 商家逾期未退款
/// MERCHANT_REFUND_SUCCESS 退款完成
/// MERCHANT_RETURN_SUCCESS 退货退款完成
/// PLATFORM_REFUNDING 平台退款中
/// PLATFORM_REFUND_FAIL 平台退款失败
/// USER_WAIT_CONFIRM 待用户确认
/// MERCHANT_REFUND_RETRY_FAIL 商家打款失败,客服关闭售后
/// MERCHANT_FAIL 售后关闭
/// USER_WAIT_CONFIRM_UPDATE 待用户处理商家协商
/// USER_WAIT_HANDLE_MERCHANT_AFTER_SALE 待用户处理商家代发起的售后申请
/// </summary>
public string status { get; set; }
/// <summary>
/// 买家身份标识
/// </summary>
public string openid { get; set; }
/// <summary>
/// 买家在开放平台的唯一标识符,若当前视频号小店已绑定到微信开放平台账号下会返回
/// </summary>
public string unionid { get; set; }
/// <summary>
/// 商品spuid
/// </summary>
public string product_id { get; set; }
/// <summary>
/// 商品skuid
/// </summary>
public string sku_id { get; set; }
/// <summary>
/// 售后数量
/// </summary>
public int? count { get; set; }
/// <summary>
/// 是否极速退款RefundInfo
/// </summary>
public string fast_refund { get; set; }
/// <summary>
/// 标明售后单退款直接原因, 枚举值参考 RefundReason
/// </summary>
public int? refund_reason { get; set; }
/// <summary>
/// 退款金额(分)
/// </summary>
public int? refund_amount { get; set; }
/// <summary>
/// 退款快递单号
/// </summary>
public string return_waybill_id { get; set; }
/// <summary>
/// 物流公司id
/// </summary>
public string return_delivery_id { get; set; }
/// <summary>
/// 物流公司名称
/// </summary>
public string return_delivery_name { get; set; }
/// <summary>
/// 售后相关商品信息JSON
/// </summary>
public string merchant_upload_info { get; set; }
/// <summary>
/// 售后单创建时间戳
/// </summary>
public int? create_time { get; set; }
/// <summary>
/// 售后单更新时间戳
/// </summary>
public int? update_time { get; set; }
/// <summary>
/// 退款原因
/// </summary>
public string reason { get; set; }
/// <summary>
/// 退款原因解释
/// </summary>
public string reason_text { get; set; }
/// <summary>
/// 售后类型。REFUND:退款;RETURN:退货退款。
/// </summary>
public string type { get; set; }
/// <summary>
/// 订单号,该字段可用于获取订单
/// </summary>
public string order_id { get; set; }
/// <summary>
/// detail json
/// </summary>
public string details { get; set; }
/// <summary>
/// 纠纷id,该字段可用于获取纠纷信息
/// </summary>
public string complaint_id { get; set; }
/// <summary>
/// 微信支付退款的响应
/// </summary>
public string refund_resp { get; set; }
/// <summary>
/// 推送状态(0未推送;1推送成功;2推送失败)
/// </summary>
public int? pull_status { get; set; }
/// <summary>
/// 订单审核时间
/// </summary>
public DateTime pull_time { get; set; }
/// <summary>
/// 商品id(o_goods外键)
/// </summary>
public long? erp_goods_id { get; set; }
/// <summary>
/// 商品skuid(o_goods_sku外键)
/// </summary>
public long? erp_goods_sku_id { get; set; }
/// <summary>
/// 商户id
/// </summary>
public long merchant_id { get; set; }
/// <summary>
/// 仓库受理状态
/// </summary>
public int? warehouse_status { get; set; }
public string return_user_name { get; set; }
public string return_province { get; set; }
public string return_city { get; set; }
public string return_county { get; set; }
public string return_detail { get; set; }
public string return_tel { get; set; }
}
}
@@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class order_item_ext
{
public long? id { get; set; }
public string order_id { get; set; }
public string out_order_id { get; set; }
public string sku_id { get; set; }
public string shop_app_id { get; set; }
public string shop_name { get; set; }
/// <summary>
/// 直发/云仓(一般只有直发才会写值,直发会覆盖中转)
/// </summary>
public string buy_type { get; set; }
/// <summary>
/// 订单异常文本
/// </summary>
public string abnormal_text { get; set; }
public int? flag { get; set; }
public string label { get; set; }
public string remark { get; set; }
public string after_sale_user_delivery_address { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,33 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class order_pdd_buyer_after_sale
{
public long? id { get; set; }
public string wx_order_id { get; set; }
public string wx_sku_id { get; set; }
/// <summary>
/// 买手订单在微信店铺的发货类型 0中转仓发货 1直发
/// </summary>
public int wx_send_type { get; set; }
public DateTime TransitCreateTime { get; set; }
//public DateTime TransitPickupTime { get; set; }
public int? pre_allocated_order_no { get; set; }
public string buyerId { get; set; }
public string buyerName { get; set; }
public string afterSalesId { get; set; }
public string orderSn { get; set; }
public int? orderAmount { get; set; }
public long? refundAmount { get; set; }
public long? orderDate { get; set; }
public string statusText { get; set; }
public string afterSaleAddress { get; set; }
public string order_detail { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,35 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class order_pdd_buyer_order
{
public long? id { get; set; }
public string wx_order_id { get; set; }
public string wx_sku_id { get; set; }
/// <summary>
/// 买手订单在微信店铺的发货类型 0中转仓发货 1直发
/// </summary>
public int wx_send_type { get; set; }
public DateTime TransitCreateTime { get; set; }
public int? pre_allocated_order_no { get; set; }
public string buyerId { get; set; }
public string buyerName { get; set; }
public string order_sn { get; set; }
public int? order_amount { get; set; }
public long? order_time { get; set; }
public string outExpressCompanyCode { get; set; }
public string tracking_number { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public string order_status_prompt { get; set; }
public int? after_sales_status { get; set; }
public string order_detail { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,133 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
/// <summary>
/// 用户操作任务状态(主任务,对应 o_user_operate_task)
/// </summary>
public class user_operate_task_info
{
/// <summary>主键id</summary>
[JsonIgnore] public long id;
/// <summary>任务类型,25:微信订单拉取任务</summary>
public int? task_type;
/// <summary>任务描述,描述任务设置的相关规则</summary>
[JsonIgnore] public string task_describe;
/// <summary>平台编码</summary>
public string task_platform_code;
/// <summary>售价加价比例</summary>
public int? sale_markup_rate;
/// <summary>售价固定加价金额,单位为(分)</summary>
public int? sale_markup_fixed;
/// <summary>运费加价比例</summary>
public int? freight_markup_rate;
/// <summary>门店id列表</summary>
public string shop_ids;
public string shop_name;
/// <summary>任务对象id列表,多个,分割</summary>
[JsonIgnore] public string object_ids;
/// <summary>子任务总数</summary>
public int? sub_task_num;
/// <summary>成功子任务数</summary>
public int? success_task_num;
/// <summary>失败子任务数</summary>
public int? fail_task_num;
/// <summary>sku最低价阈值(单位为分)</summary>
public int? sku_low_price_threshold;
/// <summary>任务状态:1:执行中,2:已完成,3:已人为中断</summary>
public int status;
/// <summary>创建人</summary>
[JsonIgnore]
public string create_by;
/// <summary>更新人</summary>
[JsonIgnore]
public string update_by;
/// <summary>备注</summary>
public string remark;
/// <summary>任务失败原因</summary>
public string task_fail_reason;
/// <summary>创建时间</summary>
public DateTime? create_time;
/// <summary>更新时间</summary>
public DateTime? update_time;
public List<user_operate_sub_task_info> sub_tasks;
}
public class user_operate_sub_task_info
{
/// <summary>子任务主键id</summary>
[JsonIgnore] public long id;
/// <summary>主任务id,对应o_user_operate_task主键id</summary>
[JsonIgnore]
public long task_id;
/// <summary>平台编码。"淘宝天猫:TMALL","京东POP:JD-POP"),"京东自营:JD-VC","拼多多:PDD","抖店:DOUDIAN","微信小店:WEISHOP","其他渠道:OFFLINE</summary>
public string platform_code;
/// <summary>门店id</summary>
[JsonIgnore] public long shop_id;
/// <summary>平台任务对象id,对应平台商品id</summary>
public string platform_object_id;
/// <summary>任务对象id。例如:商品上传中的商品id,同步订单的订单id</summary>
public string object_id;
/// <summary>平台返回状态码</summary>
[JsonIgnore] public string platform_resp_code;
/// <summary>平台返回信息</summary>
[JsonIgnore] public string platform_resp_msg;
/// <summary>平台返回数据</summary>
[JsonIgnore] public string platform_resp_data;
/// <summary>系统异常信息</summary>
public string sys_msg;
/// <summary>子任务状态:0:待执行,1:成功,2:失败,3:人为终止</summary>
public int status;
/// <summary>审核结果:2:审核不通过;3:审核通过</summary>
[JsonIgnore] public int? audit_result;
/// <summary>审核不通过原因</summary>
[JsonIgnore] public string audit_reason;
/// <summary>创建时间</summary>
[JsonIgnore] public DateTime? create_time;
/// <summary>创建人</summary>
[JsonIgnore] public string create_by;
/// <summary>更新时间</summary>
public DateTime? update_time;
/// <summary>更新人</summary>
[JsonIgnore] public string update_by;
}
}
@@ -1,69 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class user_payment_record_info
{
public long id { get; set; }
/// <summary>
/// 变动类型,1:充值,2:采购花费,3:产品退款到账,4:运费退款到账,5:采购收款,6:产品退款扣除,7:运费退款扣除,16:礼物单话费,20:中转运费,23:作废运费返还
/// </summary>
public int? type { get; set; }
/// <summary>
/// 充值或花费的金额(元)
/// </summary>
public decimal amount { get; set; }
/// <summary>
/// 充值或花费后的当前账户余额(元)
/// </summary>
public decimal balance { get; set; }
/// <summary>
/// 账户名
/// </summary>
public string user_name { get; set; }
/// <summary>
/// 平台编码
/// </summary>
public string platform_code { get; set; }
/// <summary>
/// 订单id
/// </summary>
public string order_id { get; set; }
/// <summary>
/// 售后单id
/// </summary>
public long? after_sale_id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string create_by { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime create_time { get; set; }
/// <summary>
/// 修改人
/// </summary>
public string update_by { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime update_time { get; set; }
/// <summary>
/// 是否已删除
/// </summary>
public int? is_deleted { get; set; }
/// <summary>
/// 备注
/// </summary>
public string remark { get; set; }
/// <summary>
/// 扣款的对方账户名称
/// </summary>
public string counterparty_account_name { get; set; }
}
}
@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class user_points_record_info
{
public int id { get; set; }
public string user_name { get; set; }
public string user_nick { get; set; }
public int delta_points { get; set; }
public int? new_points { get; set; }
public string option_type { get; set; }
public string operator_type { get; set; }
public string operator_name { get; set; }
public string shop_id { get; set; }
public string shop_account { get; set; }
public string remark { get; set; }
public DateTime add_time { get; set; }
/// <summary>
/// 对方账户名称
/// </summary>
public string counterparty_account_name { get; set; }
}
}
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class wx_qualification_image_info
{
public int id { get; set; }
public string cat_name { get; set; }
public string img_md5 { get; set; }
public string img_base64 { get; set; }
public string img_thumb_base64 { get; set; }
public string txt_margin { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class WxProdSecretSpuIdShopIdMapParam
{
public int id { get; set; }
public string up_secret_spu_id { get; set; }
public string up_spu_id { get; set; }
public string shop_id { get; set; }
public DateTime add_time { get; set; }
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="OrderService.asmx.cs" Class="KJD_Web.OrderService" %>
@@ -1,153 +0,0 @@
using KJD_Web.BLL;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// OrderService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class OrderService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void add_order()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().AddOrder(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_order_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().GetOrderList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//UpdateOrderStatus1
[WebMethod]
public void update_order_status1()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().UpdateOrderStatus1(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//AddOrderCodeFile
[WebMethod]
public void add_order_code_file()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().AddOrderCodeFile(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//SaveOrderCodeFileLink
[WebMethod]
public void save_order_code_file_link()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().SaveOrderCodeFileLink(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//getOrderCodeFile
[WebMethod]
public void get_order_code_file()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().getOrderCodeFile(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//UploadOrder
[WebMethod]
public void upload_order()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().UploadOrder(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void update_order_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new OrderManage().UpdateOrderStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="PriceService.asmx.cs" Class="KJD_Web.PriceService" %>
@@ -1,149 +0,0 @@
using KJD_Web.BLL;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// PriceService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class PriceService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_price_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().GetPriceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().AddPrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().DelDbPrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_db_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().MdyDBPrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_purchase_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().MdyPurchasePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_purchase_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().AddPurchasePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_purchase_price()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().DelPurchasePrice(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_purchase_price_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new PriceManage().GetPurchasePriceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="ProductService.asmx.cs" Class="KJD_Web.ProductService" %>
@@ -1,335 +0,0 @@
using KJD_Web.BLL;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ProductService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class ProductService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_product_group_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetProductGroupList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().AddProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().DelDbProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//[WebMethod]
//public void mdy_product()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// //result = new ProductManage().MdyShop(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
//[WebMethod]
//public void mdy_product_notes()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// result = new ProductManage().MdyProductNotes(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
[WebMethod]
public void mdy_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().MdyDBProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().AddUserSelectProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_user_select_product_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().MdyUserSelectProductStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetUserSelectProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetUserSelectProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().DelSelectProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_select_product_sub_sa()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().SetSelectProductSubSa(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_product_select_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().MdyProductSelectNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_select_prod_db_id_map_draft_id_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetSelectProdDbIdMapDraftIdList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_select_prod_map_up_spu_id_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetSelectProdMapUpSpuIdList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_sku_image()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().AddSkuImg(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_sku_image()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().DelSkuImg(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_image_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetSkuImgList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_base64_img_url()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().MdyBase64ImgUrl(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_base64_img_use_count()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().MdyBase64ImgUseCount(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//AddCateSizeWeightConfig
[WebMethod]
public void add_cate_size_weight_config_v2()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().AddCateSizeWeightConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_cate_size_weight_config_v2()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductManage().GetCateSizeWeightConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="ProductThirdService.asmx.cs" Class="KJD_Web.ProductThirdService" %>
@@ -1,268 +0,0 @@
using KJD_Web.BLL;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ProductThirdService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class ProductThirdService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_empty_product_json_for_bak()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetProductListEmptyProductJsonForBak(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_detail_list_bak()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetProductListBak(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().AddProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().DelDbProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//[WebMethod]
//public void mdy_product()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// //result = new ProductThridManage().MdyShop(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
//[WebMethod]
//public void mdy_product_notes()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// result = new ProductThirdManage().MdyProductNotes(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
[WebMethod]
public void mdy_product_category()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().MdyProductCategory(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().MdyDBProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().AddUserSelectProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_user_select_product_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().MdyUserSelectProductStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetUserSelectProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetUserSelectProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().DelSelectProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_select_product_sub_sa()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().SetSelectProductSubSa(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_product_select_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().MdyProductSelectNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_select_prod_db_id_map_draft_id_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new ProductThirdManage().GetSelectProdDbIdMapDraftIdList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过下列特性集
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("KJD_WebService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KJD_WebService")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
// 对 COM 组件不可见。如果需要
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
[assembly: Guid("a6c03fe1-142a-4c97-99a9-67fd915836b6")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订版本
//
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="ShopService.asmx.cs" Class="KJD_Web.ShopService" %>
Loaded 100 of 147 files, more files were not shown because too many files have changed in this diff. Show more