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
9be13856
Commit
9be13856
authored
Mar 01, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送海运采购建议的时候,需要推荐一条最近30天的最快物流渠道
parent
b577822a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
LmsShipLogisticsDto.cs
AutoTurnOver.Models/ApiDto/LmsShipLogisticsDto.cs
+5
-0
PurchaseAdviseServices.cs
AutoTurnOver.Services/PurchaseAdviseServices.cs
+21
-2
No files found.
AutoTurnOver.Models/ApiDto/LmsShipLogisticsDto.cs
View file @
9be13856
...
...
@@ -11,6 +11,11 @@ namespace AutoTurnOver.Models.ApiDto
{
public
string
Line_Code
{
get
;
set
;
}
public
string
Line_Name
{
get
;
set
;
}
/// <summary>
/// 最快签收时间
/// </summary>
public
int
?
Fast_Aging
{
get
;
set
;
}
public
string
Company_Code
{
get
;
set
;
}
public
string
Company_Name
{
get
;
set
;
}
...
...
AutoTurnOver.Services/PurchaseAdviseServices.cs
View file @
9be13856
...
...
@@ -293,9 +293,10 @@ namespace AutoTurnOver.Services
DateTime
now
=
DateTime
.
Now
;
// 查询未推送成功的采购建议的明细
var
detailList
=
purchase_advise
.
BuyDetailList
(
datas
.
Select
(
s
=>
s
.
id
).
ToList
(),
false
);
var
_connection
=
MyMySqlConnection
.
_connection
;
foreach
(
var
item
in
detailList
.
GroupBy
(
s
=>
new
{
s
.
warehouse_code
,
s
.
area_name
,
s
.
warehouse_type
,
s
.
task_transport_type
}))
{
mPlanToPurchaseDto
data
=
new
mPlanToPurchaseDto
{
bp_send
=
item
.
Key
.
warehouse_type
!=
"国内仓"
?
1
:
0
,
...
...
@@ -359,8 +360,26 @@ namespace AutoTurnOver.Services
data
.
bp_sendtype
=
4
;
}
}
//海运则自动选择一个最快的渠道
if
(
data
.
bp_sendtype
==
2
)
{
var
base_wa
=
_connection
.
QueryFirstOrDefault
<
string
>(
" select t2.`code` from dc_base_warehouse as t1 left join dc_base_country as t2 on t1.area_name = t2.`name` where warehouse_code=@warehouse_code "
,
new
{
warehouse_code
=
item
.
Key
.
warehouse_code
});
// 查询物流方案
var
logisticsData
=
ApiUtility
.
RealTimeShipLogisticsList
(
new
Models
.
ApiDto
.
LmsShipLogisticsRequstDto
{
endCountries
=
base_wa
,
character_skus
=
item
.
FirstOrDefault
().
bailun_sku
,
startPoint
=
"3"
,
transport_type
=
2
,
has_min_freight_unit_price
=
true
,
has_history_order
=
30
}).
Where
(
s
=>
s
.
min_freight_unit_price
>
1
).
Where
(
s
=>
s
.
Fast_Aging
>
10
).
OrderBy
(
s
=>
s
.
Fast_Aging
).
FirstOrDefault
();
if
(
logisticsData
!=
null
)
{
data
.
logistics_code
=
logisticsData
.
Line_Code
;
}
}
data
.
bi_buyplandetail
=
item
.
GroupBy
(
s
=>
s
.
bailun_sku
).
Select
(
s
=>
new
bi_buyplandetail
{
bd_count
=
s
.
Sum
(
g
=>
g
.
quantity_actual
>
0
?
g
.
quantity_actual
:
g
.
quantity_final_advise
),
...
...
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