Commit 37a8abc3 by jianshuqin

修改逻辑:平台利润从2021年12月23号后过虑 美美哒和达馨账号数据

parent 49767d88
...@@ -1627,7 +1627,8 @@ namespace Bailun.DC.Services ...@@ -1627,7 +1627,8 @@ namespace Bailun.DC.Services
sql += " and tb.purchase_create_time<@createend"; sql += " and tb.purchase_create_time<@createend";
sqlparam.Add("createend", createend.Value.AddDays(1)); sqlparam.Add("createend", createend.Value.AddDays(1));
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += " and tb.id not in (select id from dc_base_oms_order where seller_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU') and purchase_create_time >= '2021-12-23')";
sql += " group by tb.platform_type"; sql += " group by tb.platform_type";
...@@ -1855,6 +1856,9 @@ namespace Bailun.DC.Services ...@@ -1855,6 +1856,9 @@ namespace Bailun.DC.Services
sqlparam.Add("createend", createend.Value.AddDays(1)); sqlparam.Add("createend", createend.Value.AddDays(1));
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += " and tb.id not in (SELECT id from dc_base_oms_sku WHERE seller_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU') AND purchase_create_time >= '2021-12-23')";
if (statistictype == 0) if (statistictype == 0)
{ {
sql += " group by tb.platform_type"; sql += " group by tb.platform_type";
...@@ -3536,7 +3540,7 @@ namespace Bailun.DC.Services ...@@ -3536,7 +3540,7 @@ namespace Bailun.DC.Services
sql += " and t1.account_entry_type in ('" + string.Join("','", feetype) + "')"; sql += " and t1.account_entry_type in ('" + string.Join("','", feetype) + "')";
} }
if (description != null && description.Length > 0) if (description != null && description.Length > 0 && !((producttype != null && producttype.Count() > 0) || skusource.HasValue || shippingstrategy.HasValue))
{ {
sql += " and t1.description in ('" + string.Join("','", description) + "') "; sql += " and t1.description in ('" + string.Join("','", description) + "') ";
} }
...@@ -5342,6 +5346,19 @@ namespace Bailun.DC.Services ...@@ -5342,6 +5346,19 @@ namespace Bailun.DC.Services
} }
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += @" and t1.id not in (
select t2.id from dc_base_crm_refund t2
inner join dc_base_oms_order t3
on t2.origin_order_id = t3.origin_order_id
and t3.seller_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t3.purchase_create_time >= '2021-12-23'
where 1 = 1
and t2.platform_type = 'FBA'
and t2.bailun_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t2.refund_time >= '2021-12-23'
)";
if (!string.IsNullOrEmpty(parameter.sort)) if (!string.IsNullOrEmpty(parameter.sort))
{ {
...@@ -5510,6 +5527,19 @@ namespace Bailun.DC.Services ...@@ -5510,6 +5527,19 @@ namespace Bailun.DC.Services
} }
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += @" and t1.id not in (
select t2.id from dc_base_crm_refund t2
inner join dc_base_oms_order t3
on t2.origin_order_id = t3.origin_order_id
and t3.seller_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t3.purchase_create_time >= '2021-12-23'
where 1 = 1
and t2.platform_type = 'FBA'
and t2.bailun_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t2.refund_time >= '2021-12-23'
)";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{ {
if (cn.State == System.Data.ConnectionState.Closed) if (cn.State == System.Data.ConnectionState.Closed)
...@@ -5667,6 +5697,19 @@ namespace Bailun.DC.Services ...@@ -5667,6 +5697,19 @@ namespace Bailun.DC.Services
} }
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += @" and t1.id not in (
select t2.id from dc_base_crm_refund t2
inner join dc_base_oms_order t3
on t2.origin_order_id = t3.origin_order_id
and t3.seller_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t3.purchase_create_time >= '2021-12-23'
where 1 = 1
and t2.platform_type = 'FBA'
and t2.bailun_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t2.refund_time >= '2021-12-23'
)";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{ {
...@@ -5807,6 +5850,18 @@ namespace Bailun.DC.Services ...@@ -5807,6 +5850,18 @@ namespace Bailun.DC.Services
sql += " and t1.shipping_status in ('TotalShipping','PartShipping') "; sql += " and t1.shipping_status in ('TotalShipping','PartShipping') ";
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += @" and t1.id not in (
select t2.id from dc_base_crm_refund t2
inner join dc_base_oms_order t3
on t2.origin_order_id = t3.origin_order_id
and t3.seller_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t3.purchase_create_time >= '2021-12-23'
where 1 = 1
and t2.platform_type = 'FBA'
and t2.bailun_account in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
and t2.refund_time >= '2021-12-23'
)";
if (statistictype == 0) if (statistictype == 0)
{ {
...@@ -5867,7 +5922,18 @@ namespace Bailun.DC.Services ...@@ -5867,7 +5922,18 @@ namespace Bailun.DC.Services
from dc_base_crm_refund t1 from dc_base_crm_refund t1
left join dc_base_sku t3 on t1.bailun_sku=t3.bailun_sku left join dc_base_sku t3 on t1.bailun_sku=t3.bailun_sku
left join dc_base_sku_finance_category t4 on t3.bailun_category_id=t4.bailuncategoryid left join dc_base_sku_finance_category t4 on t3.bailun_category_id=t4.bailuncategoryid
where t1.shipping_status in ('TotalShipping','PartShipping') and t1.is_deleted=0 and is_freeze=0 and t1.company_id=1 and t1.refund_time>='{start.ToString("yyyy-MM-dd")}' and t1.refund_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'"; where t1.shipping_status in ('TotalShipping','PartShipping') and t1.is_deleted=0 and is_freeze=0 and t1.company_id=1 and t1.refund_time>='{start.ToString("yyyy-MM-dd")}' and t1.refund_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'
AND t1.id NOT IN (
SELECT t2.id FROM dc_base_crm_refund t2
INNER JOIN dc_base_oms_order t3
ON t2.origin_order_id = t3.origin_order_id
AND t3.seller_account IN ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
AND t3.purchase_create_time >= '2021-12-23'
WHERE 1 = 1
AND t2.platform_type = 'FBA'
AND t2.bailun_account IN ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU')
AND t2.refund_time >= '2021-12-23'
)";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
...@@ -6029,6 +6095,10 @@ namespace Bailun.DC.Services ...@@ -6029,6 +6095,10 @@ namespace Bailun.DC.Services
sql += " and t1.type=" + type.Value; sql += " and t1.type=" + type.Value;
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += " and t1.id not in ( select id from dc_base_finance_amazon_ad_product where account_name in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU') and t1.report_date >= '2021-12-23')";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{ {
...@@ -6128,6 +6198,8 @@ namespace Bailun.DC.Services ...@@ -6128,6 +6198,8 @@ namespace Bailun.DC.Services
{ {
sql += " and t1.type=" + type.Value; sql += " and t1.type=" + type.Value;
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += " and t1.id not in ( select id from dc_base_finance_amazon_ad_product where account_name in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU') and t1.report_date >= '2021-12-23')";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{ {
...@@ -6234,6 +6306,9 @@ namespace Bailun.DC.Services ...@@ -6234,6 +6306,9 @@ namespace Bailun.DC.Services
sql += " and t1.report_date<@end"; sql += " and t1.report_date<@end";
sqlparam.Add("end", end.Value.AddDays(1)); sqlparam.Add("end", end.Value.AddDays(1));
} }
//从2021年12月23号后过虑 美美哒和达馨('Lagunamoon_Beauty','Lagunamoon Nail Varnish','dawarmthEU') 数据
sql += " and t1.id not in ( select id from dc_base_finance_amazon_ad_product where account_name in ('Lagunamoon_Beauty', 'Lagunamoon Nail Varnish', 'dawarmthEU') and t1.report_date >= '2021-12-23')";
if (statistictype == 1) if (statistictype == 1)
...@@ -6606,7 +6681,7 @@ namespace Bailun.DC.Services ...@@ -6606,7 +6681,7 @@ namespace Bailun.DC.Services
public decimal ShopifyAD(DateTime? start, DateTime? end, bool isUSD) public decimal ShopifyAD(DateTime? start, DateTime? end, bool isUSD)
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
TimeZoneInfo easternZone = default(TimeZoneInfo); TimeZoneInfo easternZone = default(TimeZoneInfo);
//WINDIWOS //WINDIWOS
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
......
...@@ -1848,7 +1848,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1848,7 +1848,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
if (statistictype == 0) if (statistictype == 0)
{ {
ebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, null, ADfeeDescription, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, platform, website); ebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, ADfeeType, null, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, platform, website);
ebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, null, PutAwayFeeDescript, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, platform, website); ebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, null, PutAwayFeeDescript, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, platform, website);
amazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD", producttype, skusource, shippingstrategy, platform, website, null); amazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD", producttype, skusource, shippingstrategy, platform, website, null);
...@@ -1866,7 +1866,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1866,7 +1866,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
} }
else else
{ {
listebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, null, ADfeeDescription, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, statistictype, platform, website); listebayADFee = _service.EbayFeeCount(companyid, dtstart, dtend, ADfeeType, null, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, statistictype, platform, website);
listebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, null, PutAwayFeeDescript, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, statistictype, platform, website); listebayPutAway = _service.EbayFeeCount(companyid, dtstart, dtend, null, PutAwayFeeDescript, "", "", currency.ToUpper() == "USD", "", producttype, skusource, shippingstrategy, statistictype, platform, website);
listamazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD", producttype, skusource, shippingstrategy, statistictype, platform, website); listamazonAD = _service.ListAmazonADSkuCount("", dtstart, dtend, companyid, currency.ToUpper() == "USD", producttype, skusource, shippingstrategy, statistictype, platform, website);
......
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