diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index 05af92a..1922257 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,7 +27,7 @@ namespace AllBase
///
/// 版本ID
///
- public static int VersionCount = 725;
+ public static int VersionCount = 750;
//public static int VersionCount = 613;
///
diff --git a/AllBase/Model/Result/TemuDBProdMapResult.cs b/AllBase/Model/Result/TemuDBProdMapResult.cs
index b215079..ae62e18 100644
--- a/AllBase/Model/Result/TemuDBProdMapResult.cs
+++ b/AllBase/Model/Result/TemuDBProdMapResult.cs
@@ -8,8 +8,8 @@ namespace AllBase.Model.Result
{
public class DBProdDbIdMapProductIdInfo
{
- public int id { get; set; }
- public int product_select_db_id { get; set; }
+ 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; }
@@ -17,7 +17,7 @@ namespace AllBase.Model.Result
public class DBProdDraftIdMapUpSpuIdInfo
{
- public int id { get; set; }
+ public long id { get; set; }
public long draft_id { get; set; }
public long from_spu_id { get; set; }
public long shop_id { get; set; }
diff --git a/AllBase/Model/Result/TemuDBProductSelect.cs b/AllBase/Model/Result/TemuDBProductSelect.cs
index 84e4a27..58b63a6 100644
--- a/AllBase/Model/Result/TemuDBProductSelect.cs
+++ b/AllBase/Model/Result/TemuDBProductSelect.cs
@@ -11,7 +11,7 @@ namespace AllBase.Model.Result
///
public class TemuDBProductSelect
{
- public int id { get; set; }
+ public long id { get; set; }
public string out_product_Id { get; set; }
public string shop_id { get; set; }
public string shop_account { get; set; }
diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs
index fca6918..eabfd58 100644
--- a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs
+++ b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs
@@ -154,7 +154,7 @@ namespace KJD_Web.BLL.BXX
var shopMonthList = shopList.Where(s => s.add_product_month != month);
if (shopMonthList.Count() > 0)
{
- int remainCount = 100;
+ int remainCount = 300;
var shopMonthIdList = shopMonthList.Select(s => s.id);
mySql = new MysqlUtils(conn);
string ids = string.Join(",", shopMonthIdList);
@@ -332,7 +332,7 @@ namespace KJD_Web.BLL.BXX
var shopMonthList = shopList.Where(s => s.add_product_month != month);
if (shopMonthList.Count() > 0)
{
- int remainCount = 100;
+ int remainCount = 300;
var shopMonthIdList = shopMonthList.Select(s => s.id);
mySql = new MysqlUtils(conn);
string ids = string.Join(",", shopMonthIdList);
diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs
index 2596fa1..3c3cd85 100644
--- a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs
+++ b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs
@@ -2,6 +2,7 @@
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using NaiBa.Util.Extension;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -156,7 +157,7 @@ namespace KJD_Web.BLL
var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(product_get_type))
+ if (string.IsNullOrEmpty(product_get_type)) // 母店采集0或前端直采1
product_get_type = "0";
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
@@ -206,12 +207,24 @@ namespace KJD_Web.BLL
" FROM kjd.product p" +
" WHERE p.is_del=0";
else // 统计单店认领次数
+ {
sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes,p.group," +
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.product_get_type," +
"p.cost_price,delivery_fee,p.mark_fee" +
",COUNT(s.id) AS select_count" +
- " FROM kjd.product p LEFT JOIN kjd.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "'" +
+ " FROM kjd.product p" +
+ " LEFT JOIN (" +
+ " SELECT id,out_product_id,shop_id FROM kjd.product_select WHERE shop_id='" + select_shop_id + "'";
+ for (int year = Math.Max(2026, DateTime.Now.AddYears(-3).Year); year <= DateTime.Now.Year; year++)
+ {
+ sql += "UNION ALL SELECT id,out_product_id,shop_id FROM kjd_yearly.product_select_" + year + " WHERE shop_id='" + select_shop_id + "'";
+ }
+ sql += ") s" +
+ " ON s.out_product_id=p.id AND s.shop_id='" + select_shop_id + "'" +
" WHERE p.is_del=0";
+ }
+
+ //sql += "select * from " + tableName + l_spu_map_table_id + " where draft_id=" + in_draft_id_list[i];
if (!isDetail && product_get_type != "all") // 详情必须从列表页面进入,不用限制
sql += " AND p.product_get_type=" + product_get_type;
@@ -224,7 +237,7 @@ namespace KJD_Web.BLL
if (sort_field == "select_total_count")
sql += " ORDER BY p.select_total_count desc, p.id desc";
else
- sql += " ORDER BY p.id desc";
+ sql += " ORDER BY p.add_time desc";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
@@ -463,29 +476,38 @@ namespace KJD_Web.BLL
return "{\"code\":500,\"msg\":\"没有店铺信息\"}";
}
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd.product_select";
- if (is_client_jit)
- {
- tableName = "kjd.jit_product_select";
- }
+ DateTime addTime = DateTime.Now;
+ string addTimeStr = addTime.ToString("yyyy-MM-dd HH:mm:ss");
+ string dbName = "kjd";
+ if (addTime.Year >= 2026)
+ dbName = "kjd_yearly";
+
+ bool is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit")?.ParseToBool() == true;
+ string tableName;
+ if (!is_client_jit)
+ tableName = dbName + ".product_select";
+ else
+ tableName = dbName + ".jit_product_select";
+
+ if (addTime.Year >= 2026)
+ tableName += "_" + addTime.Year;
+
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "insert into " + tableName +
- " (out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,fission_product_name,add_time,mdy_time) values" +
+ string sql = "INSERT INTO " + tableName +
+ " (out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,fission_product_name,add_time,mdy_time) VALUES" +
" ('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" +
notes + "','" + status + "','" + add_fission_product_name + "','" +
- DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
- DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
+ addTimeStr + "','" +
+ addTimeStr + "');";
if (add_product_remaining > 0)
{
add_product_remaining = add_product_remaining - 1;
sql += "\r\n";
- sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
- sql += "update kjd.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";";
- //sql += "update kjd.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
+ sql += "UPDATE kjd.shop SET add_product_remaining=" + add_product_remaining + " WHERE shop_id='" + shop_id + "';";
+ sql += "UPDATE kjd.product SET select_total_count=select_total_count+1 WHERE id=" + out_product_Id + ";";
sql += "INSERT INTO kjd.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)";
+ "ON DUPLICATE KEY UPDATE add_product_remaining=add_product_remaining-1";
}
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
@@ -510,46 +532,73 @@ namespace KJD_Web.BLL
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
+ var select_db_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("'", "\\'");
-
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd.product_select";
- if (is_client_jit)
+ var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit")?.ParseToBool() == true;
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
{
- tableName = "kjd.jit_product_select";
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
}
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;
+ long l_select_map_table_id = select_db_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";
- if (is_client_jit)
+ 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";
+
+ if (!select_add_time.HasValue || select_add_time.Value.Year < 2026)
{
- sql += "insert into kjd_map.jit_product_select_map_" + l_select_map_table_id +
- " (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n";
+ if (!is_client_jit)
+ {
+ sql += "INSERT INTO kjd_map.product_select_map_" + l_select_map_table_id +
+ " (product_id,product_select_db_id,shop_id) VALUES(" + draft_id + "," + select_db_id + ",'" + shop_id + "');\r\n";
+ }
+ else
+ {
+ sql += "INSERT INTO kjd_map.jit_product_select_map_" + l_select_map_table_id +
+ " (product_id,product_select_db_id,shop_id) VALUES(" + draft_id + "," + select_db_id + ",'" + shop_id + "');\r\n";
+ }
}
- else
+ else //(select_add_time.HasValue && select_add_time.Value.Year >= 2026)
{
- 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";
+ string select_type;
+ if (!is_client_jit)
+ select_type = "normal";
+ else
+ select_type = "jit";
+ sql += "INSERT INTO kjd_map_yearly.product_select_map_" + select_add_time.Value.Year +
+ "(product_select_db_id,product_id,shop_id,select_type) VALUES" +
+ "(" + select_db_id + ",'" + draft_id + "','" + shop_id + "','" + select_type + "');\r\n";
}
}
- sql += "update " + tableName + " set";
+
+ string dbName = "kjd";
+ if (select_add_time.HasValue && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName;
+ if (!is_client_jit)
+ tableName = dbName + ".product_select";
+ else
+ tableName = dbName + ".jit_product_select";
+ if (select_add_time.HasValue && select_add_time.Value.Year >= 2026)
+ tableName += "_" + select_add_time.Value.Year;
+
+ sql += "update " + tableName + " set";
if (draft_id != null)
sql += " draft_id='" + draft_id + "',";
if (status != null)
@@ -558,7 +607,7 @@ namespace KJD_Web.BLL
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";
+ sql += " WHERE id=" + select_db_id + ";\r\n";
var rst = mySql.ExecuteNonQuery(sql);
string errMsg = mySql.Message;
if (string.IsNullOrEmpty(errMsg))
@@ -609,77 +658,97 @@ namespace KJD_Web.BLL
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
+ var search_end_time = RegexUtils.GetStringJson(ref inputData, "search_end_time")?.ParseToDateTimeNullable();
+ if (search_end_time == null || search_end_time.Value > DateTime.Now.Date.AddDays(1)) search_end_time = DateTime.Now.Date.AddDays(1);
+ var search_start_time = RegexUtils.GetStringJson(ref inputData, "search_start_time")?.ParseToDateTimeNullable();
+ if (search_start_time == null || search_start_time.Value >= search_end_time.Value) search_start_time = search_end_time.Value.AddMonths(-6);
+ int startTableId = Math.Max(2025, search_start_time.Value.Year);
+ int endTableId = Math.Max(2025, search_end_time.Value.Year);
+
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);
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd.product_select";
- if (is_client_jit)
- {
- tableName = "kjd.jit_product_select";
- }
+ var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit")?.ParseToBool() == true;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "select count(s.id) from " + tableName + " s " +
- "left join kjd.product p on s.out_product_id=p.id " +
- "left join kjd.user u on s.operate_sub_sa_name=u.user_name " +
- "where 1=1";
+ string sql = "SELECT count(s.id) from (";
+ for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
+ {
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName;
+ if (!is_client_jit)
+ tableName = dbName + ".product_select";
+ else
+ tableName = dbName + ".jit_product_select";
+
+ if (year >= 2026)
+ tableName += "_" + year;
+ if (year > search_start_time.Value.Year)
+ sql += " UNION ALL";
+ sql += " SELECT * FROM " + tableName;
+ }
+ sql += ") s " +
+ "LEFT JOIN kjd.product p ON s.out_product_id=p.id " +
+ "LEFT JOIN kjd.user u ON s.operate_sub_sa_name=u.user_name " +
+ "WHERE s.add_time BETWEEN '" + search_start_time.Value.ToString("yyyy-MM-dd") + "' AND '" + search_end_time.Value.ToString("yyyy-MM-dd") + "' ";
string where = "";
if (!isAdmin || is_client_jit)
- where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')";
+ where += " AND (s.user_name='" + user_name + "' or s.sub_user_name='" + user_name + "')";
if (!string.IsNullOrEmpty(operate_sub_sa_name))
{
- where += " and s.operate_sub_sa_name = '" + 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";
+ where += " AND s.operate_sub_sa_name IS null";
if (!string.IsNullOrEmpty(search_db_ids))
- where += " and s.id in (" + search_db_ids + ")";
+ where += " AND s.id IN (" + search_db_ids + ")";
if (!string.IsNullOrEmpty(shop_ids))
- where += " and s.shop_id in (" + shop_ids + ")";
+ where += " AND s.shop_id IN ('" + string.Join("','", shop_ids.Split(new char[] { '\"', '\'', ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)) + "')";
if (!string.IsNullOrWhiteSpace(status))
- where += " and s.status = '" + status + "'";
+ where += " AND s.status = '" + status + "'";
if (!string.IsNullOrWhiteSpace(search_shop_id))
- where += " and s.shop_id like '%" + 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 + "%'";
+ where += " AND s.shop_account LIKE '%" + search_shop_account + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
{
//核价成功 重复 核价成功(重复)
if (search_notes == "无备注")
- where += " and s.notes = ''";
+ where += " AND s.notes = ''";
else if (search_notes == "重复")
- where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'";
+ 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 '%重复%'";
+ 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 '%重复%'";
+ where += " AND (s.notes LIKE '核价成功%' OR s.notes LIKE '核价通过%') AND s.notes LIKE '重复%'";
else
- where += " and s.notes like '%" + search_notes + "%'";
+ where += " AND s.notes LIKE '%" + search_notes + "%'";
}
if (!string.IsNullOrWhiteSpace(search_user_notes))
- where += " and s.user_notes like '%" + search_user_notes + "%'";
+ where += " AND s.user_notes LIKE '%" + search_user_notes + "%'";
- where += " and p.is_del=0";
+ where += " AND p.is_del=0";
if (!string.IsNullOrWhiteSpace(search_spu))
- where += " and p.spu_id like '%" + search_spu + "%'";
+ where += " AND p.spu_id LIKE '%" + search_spu + "%'";
if (!string.IsNullOrWhiteSpace(search_skc))
- where += " and p.skc_id like '%" + search_skc + "%'";
+ where += " AND p.skc_id LIKE '%" + search_skc + "%'";
if (!string.IsNullOrWhiteSpace(search_cat))
- where += " and p.cat_name like '%" + 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 + "%'";
+ where += " AND p.ext_code LIKE '%" + search_ext_code + "%'";
if (!string.IsNullOrWhiteSpace(search_prod_name))
- where += " and p.product_name like '%" + 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 + "%')";
+ where += " AND (s.operate_sub_sa_name LIKE '%" + search_sub_sa_name + "%'";
+ where += " OR u.nick_name LIKE '%" + operate_sub_sa_name + "%')";
}
sql += where;
@@ -694,21 +763,40 @@ namespace KJD_Web.BLL
else
{
//if (isDetail)
- //sql = "select * from " + tableName + " where 1=1";
+ //sql = "SELECT * FROM " + tableName + " where 1=1";
//else
- sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
+ 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.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," +
"p.product_get_type,u.nick_name as operate_sub_sa_nick " +
- "from " + tableName + " s left join kjd.product p on s.out_product_id=p.id " +
- "left join kjd.user u on u.user_name=s.operate_sub_sa_name " +
- "where 1=1";
+ " FROM (";
+ for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
+ {
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName;
+ if (!is_client_jit)
+ tableName = dbName + ".product_select";
+ else
+ tableName = dbName + ".jit_product_select";
+
+ if (year >= 2026)
+ tableName += "_" + year;
+ if (year > search_start_time.Value.Year)
+ sql += " UNION ALL";
+ sql += " SELECT * FROM " + tableName;
+ }
+ sql += ") s" +
+ " LEFT JOIN kjd.product p ON s.out_product_id=p.id" +
+ " LEFT join kjd.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;
+ sql += " ORDER BY add_time desc";
+ sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
@@ -722,7 +810,7 @@ namespace KJD_Web.BLL
{
ProductSelectResultParam prodSelect = new ProductSelectResultParam()
{
- id = row["id"].ParseToInt(),
+ id = row["id"].ParseToLong(),
out_product_Id = row["out_product_Id"].ParseToString(),
shop_account = row["shop_account"].ParseToString(),
shop_id = row["shop_id"].ParseToString(),
@@ -785,13 +873,24 @@ namespace KJD_Web.BLL
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd.product_select";
- if (is_client_jit)
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
{
- tableName = "kjd.jit_product_select";
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
}
+ var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit")?.ParseToBool() == true;
+ string dbName = "kjd";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName;
+ if (!is_client_jit)
+ tableName = dbName + ".product_select";
+ else
+ tableName = dbName + ".jit_product_select";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ tableName += "_" + select_add_time.Value.Year;
+
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from " + tableName + " where id='"
@@ -828,48 +927,122 @@ namespace KJD_Web.BLL
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
}
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
- var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
+ var db_ids = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
+ var shop_ids = 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("'", "\\'");
+ var db_id_infos = RegexUtils.GetStringQuery(ref inputData, "db_id_infos")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id))
+ if (operate_sub_sa_name == null)
{
- return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}";
+ return "{\"code\":50002,\"msg\":\"未选择任何二级超管\"}";
+ }
+ if (string.IsNullOrEmpty(db_ids) && string.IsNullOrEmpty(shop_ids))
+ {
+ return "{\"code\":50002,\"msg\":\"未选择任何待设置对象\"}";
}
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd.product_select";
- if (is_client_jit)
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
{
- tableName = "kjd.jit_product_select";
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "update " + tableName + " set";
- if (operate_sub_sa_name != null)
+ string sql = "";
+ bool rst = false;
+
+ if (!string.IsNullOrEmpty(db_ids))
+ {
+ sql = "UPDATE kjd.product_select SET";
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);
+ sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
+ sql += " WHERE id IN (" + db_ids + ")";
+ if (!string.IsNullOrEmpty(status))
+ sql += " AND status='" + status + "';";
+
+ rst = mySql.ExecuteNonQuery(sql);
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ mySql.Close();
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ else if (!string.IsNullOrEmpty(shop_ids))
+ {
+ List yearLst = new List() { 2025 };
+ if (select_add_time != null)
+ {
+ yearLst.Clear();
+ yearLst.Add(select_add_time.Value.Year);
+ yearLst.Add(select_add_time.Value.AddMonths(-6).Year);
+ yearLst = yearLst.Distinct().ToList();
+ }
+ foreach (int year in yearLst)
+ {
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".product_select";
+ if (year >= 2026)
+ tableName += "_" + year;
+
+ sql = "UPDATE " + tableName + " SET";
+ sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
+ sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
+ sql += " WHERE shop_id in ('" + shop_ids.Replace(",", "','") + "')";
+ if (!string.IsNullOrEmpty(status))
+ sql += " AND status='" + status + "';";
+
+ rst = mySql.ExecuteNonQuery(sql);
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ mySql.Close();
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ }
+ else if (!string.IsNullOrEmpty(db_id_infos))
+ {
+ try
+ {
+ JArray jArr = JArray.Parse(db_id_infos);
+ foreach (JObject jObj in jArr)
+ {
+ var year = jObj["year"].ParseToInt();
+ var dbIds = jObj["db_ids"].ParseToString();
+
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".product_select";
+ if (year >= 2026)
+ tableName += "_" + year;
+
+ sql = "UPDATE " + tableName + " SET";
+ sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
+ sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
+ sql += " WHERE id IN (" + dbIds + ")";
+ if (!string.IsNullOrEmpty(status))
+ sql += " AND status='" + status + "';";
+
+ rst = mySql.ExecuteNonQuery(sql);
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ mySql.Close();
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ mySql.Close();
+ return "{\"code\":50004,\"msg\":\"" + ex.Message + "\"}";
+ }
+ }
mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- {
- return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
- }
+ return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
@@ -884,7 +1057,7 @@ namespace KJD_Web.BLL
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
+ var db_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"));
@@ -894,13 +1067,24 @@ namespace KJD_Web.BLL
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd.product_select";
- if (is_client_jit)
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
{
- tableName = "kjd.jit_product_select";
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
}
+ var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit")?.ParseToBool() == true;
+ string dbName = "kjd";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName;
+ if (!is_client_jit)
+ tableName = dbName + ".product_select";
+ else
+ tableName = dbName + ".jit_product_select";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ tableName += "_" + select_add_time.Value.Year;
+
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update " + tableName + " set";
@@ -911,10 +1095,10 @@ namespace KJD_Web.BLL
if (fission_product_name != null)
sql += " fission_product_name=@fission_product_name,";
sql = sql.TrimEnd(',');
- sql += " where id=@id;";
+ sql += " where id=@db_id;";
List paramLst = new List();
- paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
+ paramLst.Add(new MySqlParameter() { DbType = DbType.Int64, ParameterName = "@db_id", Value = db_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, });
@@ -955,14 +1139,29 @@ namespace KJD_Web.BLL
return "{\"code\":50002,\"msg\":\"未选择选品数据\"}";
}
- var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit").ParseToBool();
- string tableName = "kjd_map.product_select_map_";
- if (is_client_jit)
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
{
- tableName = "kjd_map.jit_product_select_map_";
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
}
- long l_select_map_table_id = select_db_id.ParseToLong() % 64;
+ var is_client_jit = RegexUtils.GetStringQuery(ref inputData, "is_client_jit")?.ParseToBool() == true;
+ string dbName = "kjd_map";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_map_yearly";
+ string tableName;
+ if (!is_client_jit || (select_add_time != null && select_add_time.Value.Year >= 2026)) // 2026年以后的数据在新表,不带jit
+ tableName = dbName + ".product_select_map_";
+ else
+ tableName = dbName + ".jit_product_select_map_";
+
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ tableName += select_add_time.Value.Year;
+ else
+ {
+ long l_select_map_table_id = select_db_id.ParseToLong() % 64;
+ tableName += +l_select_map_table_id;
+ }
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -970,8 +1169,12 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "select count(id) from " + tableName + l_select_map_table_id + " where 1=1";
+ string sql = "SELECT COUNT(id) FROM " + tableName + " where 1=1";
+
string where = " and product_select_db_id=" + select_db_id;
+ if (select_add_time != null && select_add_time.Value.Year >= 2026) // 2026年以后的数据在新表
+ where += " AND select_type='" + (!is_client_jit ? "normal" : "jit") + "'";
+
sql += where;
var count = mySql.ExecuteRowCount(sql);
@@ -983,11 +1186,11 @@ namespace KJD_Web.BLL
}
else
{
- sql = "select * from " + tableName + l_select_map_table_id + " where 1=1";
+ sql = "SELECT * FROM " + tableName + " where 1=1";
//where子句
sql += where;
- sql += " order by id desc";
- sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
+ sql += " ORDER BY add_time desc";
+ sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
@@ -1006,9 +1209,9 @@ namespace KJD_Web.BLL
{
DBProdDbIdMapProductIdResultParam dbIdMapProductId = new DBProdDbIdMapProductIdResultParam
{
- id = row["id"].ParseToInt(),
+ id = row["id"].ParseToLong(),
+ product_select_db_id = row["product_select_db_id"].ParseToLong(),
product_id = row["product_id"].ParseToLong(),
- product_select_db_id = row["product_select_db_id"].ParseToInt(),
shop_id = row["shop_id"].ParseToLong(),
add_time = Convert.ToDateTime(row["add_time"]),
};
@@ -1072,8 +1275,8 @@ namespace KJD_Web.BLL
l_spu_map_table_id = in_draft_id_list[i].ParseToLong() % 128;
sql += "select * from " + tableName + l_spu_map_table_id + " where draft_id=" + in_draft_id_list[i];
}
- sql += ") AS combined_query left join product p On combined_query.from_spu_id=p.spu_id";
- sql += " order by add_time desc";
+ sql += ") AS combined_query left join product p ON combined_query.from_spu_id=p.spu_id";
+ sql += " ORDER BY add_time desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
DataTable dt = mySql.ExecuteDataTable(sql);
@@ -1092,7 +1295,7 @@ namespace KJD_Web.BLL
{
DBProdDraftIdMapUpSpuIdResultParam draftIdMapUpSpuId = new DBProdDraftIdMapUpSpuIdResultParam
{
- id = row["id"].ParseToInt(),
+ id = row["id"].ParseToLong(),
draft_id = row["draft_id"].ParseToLong(),
from_spu_id = row["from_spu_id"].ParseToLong(),
shop_id = row["shop_id"].ParseToLong(),
@@ -1293,9 +1496,9 @@ namespace KJD_Web.BLL
sql += where;
if (is_random)
- sql += " ORDER BY RAND(),s.id desc";
+ sql += " ORDER BY RAND(),s.add_time desc";
else
- sql += " order by s.id desc";
+ sql += " ORDER BY s.add_time desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs
index e7c1e80..7abdf45 100644
--- a/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs
+++ b/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs
@@ -3,6 +3,7 @@ using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using MySqlX.XDevAPI.Common;
using NaiBa.Util.Extension;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -349,22 +350,31 @@ namespace KJD_Web.BLL
return "{\"code\":500,\"msg\":\"没有店铺信息\"}";
}
+ DateTime addTime = DateTime.Now;
+ string addTimeStr = addTime.ToString("yyyy-MM-dd HH:mm:ss");
+ string dbName = "kjd";
+ if (addTime.Year >= 2026)
+ dbName = "kjd_yearly";
+
+ string tableName = dbName + ".third_product_select";
+ if (addTime.Year >= 2026)
+ tableName += "_" + addTime.Year;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "insert into kjd.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 + "','" +
+ string sql = "INSERT INTO " + tableName +
+ " (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") + "');";
+ addTimeStr + "','" +
+ addTimeStr + "');";
if (add_product_remaining > 0)
{
add_product_remaining = add_product_remaining - 1;
sql += "\r\n";
- sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
- //sql += "update kjd.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
+ sql += "UPDATE kjd.shop SET add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
sql += "INSERT INTO kjd.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)";
+ "ON DUPLICATE KEY UPDATE add_product_remaining=add_product_remaining-1";
}
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
@@ -389,31 +399,55 @@ namespace KJD_Web.BLL
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
+ var select_db_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("'", "\\'");
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
+ {
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
+ }
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;
+ long l_select_map_table_id = select_db_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 += "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";
+ if (!select_add_time.HasValue || select_add_time.Value.Year < 2026)
+ {
+ 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 + "," + select_db_id + ",'" + shop_id + "');\r\n";
+ }
+ else
+ {
+ string select_type = "third-party";
+ sql += "INSERT INTO kjd_map_yearly.product_select_map_" + select_add_time.Value.Year +
+ "(product_select_db_id,product_id,shop_id,select_type) VALUES" +
+ "(" + select_db_id + ",'" + draft_id + "','" + shop_id + "','" + select_type + "');\r\n";
+ }
}
- sql += "update kjd.third_product_select set";
+
+ string dbName = "kjd";
+ if (select_add_time.HasValue && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+ if (select_add_time.HasValue && select_add_time.Value.Year >= 2026)
+ tableName += "_" + select_add_time.Value.Year;
+
+ sql += "update " + tableName + " set";
if (draft_id != null)
sql += " draft_id='" + draft_id + "',";
if (status != null)
@@ -422,7 +456,7 @@ namespace KJD_Web.BLL
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";
+ sql += " WHERE id=" + select_db_id + ";\r\n";
var rst = mySql.ExecuteNonQuery(sql);
string errMsg = mySql.Message;
if (string.IsNullOrEmpty(errMsg))
@@ -473,6 +507,13 @@ namespace KJD_Web.BLL
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
+ var search_end_time = RegexUtils.GetStringJson(ref inputData, "search_end_time")?.ParseToDateTimeNullable();
+ if (search_end_time == null || search_end_time.Value > DateTime.Now.Date.AddDays(1)) search_end_time = DateTime.Now.Date.AddDays(1);
+ var search_start_time = RegexUtils.GetStringJson(ref inputData, "search_start_time")?.ParseToDateTimeNullable();
+ if (search_start_time == null || search_start_time.Value >= search_end_time.Value) search_start_time = search_end_time.Value.AddMonths(-6);
+ int startTableId = Math.Max(2025, search_start_time.Value.Year);
+ int endTableId = Math.Max(2025, search_end_time.Value.Year);
+
var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
@@ -481,14 +522,30 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "select count(s.id) from kjd.third_product_select s " +
- "left join kjd.third_product p on s.out_product_id=p.id " +
- "left join kjd.user u on s.operate_sub_sa_name=u.user_name " +
- "where 1=1";
+ string sql = "select count(s.id) from (";
+
+ for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
+ {
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+
+ if (year >= 2026)
+ tableName += "_" + year;
+ if (year > search_start_time.Value.Year)
+ sql += " UNION ALL";
+ sql += " SELECT * FROM " + tableName;
+ }
+
+ sql += ") s " +
+ "LEFT JOIN kjd.third_product p on s.out_product_id=p.id " +
+ "LEFT JOIN kjd.user u on s.operate_sub_sa_name=u.user_name " +
+ "WHERE s.add_time BETWEEN '" + search_start_time.Value.ToString("yyyy-MM-dd") + "' AND '" + search_end_time.Value.ToString("yyyy-MM-dd") + "' ";
string where = "";
if (!isAdmin)
- where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')";
+ where += " and (s.user_name='" + user_name + "' or s.sub_user_name ='" + user_name + "')";
if (!string.IsNullOrEmpty(operate_sub_sa_name))
{
where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'";
@@ -555,14 +612,30 @@ namespace KJD_Web.BLL
//if (isDetail)
//sql = "select * from kjd.third_product_select where 1=1";
//else
- sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
+ 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.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 kjd.third_product_select s left join kjd.third_product p on s.out_product_id=p.id " +
- "left join kjd.user u on u.user_name=s.operate_sub_sa_name " +
- "where 1=1";
+ "FROM (";
+
+ for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
+ {
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+
+ if (year >= 2026)
+ tableName += "_" + year;
+ if (year > search_start_time.Value.Year)
+ sql += " UNION ALL";
+ sql += " SELECT * FROM " + tableName;
+ }
+
+ sql += ") s LEFT JOIN kjd.third_product p ON s.out_product_id=p.id " +
+ "LEFT JOIN kjd.user u ON u.user_name=s.operate_sub_sa_name " +
+ "WHERE 1=1";
sql += where; // where子句
@@ -581,7 +654,7 @@ namespace KJD_Web.BLL
{
ProductSelectResultParam prodSelect = new ProductSelectResultParam()
{
- id = row["id"].ParseToInt(),
+ id = row["id"].ParseToLong(),
out_product_Id = row["out_product_Id"].ParseToString(),
shop_account = row["shop_account"].ParseToString(),
shop_id = row["shop_id"].ParseToString(),
@@ -645,9 +718,22 @@ namespace KJD_Web.BLL
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
+ {
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
+ }
+
+ string dbName = "kjd";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ tableName += "_" + select_add_time.Value.Year;
+
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "delete from kjd.third_product_select where id='"
+ string sql = "delete from " + tableName + " where id='"
+ id + "'";
var rst = mySql.ExecuteNonQuery(sql);
@@ -681,41 +767,123 @@ namespace KJD_Web.BLL
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
}
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
- var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
+ var db_ids = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
+ var shop_ids = 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("'", "\\'");
+ var db_id_infos = RegexUtils.GetStringQuery(ref inputData, "db_id_infos")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id))
+ if (operate_sub_sa_name == null)
{
- return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}";
+ return "{\"code\":50002,\"msg\":\"未选择任何二级超管\"}";
+ }
+ if (string.IsNullOrEmpty(db_ids) && string.IsNullOrEmpty(shop_ids) && string.IsNullOrEmpty(db_id_infos))
+ {
+ return "{\"code\":50003,\"msg\":\"未选择任何待设置对象\"}";
+ }
+
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null && db_id_infos == null)
+ {
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "update kjd.third_product_select set";
- if (operate_sub_sa_name != null)
+
+ string sql = "";
+ bool rst = false;
+
+ if (!string.IsNullOrEmpty(db_ids))
+ {
+ sql = "UPDATE kjd.third_product_select SET";
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);
+ sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
+ sql += " WHERE id IN (" + db_ids + ")";
+ if (!string.IsNullOrEmpty(status))
+ sql += " AND status='" + status + "';";
+
+ rst = mySql.ExecuteNonQuery(sql);
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ mySql.Close();
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ else if (!string.IsNullOrEmpty(shop_ids))
+ {
+ List yearLst = new List() { 2025 };
+ if (select_add_time != null)
+ {
+ yearLst.Clear();
+ yearLst.Add(select_add_time.Value.Year);
+ yearLst.Add(select_add_time.Value.AddMonths(-6).Year);
+ yearLst = yearLst.Distinct().ToList();
+ }
+ foreach (int year in yearLst)
+ {
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+ if (year >= 2026)
+ tableName += "_" + year;
+
+ sql = "UPDATE " + tableName + " SET";
+ sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
+ sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
+ sql += " WHERE shop_id in ('" + shop_ids.Replace(",", "','") + "')";
+ if (!string.IsNullOrEmpty(status))
+ sql += " AND status='" + status + "';";
+
+ rst = mySql.ExecuteNonQuery(sql);
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ mySql.Close();
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ }
+ else if (!string.IsNullOrEmpty(db_id_infos))
+ {
+ try
+ {
+ JArray jArr = JArray.Parse(db_id_infos);
+ foreach (JObject jObj in jArr)
+ {
+ var year = jObj["year"].ParseToInt();
+ var dbIds = jObj["db_ids"].ParseToString();
+
+ string dbName = "kjd";
+ if (year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+ if (year >= 2026)
+ tableName += "_" + year;
+
+ sql = "UPDATE " + tableName + " SET";
+ sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
+ sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
+ sql += " WHERE id IN (" + dbIds + ")";
+ if (!string.IsNullOrEmpty(status))
+ sql += " AND status='" + status + "';";
+
+ rst = mySql.ExecuteNonQuery(sql);
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ mySql.Close();
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ mySql.Close();
+ return "{\"code\":50004,\"msg\":\"" + ex.Message + "\"}";
+ }
+ }
mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- {
- return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
- }
+ return "{\"code\":200,\"msg\":\"success\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
@@ -730,7 +898,7 @@ namespace KJD_Web.BLL
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
+ var db_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"));
@@ -740,9 +908,22 @@ namespace KJD_Web.BLL
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
+ {
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
+ }
+
+ string dbName = "kjd";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_yearly";
+ string tableName = dbName + ".third_product_select";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ tableName += "_" + select_add_time.Value.Year;
+
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "update kjd.third_product_select set";
+ string sql = "update " + tableName + " set";
if (notes != null)
sql += " notes=@notes,";
if (user_notes != null)
@@ -753,7 +934,7 @@ namespace KJD_Web.BLL
sql += " where id=@id;";
List paramLst = new List();
- paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
+ paramLst.Add(new MySqlParameter() { DbType = DbType.Int64, ParameterName = "@id", Value = db_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, });
@@ -793,7 +974,29 @@ namespace KJD_Web.BLL
{
return "{\"code\":50002,\"msg\":\"未选择选品数据\"}";
}
- long l_select_map_table_id = select_db_id.ParseToLong() % 64;
+
+ var select_add_time = RegexUtils.GetStringQuery(ref inputData, "select_add_time")?.Replace("'", "\\'").ParseToDateTimeNullable();
+ if (select_add_time == null)
+ {
+ //return "{\"code\":500,\"msg\":\"旧查询接口已失效,请升级软件。\"}";
+ }
+
+ string dbName = "kjd_map";
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ dbName = "kjd_map_yearly";
+ string tableName;
+ if (select_add_time != null && select_add_time.Value.Year >= 2026) // 2026年以后的数据在新表
+ tableName = dbName + ".product_select_map_";
+ else
+ tableName = dbName + ".product_third_select_map_";
+
+ if (select_add_time != null && select_add_time.Value.Year >= 2026)
+ tableName += select_add_time.Value.Year;
+ else
+ {
+ long l_select_map_table_id = select_db_id.ParseToLong() % 64;
+ tableName += +l_select_map_table_id;
+ }
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -801,8 +1004,10 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "select count(id) from kjd_map.product_third_select_map_" + l_select_map_table_id + " where 1=1";
- string where = " and product_select_db_id=" + select_db_id;
+ string sql = "SELECT COUNT(id) FROM " + tableName + " WHERE 1=1";
+ string where = " AND product_select_db_id=" + select_db_id;
+ if (select_add_time != null && select_add_time.Value.Year >= 2026) // 2026年以后的数据在新表
+ where += " AND select_type='third-party'";
sql += where;
var count = mySql.ExecuteRowCount(sql);
@@ -814,11 +1019,11 @@ namespace KJD_Web.BLL
}
else
{
- sql = "select * from kjd_map.product_third_select_map_" + l_select_map_table_id + " where 1=1";
+ sql = "SELECT * FROM " + tableName + " WHERE 1=1";
//where子句
sql += where;
- sql += " order by id desc";
- sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
+ sql += " ORDER BY add_time desc";
+ sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
@@ -837,9 +1042,9 @@ namespace KJD_Web.BLL
{
DBProdDbIdMapProductIdResultParam dbIdMapProductId = new DBProdDbIdMapProductIdResultParam
{
- id = row["id"].ParseToInt(),
+ id = row["id"].ParseToLong(),
+ product_select_db_id = row["product_select_db_id"].ParseToLong(),
product_id = row["product_id"].ParseToLong(),
- product_select_db_id = row["product_select_db_id"].ParseToInt(),
shop_id = row["shop_id"].ParseToLong(),
add_time = Convert.ToDateTime(row["add_time"]),
};
diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj.user b/KJDService/KJD_WebService/KJD_WebService.csproj.user
index 4bcdc04..1b87364 100644
--- a/KJDService/KJD_WebService/KJD_WebService.csproj.user
+++ b/KJDService/KJD_WebService/KJD_WebService.csproj.user
@@ -8,7 +8,7 @@
- Release|Any CPU
+ Debug|Any CPU
ShowAllFiles
diff --git a/KJDService/KJD_WebService/Model/DBProdDbIdMapProductIdResultParam.cs b/KJDService/KJD_WebService/Model/DBProdDbIdMapProductIdResultParam.cs
index c8717da..7325b43 100644
--- a/KJDService/KJD_WebService/Model/DBProdDbIdMapProductIdResultParam.cs
+++ b/KJDService/KJD_WebService/Model/DBProdDbIdMapProductIdResultParam.cs
@@ -7,8 +7,8 @@ namespace KJD_Web.Model
{
public class DBProdDbIdMapProductIdResultParam
{
- public int id { get; set; }
- public int product_select_db_id { get; set; }
+ 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; }
@@ -16,7 +16,7 @@ namespace KJD_Web.Model
public class DBProdDraftIdMapUpSpuIdResultParam
{
- public int id { get; set; }
+ public long id { get; set; }
public long draft_id { get; set; }
public long from_spu_id { get; set; }
public long shop_id { get; set; }
diff --git a/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs b/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs
index a77c3a5..4dafeb1 100644
--- a/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs
+++ b/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs
@@ -11,7 +11,7 @@ namespace KJD_Web.Model
///
public class ProductSelectResultParam
{
- public int id { get; set; }
+ public long id { get; set; }
public string out_product_Id { get; set; }
public string shop_id { get; set; }
public string shop_account { get; set; }
diff --git a/KJDService/KJD_WebService/Utils/Extension/Extension.Convert.cs b/KJDService/KJD_WebService/Utils/Extension/Extension.Convert.cs
index 7ef9ace..aa72517 100644
--- a/KJDService/KJD_WebService/Utils/Extension/Extension.Convert.cs
+++ b/KJDService/KJD_WebService/Utils/Extension/Extension.Convert.cs
@@ -334,6 +334,47 @@ namespace NaiBa.Util.Extension
#endregion
#region 转换为DateTime
+
+ public static DateTime? ParseToDateTimeNullable(this string str)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(str))
+ {
+ return null;
+ }
+ if (str.Contains("-") || str.Contains("/"))
+ {
+ return DateTime.Parse(str);
+ }
+ else
+ {
+ int length = str.Length;
+ switch (length)
+ {
+ case 4:
+ return DateTime.ParseExact(str, "yyyy", System.Globalization.CultureInfo.CurrentCulture);
+ case 6:
+ return DateTime.ParseExact(str, "yyyyMM", System.Globalization.CultureInfo.CurrentCulture);
+ case 8:
+ return DateTime.ParseExact(str, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);
+ case 10:
+ return DateTime.ParseExact(str, "yyyyMMddHH", System.Globalization.CultureInfo.CurrentCulture);
+ case 12:
+ return DateTime.ParseExact(str, "yyyyMMddHHmm", System.Globalization.CultureInfo.CurrentCulture);
+ case 14:
+ return DateTime.ParseExact(str, "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);
+ default:
+ return DateTime.ParseExact(str, "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);
+ }
+ }
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
///
/// 将string转换为DateTime,若转换失败,则返回日期最小值。不抛出异常。
///
diff --git a/TEMUKJD/BLL/ShopBLL.cs b/TEMUKJD/BLL/ShopBLL.cs
index f14a3f7..63806df 100644
--- a/TEMUKJD/BLL/ShopBLL.cs
+++ b/TEMUKJD/BLL/ShopBLL.cs
@@ -50,15 +50,23 @@ namespace TemuKJD.BLL
///
///
///
- public static string MdyServerShopSubInfo(ShopLoginInfo _shop)
+ public static string MdyServerShopSubInfo(ShopLoginInfo _shop, bool isEditSingleShopNotes = false)
{
var url = BaseClass.BuildObjString("shop/mdy_shop");
- var data = UserLogin.GetSignaturex()
- + "&login_name=" + _shop.LoginName
- + "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
- + "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName)
- + "&sub_user_name=" + _shop.SubUserName
- + "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes);
+ var data = UserLogin.GetSignaturex();
+ if (isEditSingleShopNotes)
+ {
+ data += "&login_name=" + _shop.LoginName;
+ data += "&shop_id=" + _shop.ShopId;
+ data += "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes);
+ }
+ else
+ {
+ data += "&login_name=" + _shop.LoginName;
+ data += "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password);
+ data += "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName);
+ data += "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName);
+ }
var result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
@@ -166,16 +174,25 @@ namespace TemuKJD.BLL
return result;
}
- public static string AdminMdyServerShop(ShopLoginInfo _shop)
+ public static string AdminMdyServerShop(ShopLoginInfo _shop, bool isEditSingleShopNotes = false)
{
var url = BaseClass.BuildObjString("shop/admin_mdy_shop");
- var data = UserLogin.GetSignaturex()
- + "&shop_user_name=" + _shop.UserName
- + "&login_name=" + _shop.LoginName
- + "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
- + "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName)
- + "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName)
- + "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes);
+ var data = UserLogin.GetSignaturex();
+ if (isEditSingleShopNotes)
+ {
+ data += "&shop_user_name=" + _shop.UserName;
+ data += "&login_name=" + _shop.LoginName;
+ data += "&shop_id=" + _shop.ShopId;
+ data += "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes);
+ }
+ else
+ {
+ data += "&shop_user_name=" + _shop.UserName;
+ data += "&login_name=" + _shop.LoginName;
+ data += "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password);
+ data += "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName);
+ data += "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName);
+ }
var result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
diff --git a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs
index e1b9b8d..0fdeb5c 100644
--- a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs
+++ b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs
@@ -65,7 +65,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.colExpires = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopAccount = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.conNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -378,7 +378,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.colExpires,
this.colShopId,
this.colShopAccount,
- this.conNotes,
+ this.colNotes,
this.colEdit,
this.colDelete});
this.dgvCardCode.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -480,11 +480,11 @@ namespace TemuKJD.KJDForms.AdminForms
this.colShopAccount.Name = "colShopAccount";
this.colShopAccount.ReadOnly = true;
//
- // conNotes
+ // colNotes
//
- this.conNotes.HeaderText = "备注";
- this.conNotes.Name = "conNotes";
- this.conNotes.ReadOnly = true;
+ this.colNotes.HeaderText = "备注";
+ this.colNotes.Name = "colNotes";
+ this.colNotes.ReadOnly = true;
//
// colEdit
//
@@ -559,7 +559,7 @@ namespace TemuKJD.KJDForms.AdminForms
private System.Windows.Forms.DataGridViewTextBoxColumn colExpires;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopAccount;
- private System.Windows.Forms.DataGridViewTextBoxColumn conNotes;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
}
diff --git a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx
index 8f6dea0..e376ecd 100644
--- a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx
+++ b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx
@@ -141,7 +141,7 @@
True
-
+
True
diff --git a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs
index 3804706..a6dc650 100644
--- a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs
+++ b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs
@@ -41,6 +41,7 @@ namespace TemuKJD.KJDForms.AdminForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
+ this.txtReplaceText = new System.Windows.Forms.TextBox();
this.btnSearchPrice3 = new DevComponents.DotNetBar.PanelEx();
this.numSleep = new System.Windows.Forms.NumericUpDown();
this.lblSleep = new System.Windows.Forms.Label();
@@ -111,6 +112,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.label20 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.chkLessThan = new TemuKJD.UserComponent.UcCheckBox(this.components);
+ this.label8 = new System.Windows.Forms.Label();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbShopLoading = new System.Windows.Forms.PictureBox();
@@ -156,6 +158,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
+ this.chkForceRestoreTitle = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -223,6 +226,7 @@ namespace TemuKJD.KJDForms.AdminForms
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
+ this.ucGroupBoxEx1.Controls.Add(this.txtReplaceText);
this.ucGroupBoxEx1.Controls.Add(this.btnSearchPrice3);
this.ucGroupBoxEx1.Controls.Add(this.numSleep);
this.ucGroupBoxEx1.Controls.Add(this.lblSleep);
@@ -269,6 +273,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.ucGroupBoxEx1.Controls.Add(this.chkFilterSize);
this.ucGroupBoxEx1.Controls.Add(this.chkSearchTime);
this.ucGroupBoxEx1.Controls.Add(this.pnlRestoreSizeAndNumber);
+ this.ucGroupBoxEx1.Controls.Add(this.label8);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(2, 2);
this.ucGroupBoxEx1.Name = "ucGroupBoxEx1";
this.ucGroupBoxEx1.Size = new System.Drawing.Size(1480, 140);
@@ -276,6 +281,13 @@ namespace TemuKJD.KJDForms.AdminForms
this.ucGroupBoxEx1.TabStop = false;
this.ucGroupBoxEx1.Text = "参数设置";
//
+ // txtReplaceText
+ //
+ this.txtReplaceText.Location = new System.Drawing.Point(964, 36);
+ this.txtReplaceText.Name = "txtReplaceText";
+ this.txtReplaceText.Size = new System.Drawing.Size(227, 23);
+ this.txtReplaceText.TabIndex = 1207;
+ //
// btnSearchPrice3
//
this.btnSearchPrice3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -412,7 +424,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.btnRestoreSizeAndNumber.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRestoreSizeAndNumber.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRestoreSizeAndNumber.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnRestoreSizeAndNumber.Location = new System.Drawing.Point(1092, 51);
+ this.btnRestoreSizeAndNumber.Location = new System.Drawing.Point(1092, 62);
this.btnRestoreSizeAndNumber.Name = "btnRestoreSizeAndNumber";
this.btnRestoreSizeAndNumber.Size = new System.Drawing.Size(99, 23);
this.btnRestoreSizeAndNumber.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -616,7 +628,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numJudgeWeight
//
- this.numJudgeWeight.Location = new System.Drawing.Point(1038, 51);
+ this.numJudgeWeight.Location = new System.Drawing.Point(1038, 62);
this.numJudgeWeight.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numJudgeWeight.Maximum = new decimal(new int[] {
10000,
@@ -658,7 +670,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numJudgeLen
//
- this.numJudgeLen.Location = new System.Drawing.Point(964, 51);
+ this.numJudgeLen.Location = new System.Drawing.Point(964, 62);
this.numJudgeLen.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numJudgeLen.Maximum = new decimal(new int[] {
299,
@@ -677,7 +689,7 @@ namespace TemuKJD.KJDForms.AdminForms
// lblJudgeLen
//
this.lblJudgeLen.AutoSize = true;
- this.lblJudgeLen.Location = new System.Drawing.Point(940, 54);
+ this.lblJudgeLen.Location = new System.Drawing.Point(940, 65);
this.lblJudgeLen.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblJudgeLen.Name = "lblJudgeLen";
this.lblJudgeLen.Size = new System.Drawing.Size(29, 17);
@@ -753,7 +765,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.btnRestoreProdName.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRestoreProdName.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRestoreProdName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnRestoreProdName.Location = new System.Drawing.Point(1092, 17);
+ this.btnRestoreProdName.Location = new System.Drawing.Point(1092, 12);
this.btnRestoreProdName.Name = "btnRestoreProdName";
this.btnRestoreProdName.Size = new System.Drawing.Size(99, 23);
this.btnRestoreProdName.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -993,7 +1005,7 @@ namespace TemuKJD.KJDForms.AdminForms
// chkFilterTitle
//
this.chkFilterTitle.AutoSize = true;
- this.chkFilterTitle.Location = new System.Drawing.Point(927, 18);
+ this.chkFilterTitle.Location = new System.Drawing.Point(927, 13);
this.chkFilterTitle.Name = "chkFilterTitle";
this.chkFilterTitle.Size = new System.Drawing.Size(171, 21);
this.chkFilterTitle.TabIndex = 857;
@@ -1004,7 +1016,7 @@ namespace TemuKJD.KJDForms.AdminForms
// lblJudgeWeight
//
this.lblJudgeWeight.AutoSize = true;
- this.lblJudgeWeight.Location = new System.Drawing.Point(1002, 54);
+ this.lblJudgeWeight.Location = new System.Drawing.Point(1002, 65);
this.lblJudgeWeight.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblJudgeWeight.Name = "lblJudgeWeight";
this.lblJudgeWeight.Size = new System.Drawing.Size(41, 17);
@@ -1024,7 +1036,7 @@ namespace TemuKJD.KJDForms.AdminForms
// chkFilterSize
//
this.chkFilterSize.AutoSize = true;
- this.chkFilterSize.Location = new System.Drawing.Point(927, 55);
+ this.chkFilterSize.Location = new System.Drawing.Point(927, 66);
this.chkFilterSize.Name = "chkFilterSize";
this.chkFilterSize.Size = new System.Drawing.Size(15, 14);
this.chkFilterSize.TabIndex = 1076;
@@ -1061,15 +1073,15 @@ namespace TemuKJD.KJDForms.AdminForms
this.pnlRestoreSizeAndNumber.Controls.Add(this.label20);
this.pnlRestoreSizeAndNumber.Controls.Add(this.label11);
this.pnlRestoreSizeAndNumber.Controls.Add(this.chkLessThan);
- this.pnlRestoreSizeAndNumber.Location = new System.Drawing.Point(920, 76);
+ this.pnlRestoreSizeAndNumber.Location = new System.Drawing.Point(920, 85);
this.pnlRestoreSizeAndNumber.Name = "pnlRestoreSizeAndNumber";
- this.pnlRestoreSizeAndNumber.Size = new System.Drawing.Size(278, 58);
+ this.pnlRestoreSizeAndNumber.Size = new System.Drawing.Size(278, 52);
this.pnlRestoreSizeAndNumber.TabIndex = 1160;
//
// numPieces
//
this.numPieces.Enabled = false;
- this.numPieces.Location = new System.Drawing.Point(125, 3);
+ this.numPieces.Location = new System.Drawing.Point(125, 2);
this.numPieces.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numPieces.Maximum = new decimal(new int[] {
99999,
@@ -1089,7 +1101,7 @@ namespace TemuKJD.KJDForms.AdminForms
// label17
//
this.label17.AutoSize = true;
- this.label17.Location = new System.Drawing.Point(109, 6);
+ this.label17.Location = new System.Drawing.Point(109, 5);
this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(20, 17);
@@ -1098,7 +1110,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numHeight2
//
- this.numHeight2.Location = new System.Drawing.Point(231, 31);
+ this.numHeight2.Location = new System.Drawing.Point(231, 27);
this.numHeight2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numHeight2.Maximum = new decimal(new int[] {
299,
@@ -1116,7 +1128,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numHeight1
//
- this.numHeight1.Location = new System.Drawing.Point(197, 31);
+ this.numHeight1.Location = new System.Drawing.Point(197, 27);
this.numHeight1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numHeight1.Maximum = new decimal(new int[] {
299,
@@ -1134,7 +1146,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numWidth1
//
- this.numWidth1.Location = new System.Drawing.Point(108, 31);
+ this.numWidth1.Location = new System.Drawing.Point(108, 27);
this.numWidth1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numWidth1.Maximum = new decimal(new int[] {
299,
@@ -1152,7 +1164,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numWidth2
//
- this.numWidth2.Location = new System.Drawing.Point(142, 31);
+ this.numWidth2.Location = new System.Drawing.Point(142, 27);
this.numWidth2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numWidth2.Maximum = new decimal(new int[] {
299,
@@ -1170,7 +1182,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numLen1
//
- this.numLen1.Location = new System.Drawing.Point(19, 31);
+ this.numLen1.Location = new System.Drawing.Point(19, 27);
this.numLen1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numLen1.Maximum = new decimal(new int[] {
299,
@@ -1188,7 +1200,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numWeight2
//
- this.numWeight2.Location = new System.Drawing.Point(221, 3);
+ this.numWeight2.Location = new System.Drawing.Point(221, 2);
this.numWeight2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numWeight2.Maximum = new decimal(new int[] {
10000,
@@ -1206,7 +1218,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numWeight1
//
- this.numWeight1.Location = new System.Drawing.Point(172, 3);
+ this.numWeight1.Location = new System.Drawing.Point(172, 2);
this.numWeight1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numWeight1.Maximum = new decimal(new int[] {
99999,
@@ -1224,7 +1236,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// numLen2
//
- this.numLen2.Location = new System.Drawing.Point(53, 31);
+ this.numLen2.Location = new System.Drawing.Point(53, 27);
this.numLen2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.numLen2.Maximum = new decimal(new int[] {
299,
@@ -1243,7 +1255,7 @@ namespace TemuKJD.KJDForms.AdminForms
// label15
//
this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(3, 34);
+ this.label15.Location = new System.Drawing.Point(3, 30);
this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(20, 17);
@@ -1253,7 +1265,7 @@ namespace TemuKJD.KJDForms.AdminForms
// label18
//
this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(92, 34);
+ this.label18.Location = new System.Drawing.Point(92, 30);
this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(20, 17);
@@ -1263,7 +1275,7 @@ namespace TemuKJD.KJDForms.AdminForms
// label19
//
this.label19.AutoSize = true;
- this.label19.Location = new System.Drawing.Point(181, 34);
+ this.label19.Location = new System.Drawing.Point(181, 30);
this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(20, 17);
@@ -1273,7 +1285,7 @@ namespace TemuKJD.KJDForms.AdminForms
// label20
//
this.label20.AutoSize = true;
- this.label20.Location = new System.Drawing.Point(155, 6);
+ this.label20.Location = new System.Drawing.Point(155, 5);
this.label20.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(20, 17);
@@ -1283,7 +1295,7 @@ namespace TemuKJD.KJDForms.AdminForms
// label11
//
this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(77, 6);
+ this.label11.Location = new System.Drawing.Point(77, 5);
this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(44, 17);
@@ -1293,7 +1305,7 @@ namespace TemuKJD.KJDForms.AdminForms
// chkLessThan
//
this.chkLessThan.AutoSize = true;
- this.chkLessThan.Location = new System.Drawing.Point(7, 4);
+ this.chkLessThan.Location = new System.Drawing.Point(7, 3);
this.chkLessThan.Name = "chkLessThan";
this.chkLessThan.Size = new System.Drawing.Size(75, 21);
this.chkLessThan.TabIndex = 1160;
@@ -1301,6 +1313,16 @@ namespace TemuKJD.KJDForms.AdminForms
this.chkLessThan.UseVisualStyleBackColor = true;
this.chkLessThan.CheckedChanged += new System.EventHandler(this.chkLessThan_CheckedChanged);
//
+ // label8
+ //
+ this.label8.AutoSize = true;
+ this.label8.Location = new System.Drawing.Point(924, 39);
+ this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(44, 17);
+ this.label8.TabIndex = 1208;
+ this.label8.Text = "过滤词";
+ //
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -1831,6 +1853,7 @@ namespace TemuKJD.KJDForms.AdminForms
//
// splitContainer4.Panel2
//
+ this.splitContainer4.Panel2.Controls.Add(this.chkForceRestoreTitle);
this.splitContainer4.Panel2.Controls.Add(this.statusBar);
this.splitContainer4.Size = new System.Drawing.Size(1484, 26);
this.splitContainer4.SplitterDistance = 322;
@@ -1850,6 +1873,18 @@ namespace TemuKJD.KJDForms.AdminForms
this.ucSplitPage1.TotalPage = 1;
this.ucSplitPage1.PageChange += new System.Action