支持从机会商品里添加商品到待上传

This commit is contained in:
wule committed 2025-10-10 23:03:24 +08:00
1 parent 5e9bdd1700
commit 8501d39f7f
19 files changed
+1245 -254

No files matched your search

@@ -771,6 +771,92 @@ namespace KJD_Web.BLL
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetSelectProductMapDraftIdList(string inputData, bool isDetail = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":50001,\"msg\":\"用户为空\"}";
}
var select_db_id = RegexUtils.GetStringQuery(ref inputData, "select_db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(select_db_id))
{
return "{\"code\":50002,\"msg\":\"未选择选品数据\"}";
}
long l_select_map_table_id = select_db_id.ParseToLong() % 64;
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from kjd_map.product_select_map_" + l_select_map_table_id + " where 1=1";
string where = " and product_select_db_id=" + select_db_id;
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from kjd_map.product_select_map_" + l_select_map_table_id + " where 1=1";
//where子句
sql += where;
sql += " order by id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
if (dt != null)
{
try
{
List<DBProductSelectMapResultParam> productSelectMapLst = new List<DBProductSelectMapResultParam>();
foreach (DataRow row in dt.Rows)
{
DBProductSelectMapResultParam productSelectMap = new DBProductSelectMapResultParam
{
id = row["id"].ParseToInt(),
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"]),
};
productSelectMapLst.Add(productSelectMap);
}
var data = JsonUtils.SerializerObjectToString(productSelectMapLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":500,\"msg\":\"查询结果为空!\",\"data\":[],\"count\":" + 0 + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -771,5 +771,91 @@ namespace KJD_Web.BLL
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetSelectProductMapDraftIdList(string inputData, bool isDetail = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":50001,\"msg\":\"用户为空\"}";
}
var select_db_id = RegexUtils.GetStringQuery(ref inputData, "select_db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(select_db_id))
{
return "{\"code\":50002,\"msg\":\"未选择选品数据\"}";
}
long l_select_map_table_id = select_db_id.ParseToLong() % 64;
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from kjd_map.product_third_select_map_" + l_select_map_table_id + " where 1=1";
string where = " and product_select_db_id=" + select_db_id;
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from kjd_map.product_third_select_map_" + l_select_map_table_id + " where 1=1";
//where子句
sql += where;
sql += " order by id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
if (dt != null)
{
try
{
List<DBProductSelectMapResultParam> productSelectMapLst = new List<DBProductSelectMapResultParam>();
foreach (DataRow row in dt.Rows)
{
DBProductSelectMapResultParam productSelectMap = new DBProductSelectMapResultParam
{
id = row["id"].ParseToInt(),
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"]),
};
productSelectMapLst.Add(productSelectMap);
}
var data = JsonUtils.SerializerObjectToString(productSelectMapLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":500,\"msg\":\"查询结果为空!\",\"data\":[],\"count\":" + 0 + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}