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
714a87d8
Commit
714a87d8
authored
Apr 26, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
母sku采购建议
parent
44a60596
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
20 deletions
+24
-20
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+24
-20
No files found.
AutoTurnOver.DB/purchase_advise.cs
View file @
714a87d8
...
...
@@ -673,7 +673,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
not_mother_datas
=
not_mother_datas
.
Where
(
s
=>
!
maps
.
Any
(
v
=>
v
.
bailun_sku_warehouse_code
==
s
.
bailun_sku_warehouse_code
)).
ToList
();
foreach
(
var
item
in
mother_datas
)
{
if
(
item
.
bailun_sku
==
"M-
352984501"
)
if
(
item
.
bailun_sku
==
"M-
221622401-美国"
)
{
}
...
...
@@ -1172,32 +1172,36 @@ where t1.bailun_order_status != 'Canceled'
and t1.paid_time>=@btime "
;
foreach
(
var
item
in
originalDatas
)
{
DynamicParameters
parameters
=
new
DynamicParameters
();
parameters
.
Add
(
"btime"
,
btime
);
parameters
.
Add
(
"bailun_sku"
,
item
.
bailun_sku
);
parameters
.
Add
(
"warehouse_code"
,
item
.
warehouse_code
);
// 新品 (只出过一个单,就只补缺货了)
var
orders
=
_connection
.
QueryFirstOrDefault
<
int
?>(
order_sql
+
" and bailun_sku=@bailun_sku and warehouse_code=@warehouse_code "
,
parameters
)
??
0
;
//新旧品判定
if
(
item
.
first_order_date
!=
null
&&
(
now
-
item
.
first_order_date
.
Value
).
TotalDays
>
14
)
if
(
item
.
is_mother_map_sku
==
0
)
{
// 旧品
if
(
orders
<=
1
)
DynamicParameters
parameters
=
new
DynamicParameters
();
parameters
.
Add
(
"btime"
,
btime
);
parameters
.
Add
(
"bailun_sku"
,
item
.
bailun_sku
);
parameters
.
Add
(
"warehouse_code"
,
item
.
warehouse_code
);
// 新品 (只出过一个单,就只补缺货了)
var
orders
=
_connection
.
QueryFirstOrDefault
<
int
?>(
order_sql
+
" and bailun_sku=@bailun_sku and warehouse_code=@warehouse_code "
,
parameters
)
??
0
;
//新旧品判定
if
(
item
.
first_order_date
!=
null
&&
(
now
-
item
.
first_order_date
.
Value
).
TotalDays
>
14
)
{
item
.
quantity_final_advise
=
0
;
item
.
remarks
=
$"旧品(
{
item
.
first_order_date
}
), 30天内只出了
{
orders
}
单,不备货"
;
// 旧品
if
(
orders
<=
1
)
{
item
.
quantity_final_advise
=
0
;
item
.
remarks
=
$"旧品(
{
item
.
first_order_date
}
), 30天内只出了
{
orders
}
单,不备货"
;
}
}
}
else
{
if
(
orders
<=
1
)
else
{
item
.
quantity_final_advise
=
(
int
)
Math
.
Ceiling
(
item
.
fixed_quantity_out_stock
??
0
);
item
.
remarks
=
$"新品(
{
item
.
first_order_date
}
), 30天内只出了
{
orders
}
单,只补缺货 (
{(
item
.
fixed_quantity_out_stock
??
0
)}
) "
;
}
if
(
orders
<=
1
)
{
item
.
quantity_final_advise
=
(
int
)
Math
.
Ceiling
(
item
.
fixed_quantity_out_stock
??
0
);
item
.
remarks
=
$"新品(
{
item
.
first_order_date
}
), 30天内只出了
{
orders
}
单,只补缺货 (
{(
item
.
fixed_quantity_out_stock
??
0
)}
) "
;
}
}
}
datas
.
Add
(
item
);
}
...
...
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