Commit 6ca2c165 by guanzhenshan

平台利润报表增加按产品类型筛选,包括广告费和上架费,退款

parent af2acf0b
...@@ -1161,7 +1161,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1161,7 +1161,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var obj = _service.ListEbayFee(parameter, companyid, start, end, ref total, feeType,orderno,account,""); var obj = _service.ListEbayFee(parameter, companyid, start, end, ref total, feeType,orderno,account,"");
var countObj = _service.EbayFeeCount(companyid, start, end, feeType, orderno,account,false,""); var countObj = _service.EbayFeeCount(companyid, start, end, feeType, orderno,account,false,"",null,null,null);
var list = obj.Select(a => new { var list = obj.Select(a => new {
a.id, a.id,
...@@ -1225,7 +1225,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1225,7 +1225,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var obj = _service.ListEbayFee(parameter, companyid, start, end, ref total, feeType, orderno, account,itemid); var obj = _service.ListEbayFee(parameter, companyid, start, end, ref total, feeType, orderno, account,itemid);
var countObj = _service.EbayFeeCount(companyid, start, end, feeType, orderno, account,false,itemid); var countObj = _service.EbayFeeCount(companyid, start, end, feeType, orderno, account,false,itemid,null,null,null);
var list = obj.Select(a => new { var list = obj.Select(a => new {
a.id, a.id,
...@@ -1532,7 +1532,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1532,7 +1532,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{ {
var _skuService = new Services.SkuInfoServices(); var _skuService = new Services.SkuInfoServices();
ViewBag.listSkuType = _skuService.ListSkuProductType(); ViewBag.listSkuType = _skuService.ListSkuProductType().Where(a=>!string.IsNullOrEmpty(a.product_type_desc)).ToList();
ViewBag.listSource = _skuService.ListSkuSource(); ViewBag.listSource = _skuService.ListSkuSource();
...@@ -1549,7 +1549,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1549,7 +1549,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns> /// <returns></returns>
[BailunAuthentication(LoginMode.Enforce)] [BailunAuthentication(LoginMode.Enforce)]
[HttpPost] [HttpPost]
public JsonResult PlatformProfitCountJson(string platform,string website, DateTime? start, DateTime? end, DateTime? shipstart, DateTime? shipend, string currency, string skucategoryids) public JsonResult PlatformProfitCountJson(string platform,string website, DateTime? start, DateTime? end, DateTime? shipstart, DateTime? shipend, string currency, string skucategoryids,int? producttype,int? skusource,int? shippingstrategy)
{ {
var _service = new Services.OrdersServices(); var _service = new Services.OrdersServices();
var companyid = HttpContextHelper.Current?.User?.GetCompanyId().ToInt32(); var companyid = HttpContextHelper.Current?.User?.GetCompanyId().ToInt32();
...@@ -1561,6 +1561,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1561,6 +1561,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var ebayADFee = new dc_base_finance_ebay(); //Ebay 广告费 var ebayADFee = new dc_base_finance_ebay(); //Ebay 广告费
var ebayPutAway = new dc_base_finance_ebay(); //Ebay 上架费 var ebayPutAway = new dc_base_finance_ebay(); //Ebay 上架费
var listRefund = new List<Models.Orders.dc_base_oms_order>(); var listRefund = new List<Models.Orders.dc_base_oms_order>();
var amazonAD = new dc_base_finance_amazon_ad_product();
var wishAD = new dc_base_finance_wish();
var aliexpressAD = new dc_base_finance_aliexpress();
var ADfeeType = new string[] { var ADfeeType = new string[] {
"FeeAd" "FeeAd"
}; };
...@@ -1586,32 +1590,66 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1586,32 +1590,66 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
"CrediteBayStores" "CrediteBayStores"
}; };
//Add by Allan at 20200320,for 增加sku级别的利润统计
if (producttype.HasValue || skusource.HasValue || shippingstrategy.HasValue)
{
if (shipstart.HasValue || shipend.HasValue) if (shipstart.HasValue || shipend.HasValue)
{ {
result = _service.ListPlatformProfitByShipTime(platform,website, start, end, shipstart, shipend, currency.ToUpper() == "USD", companyid, skucategoryids); result = _service.ListPlatformProfitByShipTime(platform, website, start, end, shipstart, shipend, currency.ToUpper() == "USD", companyid, skucategoryids, producttype, skusource, shippingstrategy);
var fbaResult = _service.ListPlatformProfit(string.IsNullOrEmpty(platform) ? "FBA" : "",website, null,null,null, null, currency.ToUpper() == "USD", companyid, skucategoryids, shipstart, shipend); var fbaResult = _service.ListPlatformProfit(string.IsNullOrEmpty(platform) ? "FBA" : "", website, null, null, null, null, currency.ToUpper() == "USD", companyid, skucategoryids, producttype, skusource, shippingstrategy, shipstart, shipend);
result.AddRange(fbaResult); result.AddRange(fbaResult);
dtstart = shipstart; dtstart = shipstart;
dtend = shipend; dtend = shipend;
listRefund = _service.ListPlatformRefund(dtstart, dtend, companyid, platform, website, currency.ToUpper() == "USD",false); //不包含未发货的退款金额 listRefund = _service.ListPlatformRefund(dtstart, dtend, companyid, platform, website, currency.ToUpper() == "USD", false, producttype, skusource, shippingstrategy); //不包含未发货的退款金额
} }
else else
{ {
result = _service.ListPlatformProfit(platform,website,start, end, shipstart, shipend, currency.ToUpper() == "USD", companyid, skucategoryids); result = _service.ListPlatformProfit(platform, website, start, end, shipstart, shipend, currency.ToUpper() == "USD", companyid, skucategoryids, producttype, skusource, shippingstrategy);
listRefund = _service.ListPlatformRefund(dtstart, dtend, companyid, platform, website, currency.ToUpper() == "USD",true); //包含未发货的退款金额 listRefund = _service.ListPlatformRefund(dtstart, dtend, companyid, platform, website, currency.ToUpper() == "USD", true, producttype, skusource, shippingstrategy); //包含未发货的退款金额
} }
ebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, ADfeeType, "", "", currency.ToUpper() == "USD",""); ebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, ADfeeType, "", "", currency.ToUpper() == "USD", "",producttype,skusource,shippingstrategy);
ebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, PutAwayFeeType, "", "", currency.ToUpper() == "USD",""); ebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, PutAwayFeeType, "", "", currency.ToUpper() == "USD", "",producttype,skusource,shippingstrategy);
var amazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD");
amazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD",producttype,skusource,shippingstrategy);
aliexpressAD = _service.ListAliexpressADCount(companyid, "", dtstart, dtend, currency.ToUpper() == "USD");
wishAD = _service.ListWishADCount(companyid, null, dtstart, dtend, currency.ToUpper() == "USD");
//aliexpressAD = _service.ListAliexpressADCount(companyid, "", dtstart, dtend, currency.ToUpper() == "USD");
}
else
{
if (shipstart.HasValue || shipend.HasValue)
{
result = _service.ListPlatformProfitByShipTime(platform, website, start, end, shipstart, shipend, currency.ToUpper() == "USD", companyid, skucategoryids, null, null, null);
var fbaResult = _service.ListPlatformProfit(string.IsNullOrEmpty(platform) ? "FBA" : "", website, null, null, null, null, currency.ToUpper() == "USD", companyid, skucategoryids, shipstart, shipend);
result.AddRange(fbaResult);
dtstart = shipstart;
dtend = shipend;
listRefund = _service.ListPlatformRefund(dtstart, dtend, companyid, platform, website, currency.ToUpper() == "USD", false, null, null, null); //不包含未发货的退款金额
}
else
{
result = _service.ListPlatformProfit(platform, website, start, end, shipstart, shipend, currency.ToUpper() == "USD", companyid, skucategoryids);
listRefund = _service.ListPlatformRefund(dtstart, dtend, companyid, platform, website, currency.ToUpper() == "USD", true, null, null, null); //包含未发货的退款金额
}
ebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, ADfeeType, "", "", currency.ToUpper() == "USD", "",null,null,null);
ebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, PutAwayFeeType, "", "", currency.ToUpper() == "USD", "",null,null,null);
amazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD",null,null,null);
wishAD = _service.ListWishADCount(companyid, null, dtstart, dtend, currency.ToUpper() == "USD");
aliexpressAD = _service.ListAliexpressADCount(companyid, "", dtstart, dtend, currency.ToUpper() == "USD");
}
var wishAD = _service.ListWishADCount(companyid, null, dtstart, dtend, currency.ToUpper() == "USD");
var aliexpressAD = _service.ListAliexpressADCount(companyid, "", dtstart, dtend, currency.ToUpper() == "USD");
foreach (var item in result) foreach (var item in result)
{ {
...@@ -1694,7 +1732,6 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1694,7 +1732,6 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
} }
var list = result.Select(p => new { var list = result.Select(p => new {
p.platform_type, p.platform_type,
customerprice = (p.amount_sales / p.order_count).ToString("N2"), customerprice = (p.amount_sales / p.order_count).ToString("N2"),
...@@ -2393,7 +2430,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -2393,7 +2430,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var total = 0; var total = 0;
var obj = _service.ListAmazonADSku(parameter, account, start, end, companyid, ref total); var obj = _service.ListAmazonADSku(parameter, account, start, end, companyid, ref total);
var countObj = _service.ListAmazonADSkuCount(account, start, end, companyid,false); var countObj = _service.ListAmazonADSkuCount(account, start, end, companyid,false,null,null,null);
var list = obj.Select(a => new { var list = obj.Select(a => new {
a.account_name, a.account_name,
...@@ -3588,5 +3625,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -3588,5 +3625,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
#endregion #endregion
#region private
#endregion
} }
} }
\ No newline at end of file
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden"> <body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<script type="text/javascript"> <script type="text/javascript">
//login_localhost(); login_localhost();
login(); //login();
window.location = "@Url.Content("~/Home/Main")"; window.location = "@Url.Content("~/Home/Main")";
</script> </script>
</body> </body>
......
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