Commit 4c08485b by guanzhenshan

完善平台利润统计报表,增加查看管理成本明细功能

parent 33fe2b77
...@@ -7,6 +7,16 @@ namespace Bailun.DC.Models.Api ...@@ -7,6 +7,16 @@ namespace Bailun.DC.Models.Api
public class mOtherFee public class mOtherFee
{ {
/// <summary> /// <summary>
/// 费用单号
/// </summary>
public string no { get; set; }
/// <summary>
/// 管理成本单类型
/// </summary>
public string manageCostType { get; set; }
/// <summary>
/// 部门名称 /// 部门名称
/// </summary> /// </summary>
public string departmentName { get; set; } public string departmentName { get; set; }
......
...@@ -22,7 +22,7 @@ namespace Bailun.DC.Models ...@@ -22,7 +22,7 @@ namespace Bailun.DC.Models
/// <summary> /// <summary>
/// 仓库编码 /// 仓库编码
/// </summary> /// </summary>
public string warehousecode { get; set; } public string warehouse_code { get; set; }
/// <summary> /// <summary>
/// 仓库名称 /// 仓库名称
...@@ -82,72 +82,92 @@ namespace Bailun.DC.Models ...@@ -82,72 +82,92 @@ namespace Bailun.DC.Models
/// <summary> /// <summary>
/// 采购价格 /// 采购价格
/// </summary> /// </summary>
public decimal buyprice { get; set; } public decimal? buyprice { get; set; }
/// <summary> /// <summary>
/// 在库数量 /// 库存数
/// </summary> /// </summary>
public int inventorycount { get; set; } public int? usable_stock { get; set; }
/// <summary> /// <summary>
/// 在库金额 /// 库存金额
/// </summary> /// </summary>
public decimal inventoryamount { get; set; } public decimal? amount_stock { get; set; }
/// <summary> /// <summary>
/// 采购在途数量 /// 采购在途数量
/// </summary> /// </summary>
public int purchaseonwaycount { get; set; } public int? quantity_purchase { get; set; }
/// <summary> /// <summary>
/// 采购在途金额 /// 采购在途金额
/// </summary> /// </summary>
public decimal purchaseonwayamount { get; set; } public decimal? purchase_amount { get; set; }
/// <summary> /// <summary>
/// 调拨在途数量 /// 调拨在途数量
/// </summary> /// </summary>
public int allotcount { get; set; } public int? quantity_transfer { get; set; }
/// <summary> /// <summary>
/// 调拨在途金额 /// 调拨在途金额
/// </summary> /// </summary>
public decimal allotamount { get; set; } public decimal? amount_transit { get; set; }
/// <summary> /// <summary>
/// 未发货数量 /// 缺货数
/// </summary> /// </summary>
public int nosendcount { get; set; } public int? quantity_out_stock { get; set; }
/// <summary> /// <summary>
/// 缺货数 /// 昨日总
/// </summary> /// </summary>
public int nostockcount { get; set; } public int? oneday_total_sales { get; set; }
/// <summary> /// <summary>
/// 昨日日均销量 /// 昨日总销售额
/// </summary> /// </summary>
public decimal avg_yesterdaysales { get; set; } public decimal? amount_onedaysale { get; set; }
/// <summary> /// <summary>
/// 近七日日均销量 /// 7日总销量
/// </summary> /// </summary>
public decimal avg_sevendaysales { get; set; } public int? sevenday_total_sales { get; set; }
/// <summary> /// <summary>
/// 近十四日日均销量 /// 7日总销售额
/// </summary> /// </summary>
public decimal avg_fourteensales { get; set; } public decimal? amount_sevendaysale { get; set; }
/// <summary> /// <summary>
/// 近30日日均销量 /// 14日总销量
/// </summary> /// </summary>
public decimal avg_thirtysales { get; set; } public int? fourteenday_total_sales { get; set; }
/// <summary> /// <summary>
/// 近7天销售额 /// 30日总销量
/// </summary> /// </summary>
public decimal sevendaysales_amount { get; set; } public int? thirtyday_total_sales { get; set; }
/// <summary>
/// 7日日均销量
/// </summary>
public decimal? sevenday_average_sales { get; set; }
/// <summary>
/// 14日日均销量
/// </summary>
public decimal? fourteenday_average_sales { get; set; }
/// <summary>
/// 30日日均销量
/// </summary>
public decimal? thirtyday_average_sales { get; set; }
/// <summary>
/// sku开发时间
/// </summary>
public DateTime? skucreatetime { get; set; }
} }
} }
...@@ -188,11 +188,11 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -188,11 +188,11 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns> /// <returns></returns>
public IActionResult AdministrativeCost() public IActionResult AdministrativeCost()
{ {
var lastmonth = DateTime.Now.AddMonths(-1); var lastmonth = DateTime.Now;
var day = DateTime.Now; var day = DateTime.Now;
var start = DateTime.Parse(lastmonth.Year + "-" + lastmonth.Month + "-01"); var start = DateTime.Parse(lastmonth.Year + "-" + lastmonth.Month + "-01");
var end = start.AddMonths(1).AddDays(-1); var end = day.AddDays(-1);
ViewBag.start = start; ViewBag.start = start;
ViewBag.end = end; ViewBag.end = end;
...@@ -469,6 +469,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -469,6 +469,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
if (obj.Count > 0) if (obj.Count > 0)
{ {
var m = new Models.Api.mOtherFee { var m = new Models.Api.mOtherFee {
no = "",
companyName = "", companyName = "",
amount = obj.Sum(a => a.amount), amount = obj.Sum(a => a.amount),
amountRmb = obj.Sum(a => a.amountRmb), amountRmb = obj.Sum(a => a.amountRmb),
...@@ -489,6 +490,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -489,6 +490,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
a.departmentName, a.departmentName,
a.feeSubType, a.feeSubType,
a.feeSuperType, a.feeSuperType,
a.no,
a.manageCostType
}).ToList(); }).ToList();
......
...@@ -41,46 +41,67 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -41,46 +41,67 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var service = new Services.SkuMonitorServices(); var service = new Services.SkuMonitorServices();
var total = 0; var total = 0;
var obj = service.List(request.pageIndex, request.limit, warehousetype, warehousecode, start, end, monitorstatus, cleanstatus, infringestatus, skutip, storestart, storeend, skucategory, searchkey, skucategoryids, ref total); var obj = service.List(request, warehousetype, warehousecode, start, end, monitorstatus, cleanstatus, infringestatus, skutip, storestart, storeend, skucategory, searchkey, skucategoryids, ref total);
var countM = service.ListCount(warehousetype, warehousecode, start, end, monitorstatus, cleanstatus, infringestatus, skutip, storestart, storeend, skucategory, skucategoryids, searchkey); var countM = service.ListCount(warehousetype, warehousecode, start, end, monitorstatus, cleanstatus, infringestatus, skutip, storestart, storeend, skucategory, skucategoryids, searchkey);
countM.skuname = "总计:"; countM.skuname = "总计:";
countM.inventoryamount = Math.Round(countM.inventoryamount, 2, MidpointRounding.AwayFromZero);
countM.purchaseonwayamount = Math.Round(countM.purchaseonwayamount, 2, MidpointRounding.AwayFromZero);
countM.sevendaysales_amount = Math.Round(countM.sevendaysales_amount, 2, MidpointRounding.AwayFromZero);
countM.allotamount = Math.Round(countM.allotamount, 2, MidpointRounding.AwayFromZero);
var list = obj.Select(p => new { var list = obj.Select(p => new {
p.id, p.id,
allotamount = p.buyprice*p.allotcount, p.warehousetype,
p.allotcount, p.warehouse_code,
p.avg_fourteensales, p.warehousename,
p.avg_sevendaysales,
p.avg_thirtysales,
p.avg_yesterdaysales,
p.buyprice,
p.categoryname,
clearancestatus = p.clearancestatus==1?"正在清货":"否",
inventoryamount = p.inventoryamount.ToString("###,###.##"),
p.inventorycount,
monitorstatus = p.monitorstatus==1?"正在监控":"停止监控",
p.nosendcount,
p.nostockcount,
purchaseonwayamount = (p.purchaseonwaycount*p.buyprice).ToString("###,###.##"),
p.purchaseonwaycount,
sevendaysales_amount = p.sevendaysales_amount.ToString("###,###.##"),
p.sku, p.sku,
p.categoryname,
p.skuname, p.skuname,
p.stockcount, monitorstatus = (p.monitorstatus??0)==1?"正在监控":"停止监控",
clearancestatus = (p.clearancestatus??0)==1?"正在清货":"否",
tortstatus = (p.tortstatus??0)==1?"已侵权":"否",
p.str_skutag, p.str_skutag,
tortstatus = p.tortstatus==1?"已侵权":"否", buyprice = (p.buyprice??0).ToString("N2"),
p.warehousecode, usable_stock = (p.usable_stock??0),
p.warehousename, amount_stock = (p.amount_stock??0).ToString("N2"),
p.warehousetype, quantity_purchase = (p.quantity_purchase??0),
purchase_amount = (p.purchase_amount??0).ToString("N2"),
quantity_transfer = (p.quantity_transfer??0),
amount_transit = (p.amount_transit??0).ToString("N2"),
quantity_out_stock = (p.quantity_out_stock??0),
oneday_total_sales = (p.oneday_total_sales??0),
amount_onedaysale = (p.amount_onedaysale??0).ToString("N2"),
sevenday_total_sales = (p.sevenday_total_sales??0),
fourteenday_total_sales = (p.fourteenday_total_sales??0),
thirtyday_total_sales = (p.thirtyday_total_sales??0),
sevenday_average_sales = (p.sevenday_average_sales??0),
fourteenday_average_sales = (p.fourteenday_average_sales??0),
thirtyday_average_sales = (p.thirtyday_average_sales??0),
skucreatetime = p.skucreatetime.HasValue?p.skucreatetime.Value.ToString("yyyy-MM-dd HH:mm"):"",
amount_sevendaysale = (p.amount_sevendaysale??0).ToString("N2"),
}); });
return JsonConvert.SerializeObject(new { total = total, rows = list,count_row = countM }); return JsonConvert.SerializeObject(new { total = total, rows = list,count_row = new {
skuname = "总计",
usable_stock = (countM.usable_stock??0),
amount_stock = (countM.amount_stock??0).ToString("N2"),
quantity_purchase = (countM.quantity_purchase??0),
purchase_amount = (countM.purchase_amount??0).ToString("N2"),
quantity_transfer = (countM.quantity_transfer??0),
amount_transit = (countM.amount_transit??0).ToString("N2"),
quantity_out_stock = (countM.quantity_out_stock??0),
oneday_total_sales = (countM.oneday_total_sales??0),
amount_onedaysale = (countM.amount_onedaysale??0).ToString("N2"),
sevenday_total_sales = (countM.sevenday_total_sales??0),
fourteenday_total_sales = (countM.fourteenday_total_sales??0),
thirtyday_total_sales = (countM.thirtyday_total_sales??0),
sevenday_average_sales = (countM.sevenday_average_sales??0).ToString("N4"),
fourteenday_average_sales = (countM.fourteenday_average_sales??0).ToString("N4"),
thirtyday_average_sales = (countM.thirtyday_average_sales??0),
amount_sevendaysale = (countM.amount_sevendaysale??0).ToString("N2"),
} });
} }
/// <summary> /// <summary>
......
...@@ -607,7 +607,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -607,7 +607,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
cost_handle_bailun = p.cost_handle_bailun.ToString("N2"), cost_handle_bailun = p.cost_handle_bailun.ToString("N2"),
cost_handle_platform = p.cost_handle_platform.ToString("N2"), cost_handle_platform = p.cost_handle_platform.ToString("N2"),
cost_tail = p.cost_tail.ToString("N2"), cost_tail = p.cost_tail.ToString("N2"),
amount_prepaid = p.amount_prepaid.ToString("N2"), amount_prepaid = p.amount_prepaid.ToString("N2"),
cost_product = p.cost_product.ToString("N2")
}); });
return Json(list); return Json(list);
......
...@@ -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).ToString("N2"), fourteenday_total_sales = (p.fourteenday_total_sales??0),
noshippingcount = (p.noshippingcount??0).ToString("N2"), noshippingcount = (p.noshippingcount??0),
nostockcount = (p.nostockcount??0).ToString("N2"), nostockcount = (p.nostockcount??0),
oneday_total_sales = (p.oneday_total_sales??0).ToString("N2"), oneday_total_sales = (p.oneday_total_sales??0),
purchase_amount = (p.purchase_amount??0).ToString("N2"), purchase_amount = (p.purchase_amount??0).ToString("N2"),
quantity_purchase = (p.quantity_purchase??0).ToString("N2"), quantity_purchase = (p.quantity_purchase??0),
quantity_transfer = (p.quantity_transfer??0).ToString("N2"), quantity_transfer = (p.quantity_transfer??0),
sevenday_total_sales = (p.sevenday_total_sales??0).ToString("N2"), sevenday_total_sales = (p.sevenday_total_sales??0),
thirtyday_total_sales = (p.thirtyday_total_sales??0).ToString("N2"), thirtyday_total_sales = (p.thirtyday_total_sales??0),
usable_stock = p.usable_stock.ToString("N2"), usable_stock = p.usable_stock,
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).ToString("N2"), noshippingcount = (countM.noshippingcount??0),
nostockcount = (countM.nostockcount??0).ToString("N2"), nostockcount = (countM.nostockcount??0),
oneday_total_sales = (countM.oneday_total_sales??0).ToString("N2"), oneday_total_sales = (countM.oneday_total_sales??0),
purchase_amount = (countM.purchase_amount??0).ToString("N2"), purchase_amount = (countM.purchase_amount??0).ToString("N2"),
quantity_purchase = (countM.quantity_purchase??0).ToString("N2"), quantity_purchase = (countM.quantity_purchase??0),
quantity_transfer = (countM.quantity_transfer??0).ToString("N2"), quantity_transfer = (countM.quantity_transfer??0),
sevenday_total_sales = (countM.sevenday_total_sales??0).ToString("N2"), sevenday_total_sales = (countM.sevenday_total_sales??0),
thirtyday_total_sales = (countM.thirtyday_total_sales??0).ToString("N2"), thirtyday_total_sales = (countM.thirtyday_total_sales??0),
usable_stock = countM.usable_stock.ToString("N2"), usable_stock = countM.usable_stock,
fourteenday_total_sales = (countM.fourteenday_total_sales??0).ToString("N2") fourteenday_total_sales = (countM.fourteenday_total_sales??0)
} }); } });
} }
......
...@@ -49,6 +49,12 @@ ...@@ -49,6 +49,12 @@
var end = $('#end').val(); var end = $('#end').val();
var columns = [ var columns = [
{
field: 'no', title: '费用单号', formatter: function (idx, data) {
//return '<div class="mules" title="' + data.no + '">' + data.no + '</div>';
return '<a href="http://fee.bailuntec.com/#/manage_cost?manageCostType=' + data.manageCostType+'&no='+data.no+'" target="_blank">' + data.no + '</a>';
}
},
{ field: 'departmentName', title: '部门名称' }, { field: 'departmentName', title: '部门名称' },
{ field: 'companyName', title: '付款主体名称', }, { field: 'companyName', title: '付款主体名称', },
{ field: 'feeSuperType', title: '父级分类' }, { field: 'feeSuperType', title: '父级分类' },
......
...@@ -155,24 +155,24 @@ ...@@ -155,24 +155,24 @@
return str; return str;
} }
}, },
{ field: 'monitorstatus', title: '监控状态', width: '80' }, { field: 'monitorstatus', title: '监控状态', width: '100', sortable: true },
{ field: 'clearancestatus', title: '清货状态', width: '80' }, { field: 'clearancestatus', title: '清货状态', width: '100', sortable: true },
{ field: 'tortstatus', title: '侵权状态', width: '80' }, { field: 'tortstatus', title: '侵权状态', width: '100', sortable: true },
{ field: 'str_skutag', title: 'sku标签', width: '80' }, { field: 'str_skutag', title: 'sku标签', width: '120', sortable: true },
{ field: 'buyprice', title: '采购价', width: '60' }, { field: 'buyprice', title: '采购价', width: '100', sortable: true },
{ field: 'inventorycount', title: '库存数量', width: '80', iscount: true }, { field: 'usable_stock', title: '库存数量', width: '110', sortable: true, iscount: true },
{ field: 'inventoryamount', title: '库存金额', width: '110', iscount: true }, { field: 'amount_stock', title: '库存金额', width: '110', sortable: true, iscount: true },
{ field: 'purchaseonwaycount', title: '采购在途数量', width: '100', iscount: true }, { field: 'quantity_purchase', title: '采购在途数量', width: '120', sortable: true, iscount: true },
{ field: 'purchaseonwayamount', title: '采购在途金额', width: '100', iscount: true }, { field: 'purchase_amount', title: '采购在途金额', width: '120', sortable: true, iscount: true },
{ field: 'allotcount', title: '调拨在途数量', width: '100', iscount: true }, { field: 'quantity_transfer', title: '调拨在途数量', width: '120', sortable: true, iscount: true },
{ field: 'allotamount', title: '调拨在途金额', width: '110', iscount: true }, { field: 'amount_transit', title: '调拨在途金额', width: '120', sortable: true, iscount: true },
{ field: 'nosendcount', title: '待发货数量', width: '90', iscount: true }, { field: 'nosendcount', title: '待发货数量', width: '120', sortable: true, iscount: true },
{ field: 'nostockcount', title: '缺货数量', width: '80', iscount: true }, { field: 'quantity_out_stock', title: '缺货数量', sortable: true, width: '110', iscount: true },
{ field: 'avg_yesterdaysales', title: '昨日销量', width: '80', iscount: true }, { field: 'oneday_total_sales', title: '昨日销量', sortable: true, width: '110', iscount: true },
{ field: 'avg_sevendaysales', title: '近七日日均销量', width: '120' }, { field: 'sevenday_average_sales', title: '近七日日均销量', width: '140', sortable: true, iscount: true },
{ field: 'avg_fourteensales', title: '近十四日均销量', width: '120' }, { field: 'fourteenday_average_sales', title: '近十四日均销量', width: '140', sortable: true, iscount: true },
{ field: 'avg_thirtysales', title: '近三十日均销量', width: '130' }, { field: 'thirtyday_average_sales', title: '近三十日均销量', width: '140', sortable: true, iscount: true },
{ field: 'sevendaysales_amount', title: '7天总销售额', width: '120', iscount: true } { field: 'amount_sevendaysale', title: '7天总销售额', width: '140', sortable: true, iscount: true }
]; ];
var s = ''; var s = '';
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<th>平台</th> <th>平台</th>
<th>订单数</th> <th>订单数</th>
<th>销售额</th> <th>销售额</th>
<th>产品成本</th>
<th>客单价</th> <th>客单价</th>
<th>平台费</th> <th>平台费</th>
<th>头程费</th> <th>头程费</th>
...@@ -95,6 +96,7 @@ ...@@ -95,6 +96,7 @@
var s = '<tr><td class="platform"><a href="javascript:;" onclick="ShowWebsite(\'' + result[i].platform_type + '\');">' + result[i].platform_type + '</a></td>'; var s = '<tr><td class="platform"><a href="javascript:;" onclick="ShowWebsite(\'' + result[i].platform_type + '\');">' + result[i].platform_type + '</a></td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'订单数\',\'\',0)">' + result[i].order_count + '</td>'; s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'订单数\',\'\',0)">' + result[i].order_count + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'销售额\',\'0\',0)">' + result[i].amount_sales + '</td>'; s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'销售额\',\'0\',0)">' + result[i].amount_sales + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'产品成本\',\'cost_product\',1)">' + result[i].cost_product + '</td>';
s += '<td>' + result[i].customerprice + '</td>'; s += '<td>' + result[i].customerprice + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'平台费用\',\'cost_platform_fee\',1)">' + result[i].cost_platform_fee + '</td>'; s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'平台费用\',\'cost_platform_fee\',1)">' + result[i].cost_platform_fee + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'头程费\',\'cost_first\',1)">' + result[i].cost_first + '</td>'; s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'头程费\',\'cost_first\',1)">' + result[i].cost_first + '</td>';
......
...@@ -49,6 +49,8 @@ namespace Bailun.DC.Web ...@@ -49,6 +49,8 @@ namespace Bailun.DC.Web
app.UseStaticFiles(); app.UseStaticFiles();
app.UseCookiePolicy(); app.UseCookiePolicy();
//Bailun.DC.Common.GlobalConfig.ConnectionString = Configuration.GetSection("cn_str").Value;
//app.UseMvc(routes =>{ //app.UseMvc(routes =>{
// routes.MapRoute( // routes.MapRoute(
// name : "default", // name : "default",
......
...@@ -5,5 +5,6 @@ ...@@ -5,5 +5,6 @@
} }
}, },
"AllowedHosts": "*", "AllowedHosts": "*",
"FeeUrl": "http://api.fee.bailuntec.com/purchase/other/cost/api/manageCostList" "FeeUrl": "http://api.fee.bailuntec.com/purchase/other/cost/api/manageCostList",
"cn_str": "server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
} }
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