Commit c2b5ade7 by 泽锋 李

fix

parent dc26554a
...@@ -4377,9 +4377,9 @@ where (t1.gmt_purchase_modified>=@start_time and t1.gmt_purchase_modified<=@end_ ...@@ -4377,9 +4377,9 @@ where (t1.gmt_purchase_modified>=@start_time and t1.gmt_purchase_modified<=@end_
/// <param name="limit"></param> /// <param name="limit"></param>
/// <param name="total"></param> /// <param name="total"></param>
/// <returns></returns> /// <returns></returns>
public static List<dc_report_goods> GetReportGoodsPage(dc_report_goods_search_dto searchData, int offset, int limit, ref int total, string order = "", string sort = "") public static List<dc_report_goods_dto> GetReportGoodsPage(dc_report_goods_search_dto searchData, int offset, int limit, ref int total, string order = "", string sort = "")
{ {
var sql = " select * from dc_report_goods as t1 left join dc_base_warehouse as t2 on t1.warehouse_code=t2.warehouse_code where 1=1 "; var sql = " select t1.*,t2.hq_type as 'warehouse_type' from dc_report_goods as t1 left join dc_base_warehouse as t2 on t1.warehouse_code=t2.warehouse_code where 1=1 ";
var countSql = " select count(1) from dc_report_goods as t1 left join dc_base_warehouse as t2 on t1.warehouse_code=t2.warehouse_code where 1=1 "; var countSql = " select count(1) from dc_report_goods as t1 left join dc_base_warehouse as t2 on t1.warehouse_code=t2.warehouse_code where 1=1 ";
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
if (!string.IsNullOrWhiteSpace(searchData.product_code)) if (!string.IsNullOrWhiteSpace(searchData.product_code))
...@@ -4422,7 +4422,7 @@ where (t1.gmt_purchase_modified>=@start_time and t1.gmt_purchase_modified<=@end_ ...@@ -4422,7 +4422,7 @@ where (t1.gmt_purchase_modified>=@start_time and t1.gmt_purchase_modified<=@end_
} }
sql += " limit " + offset + "," + limit; sql += " limit " + offset + "," + limit;
total = _connection.QueryFirstOrDefault<int>(countSql, parameters); total = _connection.QueryFirstOrDefault<int>(countSql, parameters);
return _connection.Query<dc_report_goods>(sql, parameters).AsList(); return _connection.Query<dc_report_goods_dto>(sql, parameters).AsList();
} }
} }
} }
......
...@@ -36,6 +36,10 @@ namespace AutoTurnOver.Models ...@@ -36,6 +36,10 @@ namespace AutoTurnOver.Models
{ {
} }
public class dc_report_goods_dto: dc_report_goods
{
public string warehouse_type { get; set; }
}
public class dc_report_goods_search_dto public class dc_report_goods_search_dto
{ {
......
...@@ -1037,7 +1037,7 @@ namespace AutoTurnOver.Services ...@@ -1037,7 +1037,7 @@ namespace AutoTurnOver.Services
return report.GetProductTypeList(); return report.GetProductTypeList();
} }
public List<dc_report_goods> GetReportGoodsPage(dc_report_goods_search_dto m, int offset, int limit, ref int total, string order = "", string sort = "") public List<dc_report_goods_dto> GetReportGoodsPage(dc_report_goods_search_dto m, int offset, int limit, ref int total, string order = "", string sort = "")
{ {
return report.GetReportGoodsPage(m, offset, limit, ref total, order, sort); return report.GetReportGoodsPage(m, offset, limit, ref total, order, sort);
} }
...@@ -1055,8 +1055,7 @@ namespace AutoTurnOver.Services ...@@ -1055,8 +1055,7 @@ namespace AutoTurnOver.Services
var list = GetReportGoodsPage(m, (page - 1) * rows, rows, ref total, order, sort); var list = GetReportGoodsPage(m, (page - 1) * rows, rows, ref total, order, sort);
if (list == null || list.Count <= 0) break; if (list == null || list.Count <= 0) break;
DataTable table = new DataTable(); DataTable table = new DataTable();
string[] cols = new string[] { "Sku","商品编码", "内部编码", "sku标题", "仓库编码", "仓库名称","仓库所在国家", "MOQ", string[] cols = new string[] { "商品编码","产品类型", "仓库类型", "仓库名称", "可用库存数", "在途","单价", "重量","采购","中文名称","昨日销量","昨日销售额","近7天销量","近7天销售额","近30天销量","近30天销售额",
}; };
foreach (var item in cols) foreach (var item in cols)
{ {
...@@ -1066,7 +1065,22 @@ namespace AutoTurnOver.Services ...@@ -1066,7 +1065,22 @@ namespace AutoTurnOver.Services
foreach (var itemData in list) foreach (var itemData in list)
{ {
DataRow row = table.NewRow(); DataRow row = table.NewRow();
//row["计算时间"] = itemData.gmt_modified.ToString("yyyy-MM-dd"); row["商品编码"] = itemData.product_code;
row["产品类型"] = itemData.product_type;
row["仓库类型"] = itemData.warehouse_type;
row["仓库名称"] = itemData.warehouse_name;
row["可用库存数"] = itemData.stock;
row["在途"] = itemData.on_the_way_quantity;
row["单价"] = itemData.unit_price;
row["重量"] = itemData.weight;
row["采购"] = itemData.buyer_name;
row["中文名称"] = itemData.product_title;
row["昨日销量"] = itemData.sales_yesterday;
row["昨日销售额"] = itemData.sales_yesterday_amount_usd;
row["近7天销量"] = itemData.sales_yesterday_7;
row["近7天销售额"] = itemData.sales_yesterday_amount_usd_7;
row["近30天销量"] = itemData.sales_yesterday_30;
row["近30天销售额"] = itemData.sales_yesterday_amount_usd_30;
table.Rows.Add(row); table.Rows.Add(row);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment