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
50717029
Commit
50717029
authored
May 05, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级缺货改零算法
parent
8186ada2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
15 deletions
+43
-15
ReportServices.cs
AutoTurnOver.Services/ReportServices.cs
+42
-15
Program.cs
ShortagePush/Program.cs
+1
-0
No files found.
AutoTurnOver.Services/ReportServices.cs
View file @
50717029
...
@@ -453,11 +453,20 @@ namespace AutoTurnOver.Services
...
@@ -453,11 +453,20 @@ namespace AutoTurnOver.Services
List
<
string
>
platform1s
=
new
List
<
string
>
{
"ebay"
,
"amazon"
,
"aliexpress"
,
"shopee"
,
"wish"
,
"lazada"
};
List
<
string
>
platform1s
=
new
List
<
string
>
{
"ebay"
,
"amazon"
,
"aliexpress"
,
"shopee"
,
"wish"
,
"lazada"
};
foreach
(
var
item
in
platform1s
.
Where
(
s
=>
string
.
IsNullOrWhiteSpace
(
platform
)
||
platform
==
s
))
foreach
(
var
item
in
platform1s
.
Where
(
s
=>
string
.
IsNullOrWhiteSpace
(
platform
)
||
platform
==
s
))
{
{
List
<
dc_auto_shortage_push
>
datas
=
new
List
<
dc_auto_shortage_push
>();
try
datas
.
AddRange
(
report
.
ChinaShortagePush
(
item
,
is_all
));
{
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
,
item
);
List
<
dc_auto_shortage_push
>
datas
=
new
List
<
dc_auto_shortage_push
>();
// 记录推送状态
datas
.
AddRange
(
report
.
ChinaShortagePush
(
item
,
is_all
));
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
,
item
);
// 记录推送状态
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
Console
.
WriteLine
(
ex
.
StackTrace
);
}
}
}
//国外仓1
//国外仓1
...
@@ -465,11 +474,20 @@ namespace AutoTurnOver.Services
...
@@ -465,11 +474,20 @@ namespace AutoTurnOver.Services
List
<
string
>
rule1
=
new
List
<
string
>
{
"GBYKD"
,
"JZHYBLGC"
,
"MDBLWYT"
,
"MXBLWYT"
,
"BLUSGDC"
,
"GBBMHBL"
,
"GB4PXBL"
,
"DEBLDG"
,
"USGCBL"
,
"USHWBL"
,
"US4PXBL"
,
"AUWYTBL"
,
"AU4PXBL"
,
"GBWYTUK"
,
"BLGBPX"
};
List
<
string
>
rule1
=
new
List
<
string
>
{
"GBYKD"
,
"JZHYBLGC"
,
"MDBLWYT"
,
"MXBLWYT"
,
"BLUSGDC"
,
"GBBMHBL"
,
"GB4PXBL"
,
"DEBLDG"
,
"USGCBL"
,
"USHWBL"
,
"US4PXBL"
,
"AUWYTBL"
,
"AU4PXBL"
,
"GBWYTUK"
,
"BLGBPX"
};
foreach
(
var
item
in
platform2s
.
Where
(
s
=>
string
.
IsNullOrWhiteSpace
(
platform
)
||
platform
==
s
))
foreach
(
var
item
in
platform2s
.
Where
(
s
=>
string
.
IsNullOrWhiteSpace
(
platform
)
||
platform
==
s
))
{
{
List
<
dc_auto_shortage_push
>
datas
=
new
List
<
dc_auto_shortage_push
>();
try
datas
.
AddRange
(
report
.
NotChinaShortagePush
(
rule1
,
item
,
is_all
));
{
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
,
item
);
List
<
dc_auto_shortage_push
>
datas
=
new
List
<
dc_auto_shortage_push
>();
// 记录推送状态
datas
.
AddRange
(
report
.
NotChinaShortagePush
(
rule1
,
item
,
is_all
));
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
,
item
);
// 记录推送状态
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
Console
.
WriteLine
(
ex
.
StackTrace
);
}
}
}
// 国外仓2
// 国外仓2
...
@@ -477,11 +495,20 @@ namespace AutoTurnOver.Services
...
@@ -477,11 +495,20 @@ namespace AutoTurnOver.Services
List
<
string
>
rule2
=
new
List
<
string
>
{
"MDBLWYT"
,
"MXBLWYT"
,
"BLUSGDC"
,
"USGCBL"
,
"USHWBL"
,
"US4PXBL"
};
List
<
string
>
rule2
=
new
List
<
string
>
{
"MDBLWYT"
,
"MXBLWYT"
,
"BLUSGDC"
,
"USGCBL"
,
"USHWBL"
,
"US4PXBL"
};
foreach
(
var
item
in
platform3s
.
Where
(
s
=>
string
.
IsNullOrWhiteSpace
(
platform
)
||
platform
==
s
))
foreach
(
var
item
in
platform3s
.
Where
(
s
=>
string
.
IsNullOrWhiteSpace
(
platform
)
||
platform
==
s
))
{
{
List
<
dc_auto_shortage_push
>
datas
=
new
List
<
dc_auto_shortage_push
>();
try
datas
.
AddRange
(
report
.
NotChinaShortagePush
(
rule2
,
item
,
is_all
));
{
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
,
item
);
List
<
dc_auto_shortage_push
>
datas
=
new
List
<
dc_auto_shortage_push
>();
// 记录推送状态
datas
.
AddRange
(
report
.
NotChinaShortagePush
(
rule2
,
item
,
is_all
));
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
var
err_datas
=
ApiServices
.
ShortagePush
(
datas
,
item
);
// 记录推送状态
report
.
AddShortagePush
(
datas
.
Where
(
s
=>
!
err_datas
.
Any
(
e
=>
e
.
warehouseCode
==
s
.
warehouse_code
&&
s
.
bailun_sku
==
e
.
sku
)));
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
Console
.
WriteLine
(
ex
.
StackTrace
);
}
}
}
}
}
...
...
ShortagePush/Program.cs
View file @
50717029
...
@@ -13,6 +13,7 @@ namespace ShortagePush
...
@@ -13,6 +13,7 @@ namespace ShortagePush
{
{
Console
.
WriteLine
(
"推送缺货数据服务"
);
Console
.
WriteLine
(
"推送缺货数据服务"
);
new
ReportServices
().
ShortagePush
();
new
ReportServices
().
ShortagePush
();
//new ReportServices().ShortagePush(platform: "ebay");
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
{
services
.
AddHostedService
<
ShortagePushBackgroundService
>();
services
.
AddHostedService
<
ShortagePushBackgroundService
>();
...
...
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