Commit bc7c674b by wangwanchang

sku仓库列表页增加超链,订单统计任务修改

parent 096e3a5e
...@@ -160,6 +160,16 @@ namespace Bailun.DataCenter.Application.Order ...@@ -160,6 +160,16 @@ namespace Bailun.DataCenter.Application.Order
var endpaytime = DateTime.Parse(queryParam["endpaytime"].ToString()); var endpaytime = DateTime.Parse(queryParam["endpaytime"].ToString());
query = query.Where(t => t.paytime < endpaytime); query = query.Where(t => t.paytime < endpaytime);
} }
if (!queryParam["shipstatus"].IsEmpty())
{
var shipstatus = queryParam["shipstatus"].ToInt();
query = query.Where(t => t.shipping_status == shipstatus);
}
if (!queryParam["status"].IsEmpty())
{
var status = queryParam["status"].ToInt();
query = query.Where(t => t.state == status);
}
if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty()) if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty())
{ {
var warehousetype = queryParam["warehousetype"].ToInt(); var warehousetype = queryParam["warehousetype"].ToInt();
...@@ -230,6 +240,11 @@ namespace Bailun.DataCenter.Application.Order ...@@ -230,6 +240,11 @@ namespace Bailun.DataCenter.Application.Order
var datasource = queryParam["datasource"].ToString(); var datasource = queryParam["datasource"].ToString();
query = query.Where(t => t.datasource == datasource); query = query.Where(t => t.datasource == datasource);
} }
if (!queryParam["shipstatus"].IsEmpty())
{
var shipstatus = queryParam["shipstatus"].ToInt();
query = query.Where(t => t.shipping_status == shipstatus);
}
if (!queryParam["seller"].IsEmpty()) if (!queryParam["seller"].IsEmpty())
{ {
var seller = queryParam["seller"].ToString(); var seller = queryParam["seller"].ToString();
......
...@@ -14,6 +14,7 @@ using System.Linq.Expressions; ...@@ -14,6 +14,7 @@ using System.Linq.Expressions;
using System.Text; using System.Text;
using Bailun.DataCenter.Application.Common; using Bailun.DataCenter.Application.Common;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using Bailun.DataCenter.Application.BasicInfo;
namespace Bailun.DataCenter.Application.Statistic namespace Bailun.DataCenter.Application.Statistic
{ {
...@@ -28,12 +29,15 @@ namespace Bailun.DataCenter.Application.Statistic ...@@ -28,12 +29,15 @@ namespace Bailun.DataCenter.Application.Statistic
{ {
private readonly ISkuStatisticRepository _skuStatisticRepository; private readonly ISkuStatisticRepository _skuStatisticRepository;
private readonly ICommonAppService _commonAppService; private readonly ICommonAppService _commonAppService;
private readonly IWarehouseInfoAppService _warehouseInfoAppService;
public SkuStatisticAppService(ISkuStatisticRepository skuStatisticRepository, public SkuStatisticAppService(ISkuStatisticRepository skuStatisticRepository,
ICommonAppService commonAppService) ICommonAppService commonAppService,
IWarehouseInfoAppService warehouseInfoAppService)
{ {
_skuStatisticRepository = skuStatisticRepository; _skuStatisticRepository = skuStatisticRepository;
_commonAppService = commonAppService; _commonAppService = commonAppService;
_warehouseInfoAppService = warehouseInfoAppService;
} }
#region 获取数据 #region 获取数据
...@@ -95,7 +99,7 @@ namespace Bailun.DataCenter.Application.Statistic ...@@ -95,7 +99,7 @@ namespace Bailun.DataCenter.Application.Statistic
if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty()) if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty())
{ {
var warehousetype = queryParam["warehousetype"].ToInt(); var warehousetype = queryParam["warehousetype"].ToInt();
var data = _commonAppService.GetWarehouseList().Where(d => d.WH_Type.ToInt() == warehousetype).Select(d => d.WareCode).ToList(); var data = _warehouseInfoAppService.GetList(new { waretype = warehousetype }.ToJson()).Select(d => d.WareCode).ToList();
query = query.Where(d => data.Contains(d.warehouse_code)); query = query.Where(d => data.Contains(d.warehouse_code));
} }
} }
...@@ -140,7 +144,7 @@ namespace Bailun.DataCenter.Application.Statistic ...@@ -140,7 +144,7 @@ namespace Bailun.DataCenter.Application.Statistic
if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty()) if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty())
{ {
var warehousetype = queryParam["warehousetype"].ToInt(); var warehousetype = queryParam["warehousetype"].ToInt();
var data = _commonAppService.GetWarehouseList().Where(d => d.WH_Type.ToInt() == warehousetype).Select(d => d.WareCode).ToList(); var data = _warehouseInfoAppService.GetList(new { waretype = warehousetype }.ToJson()).Select(d => d.WareCode).ToList();
strsql.AppendFormat(" and warehouse_code in('{0}')", string.Join("','", data)); strsql.AppendFormat(" and warehouse_code in('{0}')", string.Join("','", data));
} }
} }
......
...@@ -41,10 +41,34 @@ namespace Bailun.DataCenter.Tasks.Jobs.SkuStatistics ...@@ -41,10 +41,34 @@ namespace Bailun.DataCenter.Tasks.Jobs.SkuStatistics
string skuNumber = string.Empty; string skuNumber = string.Empty;
do do
{ {
List<System.Threading.Tasks.Task> tasklist = new List<System.Threading.Tasks.Task>();
skuNumber = RedisOprate.Set_Pop<string>("SkuSet"); skuNumber = RedisOprate.Set_Pop<string>("SkuSet");
if (!string.IsNullOrEmpty(skuNumber)) if (!string.IsNullOrEmpty(skuNumber))
{ {
SkuStatistics(skuNumber); tasklist.Add(System.Threading.Tasks.Task.Factory.StartNew(() =>
{
SkuStatistics(skuNumber);
}));
}
skuNumber = RedisOprate.Set_Pop<string>("SkuSet");
if (!string.IsNullOrEmpty(skuNumber))
{
tasklist.Add(System.Threading.Tasks.Task.Factory.StartNew(() =>
{
SkuStatistics(skuNumber);
}));
}
skuNumber = RedisOprate.Set_Pop<string>("SkuSet");
if (!string.IsNullOrEmpty(skuNumber))
{
tasklist.Add(System.Threading.Tasks.Task.Factory.StartNew(() =>
{
SkuStatistics(skuNumber);
}));
}
if (tasklist.Count > 0)
{
System.Threading.Tasks.Task.WaitAll(tasklist.ToArray());
} }
} }
while (!string.IsNullOrEmpty(skuNumber)); while (!string.IsNullOrEmpty(skuNumber));
...@@ -228,7 +252,7 @@ namespace Bailun.DataCenter.Tasks.Jobs.SkuStatistics ...@@ -228,7 +252,7 @@ namespace Bailun.DataCenter.Tasks.Jobs.SkuStatistics
} }
//已发货总量 //已发货总量
dssList[dssIndex].shipped_totalquantity += item.shipped_quantity; dssList[dssIndex].shipped_totalquantity += item.shipped_quantity;
//发货总量 //发货总量
dssList[dssIndex].notshipped_totalquantity += item.notshipped_quantity; dssList[dssIndex].notshipped_totalquantity += item.notshipped_quantity;
//已到货总量 //已到货总量
dssList[dssIndex].arrived_totalquantity += item.arrived_quantity; dssList[dssIndex].arrived_totalquantity += item.arrived_quantity;
......
...@@ -148,7 +148,7 @@ namespace Bailun.DataCenter.Tasks.Jobs.WarehouseStatistics ...@@ -148,7 +148,7 @@ namespace Bailun.DataCenter.Tasks.Jobs.WarehouseStatistics
} }
catch (Exception) catch (Exception)
{ {
log.ErrorFormat("仓库实时统计错误:仓库编码:{1},仓库名称:{2}",item.warehouse_code, item.warehouse_name); log.ErrorFormat("仓库实时统计错误:仓库编码:{0},仓库名称:{1}",item.warehouse_code, item.warehouse_name);
} }
string warehousecode = item.warehouse_code; string warehousecode = item.warehouse_code;
......
...@@ -13,6 +13,7 @@ using Bailun.DataCenter.Tasks.Jobs.SkuFbaOrder; ...@@ -13,6 +13,7 @@ using Bailun.DataCenter.Tasks.Jobs.SkuFbaOrder;
using Bailun.DataCenter.Tasks.Jobs.FbaSkuStock; using Bailun.DataCenter.Tasks.Jobs.FbaSkuStock;
using Bailun.DataCenter.Common.Redis; using Bailun.DataCenter.Common.Redis;
using Bailun.DataCenter.Tasks.Jobs.MaterialStock; using Bailun.DataCenter.Tasks.Jobs.MaterialStock;
using System.Collections.Generic;
namespace Bailun.DataCenter.Tasks namespace Bailun.DataCenter.Tasks
{ {
...@@ -147,10 +148,34 @@ namespace Bailun.DataCenter.Tasks ...@@ -147,10 +148,34 @@ namespace Bailun.DataCenter.Tasks
//string skuNumber = string.Empty; //string skuNumber = string.Empty;
//do //do
//{ //{
// List<System.Threading.Tasks.Task> tasklist = new List<System.Threading.Tasks.Task>();
// skuNumber = RedisOprate.Set_Pop<string>("SkuSet"); // skuNumber = RedisOprate.Set_Pop<string>("SkuSet");
// if (!string.IsNullOrEmpty(skuNumber)) // if (!string.IsNullOrEmpty(skuNumber))
// { // {
// ss.SkuStatistics(skuNumber); // tasklist.Add(System.Threading.Tasks.Task.Factory.StartNew(() =>
// {
// ss.SkuStatistics(skuNumber);
// }));
// }
// skuNumber = RedisOprate.Set_Pop<string>("SkuSet");
// if (!string.IsNullOrEmpty(skuNumber))
// {
// tasklist.Add(System.Threading.Tasks.Task.Factory.StartNew(() =>
// {
// ss.SkuStatistics(skuNumber);
// }));
// }
// skuNumber = RedisOprate.Set_Pop<string>("SkuSet");
// if (!string.IsNullOrEmpty(skuNumber))
// {
// tasklist.Add(System.Threading.Tasks.Task.Factory.StartNew(() =>
// {
// ss.SkuStatistics(skuNumber);
// }));
// }
// if (tasklist.Count > 0)
// {
// System.Threading.Tasks.Task.WaitAll(tasklist.ToArray());
// } // }
//} //}
//while (!string.IsNullOrEmpty(skuNumber)); //while (!string.IsNullOrEmpty(skuNumber));
......
...@@ -123,7 +123,12 @@ ...@@ -123,7 +123,12 @@
} }
}, },
{ label: '调拨在途金额', name: 'allot_transit_money', index: 'allot_transit_money', align: 'center', sortable: true }, { label: '调拨在途金额', name: 'allot_transit_money', index: 'allot_transit_money', align: 'center', sortable: true },
{ label: '待发货数量', name: 'plan_shipped', index: 'plan_shipped', align: 'center', sortable: true }, {
label: '待发货数量', name: 'plan_shipped', index: 'plan_shipped', align: 'center', sortable: true,
formatter: function (cellvalue, options, rowObject) {
return '<a style="color: rgb(51, 122, 183);cursor:pointer" onclick="navigateToDetail(\'' + rowObject.s_number + '\',1,4,\'订单明细\')">' + cellvalue + '</a>';
}
},
{ label: '缺货数量', name: 'out_stock', index: 'out_stock', align: 'center', sortable: true }, { label: '缺货数量', name: 'out_stock', index: 'out_stock', align: 'center', sortable: true },
{ label: '昨日总销量', name: 'oneday_sales', index: 'oneday_sales', align: 'center', sortable: true }, { label: '昨日总销量', name: 'oneday_sales', index: 'oneday_sales', align: 'center', sortable: true },
{ label: '昨日总销量额', name: 'oneday_salesmoney', index: 'oneday_salesmoney', align: 'center', sortable: true }, { label: '昨日总销量额', name: 'oneday_salesmoney', index: 'oneday_salesmoney', align: 'center', sortable: true },
...@@ -174,7 +179,7 @@ ...@@ -174,7 +179,7 @@
//{ label: 'fba库存数量', name: 'fba_stock_quantity', index: 'fba_stock_quantity', align: 'center', sortable: true }, //{ label: 'fba库存数量', name: 'fba_stock_quantity', index: 'fba_stock_quantity', align: 'center', sortable: true },
{ label: '采购在途数量', name: 'purchase_transit_quantity', index: 'purchase_transit_quantity', align: 'center', sortable: true }, { label: '采购在途数量', name: 'purchase_transit_quantity', index: 'purchase_transit_quantity', align: 'center', sortable: true },
{ label: '调拨在途数量', name: 'allot_transit_quantity', index: 'allot_transit_quantity', align: 'center', sortable: true }, { label: '调拨在途数量', name: 'allot_transit_quantity', index: 'allot_transit_quantity', align: 'center', sortable: true },
{ label: '待发货数量', name: 'plan_shipped', index: 'plan_shipped', align: 'center', sortable: true }, {label: '待发货数量', name: 'plan_shipped', index: 'plan_shipped', align: 'center', sortable: true},
{ label: '缺货数量', name: 'out_stock', index: 'out_stock', align: 'center', sortable: true }, { label: '缺货数量', name: 'out_stock', index: 'out_stock', align: 'center', sortable: true },
{ label: '近一日销量', name: 'oneday_sales', index: 'oneday_sales', align: 'center', sortable: true }, { label: '近一日销量', name: 'oneday_sales', index: 'oneday_sales', align: 'center', sortable: true },
{ label: '近七日销量', name: 'sevendays_sales', index: 'sevendays_sales', align: 'center', sortable: true }, { label: '近七日销量', name: 'sevendays_sales', index: 'sevendays_sales', align: 'center', sortable: true },
...@@ -451,6 +456,10 @@ ...@@ -451,6 +456,10 @@
else if (type === 3) { else if (type === 3) {
url = '/Statistic/SkuStatistic/skuwarehouseIndex?sku=' + sku; url = '/Statistic/SkuStatistic/skuwarehouseIndex?sku=' + sku;
} }
//销售订单
else if (type === 4) {
url = '/Order/SkuOrder/Index?sku=' + sku + '&status=' + status + '&shipstatus=1';
}
top.tablist.newTab({ top.tablist.newTab({
id: "sku_statistics", id: "sku_statistics",
title: title, title: title,
......
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