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
9ab13852
Commit
9ab13852
authored
Nov 11, 2019
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11号晚上8点半,推一波单
parent
d66cd5bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
7 deletions
+30
-7
GeneratePurchaseAdviseBackgroundService.cs
...PurchaseAdvise/GeneratePurchaseAdviseBackgroundService.cs
+6
-1
Program.cs
AutoGeneratePurchaseAdvise/Program.cs
+1
-1
PurchaseAdviseServices.cs
AutoTurnOver.Services/PurchaseAdviseServices.cs
+23
-5
No files found.
AutoGeneratePurchaseAdvise/GeneratePurchaseAdviseBackgroundService.cs
View file @
9ab13852
...
...
@@ -24,13 +24,18 @@ namespace AutoGeneratePurchaseAdvise
{
var
now
=
DateTime
.
Now
;
if
(
now
.
Day
==
11
&&
now
.
Hour
==
20
&&
now
.
Minute
==
29
)
{
Console
.
WriteLine
(
$"开始推送 jit甲油采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
AutoPushBuySys
(
1
);
Console
.
WriteLine
(
$"结束推送 jit甲油采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
5
&&
now
.
Minute
==
29
)
{
Console
.
WriteLine
(
$"开始推送 jit甲油采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
PurchaseAdviseServices
.
AutoPushBuySys
(
1
);
Console
.
WriteLine
(
$"结束推送 jit甲油采购建议 任务,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
10
&&
now
.
Minute
==
01
)
...
...
AutoGeneratePurchaseAdvise/Program.cs
View file @
9ab13852
...
...
@@ -12,7 +12,7 @@ namespace AutoGeneratePurchaseAdvise
static
async
Task
Main
(
string
[]
args
)
{
Console
.
WriteLine
(
"采购建议计算任务启动..."
);
//PurchaseAdviseServices.Generate(
);
PurchaseAdviseServices
.
AutoPushBuySys
(
1
);
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
services
.
AddHostedService
<
GeneratePurchaseAdviseBackgroundService
>();
...
...
AutoTurnOver.Services/PurchaseAdviseServices.cs
View file @
9ab13852
...
...
@@ -106,7 +106,7 @@ namespace AutoTurnOver.Services
/// <param name="datas"></param>
/// <param name="user"></param>
/// <param name="is_skip_error">是否跳过异常</param>
public
static
void
PushBuySys
(
List
<
dc_auto_purchase_advise_detailed_dto
>
datas
,
UserData
user
,
bool
is_skip_error
)
public
static
void
PushBuySys
(
List
<
dc_auto_purchase_advise_detailed_dto
>
datas
,
UserData
user
,
bool
is_skip_error
,
string
remarks
=
""
)
{
lock
(
_push_lock
)
{
...
...
@@ -133,7 +133,7 @@ namespace AutoTurnOver.Services
bp_sendtoCode
=
item
.
Key
.
warehouse_type
!=
"国内仓"
?
item
.
Key
.
warehouse_code
:
null
,
sys_source
=
item
.
Any
(
s
=>
s
.
type
==
2
)
?
2
:
item
.
Any
(
s
=>
s
.
type
==
1
)
?
1
:
3
,
bi_buyplandetail
=
new
List
<
bi_buyplandetail
>(),
bp_remark
=
$"用户
{
user
.
UserName
}
在 aims 操作推送
"
bp_remark
=
$"用户
{
user
.
UserName
}
在 aims 操作推送
-"
+
remarks
};
data
.
bi_buyplandetail
=
item
.
GroupBy
(
s
=>
s
.
bailun_sku
).
Select
(
s
=>
new
bi_buyplandetail
...
...
@@ -196,17 +196,35 @@ namespace AutoTurnOver.Services
{
if
(
"张莹霞"
.
Equals
(
item
.
buyer_name
)
&&
item
.
quantity_out_stock_aliexpress
>
0
)
{
//if(item.)
var
temp_other_data
=
item
.
ToJson
().
ToObject
<
dc_auto_purchase_advise_detailed_dto
>()
;
temp_other_data
.
quantity_final_advise
=
(
int
)
Math
.
Round
(
item
.
quantity_out_stock
-
item
.
quantity_out_stock_aliexpress
.
Value
);
if
(
temp_other_data
.
quantity_final_advise
>
0
)
{
other_datas
.
Add
(
temp_other_data
);
}
var
temp_ali_data
=
item
.
ToJson
().
ToObject
<
dc_auto_purchase_advise_detailed_dto
>();
temp_ali_data
.
quantity_final_advise
=
item
.
quantity_final_advise
-
temp_other_data
.
quantity_final_advise
;
if
(
temp_ali_data
.
quantity_final_advise
>
0
)
{
ali_datas
.
Add
(
temp_ali_data
);
}
}
else
{
other_datas
.
Add
(
item
);
}
}
if
(
ali_datas
!=
null
&&
ali_datas
.
Count
>
0
)
{
PushBuySys
(
ali_datas
,
user
,
is_skip_error
);
PushBuySys
(
ali_datas
,
user
,
is_skip_error
,
"速卖通"
);
}
if
(
other_datas
!=
null
&&
other_datas
.
Count
>
0
)
{
PushBuySys
(
other_datas
,
user
,
is_skip_error
);
PushBuySys
(
other_datas
,
user
,
is_skip_error
,
"非速卖通"
);
}
}
...
...
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