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
c333aff5
Commit
c333aff5
authored
May 15, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4d154e1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
dc_auto_first_order_sku_dao.cs
AutoTurnOver.DB/dc_auto_first_order_sku_dao.cs
+7
-3
QiYeJiQiRenHelper.cs
AutoTurnOver.Utility/QiYeJiQiRenHelper.cs
+26
-0
No files found.
AutoTurnOver.DB/dc_auto_first_order_sku_dao.cs
View file @
c333aff5
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using
System.Text
;
using
System.Text
;
using
Dapper
;
using
Dapper
;
using
System.Linq
;
using
System.Linq
;
using
AutoTurnOver.Utility
;
namespace
AutoTurnOver.DB
namespace
AutoTurnOver.DB
{
{
...
@@ -73,7 +74,7 @@ namespace AutoTurnOver.DB
...
@@ -73,7 +74,7 @@ namespace AutoTurnOver.DB
using
(
var
t
=
conn
.
BeginTransaction
())
using
(
var
t
=
conn
.
BeginTransaction
())
{
{
// 查询当前待出建议的sku
// 查询当前待出建议的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
=
0 "
).
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
<=1
0 "
).
AsList
();
var
rule_list
=
conn
.
Query
<
dc_auto_first_order_rule
>(
" select * from dc_auto_first_order_rule "
).
AsList
();
var
rule_list
=
conn
.
Query
<
dc_auto_first_order_rule
>(
" select * from dc_auto_first_order_rule "
).
AsList
();
...
@@ -233,15 +234,18 @@ namespace AutoTurnOver.DB
...
@@ -233,15 +234,18 @@ namespace AutoTurnOver.DB
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
conn
.
Execute
(
" update dc_auto_first_order_sku set is_error=1 where id in @ids "
,
new
{
ids
=
itemGroup
.
Select
(
s
=>
s
.
id
)});
var
goods_sku
=
$"【商品sku】:【
{
itemGroup
.
Key
.
product_inner_code
}
】【
{
itemGroup
.
Key
.
warehouse_code
}
】"
;
conn
.
Execute
(
" update dc_auto_first_order_sku set is_error=1 where id in @ids "
,
new
{
ids
=
itemGroup
.
Select
(
s
=>
s
.
id
)},
t
);
err_count
=
true
;
err_count
=
true
;
conn
.
Insert
(
new
dc_task_error_log
conn
.
Insert
(
new
dc_task_error_log
{
{
message
=
$"【商品sku】:【
{
itemGroup
.
Key
.
product_inner_code
}
】【
{
itemGroup
.
Key
.
warehouse_code
}
】"
+
ex
.
Message
,
message
=
goods_sku
+
ex
.
Message
,
stack_trace
=
ex
.
StackTrace
,
stack_trace
=
ex
.
StackTrace
,
task_name
=
"auto_first_order_GeneratePurchaseAdvise"
,
task_name
=
"auto_first_order_GeneratePurchaseAdvise"
,
date
=
DateTime
.
Now
date
=
DateTime
.
Now
},
t
);
},
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"
);
}
}
}
}
...
...
AutoTurnOver.Utility/QiYeJiQiRenHelper.cs
0 → 100644
View file @
c333aff5
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
AutoTurnOver.Utility
{
public
class
QiYeJiQiRenHelper
{
public
static
void
QiYeJiQiRenMsPush
(
QiYeJiQiRenMsDto
data
,
string
url
)
{
string
resultStr
=
HttpHelper
.
Request
(
url
,
RequestType
.
POST
,
data
.
ToJson
(),
timeout
:
1000
*
60
*
60
*
24
,
entype
:
"application/json"
);
}
public
class
QiYeJiQiRenMsDto
{
public
string
msgtype
{
get
;
set
;
}
public
text_dto
text
{
get
;
set
;
}
public
class
text_dto
{
public
string
content
{
get
;
set
;
}
}
}
}
}
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