Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wsmonitor_sql
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
宋鹏博
wsmonitor_sql
Commits
10f31ab2
Commit
10f31ab2
authored
Mar 20, 2025
by
宋鹏博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
2be2b126
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
33 deletions
+5
-33
cutils.py
common/cutils.py
+4
-32
start.py
start.py
+1
-1
No files found.
common/cutils.py
View file @
10f31ab2
...
@@ -43,17 +43,6 @@ def mk_error_message(error_editor, error_answer, message_id, url=wechaturl):
...
@@ -43,17 +43,6 @@ def mk_error_message(error_editor, error_answer, message_id, url=wechaturl):
requests
.
post
(
url
,
json
=
data
)
requests
.
post
(
url
,
json
=
data
)
def
mk_error_aireview_message
(
error_editor
,
error_answer
,
message_id
,
biz_id
,
url
=
wechaturl
):
data
=
{
"msgtype"
:
"markdown"
,
"markdown"
:
{
"content"
:
f
"ws推送<font color=
\"
warning
\"
>异常</font>,请相关同事注意。
\n
>问题编辑:<font color=
\"
comment
\"
>{error_editor}</font>
\n
>消息id:<font color=
\"
comment
\"
>{message_id}</font>
\n
>返回消息:<font color=
\"
comment
\"
>{error_answer}</font>
\n
>biz_id:<font color=
\"
comment
\"
>{biz_id}</font> "
,
"mentioned_mobile_list"
:
[
"16638842134"
,
"@宋鹏博"
]
}
}
requests
.
post
(
url
,
json
=
data
)
# 查询ws异常消息
# 查询ws异常消息
def
ws_error
(
minute
,
error_answer_list
=
error_answer
):
def
ws_error
(
minute
,
error_answer_list
=
error_answer
):
print
(
"开始"
)
print
(
"开始"
)
...
@@ -66,33 +55,16 @@ def ws_error(minute, error_answer_list=error_answer):
...
@@ -66,33 +55,16 @@ def ws_error(minute, error_answer_list=error_answer):
editor
=
DButils
()
.
select_sql
(
editor
=
DButils
()
.
select_sql
(
f
"select name from aicaptain.job where id= (SELECT job_id FROM aicaptain.employee WHERE "
f
"select name from aicaptain.job where id= (SELECT job_id FROM aicaptain.employee WHERE "
f
" id= {data[i][0]} ); "
)
f
" id= {data[i][0]} ); "
)
if
editor
[
0
][
0
]
in
[
"AI审校团队"
,
"AI预审编辑"
]:
if
"true"
or
"false"
in
data
[
0
][
1
]:
dirt
=
data
[
0
][
1
]
.
replace
(
"true"
,
"True"
)
.
replace
(
"false"
,
"False"
)
d
=
ast
.
literal_eval
(
dirt
)
biz_id
=
d
.
get
(
"msgContentList"
)[
1
]
.
get
(
"data"
)
.
get
(
"reviewReportRecordId"
)
mk_error_aireview_message
(
editor
[
0
][
0
],
n
,
data
[
i
][
2
],
biz_id
)
else
:
mk_error_message
(
editor
[
0
][
0
],
n
,
data
[
i
][
2
])
mk_error_message
(
editor
[
0
][
0
],
n
,
data
[
i
][
2
])
print
(
"结束"
)
print
(
"结束"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
error_answer_list
=
[
"无法回答此类问题,请换个话题吧"
,
"二维码创建失败"
,
"意图下发失败"
,
"文件处理失败"
,
"生成失败"
,
"润色任务失败"
,
"网络异常"
,
"获取书评助理结果失败"
,
"审校失败"
,
"图书生成报告失败"
,
"对不起,我暂时无法回答这个问题"
]
data
=
DButils
()
.
select_sql
(
data
=
DButils
()
.
select_sql
(
f
"select emp_id,content,id from aicaptain.message_record mr WHERE id=1900420961792245760 "
f
"select emp_id,content,id from aicaptain.message_record mr WHERE create_time > NOW() - INTERVAL 100 minute "
f
"and msg_type != 1 ; "
)
f
"and id=1895017692240617472 limit 1; "
)
print
(
data
)
for
i
in
range
(
len
(
data
)):
for
n
in
error_answer_list
:
if
n
in
data
[
i
][
1
]:
editor
=
DButils
()
.
select_sql
(
f
"select name from aicaptain.job where id= (SELECT job_id FROM aicaptain.employee WHERE "
f
" id= {data[i][0]} ); "
)
if
editor
[
0
][
0
]
==
"AI审校团队"
or
editor
[
0
][
0
]
==
"AI预审编辑"
:
if
"true"
or
"false"
in
data
[
0
][
1
]:
if
"true"
or
"false"
in
data
[
0
][
1
]:
dirt
=
data
[
0
][
1
]
.
replace
(
"true"
,
"True"
)
.
replace
(
"false"
,
"False"
)
dirt
=
data
[
0
][
1
]
.
replace
(
"true"
,
"True"
)
.
replace
(
"false"
,
"False"
)
d
=
ast
.
literal_eval
(
dirt
)
d
=
ast
.
literal_eval
(
dirt
)
biz_id
=
d
.
get
(
"msgContentList"
)[
1
]
.
get
(
"data"
)
.
get
(
"reviewReportRecordId"
)
print
(
d
.
get
(
"msgContentList"
)[
1
]
.
get
(
"data"
))
start.py
View file @
10f31ab2
from
common.cutils
import
ws_error
from
common.cutils
import
ws_error
ws_error
(
1
5
)
ws_error
(
1
0
)
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