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
1671ea28
Commit
1671ea28
authored
Jun 15, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ebay + wish 的单独出一个单
parent
e17de7cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
2 deletions
+52
-2
Program.cs
AutoGeneratePurchaseAdvise/Program.cs
+1
-0
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+23
-0
PurchaseAdviseServices.cs
AutoTurnOver.Services/PurchaseAdviseServices.cs
+28
-2
No files found.
AutoGeneratePurchaseAdvise/Program.cs
View file @
1671ea28
...
...
@@ -20,6 +20,7 @@ namespace AutoGeneratePurchaseAdvise
//PurchaseAdviseServices.AutoPushBuySys(2);
//dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
//PurchaseAdviseServices.AutoPushBuySys(2);
//PurchaseAdviseServices.AutoPushBuySys(1);
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
services
.
AddHostedService
<
GeneratePurchaseAdviseBackgroundService
>();
...
...
AutoTurnOver.DB/purchase_advise.cs
View file @
1671ea28
...
...
@@ -746,6 +746,29 @@ where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 an
}
/// <summary>
/// 特定平台的缺货sku
/// </summary>
/// <returns></returns>
public
static
List
<
string
>
ShortageSkuList
(
List
<
string
>
platform_types
)
{
return
_connection
.
Query
<
string
>(
@"
select bailun_sku from dc_base_oms_sku as t1
where 1=1
and t1.company_id=1
and t1.has_innersale=0
and t1.create_time>'2019-03-01 12:00:00'
and t1.bailun_picking_status!='TotalPicked'
and t1.bailun_order_status = 'Handling'
and t1.has_delete=0
and t1.has_scalp=0
and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
and t1.bailun_interception_status not in ('Success','Part') and t1.platform_type!='FBA'
and platform_type in @platform_types
"
,
new
{
platform_types
=
platform_types
},
commandTimeout
:
0
).
AsList
();
}
/// <summary>
/// 获取采购建议列表
/// </summary>
/// <param name="m"></param>
...
...
AutoTurnOver.Services/PurchaseAdviseServices.cs
View file @
1671ea28
...
...
@@ -204,7 +204,7 @@ namespace AutoTurnOver.Services
/// <summary>
/// 速卖通的挑出来单独下
/// </summary>
public
static
void
PushBuySysSplit
(
List
<
dc_auto_purchase_advise_detailed_dto
>
datas
,
UserData
user
,
bool
is_skip_error
)
public
static
void
PushBuySysSplit
_bak
(
List
<
dc_auto_purchase_advise_detailed_dto
>
datas
,
UserData
user
,
bool
is_skip_error
)
{
if
(
datas
==
null
||
datas
.
Count
<=
0
)
return
;
var
amazon_datas
=
new
List
<
dc_auto_purchase_advise_detailed_dto
>();
...
...
@@ -263,6 +263,32 @@ namespace AutoTurnOver.Services
}
/// <summary>
/// 指定平台(ebay, wish)的挑出来单独下
/// </summary>
public
static
void
PushBuySysSplit
(
List
<
dc_auto_purchase_advise_detailed_dto
>
datas
,
UserData
user
,
bool
is_skip_error
)
{
if
(
datas
==
null
||
datas
.
Count
<=
0
)
return
;
var
alone_datas
=
new
List
<
dc_auto_purchase_advise_detailed_dto
>();
var
other_datas
=
new
List
<
dc_auto_purchase_advise_detailed_dto
>();
// 查询当前有缺货的sku
var
shortageSkuList
=
purchase_advise
.
ShortageSkuList
(
new
List
<
string
>
{
"ebay"
,
"wish"
});
alone_datas
=
datas
.
Where
(
s
=>
shortageSkuList
.
Any
(
v
=>
v
==
s
.
bailun_sku
)).
ToList
();
other_datas
=
datas
.
Where
(
s
=>
!
shortageSkuList
.
Any
(
v
=>
v
==
s
.
bailun_sku
)).
ToList
();
if
(
alone_datas
!=
null
&&
alone_datas
.
Count
>
0
)
{
PushBuySys
(
alone_datas
,
user
,
is_skip_error
,
"ebay+wish"
);
}
if
(
other_datas
!=
null
&&
other_datas
.
Count
>
0
)
{
PushBuySys
(
other_datas
,
user
,
is_skip_error
,
"其他"
);
}
}
/// <summary>
/// 自动推送采购单
/// </summary>
...
...
@@ -305,7 +331,7 @@ namespace AutoTurnOver.Services
var
total
=
0
;
datas
.
AddRange
(
PurchaseAdviseServices
.
DetailList
(
new
dc_auto_purchase_advise_detailed_search_dto
{
main_id
=
mainID
,
ispush
=
false
},
0
,
int
.
MaxValue
,
ref
total
));
//datas.AddRange(PurchaseAdviseServices.DetailList(new dc_auto_purchase_advise_detailed_search_dto { main_id = mainID, ispush = false }, 0, int.MaxValue, ref total));
if
(
fals
e
)
if
(
tru
e
)
{
PurchaseAdviseServices
.
PushBuySysSplit
(
datas
,
new
UserData
{
UserName
=
"admin"
},
true
);
}
...
...
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