产品库手动更新sku下架情况
This commit is contained in:
1 parent
1b2b6bb553
commit
30efe8fccb
25 files changed
+2214
-490
No files matched your search
@@ -4,6 +4,7 @@ using KJD_Web.Utils;
|
||||
using MySql.Data.MySqlClient;
|
||||
using NaiBa.Util.Extension;
|
||||
using NaiBa.Util.Helper;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -242,6 +243,76 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetProductSpuIdLst(string inputData)
|
||||
{
|
||||
var timeCalc = DateTime.Now;
|
||||
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 version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
|
||||
if (version < (System.Configuration.ConfigurationManager.ConnectionStrings["LimitVersion"]?.ConnectionString).ParseToInt())
|
||||
return "{\"code\":1,\"msg\":\"当前版本过于陈旧,请立即升级新版\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var search_secret_spu_ids = RegexUtils.GetStringQuery(ref inputData, "search_secret_spu_ids")?.Replace("'", "\\'");
|
||||
var search_spu_ids = RegexUtils.GetStringQuery(ref inputData, "search_spu_ids")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(500);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select id,spu_id,secret_spu_id from bxx.product p where p.is_del=0";
|
||||
if (search_secret_spu_ids != null)
|
||||
{
|
||||
sql += " and p.secret_spu_id in ('" + string.Join("','", search_secret_spu_ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) + "')";
|
||||
}
|
||||
if (search_spu_ids != null)
|
||||
{
|
||||
sql += " and p.spu_id in ('" + string.Join("','", search_spu_ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) + "')";
|
||||
}
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<DBProductResultParamLite> productLst = new List<DBProductResultParamLite>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
DBProductResultParamLite prod = new DBProductResultParamLite
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
spu_id = row["spu_id"].ToString(),
|
||||
secret_spu_id = row["secret_spu_id"].IsNullOrEmpty() ? null : row["secret_spu_id"].ParseToString(),
|
||||
};
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + productLst.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 GetProductList(string inputData, bool isDetail = false)
|
||||
{
|
||||
var timeCalc = DateTime.Now;
|
||||
@@ -500,7 +571,8 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -517,6 +589,158 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string AddProdDownSku(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 password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
|
||||
var itemMainImage = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "itemMainImage")).ParseToString().Replace("'", "\\'");
|
||||
var itemName = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "itemName")).ParseToString().Replace("'", "\\'");
|
||||
var styleCode = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "styleCode")).ParseToString().Replace("'", "\\'");
|
||||
var itemCode = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "itemCode")).ParseToString().Replace("'", "\\'");
|
||||
var colourSpec = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "colourSpec")).ParseToString().Replace("'", "\\'");
|
||||
var supplyPrice = RegexUtils.GetStringQuery(ref inputData, "supplyPrice").ParseToString().Replace("'", "\\'");
|
||||
var supplierName = RegexUtils.GetStringQuery(ref inputData, "supplierName").ParseToString().Replace("'", "\\'");
|
||||
var shelvesTime = RegexUtils.GetStringQuery(ref inputData, "shelvesTime").ParseToString().Replace("'", "\\'");
|
||||
var supplierCoId = RegexUtils.GetStringQuery(ref inputData, "supplierCoId").ParseToString().Replace("'", "\\'");
|
||||
var coId = RegexUtils.GetStringQuery(ref inputData, "coId").ParseToString().Replace("'", "\\'");
|
||||
var spuId = RegexUtils.GetStringQuery(ref inputData, "spuId").ParseToString().Replace("'", "\\'");
|
||||
var partnerSkuId = RegexUtils.GetStringQuery(ref inputData, "partnerSkuId").ParseToString().Replace("'", "\\'");
|
||||
var partnerSpuId = RegexUtils.GetStringQuery(ref inputData, "partnerSpuId").ParseToString().Replace("'", "\\'");
|
||||
var supplierId = RegexUtils.GetStringQuery(ref inputData, "supplierId").ParseToString().Replace("'", "\\'");
|
||||
var drpItemStatus = RegexUtils.GetStringQuery(ref inputData, "drpItemStatus").ParseToString().Replace("'", "\\'");
|
||||
var lastOperator = RegexUtils.GetStringQuery(ref inputData, "lastOperator").ParseToString().Replace("'", "\\'");
|
||||
var itemSpuIdMd5 = RegexUtils.GetStringQuery(ref inputData, "itemSpuIdMd5").ParseToString().Replace("'", "\\'");
|
||||
var secret_spu_id = RegexUtils.GetStringQuery(ref inputData, "secret_spu_id").ParseToString().Replace("'", "\\'");
|
||||
var secret_sku_id = RegexUtils.GetStringQuery(ref inputData, "secret_sku_id").ParseToString().Replace("'", "\\'");
|
||||
var is_in_product_db = RegexUtils.GetStringQuery(ref inputData, "is_in_product_db").ParseToInt();
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
sql = "select styleCode,itemCode,colourSpec from bxx.product_jst_update where styleCode='" + styleCode +
|
||||
"' and itemCode='" + itemCode + "' and colourSpec='" + colourSpec + "'";
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"数据已存在\"}";
|
||||
}
|
||||
|
||||
sql = "insert into bxx.product_jst_update " +
|
||||
" (itemMainImage,itemName,styleCode,itemCode,colourSpec,supplyPrice,supplierName,shelvesTime,supplierCoId,coId,spuId," +
|
||||
" partnerSkuId,partnerSpuId,supplierId,drpItemStatus,lastOperator,itemSpuIdMd5,secret_spu_id,secret_sku_id,is_in_product_db)" +
|
||||
" values('" + itemMainImage + "','" + itemName + "','" + styleCode + "','" + itemCode + "','" + colourSpec + "','" + supplyPrice + "','" +
|
||||
supplierName + "','" + shelvesTime + "','" + supplierCoId + "','" + coId + "','" + spuId + "','" + partnerSkuId + "','" +
|
||||
partnerSpuId + "','" + supplierId + "','" + drpItemStatus + "','" + lastOperator + "','" + itemSpuIdMd5 + "','" + secret_spu_id + "','"
|
||||
+ secret_sku_id + "'," + is_in_product_db + ")";
|
||||
|
||||
//var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
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 GetProdDownSkuLstBySkuCodes(string inputData)
|
||||
{
|
||||
var timeCalc = DateTime.Now;
|
||||
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 version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
|
||||
//if (version < (System.Configuration.ConfigurationManager.ConnectionStrings["LimitVersion"]?.ConnectionString).ParseToInt())
|
||||
// return "{\"code\":1,\"msg\":\"当前版本过于陈旧,请立即升级新版\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var search_spu_ids = RegexUtils.GetStringQuery(ref inputData, "search_spu_ids")?.Replace("'", "\\'");
|
||||
var search_sku_codes = RegexUtils.GetStringQuery(ref inputData, "search_sku_codes")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(500);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select id,spuId,itemName,styleCode,itemCode,colourSpec,supplierCoId,supplierName,is_in_product_db,add_time from bxx.product_jst_update p where 1=1";
|
||||
if (search_spu_ids != null)
|
||||
{
|
||||
sql += " and p.spuId in ('" + string.Join("','", search_spu_ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) + "')";
|
||||
}
|
||||
if (search_sku_codes != null)
|
||||
{
|
||||
sql += " and p.itemCode in ('" + string.Join("','", search_sku_codes.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) + "')";
|
||||
}
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<JSTDownProdSkuInfo> productLst = new List<JSTDownProdSkuInfo>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
JSTDownProdSkuInfo prod = new JSTDownProdSkuInfo
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
spuId = row["spuId"].ToString(),
|
||||
itemName = row["itemName"].ToString(),
|
||||
styleCode = row["styleCode"].ToString(),
|
||||
itemCode = row["itemCode"].ToString(),
|
||||
colourSpec = row["colourSpec"].ToString(),
|
||||
supplierCoId = row["supplierCoId"].ToString(),
|
||||
supplierName = row["supplierName"].ToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
is_in_product_db = row["is_in_product_db"].ParseToInt(),
|
||||
};
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + productLst.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 GetProductGroups(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -738,6 +962,7 @@ namespace KJD_Web.BLL.BXX
|
||||
var in_spu_ids = RegexUtils.GetStringQuery(ref inputData, "in_spu_ids")?.Replace("'", "\\'");
|
||||
var in_skc_ids = RegexUtils.GetStringQuery(ref inputData, "in_skc_ids")?.Replace("'", "\\'");
|
||||
var in_groups = RegexUtils.GetStringQuery(ref inputData, "in_groups")?.Replace("'", "\\'");
|
||||
var product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.Replace("'", "\\'");
|
||||
var in_cates = RegexUtils.GetStringQuery(ref inputData, "in_cates")?.Replace("'", "\\'");
|
||||
var wx_cat_1 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_1")?.Replace("'", "\\'");
|
||||
var wx_cat_2 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_2")?.Replace("'", "\\'");
|
||||
@@ -755,7 +980,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(*) from bxx.product p where p.is_del=0";
|
||||
string sql = "select count(*) from bxx.product p FORCE INDEX (index_wx_safe_status) where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(in_ext_codes))
|
||||
@@ -783,6 +1008,10 @@ namespace KJD_Web.BLL.BXX
|
||||
in_cates = "'" + string.Join("','", in_cates.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and (p.cat_name in (" + in_cates + ") or p.main_cat_name in (" + in_cates + "))";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(product_name))
|
||||
{
|
||||
where += " and p.product_name='" + product_name + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(wx_cat_1))
|
||||
{
|
||||
where += " and p.wx_cat_1=" + wx_cat_1 + "";
|
||||
@@ -833,14 +1062,14 @@ namespace KJD_Web.BLL.BXX
|
||||
//sql += " ORDER BY RAND()";
|
||||
//sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
|
||||
var limit = RandomUtils.GetId(count - page_size);
|
||||
var limit = RandomUtils.GetId(Math.Max(1, count - page_size));
|
||||
sql += " limit " + limit + "," + page_size;
|
||||
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
Thread.Sleep(100);
|
||||
if (!string.IsNullOrEmpty(mySql.Message) || dt == null)
|
||||
{
|
||||
mySql.Close();
|
||||
Thread.Sleep(1000);
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
|
||||
@@ -450,7 +451,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select id from wxxd_product_shop_map.product_shop_map_" + index.ParseToString().PadLeft(4, '0') +
|
||||
" where up_secret_spu_id='" + up_secret_spu_id + "'and shop_id='" + shop_id + "'";
|
||||
" where up_secret_spu_id='" + up_secret_spu_id + "' and shop_id='" + shop_id + "';";
|
||||
|
||||
DataTable dt = mySql.ExecuteDataTable(sql);
|
||||
if (!string.IsNullOrEmpty(mySql.Message) || dt == null || dt.Rows == null)
|
||||
@@ -481,6 +482,104 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetSecretSpuIdShopIdMapList(string inputData)
|
||||
{
|
||||
var timeCalc = DateTime.Now;
|
||||
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 up_secret_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_secret_spu_id")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(up_secret_spu_id))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"缺少商品编号1\"}";
|
||||
}
|
||||
var index = RegexUtils.GetStringQuery(ref inputData, "index").ParseToNullableLong();
|
||||
if (index == null)
|
||||
index = up_secret_spu_id.ParseToLong() % 1024;
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
|
||||
var is_not_count = (RegexUtils.GetStringQuery(ref inputData, "is_not_count")?.Replace("'", "\\'")).ParseToBool();
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
int count = 0;
|
||||
string sql = "";
|
||||
if (!is_not_count)
|
||||
{
|
||||
sql = "select count(*) from wxxd_product_shop_map.product_shop_map_" + index.ParseToString().PadLeft(4, '0') +
|
||||
" where up_secret_spu_id='" + up_secret_spu_id;
|
||||
if (!shop_id.IsNullOrEmpty())
|
||||
sql += "' and shop_id='" + shop_id + "'";
|
||||
sql += ";";
|
||||
|
||||
count = mySql.ExecuteRowCount(sql);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0 && !is_not_count)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "select * from wxxd_product_shop_map.product_shop_map_" + index.ParseToString().PadLeft(4, '0') +
|
||||
" where up_secret_spu_id='" + up_secret_spu_id;
|
||||
if (!shop_id.IsNullOrEmpty())
|
||||
sql += "' and shop_id='" + shop_id + "'";
|
||||
sql += " order by add_time desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (!string.IsNullOrEmpty(mySql.Message) || dt == null)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<WxProdSecretSpuIdShopIdMapParam> prodSecretIdMapLst = new List<WxProdSecretSpuIdShopIdMapParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
WxProdSecretSpuIdShopIdMapParam idMap = new WxProdSecretSpuIdShopIdMapParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
up_secret_spu_id = row["up_secret_spu_id"].ToString(),
|
||||
up_spu_id = row["up_spu_id"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
//mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
};
|
||||
prodSecretIdMapLst.Add(idMap);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(prodSecretIdMapLst);
|
||||
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 WXAddMdyAfterSale(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
|
||||
@@ -49,6 +49,43 @@ namespace KJD_Web
|
||||
}
|
||||
}
|
||||
|
||||
[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()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using KJD_Web.BLL.BXX;
|
||||
using KJD_Web.BLL.WXXD;
|
||||
using KJD_Web.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -215,5 +216,17 @@ namespace KJD_Web
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,8 @@
|
||||
<Compile Include="BLL\WXXD\WXProductManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXShopManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXUserManage.cs" />
|
||||
<Compile Include="Model\JSTDownProdSkuInfo.cs" />
|
||||
<Compile Include="Model\WxProdSecretSpuIdShopIdMapParam.cs" />
|
||||
<Compile Include="Utils\HttpUtils.cs" />
|
||||
<Compile Include="Utils\RandomUtils.cs" />
|
||||
<Compile Include="WXProductService.asmx.cs">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
|
||||
@@ -5,6 +5,13 @@ 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>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -31,11 +31,15 @@ namespace KJD_Web.Utils
|
||||
}
|
||||
}
|
||||
|
||||
public static string SerializerObjectToString(object obj)
|
||||
public static string SerializerObjectToString(object obj, JsonSerializerSettings jsonsetting = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string str = JsonConvert.SerializeObject(obj, Formatting.None);
|
||||
string str = "";
|
||||
if (jsonsetting != null)
|
||||
str = JsonConvert.SerializeObject(obj, Formatting.None, jsonsetting);
|
||||
else
|
||||
str = JsonConvert.SerializeObject(obj, Formatting.None);
|
||||
return str;
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -134,7 +134,21 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
//WXAddMdyAfterSale
|
||||
/// <summary>
|
||||
/// 根据聚水潭加密商品编号(货号)查询所有上传过的店铺id 260224 未测试
|
||||
/// </summary>
|
||||
[WebMethod]
|
||||
public void get_secret_spu_id_shop_id_map_List()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXProductManage().WXGetSecretSpuIdShopIdMapList(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_add_mdy_after_sale()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user