Commit a7f0bbff by guanzhenshan

增加计算说明

parent f6a8ba17
...@@ -7533,10 +7533,17 @@ namespace Bailun.DC.Services ...@@ -7533,10 +7533,17 @@ namespace Bailun.DC.Services
cn.Open(); cn.Open();
} }
if(parameter.limit==0)
{
var obj = cn.Page<dc_mid_itemno_profit_order>(parameter.pageIndex, parameter.limit, sql, ref total); var obj = cn.Page<dc_mid_itemno_profit_order>(parameter.pageIndex, parameter.limit, sql, ref total);
return obj.ToList(); return obj.ToList();
} }
else
{
return cn.Query<dc_mid_itemno_profit_order>(sql,null,null,true,6*60).ToList();
}
}
} }
...@@ -7682,3 +7689,4 @@ namespace Bailun.DC.Services ...@@ -7682,3 +7689,4 @@ namespace Bailun.DC.Services
} }
} }
...@@ -4209,6 +4209,48 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -4209,6 +4209,48 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}); });
} }
/// <summary>
/// 导出itemno 广告利润率计算的订单明细
/// </summary>
/// <param name="itemid"></param>
/// <param name="day"></param>
/// <returns></returns>
public ActionResult ExportItemNoProfitOrderDetail(string itemid, DateTime day)
{
var total = 0;
var _service = new Services.OrdersServices();
var obj = _service.ListItemNoOrder(new BtTableParameter { offset=0,limit=0},itemid,day,ref total);
var colNames = new List<string> {"平台订单号","发货状态","销售额", "产品成本","头程费用",
"尾程费用","平台费用","操作费","处理费","paypal费",
"FBA费","提现损耗"
};
var listVal = new List<string>();
foreach (var item in obj)
{
listVal.Add(
item.origin_order_id + "|" + item.shipping_status + "|" + item.amount_sales + "|" + item.cost_product + "|" + item.cost_first + "|" +
item.cost_logistics + "|" + item.cost_platform_fee + "|" + item.cost_handle_platform + "|" + item.cost_handle_bailun+"|"+item.cost_paypal_fee+"|"+
item.cost_fba_fee+"|"+item.losswithdraw
);
}
var guid = Guid.NewGuid().ToString();
var filename = "itemno:" + itemid+"的利润率的订单明细数据" + DateTime.Now.ToString("yyyyMMddHHmmss");
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
ToCSV(listVal, colNames, guid, filepath);
var ms = new System.IO.MemoryStream();
using (var f = new System.IO.FileStream(filepath + guid + ".csv", System.IO.FileMode.Open))
{
f.CopyTo(ms);
}
ms.Position = 0;
return File(ms, "text/csv", filename + ".csv");
}
#endregion #endregion
#region private #region private
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div style="float:right;width:100%;"> <div style="float:right;width:100%;">
<div id="rightcontain"> <div id="rightcontain">
<div class="ibox-content m-b-sm border-bottom"> <div class="ibox-content m-b-sm border-bottom">
<button type="button" class="btn btn-primary" onclick="exportxls();">导出订单明细</button>
</div> </div>
<div class="ibox-content m-b-sm border-bottom"> <div class="ibox-content m-b-sm border-bottom">
...@@ -110,79 +110,11 @@ ...@@ -110,79 +110,11 @@
} }
} }
function listAccount() { function exportxls() {
$.submit({ window.open('@Url.Content("~/Reports/Orders/ExportItemNoProfitOrderDetail")'+'?itemid=@(ViewBag.itemid)&day=@(ViewBag.day)', '_blank');
url: '@Url.Content("~/Reports/Orders/ListAccount")',
type:'POST',
paramData: 'platform=Ebay',
func: function (result) {
if (result != null && result != undefined) {
$('#account').html('<option value="">选择帐号</option>');
for (var i = 0; i < result.length; i++) {
$('#account').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
function listWebsite() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListWebSite")',
type:'POST',
paramData: 'platform=@(ViewBag.platform)',
func: function (result) {
if (result != null && result != undefined) {
$('#website').html('<option value="">选择站点</option>');
for (var i = 0; i < result.length; i++) {
$('#website').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
function showleft() {
var c = $('#leftcontain').css('display');
if (c == 'none') {
$('#leftcontain').css('display', 'inline');
$("#rightcontain").animate({ marginLeft: "220px" });
}
else {
$('#leftcontain').css('display', 'none');
$("#rightcontain").animate({ marginLeft: "0px" });
}
}
function listcategory12() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListSkuCategoryOneAndSecondLevel")',
paramData: '',
type: 'POST',
func: function (result) {
var setting = {
check: {
chkStyle:'checkbox',
enable: true
}
};
zTreeObj = $.fn.zTree.init($("#ztree"), setting, eval('('+result+')'));
}
})
} }
function getChkNode() {
var s = '';
var o = $.fn.zTree.getZTreeObj("ztree");
var nodes = o.getCheckedNodes();
for (var i in nodes) {
if (nodes[i].children == null || nodes[i].children.length <= 0) {
s += (nodes[i].id) + '|';
}
}
return s;
}
</script> </script>
......
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