Commit 5d78bfed by guanzhenshan

增加产品分类筛选

parent 736a76bf
......@@ -145,5 +145,10 @@ namespace Bailun.DC.Models.Stock
/// </summary>
public decimal? stock_age_6months_amount { get; set; }
/// <summary>
/// sku产品分类
/// </summary>
public string skucategory { get; set; }
}
}
......@@ -185,5 +185,10 @@ namespace Bailun.DC.Models.Stock
/// 超过6个月库龄的库存金额
/// </summary>
public decimal? stock_age_6months_amount { get; set; }
/// <summary>
/// sku产品分类
/// </summary>
public string skucategory { get; set; }
}
}
......@@ -74,7 +74,7 @@ namespace Bailun.DC.Services
/// <param name="warehouse">仓库编码</param>
/// <param name="total">符合条件的记录总数</param>
/// <returns></returns>
public List<Models.Stock.mLogicWarehouse> ListLogicWarehouseStock(BtTableParameter parameter, string warehousetype, string warehouse,ref int total)
public List<Models.Stock.mLogicWarehouse> ListLogicWarehouseStock(BtTableParameter parameter, string warehousetype, string warehouse,int? isfinish,string category, ref int total)
{
var sqlparam = new DynamicParameters();
var sqlwhere = " where 1=1 ";
......@@ -93,6 +93,24 @@ namespace Bailun.DC.Services
sqlparam.Add("warehouse_code", warehouse);
}
if (isfinish.HasValue)
{
if (isfinish.Value == 1)
{
sqlwhere += " and hq_type!='半成品仓' ";
}
else if (isfinish.Value == 2)
{
sqlwhere += " and hq_type='半成品仓' ";
}
}
if (!string.IsNullOrWhiteSpace(category))
{
sqlwhere += " and skucategory=@category ";
sqlparam.Add("category", category);
}
sqlwhere += " group by warehouse_code";
var sqlorder = "";
......@@ -132,7 +150,7 @@ namespace Bailun.DC.Services
/// <param name="warehouse">仓库编码</param>
/// <param name="total">符合条件的记录总数</param>
/// <returns></returns>
public List<Models.Stock.mLogicWarehouse> ListLogicWarehouseStock(string warehousetype, string warehouse)
public List<Models.Stock.mLogicWarehouse> ListLogicWarehouseStock(string warehousetype, string warehouse, int? isfinish, string category)
{
var sqlparam = new DynamicParameters();
var sqlwhere = " where 1=1 ";
......@@ -151,6 +169,24 @@ namespace Bailun.DC.Services
sqlparam.Add("warehouse_code", warehouse);
}
if (isfinish.HasValue)
{
if (isfinish.Value == 1)
{
sqlwhere += " and hq_type!='半成品仓' ";
}
else if (isfinish.Value == 2)
{
sqlwhere += " and hq_type='半成品仓' ";
}
}
if (!string.IsNullOrWhiteSpace(category))
{
sqlwhere += " and skucategory=@category ";
sqlparam.Add("category", category);
}
sqlwhere += " group by warehouse_code";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
......@@ -171,7 +207,7 @@ namespace Bailun.DC.Services
/// <param name="warehousetype"></param>
/// <param name="warehouse"></param>
/// <returns></returns>
public Models.Stock.mLogicWarehouse LogicWarehouseStockCount(string warehousetype, string warehouse)
public Models.Stock.mLogicWarehouse LogicWarehouseStockCount(string warehousetype, string warehouse, int? isfinish, string category)
{
var sqlparam = new DynamicParameters();
var sqlwhere = " where 1=1 ";
......@@ -187,6 +223,24 @@ namespace Bailun.DC.Services
sqlwhere += " and warehouse_code=@warehouse_code";
sqlparam.Add("warehouse_code", warehouse);
}
if (isfinish.HasValue)
{
if (isfinish.Value == 1)
{
sqlwhere += " and hq_type!='半成品仓' ";
}
else if(isfinish.Value==2)
{
sqlwhere += " and hq_type='半成品仓' ";
}
}
if (!string.IsNullOrWhiteSpace(category))
{
sqlwhere += " and skucategory=@category ";
sqlparam.Add("category", category);
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{
......@@ -215,7 +269,7 @@ namespace Bailun.DC.Services
/// <param name="total">符合条件的总记录数</param>
/// <param name="onedaysalescount">昨日销量,0:0销量,1:0-1销量,2:1-5销量,5:5-10销量,10:大于10的销量</param>
/// <returns></returns>
public List<Models.Stock.mSkuWarehouse> ListWareHouseSku(BtTableParameter parameter, string warehousecode, int? categoryid, int? minordercount, int? maxordercount, int? stockmin, int? stockmax, decimal? stockamountmin, decimal? stockamountmax, string skucategoryids,int? push_status,int? available_days_start,int? available_days_end, ref int total,DateTime? day,int? onedaysalescount=null)
public List<Models.Stock.mSkuWarehouse> ListWareHouseSku(BtTableParameter parameter, string warehousecode, int? categoryid, int? minordercount, int? maxordercount, int? stockmin, int? stockmax, decimal? stockamountmin, decimal? stockamountmax, string skucategoryids,int? push_status,int? available_days_start,int? available_days_end, ref int total, string category, DateTime? day,int? onedaysalescount=null)
{
var sqlparam = new DynamicParameters();
//available_days
......@@ -346,6 +400,12 @@ namespace Bailun.DC.Services
}
}
if (!string.IsNullOrWhiteSpace(category))
{
sqlwhere += " and t1.skucategory=@category ";
sqlparam.Add("category", category);
}
var sqlsort = "";
......@@ -395,7 +455,7 @@ namespace Bailun.DC.Services
/// <param name="total">符合条件的总记录数</param>
/// <param name="onedaysalescount">昨日销量,0:0销量,1:0-1销量,2:1-5销量,5:5-10销量,10:大于10的销量</param>
/// <returns></returns>
public Models.Stock.mSkuWarehouse ListWareHouseSkuCount(string warehousecode, int? categoryid, int? minordercount, int? maxordercount, int? stockmin, int? stockmax, decimal? stockamountmin, decimal? stockamountmax, string skucategoryids, int? push_status, int? available_days_start, int? available_days_end,DateTime? day,int? onedaysalescount = null)
public Models.Stock.mSkuWarehouse ListWareHouseSkuCount(string warehousecode, int? categoryid, int? minordercount, int? maxordercount, int? stockmin, int? stockmax, decimal? stockamountmin, decimal? stockamountmax, string skucategoryids, int? push_status, int? available_days_start, int? available_days_end, string category, DateTime? day,int? onedaysalescount = null)
{
var sqlparam = new DynamicParameters();
//available_days
......@@ -525,6 +585,12 @@ namespace Bailun.DC.Services
}
}
if (!string.IsNullOrWhiteSpace(category))
{
sqlwhere += " and t1.skucategory=@category ";
sqlparam.Add("category", category);
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{
......@@ -1355,7 +1421,7 @@ namespace Bailun.DC.Services
/// <param name="warehouse_code"></param>
/// <param name="columnname"></param>
/// <returns></returns>
public List<string> GetMidLogicWarehouseStatisticCount(string columnname, DateTime start, DateTime end)
public List<string> GetMidLogicWarehouseStatisticCount(string columnname, DateTime start, DateTime end,string category)
{
var sql = "select CONCAT(name,',',DATE_FORMAT(day,'%Y-%m-%d')) as name from (";
......@@ -1369,6 +1435,11 @@ namespace Bailun.DC.Services
sql += "select sum(" + columnname + ") as name,day from dc_daily_logic_wh_statistic where ";
}
if (!string.IsNullOrWhiteSpace(category))
{
sql += $" skucategory='{category}' ";
}
sql += $" day>='{start.ToString("yyyy-MM-dd")}' and day<='{end.ToString("yyyy-MM-dd")}' group by day";
sql += " ) t1 ";
......
......@@ -271,7 +271,7 @@
s = '';
}
var url = '@Url.Content("~/Reports/Warehouse/ListWareHouseSkuJson")' + '?' + $("#toolbar").serialize() + '&skucategoryids=' + s+'&onedaysalescount=@(ViewBag.onedaysalescount)';
var url = '@Url.Content("~/Reports/Warehouse/ListWareHouseSkuJson")' + '?' + $("#toolbar").serialize() + '&skucategoryids=' + s + '&onedaysalescount=@(ViewBag.onedaysalescount)' + '&isfinish=@(ViewBag.isfinish)' +'&category=@(ViewBag.category)';
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
......
......@@ -304,11 +304,35 @@
}
function SkuDetail(code) {
layer_show('Sku仓库', '@Url.Content("~/Reports/Warehouse/ListWareHouseSku?code=")' + code,'90%','90%');
var isfinish = $('#isfinish').val();
var category = $('#category').val();
var title = '';
if (isfinish != '') {
title == isfinish == 1 ? "成品 " : "半成品 ";
}
if (category != '') {
title += $("#category").find("option:selected").text();
}
layer_show(title+' Sku仓库', '@Url.Content("~/Reports/Warehouse/ListWareHouseSku?code=")' + code + '&isfinish=' + + '&category=' + $('#category').val(),'90%','90%');
}
function ShowDynamicStock(code, name) {
layer_show(name+'动态库存分析', '@Url.Content("~/Reports/Warehouse/DynamicStockAnalyse?warehouse_code=")' + code,'90%','90%');
var isfinish = $('#isfinish').val();
var category = $('#category').val();
var title = '';
if (isfinish != '') {
title == isfinish == 1 ? "成品 " : "半成品 ";
}
if (category != '') {
title += $("#category").find("option:selected").text();
}
title += ' ';
layer_show(title+ name + '动态库存分析', '@Url.Content("~/Reports/Warehouse/DynamicStockAnalyse?warehouse_code=")' + code + '&isfinish=' + $('#isfinish').val() + '&category=' + $('#category').val(),'90%','90%');
}
function ShowTrendChart(code, name, key, whname) {
......@@ -316,7 +340,16 @@
code = '';
}
layer_show(whname+"=》"+name + '的趋势图', '@Url.Content("~/Reports/Warehouse/WarehouseTrendChart?warehouse_code=")' + code + '&key=' + key + '&titlename=' + name,'90%','90%');
if (isfinish != '') {
title == isfinish == 1 ? "成品 " : "半成品 ";
}
if (category != '') {
title += $("#category").find("option:selected").text();
}
title += ' ';
layer_show(title+ whname + "=》" + name + '的趋势图', '@Url.Content("~/Reports/Warehouse/WarehouseTrendChart?warehouse_code=")' + code + '&key=' + key + '&titlename=' + name + '&isfinish=' + $('#isfinish').val() + '&category=' + $('#category').val(),'90%','90%');
}
function ShowCashFlow(code,name) {
......@@ -372,7 +405,10 @@
var semiCategory;
function listSemiCategory() {
if (semiCategory == undefined) {
$.submit({
$('#category').html('<option value="">产品类型</option>');
@*$.submit({
url: '@Url.Content("~/Reports/Warehouse/ListFinanceCategory")',
paramData: '',
type: 'POST',
......@@ -386,7 +422,7 @@
}
}
}
})
})*@
}
else {
$('#category').html('<option value="">产品类型</option>');
......
......@@ -48,7 +48,7 @@
$.submit({
type:'POST',
url: '@Url.Content("~/Reports/Warehouse/WarehouseTrendChartJson")',
paramData: 'warehouse_code=@(ViewBag.warehouse_code)&key=@(ViewBag.key)&' + $("#toolbar").serialize(),
paramData: 'warehouse_code=@(ViewBag.warehouse_code)&key=@(ViewBag.key)&' + $("#toolbar").serialize()+'&category=@(ViewBag.category)',
func: function (result) {
if (result.success) {
var arrval = new Array();
......
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