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
fad0e00f
Commit
fad0e00f
authored
Jul 04, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
如果没命中规则应该是没出准确的采购建议数
parent
c9fe6e11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
dc_auto_first_order_sku_dao.cs
AutoTurnOver.DB/dc_auto_first_order_sku_dao.cs
+21
-2
No files found.
AutoTurnOver.DB/dc_auto_first_order_sku_dao.cs
View file @
fad0e00f
...
...
@@ -74,7 +74,7 @@ namespace AutoTurnOver.DB
using
(
var
t
=
conn
.
BeginTransaction
())
{
// 查询当前待出建议的sku
var
sku_list
=
conn
.
Query
<
dc_auto_first_order_sku
>(
" select * from dc_auto_first_order_sku where order_time < '2020-01-01' and is_error<=
10
"
).
AsList
();
var
sku_list
=
conn
.
Query
<
dc_auto_first_order_sku
>(
" select * from dc_auto_first_order_sku where order_time < '2020-01-01' and is_error<=
0
"
).
AsList
();
var
rule_list
=
conn
.
Query
<
dc_auto_first_order_rule
>(
" select * from dc_auto_first_order_rule "
).
AsList
();
...
...
@@ -83,6 +83,7 @@ namespace AutoTurnOver.DB
var
err_count
=
false
;
foreach
(
var
itemGroup
in
sku_list
.
GroupBy
(
s
=>
new
{
s
.
product_inner_code
,
s
.
warehouse_code
}))
{
int
purchase_advise_id
=
conn
.
Insert
<
dc_auto_purchase_advise
>(
new
dc_auto_purchase_advise
{
buy_sys_plan_no
=
"自动下首单"
,
create_time
=
DateTime
.
Now
,
no
=
purchase_advise
.
MaxNo
(),
sendtype
=
itemGroup
.
Max
(
v
=>
v
.
sendtype
)
},
t
)
??
0
;
try
{
var
item_warehouse
=
warehouse_list
.
FirstOrDefault
(
s
=>
itemGroup
.
Key
.
warehouse_code
.
Equals
(
s
.
warehouse_code
,
StringComparison
.
CurrentCultureIgnoreCase
));
...
...
@@ -209,7 +210,7 @@ namespace AutoTurnOver.DB
}
int
purchase_advise_id
=
conn
.
Insert
<
dc_auto_purchase_advise
>(
new
dc_auto_purchase_advise
{
buy_sys_plan_no
=
"自动下首单"
,
create_time
=
DateTime
.
Now
,
no
=
purchase_advise
.
MaxNo
(),
sendtype
=
itemGroup
.
Max
(
v
=>
v
.
sendtype
)},
t
)
??
0
;
foreach
(
var
item
in
data_detailed_list
)
{
conn
.
Insert
(
new
dc_auto_purchase_advise_detailed
...
...
@@ -248,6 +249,24 @@ namespace AutoTurnOver.DB
},
t
);
QiYeJiQiRenHelper
.
QiYeJiQiRenMsPush
(
new
QiYeJiQiRenHelper
.
QiYeJiQiRenMsDto
{
msgtype
=
"text"
,
text
=
new
QiYeJiQiRenHelper
.
QiYeJiQiRenMsDto
.
text_dto
{
content
=
" 查收异常消息: "
+
goods_sku
+
ex
.
Message
}
},
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=0ff68206-f585-4d1e-824b-630c473978d8"
);
foreach
(
var
item
in
itemGroup
.
ToList
())
{
conn
.
Insert
(
new
dc_auto_purchase_advise_detailed
{
bailun_sku
=
item
.
bailun_sku
,
warehouse_code
=
itemGroup
.
Key
.
warehouse_code
,
quantity_init_advise
=
0
,
quantity_actual
=
0
,
main_id
=
purchase_advise_id
,
forecast_formula
=
""
,
fit_forecast_formula
=
""
,
ispush
=
0
,
type
=
4
,
product_inner_code
=
itemGroup
.
Key
.
product_inner_code
,
good_sku_codes
=
""
,
purchase_type_jit
=
3
},
t
);
}
}
}
...
...
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