Commit bc7c674b by wangwanchang

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

parent 096e3a5e
......@@ -160,6 +160,16 @@ namespace Bailun.DataCenter.Application.Order
var endpaytime = DateTime.Parse(queryParam["endpaytime"].ToString());
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())
{
var warehousetype = queryParam["warehousetype"].ToInt();
......@@ -230,6 +240,11 @@ namespace Bailun.DataCenter.Application.Order
var datasource = queryParam["datasource"].ToString();
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())
{
var seller = queryParam["seller"].ToString();
......
......@@ -14,6 +14,7 @@ using System.Linq.Expressions;
using System.Text;
using Bailun.DataCenter.Application.Common;
using MySql.Data.MySqlClient;
using Bailun.DataCenter.Application.BasicInfo;
namespace Bailun.DataCenter.Application.Statistic
{
......@@ -28,12 +29,15 @@ namespace Bailun.DataCenter.Application.Statistic
{
private readonly ISkuStatisticRepository _skuStatisticRepository;
private readonly ICommonAppService _commonAppService;
private readonly IWarehouseInfoAppService _warehouseInfoAppService;
public SkuStatisticAppService(ISkuStatisticRepository skuStatisticRepository,
ICommonAppService commonAppService)
ICommonAppService commonAppService,
IWarehouseInfoAppService warehouseInfoAppService)
{
_skuStatisticRepository = skuStatisticRepository;
_commonAppService = commonAppService;
_warehouseInfoAppService = warehouseInfoAppService;
}
#region 获取数据
......@@ -95,7 +99,7 @@ namespace Bailun.DataCenter.Application.Statistic
if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty())
{
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));
}
}
......@@ -140,7 +144,7 @@ namespace Bailun.DataCenter.Application.Statistic
if (!queryParam["warehousetype"].IsEmpty() && queryParam["Warehouse"].IsEmpty())
{
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));
}
}
......
......@@ -41,10 +41,34 @@ namespace Bailun.DataCenter.Tasks.Jobs.SkuStatistics
string skuNumber = string.Empty;
do
{
List<System.Threading.Tasks.Task> tasklist = new List<System.Threading.Tasks.Task>();
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);
}));
}
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));
......@@ -228,7 +252,7 @@ namespace Bailun.DataCenter.Tasks.Jobs.SkuStatistics
}
//已发货总量
dssList[dssIndex].shipped_totalquantity += item.shipped_quantity;
//发货总量
//发货总量
dssList[dssIndex].notshipped_totalquantity += item.notshipped_quantity;
//已到货总量
dssList[dssIndex].arrived_totalquantity += item.arrived_quantity;
......
......@@ -148,7 +148,7 @@ namespace Bailun.DataCenter.Tasks.Jobs.WarehouseStatistics
}
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;
......
......@@ -13,6 +13,7 @@ using Bailun.DataCenter.Tasks.Jobs.SkuFbaOrder;
using Bailun.DataCenter.Tasks.Jobs.FbaSkuStock;
using Bailun.DataCenter.Common.Redis;
using Bailun.DataCenter.Tasks.Jobs.MaterialStock;
using System.Collections.Generic;
namespace Bailun.DataCenter.Tasks
{
......@@ -147,10 +148,34 @@ namespace Bailun.DataCenter.Tasks
//string skuNumber = string.Empty;
//do
//{
// List<System.Threading.Tasks.Task> tasklist = new List<System.Threading.Tasks.Task>();
// 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);
// }));
// }
// 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));
......
......@@ -24,11 +24,27 @@
<td>
<div id="Warehouse" type="select" style="width: 200px;" class="ui-select"></div>
</td>
<td>
<label class="lb-title">
订单状态:
</label>
</td>
<td>
<div id="status" type="select" class="ui-select" style="width: 100px;"></div>
</td>
<td>
<label class="lb-title">
发货状态:
</label>
</td>
<td>
<div id="shipstatus" type="select" class="ui-select" style="width: 100px;"></div>
</td>
<td style="padding-center: 3px;">
<input id="txt_Sku" type="text" class="form-control" placeholder="请输入要查询的Sku编码" style="width: 200px;"/>
<input id="txt_Sku" type="text" class="form-control" placeholder="请输入要查询的Sku编码" style="width: 200px;" />
</td>
<td style="padding-center: 3px;">
<input id="txt_Onumber" type="text" class="form-control" placeholder="请输入要查询的订单编号" style="width: 200px;"/>
<input id="txt_Onumber" type="text" class="form-control" placeholder="请输入要查询的订单编号" style="width: 200px;" />
</td>
<td style="padding-center: 5px;">
<a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>查询</a>
......@@ -52,6 +68,50 @@
<script>
var warehouseList = [];
$(function () {
$("#status").ComboBox({
//url: "/ProductManage/Product/GetDeliverId",
id: "Id",
description: "全部",
text: "Name",
height: "200px",
allowSearch: false,
data: [{ Id: '1', Name: '进行中' }, { Id: '2', Name: '订单完成' }, { Id: '3', Name: '订单取消' }]
});
$("#shipstatus").ComboBox({
//url: "/ProductManage/Product/GetDeliverId",
id: "Id",
description: "全部",
text: "Name",
height: "200px",
allowSearch: false,
data: [{ Id: '1', Name: '未发货' }, { Id: '2', Name: '已发货' }, { Id: '3', Name: '部分发货' }]
});
$("#sel_warehouse_type").ComboBox({
//url: "/ProductManage/Product/GetDeliverId",
id: "Id",
description: "全部",
text: "TypeName",
height: "200px",
allowSearch: false,
data: [{ Id: '1', TypeName: '国内仓' }, { Id: '2', TypeName: '海外仓' }, { Id: '3', TypeName: 'fba仓' }, { Id: '4', TypeName: '第三方仓库' }]
});
//仓库
$("#Warehouse").ComboBox({
url: "../../Statistic/SkuStatistic/GetWarehouse",
description: "==请选择仓库==",
id: "WareCode",
text: "WH_Title",
allowSearch: true,
height: "200px",
successCallback: function (data) {
warehouseList = data;
//$("#queryWarehouseId").ComboBoxSetValue(initWareCode);
}
});
GetGrid();
InitialPage();
......@@ -127,15 +187,40 @@
}
function GetPostData() {
debugger;
var sku = request('sku');
var warehousecode = request("warehousecode");
var shipstatus = request("shipstatus");
var status = request("status");
var datasource = request("datasource");
if (sku) {
$("#txt_Sku").val(sku);
}
if (warehousecode) {
$("#Warehouse").ComboBoxSetValue(warehousecode);
}
if (status) {
$("#status").ComboBoxSetValue(status);
}
if (shipstatus) {
$("#shipstatus").ComboBoxSetValue(shipstatus);
}
if (sku || shipstatus || warehousecode || datasource || status) {
$(".titlePanel").hide();
}
var queryJson = {
Sku: $("#txt_Sku").val(),
Warehouse: $("#Warehouse").attr("data-value"),
Onumber: $("#txt_Onumber").val(),
datasource: "HQOMS",
seller: $("#seller").attr("data-value"),
startpaytime: $("#StartTime").val(),
endpaytime: $("#EndTime").val(),
warehousetype: $("#sel_warehouse_type").attr("data-value")
warehousetype: $("#sel_warehouse_type").attr("data-value"),
status: $("#status").attr("data-value"),
shipstatus: $("#shipstatus").attr("data-value")
}
if (datasource) {
queryJson.datasource = datasource;
}
return JSON.stringify(queryJson);
}
......@@ -158,10 +243,20 @@
autowidth: true,
height: $(window).height() - $('#gridTable').offset().top - gridHeight,
url: "../../Order/SkuOrder/GetPageListJson",
postData: {
queryJson: GetPostData()
},
datatype: "json",
colModel: [
{ label: '自增编号', name: 'Id', index: 'Id', align: 'center', sortable: true,hidden:true },
{ label: '自增编号', name: 'Id', index: 'Id', align: 'center', sortable: true, hidden: true },
{ label: '流水号', name: 'so_number', index: 'so_number', align: 'center', sortable: false },
{
label: '订单编号', name: 'o_number', index: 'o_number', align: 'center', sortable: false,
formatter: function (cellvalue, options, rowObject) {
return '<a style="color: rgb(51, 122, 183);cursor:pointer" onclick="navigateToOrder(\'' + cellvalue + '\',\'' + rowObject.datasource + '\')">' + cellvalue + '</a>';
}
},
{ label: '外部订单编号', name: 'o_number_external', index: 'o_number_external', align: 'center', sortable: false },
{ label: 'sku编码', name: 's_number', index: 's_number', align: 'center', sortable: false },
{ label: '刊登sku编码', name: 's_number_publish', index: 's_number_publish', align: 'center', sortable: false },
{ label: '主图', name: 'S_IMAGE_MAIN', index: 'S_IMAGE_MAIN', align: 'center', sortable: false, formatter: displayImgFormatter },
......@@ -186,17 +281,8 @@
} else {
return '否';
}
//switch (cellvalue) {
// case 0:
// return '否';
// case 1:
// return '是';
// default:
// return '否';
//}
}},
{ label: '订单编号', name: 'o_number', index: 'o_number', align: 'center', sortable: false },
{ label: '外部订单编号', name: 'o_number_external', index: 'o_number_external', align: 'center', sortable: false },
}
},
{
label: '订单状态', name: 'state', index: 'state', align: 'center', sortable: true, formatter: function (cellvalue, options, rowObject) {
switch (cellvalue) {
......@@ -219,13 +305,15 @@
return '未发货';
case 2:
return '已发货';
case 3:
return '部分发货';
default:
return '未发货';
}
}
},
{ label: '创建时间', name: 'createtime', index: 'createtime', align: 'center', sortable: true },
{ label: '更新时间', name: 'updatetime', index: 'updatetime', align: 'center', sortable: true },
{ label: '更新时间', name: 'updatetime', index: 'updatetime', align: 'center', sortable: true }
],
rowNum: 30,
rowList: [30, 50, 100],
......@@ -253,4 +341,13 @@
var imgUrlList = cellvalue.split(',');
return "<a target='_blank' href='/ProductManage/Product/FrontInfo/" + rowObject.Id + "' href1='" + imgUrlList[0] + "' class='tooltip1'><img src='" + imgUrlList[0] + "' title='" + rowObject['Title'] + "' width='50' height='50'/></a>";
};
//跳转到采购系统
var navigateToOrder = function (orderno, datasource) {
var url = 'http://tj.oa.com/OrderList/Order/OrderIndex?orderno=' + orderno;
if (datasource.toLowerCase() == "fba") {
url = "";
}
window.open(url, '_blank');
}
</script>
\ No newline at end of file
......@@ -123,7 +123,12 @@
}
},
{ 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: 'oneday_sales', index: 'oneday_sales', align: 'center', sortable: true },
{ label: '昨日总销量额', name: 'oneday_salesmoney', index: 'oneday_salesmoney', align: 'center', sortable: true },
......@@ -174,7 +179,7 @@
//{ 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: '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: 'oneday_sales', index: 'oneday_sales', align: 'center', sortable: true },
{ label: '近七日销量', name: 'sevendays_sales', index: 'sevendays_sales', align: 'center', sortable: true },
......@@ -451,6 +456,10 @@
else if (type === 3) {
url = '/Statistic/SkuStatistic/skuwarehouseIndex?sku=' + sku;
}
//销售订单
else if (type === 4) {
url = '/Order/SkuOrder/Index?sku=' + sku + '&status=' + status + '&shipstatus=1';
}
top.tablist.newTab({
id: "sku_statistics",
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