Commit bdfdeac6 by guanzhenshan

调整逻辑仓页面

parent a56ce2b7
...@@ -526,19 +526,34 @@ namespace Bailun.DC.Services ...@@ -526,19 +526,34 @@ namespace Bailun.DC.Services
/// </summary> /// </summary>
/// <param name="name"></param> /// <param name="name"></param>
/// <returns></returns> /// <returns></returns>
public List<string> ListGroupName(string name) public List<string> ListGroupName(string name, string country, string warehousetype, string warehousecode)
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var sql = "select groupname from dc_sku_monitor "; var sql = "select t1.groupname from dc_sku_monitor t1 join dc_base_warehouse t2 on t1.warehousecode=t2.warehouse_code where 1=1 ";
if (!string.IsNullOrEmpty(name)) if (!string.IsNullOrEmpty(name))
{ {
sql += " where groupname like @groupname"; sql += " and t1.groupname like @groupname";
sqlparam.Add("groupname", "%"+name+"%"); sqlparam.Add("groupname", "%"+name+"%");
} }
if (!string.IsNullOrEmpty(country))
{
sql += " and t2.area_name=@area_name";
sqlparam.Add("area_name", country);
}
if (!string.IsNullOrEmpty(warehousetype))
{
sql += " and t2.hq_type=@hq_type";
sqlparam.Add("hq_type", warehousetype);
}
if (!string.IsNullOrEmpty(warehousecode))
{
sql += " and t1.warehousecode=@warehousecode";
sqlparam.Add("warehousecode", warehousecode);
}
sql += " group by groupname"; sql += " group by t1.groupname";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{ {
......
...@@ -371,5 +371,35 @@ namespace Bailun.DC.Services ...@@ -371,5 +371,35 @@ namespace Bailun.DC.Services
} }
/// <summary>
/// 获取逻辑仓库里面有的仓库
/// </summary>
/// <param name="warehousetype"></param>
/// <returns></returns>
public List<dc_base_warehouse> ListWarehouseFromStockAndSales(string warehousetype)
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var sqlparam = new DynamicParameters();
var sql = "select warehouse_code,warehouse_name from dc_skuwarehouse_stock_sales where 1=1 ";
if (!string.IsNullOrEmpty(warehousetype))
{
sql += " and hq_type=@hq_type";
sqlparam.Add("hq_type",warehousetype);
}
sql += " group by warehouse_code";
return cn.Query<dc_base_warehouse>(sql, sqlparam).AsList();
}
}
} }
} }
...@@ -52,16 +52,16 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -52,16 +52,16 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
amount_onedaysale = (p.amount_onedaysale??0).ToString("N2"), amount_onedaysale = (p.amount_onedaysale??0).ToString("N2"),
amount_stock = p.amount_stock.ToString("N2"), amount_stock = p.amount_stock.ToString("N2"),
amount_transit = (p.amount_transit??0.00M).ToString("N2"), amount_transit = (p.amount_transit??0.00M).ToString("N2"),
fourteenday_total_sales = (p.fourteenday_total_sales??0), fourteenday_total_sales = (p.fourteenday_total_sales??0).ToString("N0"),
noshippingcount = (p.noshippingcount??0), noshippingcount = (p.noshippingcount??0).ToString("N0"),
nostockcount = (p.nostockcount??0), nostockcount = (p.nostockcount??0).ToString("N0"),
oneday_total_sales = (p.oneday_total_sales??0), oneday_total_sales = (p.oneday_total_sales??0).ToString("N0"),
purchase_amount = (p.purchase_amount??0).ToString("N2"), purchase_amount = (p.purchase_amount??0).ToString("N2"),
quantity_purchase = (p.quantity_purchase??0), quantity_purchase = (p.quantity_purchase??0).ToString("N0"),
quantity_transfer = (p.quantity_transfer??0), quantity_transfer = (p.quantity_transfer??0).ToString("N0"),
sevenday_total_sales = (p.sevenday_total_sales??0), sevenday_total_sales = (p.sevenday_total_sales??0).ToString("N0"),
thirtyday_total_sales = (p.thirtyday_total_sales??0), thirtyday_total_sales = (p.thirtyday_total_sales??0).ToString("N0"),
usable_stock = p.usable_stock, usable_stock = p.usable_stock.ToString("N0"),
p.warehouse_code, p.warehouse_code,
p.warehouse_name, p.warehouse_name,
}); });
...@@ -71,16 +71,16 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -71,16 +71,16 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
amount_onedaysale = (countM.amount_onedaysale??0).ToString("N2"), amount_onedaysale = (countM.amount_onedaysale??0).ToString("N2"),
amount_stock = countM.amount_stock.ToString("N2"), amount_stock = countM.amount_stock.ToString("N2"),
amount_transit = (countM.amount_transit??0).ToString("N2"), amount_transit = (countM.amount_transit??0).ToString("N2"),
noshippingcount = (countM.noshippingcount??0), noshippingcount = (countM.noshippingcount??0).ToString("N0"),
nostockcount = (countM.nostockcount??0), nostockcount = (countM.nostockcount??0).ToString("N0"),
oneday_total_sales = (countM.oneday_total_sales??0), oneday_total_sales = (countM.oneday_total_sales??0).ToString("N0"),
purchase_amount = (countM.purchase_amount??0).ToString("N2"), purchase_amount = (countM.purchase_amount??0).ToString("N2"),
quantity_purchase = (countM.quantity_purchase??0), quantity_purchase = (countM.quantity_purchase??0).ToString("N0"),
quantity_transfer = (countM.quantity_transfer??0), quantity_transfer = (countM.quantity_transfer??0).ToString("N0"),
sevenday_total_sales = (countM.sevenday_total_sales??0), sevenday_total_sales = (countM.sevenday_total_sales??0).ToString("N0"),
thirtyday_total_sales = (countM.thirtyday_total_sales??0), thirtyday_total_sales = (countM.thirtyday_total_sales??0).ToString("N0"),
usable_stock = countM.usable_stock, usable_stock = countM.usable_stock.ToString("N0"),
fourteenday_total_sales = (countM.fourteenday_total_sales??0) fourteenday_total_sales = (countM.fourteenday_total_sales??0).ToString("N0")
} }); } });
} }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<option value="海外仓">海外仓</option> <option value="海外仓">海外仓</option>
<option value="FBA仓">FBA仓</option> <option value="FBA仓">FBA仓</option>
<option value="第三方仓库">第三方仓库</option> <option value="第三方仓库">第三方仓库</option>
<option value="半成品仓">半成品仓</option>
<option value="耗材仓">耗材仓</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -132,7 +134,7 @@ ...@@ -132,7 +134,7 @@
var type = $('#warehousetype').val(); var type = $('#warehousetype').val();
$.submit({ $.submit({
url: '@Url.Content("~/Home/ListWareHouse")', url: '@Url.Content("~/Home/ListWarehouseFromStockAndSales")',
paramData: 'warehousetype=' + type, paramData: 'warehousetype=' + type,
type:'POST', type:'POST',
func: function (result) { func: function (result) {
......
...@@ -43,9 +43,9 @@ namespace Bailun.DC.Web.Controllers ...@@ -43,9 +43,9 @@ namespace Bailun.DC.Web.Controllers
/// <param name="name"></param> /// <param name="name"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public JsonResult GetListGroup(string name) public JsonResult GetListGroup(string name,string country,string warehousetype,string warehousecode)
{ {
var result = new Services.SkuMonitorServices().ListGroupName(name); var result = new Services.SkuMonitorServices().ListGroupName(name,country,warehousetype,warehousecode);
return Json(result); return Json(result);
} }
......
...@@ -89,5 +89,13 @@ namespace Bailun.DC.Web.Controllers ...@@ -89,5 +89,13 @@ namespace Bailun.DC.Web.Controllers
var result = new Services.WareHouseServices().ListGroupName().Where(a=>!string.IsNullOrEmpty(a)); var result = new Services.WareHouseServices().ListGroupName().Where(a=>!string.IsNullOrEmpty(a));
return Json(result); return Json(result);
} }
[HttpPost]
public JsonResult ListWarehouseFromStockAndSales(string warehousetype)
{
var result = new Services.WareHouseServices().ListWarehouseFromStockAndSales(warehousetype);
return Json(result);
}
} }
} }
\ No newline at end of file
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