"query":"select IFNULL(count(1), 0) as count from (\nselect a.rw_id,screen_name,occur_date from craw_warn_log_info a where a.rw_id = {{JSON.stringify(JSON.parse($('Webhook').all()[0].json.body.schedule_id)) }} and a.screen_name = {{JSON.stringify(JSON.parse($('Webhook').all()[0].json.body.info).user_screen_name) }} and a.content like '%429%' and a.status =0 group by screen_name,occur_date) as craw_warn_info;\n",
"options":{}
},
"id":"39c485eb-21e6-4686-a529-f76bac5c33ed",
"name":"is_exists_warn_by_retry",
"type":"n8n-nodes-base.mySql",
"typeVersion":2.4,
"position":[
80,
780
],
"alwaysOutputData":false,
"credentials":{
"mySql":{
"id":"YpVIiGwzmmkf7vR7",
"name":"SL-DB-PRD"
}
}
},
{
"parameters":{
"operation":"executeQuery",
"query":"select IFNULL(count(1), 0) as count from (\nselect a.rw_id,screen_name,occur_date from craw_warn_log_info a where a.rw_id = {{JSON.stringify(JSON.parse($('Webhook').all()[0].json.body.schedule_id)) }} and a.screen_name = {{JSON.stringify(JSON.parse($('Webhook').all()[0].json.body.info).user_screen_name) }} and (a.content not like '%429%' and a.content not like '%403%' and LENGTH(TRIM(a.content))>0) and a.status =0 group by screen_name,occur_date) as craw_warn_info;\n",
"query":"select a.`name` from schedule a where a.id = {{ JSON.parse($('Webhook').all()[0].json.body.schedule_id) }};\n",
"options":{}
},
"id":"691dd49f-a745-409e-a94e-91924ab2a074",
"name":"get_rw_name",
"type":"n8n-nodes-base.mySql",
"typeVersion":2.4,
"position":[
480,
900
],
"alwaysOutputData":false,
"credentials":{
"mySql":{
"id":"YpVIiGwzmmkf7vR7",
"name":"SL-DB-PRD"
}
}
},
{
"parameters":{
"jsCode":"// Loop over input items and add a new field called 'myNewField' to the JSON of each one\ninfo_data = JSON.parse($('Webhook').all()[0].json.body.info);\nschedule_id = JSON.parse($('Webhook').all()[0].json.body.schedule_id);\nrw_name = $('get_rw_name').all()[0].json.name;\ninfo_content = \"## twitter采集异常\\n >ID:<font color=\\\"comment\\\">\"+schedule_id+\"</font>\\n>任务名称:<font color=\\\"comment\\\">\"+rw_name+\"</font>\\n>博主名称:<font color=\\\"comment\\\">\"+info_data.user_screen_name+\"</font>\\n>原因:<font color=\\\"comment\\\"> \"+info_data.error_info+\"</font>\\n>失败时间:<font color=\\\"warning\\\"> \"+info_data.occur_date+\"</font>\\n>详情页:<font color=\\\"comment\\\"> [http://16.162.124.172:8080/#/tasks](http://16.162.124.172:8080/#/tasks)</font>\";\noutput_all_data = {};\noutput_all = [];\noutput_all_data['content'] = info_content;\noutput_all.push(output_all_data);\n// console.log(output_all);\nreturn output_all;"