1上货逻辑改造修改sku件数和包装尺寸重量 2统计计算利润和填写商品进货价相关功能
This commit is contained in:
1 parent
cc539ce604
commit
511affaeb5
28 files changed
+3283
-482
No files matched your search
@@ -308,6 +308,8 @@ namespace KJD_Web.BLL
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name");
|
||||
string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id")).ParseToString();
|
||||
string skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "skc_id")).ParseToString();
|
||||
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
|
||||
@@ -315,6 +317,7 @@ namespace KJD_Web.BLL
|
||||
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
|
||||
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
|
||||
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
|
||||
string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString();
|
||||
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
|
||||
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
|
||||
@@ -324,9 +327,11 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sqlExist = "select count(spu_id) from kjd.product_purchase_price where spu_id=@spu_id";
|
||||
string sql = "insert into kjd.product_purchase_price " +
|
||||
"(spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,price_text,sku_purchase_price_json,notes) " +
|
||||
"values (@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@price_text,@sku_purchase_price_json,@notes);";
|
||||
"(shop_id,shop_name,spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,discount,price_text,sku_purchase_price_json,notes) " +
|
||||
"values (@shop_id,@shop_name,@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@discount,@price_text,@sku_purchase_price_json,@notes);";
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
|
||||
@@ -334,6 +339,7 @@ namespace KJD_Web.BLL
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
|
||||
@@ -375,21 +381,28 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
|
||||
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
|
||||
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name");
|
||||
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
|
||||
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
|
||||
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
|
||||
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
|
||||
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
|
||||
string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString();
|
||||
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
|
||||
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@db_id", Value = db_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
|
||||
@@ -398,6 +411,10 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "update kjd.product_purchase_price set";
|
||||
if (shop_id != null)
|
||||
sql += " shop_id=@shop_id,";
|
||||
if (shop_name != null)
|
||||
sql += " shop_name=@shop_name,";
|
||||
if (cat_id != null)
|
||||
sql += " cat_id=@cat_id,";
|
||||
if (cat_name != null)
|
||||
@@ -408,6 +425,8 @@ namespace KJD_Web.BLL
|
||||
sql += " product_name=@product_name,";
|
||||
if (main_img != null)
|
||||
sql += " main_img=@main_img,";
|
||||
if (discount != null)
|
||||
sql += " discount=@discount,";
|
||||
if (price_text != null)
|
||||
sql += " price_text=@price_text,";
|
||||
if (sku_purchase_price_json != null)
|
||||
@@ -478,7 +497,7 @@ namespace KJD_Web.BLL
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and p.notes like @search_notes";
|
||||
if (!string.IsNullOrEmpty(in_spu_id))
|
||||
where += " and p.ext_code in ('" + in_spu_id?.Replace(",", "','") + "')";
|
||||
where += " and p.spu_id in ('" + in_spu_id?.Replace(",", "','") + "')";
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
|
||||
@@ -511,9 +530,12 @@ namespace KJD_Web.BLL
|
||||
ProductPurchasePriceResultParam price = new ProductPurchasePriceResultParam
|
||||
{
|
||||
id = row["id"].ParseToInt(),
|
||||
shop_id = row["shop_id"].ParseToString(),
|
||||
shop_name = row["shop_name"].ParseToString(),
|
||||
cat_id = row["cat_id"].ParseToString(),
|
||||
cat_name = row["cat_name"].ParseToString(),
|
||||
main_img = row["main_img"].ParseToString(),
|
||||
discount = row["discount"].ParseToInt(),
|
||||
price_text = row["price_text"].ParseToString(),
|
||||
product_name = row["product_name"].ParseToString(),
|
||||
skc_id = row["skc_id"].ParseToString(),
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace KJD_Web.Model
|
||||
public class ProductPurchasePriceResultParam
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string shop_id { get; set; }
|
||||
public string shop_name { get; set; }
|
||||
public string spu_id { get; set; }
|
||||
public string skc_id { get; set; }
|
||||
public string cat_id { get; set; }
|
||||
@@ -15,6 +17,7 @@ namespace KJD_Web.Model
|
||||
public string ext_code { get; set; }
|
||||
public string product_name { get; set; }
|
||||
public string main_img { get; set; }
|
||||
public int discount { get; set; }
|
||||
public string price_text { get; set; }
|
||||
public string sku_purchase_price_json { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
|
||||
Reference in new issue
Block a user