商品随机sku价格顺序提交尝试
This commit is contained in:
1 parent
c66ce84d26
commit
f92e8ed79b
15 files changed
+696
-299
No files matched your search
@@ -395,7 +395,8 @@ namespace KJD_Web.BLL
|
||||
var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'");
|
||||
|
||||
long l_draft_id = draft_id.ParseToLong();
|
||||
long l_table_id = l_draft_id % 128;
|
||||
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);
|
||||
@@ -404,8 +405,12 @@ namespace KJD_Web.BLL
|
||||
//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_table_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_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 kjd.product_select set";
|
||||
if (draft_id != null)
|
||||
sql += " draft_id='" + draft_id + "',";
|
||||
|
||||
@@ -358,7 +358,8 @@ namespace KJD_Web.BLL
|
||||
var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'");
|
||||
|
||||
long l_draft_id = draft_id.ParseToLong();
|
||||
long l_table_id = l_draft_id % 128;
|
||||
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);
|
||||
@@ -367,8 +368,12 @@ namespace KJD_Web.BLL
|
||||
//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_table_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 kjd.third_product_select set";
|
||||
if (draft_id != null)
|
||||
sql += " draft_id='" + draft_id + "',";
|
||||
|
||||
@@ -36,20 +36,20 @@ namespace KJD_Web.BLL
|
||||
// MysqlUtils mySql = new MysqlUtils(conn);
|
||||
// string sql = "";
|
||||
// string sql1 = "";
|
||||
// for (int i = 0; i < 69; i++)
|
||||
// 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.spu_map_" + i + @" (
|
||||
// sql = @"CREATE TABLE IF NOT EXISTS kjd_map.product_third_select_map_" + i + @" (
|
||||
// `id` int NOT NULL AUTO_INCREMENT,
|
||||
// `draft_id` bigint NOT NULL COMMENT '草稿箱/商品Id',
|
||||
// `from_spu_id` bigint NOT NULL COMMENT '母店来源商品Id',
|
||||
// `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 = '上传商品与母店商品spu映射关系';";
|
||||
|
||||
// sql += @"
|
||||
//ALTER TABLE
|
||||
// kjd_map.spu_map_" + i + @"
|
||||
// kjd_map.product_third_select_map_" + i + @"
|
||||
//ADD
|
||||
// COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP";
|
||||
// var rst = mySql.ExecuteNonQuery(sql);
|
||||
|
||||
Reference in new issue
Block a user