Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
data-center-auto
Commits
7012c94d
Commit
7012c94d
authored
Nov 26, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
吧刷新最新7天oms数据的任务,跟数据中心30天的错开
parent
3fb04cbf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
132 deletions
+166
-132
Program.cs
AutoGeneratePurchaseAdvise/Program.cs
+18
-0
report.cs
AutoTurnOver.DB/report.cs
+138
-131
Program.cs
ResetOutofstock/Program.cs
+1
-0
StockBackgrounService.cs
ResetOutofstock/StockBackgrounService.cs
+9
-1
No files found.
AutoGeneratePurchaseAdvise/Program.cs
View file @
7012c94d
...
...
@@ -20,6 +20,24 @@ namespace AutoGeneratePurchaseAdvise
//purchase_advise.ReplaceLogistics(DateTime.Now);
//purchase_advise.WaitReplaceLogisticsTask();
PurchaseAdviseServices
.
AutoPushBuySys
(
1
);
Console
.
WriteLine
(
$"开始推送 手机采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
AutoPushBuySys
(
3
);
Console
.
WriteLine
(
$"结束推送 手机采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"开始推送 服装采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
AutoPushBuySys
(
2
);
Console
.
WriteLine
(
$"结束推送 服装采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"开始推送 义乌无库仓采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
AutoPushBuySys
(
6
);
Console
.
WriteLine
(
$"结束推送 义乌无库仓采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"开始推送 独立站采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
AutoPushBuySys
(
7
);
Console
.
WriteLine
(
$"结束推送 独立站采购建议任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
catch
(
Exception
ex
)
{
...
...
AutoTurnOver.DB/report.cs
View file @
7012c94d
...
...
@@ -1630,137 +1630,6 @@ t1.bailun_sku,
from dc_base_sku as t1
);"
,
commandTimeout
:
0
);
_connection
.
Execute
(
@"-- 刷新缺货明细表
set session transaction isolation level read uncommitted;
start transaction;
-- 清空视图表的数据
Truncate table dc_base_oms_sku_7_temp;
INSERT into dc_base_oms_sku_7_temp (
select
t1.`id`,
t1.`origin_order_id`,
t1.`platform_type`,
t1.`transaction_id`,
t1.`pay_time`,
t1.`pay_method`,
t1.`pay_account`,
t1.`pay_status`,
t1.`collection_account`,
t1.`platform_order_type`,
t1.`website`,
t1.`create_time`,
t1.`paid_time`,
t1.`refund_time`,
t1.`seller_id`,
t1.`bailun_account_id`,
t1.`hq_account`,
t1.`seller_account`,
t1.`seller_order_id`,
t1.`seller_email`,
t1.`order_update_time`,
t1.`seller_order_exchange_rate`,
t1.`seller_other_exchange_rate`,
t1.`finance_order_exchange_rate`,
t1.`finance_other_exchange_rate`,
t1.`cny_to_usd_exchange_rate`,
t1.`order_to_usd_exchange_rate`,
t1.`other_to_usd_exchange_rate` ,
t1.`order_currency`,
t1.`other_currency`,
t1.`seller_name`,
t1.`bailun_order_id`,
t1.`platform_order_status`,
t1.`bailun_order_status`,
t1.`bailun_payment_status`,
t1.`bailun_interception_status`,
t1.`shipping_status`,
t1.`bailun_sku`,
t1.`bailun_sku_title_en`,
t1.`bailun_sku_title_cn`,
t1.`bailun_sku_quantity_ordered`,
t1.`bailun_sku_quantity_shipped`,
t1.`bailun_sku_quantity_refund`,
t1.`bailun_sku_quantity_picked`,
t1.`warehouse_name`,
t1.`warehouse_code_fba`,
t1.`warehouse_code`,
t1.`bailun_sku_unit_price`,
t1.`bailun_sku_weight`,
t1.`bailun_sku_size`,
t1.`amount_sales`,
t1.`amount_total`,
t1.`amount_shipping`,
t1.`amount_product`,
t1.`amount_tax`,
t1.`amount_adjustment`,
t1.`amount_gift_wrap`,
t1.`amount_refund`,
t1.`amount_prepaid`,
t1.`cost_total`,
t1.`cost_promotion`,
t1.`cost_platform_fee`,
t1.`cost_product`,
t1.`cost_shipping`,
t1.`cost_package`,
t1.`cost_fba_fee`,
t1.`cost_paypal_fee`,
t1.`cost_refund_commisson`,
t1.`cost_handle_bailun`,
t1.`cost_handle_platform`,
t1.`cost_tail`,
t1.`cost_first`,
t1.`cost_logistics`,
t1.`profit_total`,
t1.`profit_rate`,
t1.`receipt_country`,
t1.`receipt_city`,
t1.`receipt_area`,
t1.`receipt_address`,
t1.`receipt_address_2`,
t1.`receipt_postal_code`,
t1.`receiver`,
t1.`receiver_phone`,
t1.`buyer_id`,
t1.`buyer_name`,
t1.`buyer_email`,
t1.`has_fba_exception`,
t1.`has_platform_exception`,
t1.`has_cancle`,
t1.`area_id`,
t1.`bailun_category_id`,
t1.`bailun_category_name`,
t1.`gmt_create`,
t1.`gmt_modified`,
t1.`ratio_weight`,
t1.`ratio_price`,
t1.`bailun_picking_status`,
t1.`bailun_require_logistics`,
t1.`has_delete`,
t1.`has_scalp`,
t1.`logistics_method_code`,
t1.`logistics_method_name`,
t1.`has_innersale`,
t1.`company_id`,
t1.`bailun_refund_status`,
t1.`refund_obj`,
t1.`refund_type`,
t1.`refund_reference_id`,
t1.`has_fba_s`,
t1.`bailun_sku_quantity_pushed`,
( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend'
from dc_base_oms_sku as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>@time and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
);
alter table dc_base_oms_sku_7 rename dc_base_oms_sku_7Temp;
alter table dc_base_oms_sku_7_temp rename dc_base_oms_sku_7;
alter table dc_base_oms_sku_7Temp rename dc_base_oms_sku_7_temp;
truncate table dc_base_oms_sku_7_temp; "
,
new
{
time
=
DateTime
.
Now
.
AddDays
(-
8
).
ToString
(
"yyyy-MM-dd 00:00:00"
)
},
commandTimeout
:
0
);
_connection
.
Execute
(
@"
set session transaction isolation level read uncommitted;
...
...
@@ -2084,6 +1953,144 @@ where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code;
}
/// <summary>
/// 刷新oms最近7天的数据
/// </summary>
public
static
void
ResetOms7
()
{
_connection
.
Execute
(
@"-- 刷新缺货明细表
set session transaction isolation level read uncommitted;
start transaction;
-- 清空视图表的数据
Truncate table dc_base_oms_sku_7_temp;
INSERT into dc_base_oms_sku_7_temp (
select
t1.`id`,
t1.`origin_order_id`,
t1.`platform_type`,
t1.`transaction_id`,
t1.`pay_time`,
t1.`pay_method`,
t1.`pay_account`,
t1.`pay_status`,
t1.`collection_account`,
t1.`platform_order_type`,
t1.`website`,
t1.`create_time`,
t1.`paid_time`,
t1.`refund_time`,
t1.`seller_id`,
t1.`bailun_account_id`,
t1.`hq_account`,
t1.`seller_account`,
t1.`seller_order_id`,
t1.`seller_email`,
t1.`order_update_time`,
t1.`seller_order_exchange_rate`,
t1.`seller_other_exchange_rate`,
t1.`finance_order_exchange_rate`,
t1.`finance_other_exchange_rate`,
t1.`cny_to_usd_exchange_rate`,
t1.`order_to_usd_exchange_rate`,
t1.`other_to_usd_exchange_rate` ,
t1.`order_currency`,
t1.`other_currency`,
t1.`seller_name`,
t1.`bailun_order_id`,
t1.`platform_order_status`,
t1.`bailun_order_status`,
t1.`bailun_payment_status`,
t1.`bailun_interception_status`,
t1.`shipping_status`,
t1.`bailun_sku`,
t1.`bailun_sku_title_en`,
t1.`bailun_sku_title_cn`,
t1.`bailun_sku_quantity_ordered`,
t1.`bailun_sku_quantity_shipped`,
t1.`bailun_sku_quantity_refund`,
t1.`bailun_sku_quantity_picked`,
t1.`warehouse_name`,
t1.`warehouse_code_fba`,
t1.`warehouse_code`,
t1.`bailun_sku_unit_price`,
t1.`bailun_sku_weight`,
t1.`bailun_sku_size`,
t1.`amount_sales`,
t1.`amount_total`,
t1.`amount_shipping`,
t1.`amount_product`,
t1.`amount_tax`,
t1.`amount_adjustment`,
t1.`amount_gift_wrap`,
t1.`amount_refund`,
t1.`amount_prepaid`,
t1.`cost_total`,
t1.`cost_promotion`,
t1.`cost_platform_fee`,
t1.`cost_product`,
t1.`cost_shipping`,
t1.`cost_package`,
t1.`cost_fba_fee`,
t1.`cost_paypal_fee`,
t1.`cost_refund_commisson`,
t1.`cost_handle_bailun`,
t1.`cost_handle_platform`,
t1.`cost_tail`,
t1.`cost_first`,
t1.`cost_logistics`,
t1.`profit_total`,
t1.`profit_rate`,
t1.`receipt_country`,
t1.`receipt_city`,
t1.`receipt_area`,
t1.`receipt_address`,
t1.`receipt_address_2`,
t1.`receipt_postal_code`,
t1.`receiver`,
t1.`receiver_phone`,
t1.`buyer_id`,
t1.`buyer_name`,
t1.`buyer_email`,
t1.`has_fba_exception`,
t1.`has_platform_exception`,
t1.`has_cancle`,
t1.`area_id`,
t1.`bailun_category_id`,
t1.`bailun_category_name`,
t1.`gmt_create`,
t1.`gmt_modified`,
t1.`ratio_weight`,
t1.`ratio_price`,
t1.`bailun_picking_status`,
t1.`bailun_require_logistics`,
t1.`has_delete`,
t1.`has_scalp`,
t1.`logistics_method_code`,
t1.`logistics_method_name`,
t1.`has_innersale`,
t1.`company_id`,
t1.`bailun_refund_status`,
t1.`refund_obj`,
t1.`refund_type`,
t1.`refund_reference_id`,
t1.`has_fba_s`,
t1.`bailun_sku_quantity_pushed`,
( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend'
from dc_base_oms_sku as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>@time and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
);
alter table dc_base_oms_sku_7 rename dc_base_oms_sku_7Temp;
alter table dc_base_oms_sku_7_temp rename dc_base_oms_sku_7;
alter table dc_base_oms_sku_7Temp rename dc_base_oms_sku_7_temp;
truncate table dc_base_oms_sku_7_temp; "
,
new
{
time
=
DateTime
.
Now
.
AddDays
(-
8
).
ToString
(
"yyyy-MM-dd 00:00:00"
)
},
commandTimeout
:
0
);
}
/// <summary>
/// 刷新安全库存
/// </summary>
public
static
void
ResetInventory
()
...
...
ResetOutofstock/Program.cs
View file @
7012c94d
...
...
@@ -23,6 +23,7 @@ namespace ResetOutofstock
//base_supplier_holiday_time_dao.SynchroData();
//report.ResetCashFlowData();
//report.StockWeekBackUp();
//report.PurchaseWeekBackUp();
//report.CalculationSalesTrend();
//report.PurchaseWeekBackUp();
//report_cash_flow_dao.CalculationTransferOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59")));
...
...
ResetOutofstock/StockBackgrounService.cs
View file @
7012c94d
...
...
@@ -50,7 +50,15 @@ namespace ResetOutofstock
}
}
if
(
now
.
Hour
==
8
&&
now
.
Minute
==
1
)
if
(
now
.
Hour
==
1
&&
now
.
Minute
==
1
)
{
Console
.
WriteLine
(
$"开始 刷新最近7天的oms数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report
.
ResetOutofstock
();
Console
.
WriteLine
(
$"结束 刷新最近7天的oms数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
8
&&
now
.
Minute
==
1
)
{
Console
.
WriteLine
(
$"开始 刷新jit安全库存,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
report
.
ResetInventory
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment