rule_data={"logicIf":{"ruleCond":{"condType":2,"robId":event_id,"objName":"IncomingMessage","objDescribe":"Incoming message","objType":"bool","objCategory":"","objKind":3,"valueFrom":3,"parentRobId":"","showType":"","showKind":"","showPlaceholder":"","valueList":[],"specifyOperator":"","compOperatorType":"eq","compOperatorValue":"true","next":None,"logicType":"and"},"result":[{"robId":rob_id,"objName":"CloseConversation","objDescribe":"Close the conversation","objType":"bool","objCategory":"","objKind":2,"valueFrom":1,"parentRobId":"","showType":"","showKind":"","showPlaceholder":"","valueList":[],"specifyOperator":"","objValue":"true"}]}}
rule_select_sql=f'select * from `rule_define` where brand_id = {ruleData.brandId} and status != 3 and tpl_id = "{ruleData.rule_parent_template_id}" and child_rule = 0'
insert_rule_raw='{"ruleId":"%s","tplId":"%s","brandId":%s,"eventId":"%s","ruleName":"%s","status":%s,"ruleLogic":{"logicIf":{"ruleCond":{"condType":2,"robId":"%s","objName":"IncomingMessage","objType":"bool","compOperatorType":"eq","compOperatorValue":"true","logicType":"and"},"result":[{"ruleId":"%s","robId":"cjerr94uvd8ufj7e2os0","objName":"MarkAsSpam","objType":"bool","objKind":2,"objDescribe":"Mark as spam","objValue":"true","resultType":1}],"index":1}}}'%(ruleData.insert_rule_id,ruleData.rule_parent_template_id,ruleData.brandId,ruleData.rule_name,ruleData.rule_status,ruleData.event_id,ruleData.insert_rule_id)
rule_insert_sql=f"""INSERT INTO willdesk.rule_define (rule_id,tpl_id,brand_id,event_id,rule_name,rule_describe,rule_dsl,rule_raw,sorts,parent_ruleid,child_rule,dsl_version,json_version,status,create_at,update_at) VALUES
insert_rule_raw='{"ruleId":"cp5ccqct7rnv226qoavg","tplId":"cj6d0n6ein6dsof86ng0","brandId":6052,"eventId":"cmk9m1n73uvgh1rfmho0","ruleName":"Triage button and assign to different teams","ruleDescribe":"When a customer opens a new conversation, it is assigned according to the type selected by the user, and the issue information is collected synchronously, add the tag.","status":1,"ruleLogic":{"logicIf":{"ruleCond":{"condType":2,"robId":"cmk9m1n73uvgh1rfmho0","objName":"ChatBotIncomingMessage","objType":"bool","compOperatorType":"eq","compOperatorValue":"true","extendedAttributes":"{\\"x\\":212,\\"y\\":212,\\"nodeId\\":\\"Triggers_35705406543421204\\"}"},"result":[{"extendedAttributes":"{\\"showType\\":\\"next\\",\\"nodeId\\":\\"Actions_7500242750723225\\"}","resultType":2,"inner":[{"ruleId":"cp5ccqct7rnv226qoavg","robId":"cjhg9iuein687habss50","objName":"ChatBotMulReply","objType":"string","objKind":2,"objValue":"{\\"contentList\\":\\"Hi👋~\\",\\"attachmentList\\":[]}","showType":"mulInput","showKind":"chatBotReply","extendedAttributes":"{\\"title\\":\\"Message content\\",\\"nodeId\\":\\"Actions_7500242750723225\\",\\"x\\":658.2869318181818,\\"y\\":270.7599431818181}","resultType":1}]}],"index":1}}}'
workflow_insert_sql=f"""INSERT INTO willdesk.rule_define (rule_id,tpl_id,brand_id,event_id,rule_name,rule_describe,rule_dsl,rule_raw,sorts,parent_ruleid,child_rule,dsl_version,json_version,status,create_at,update_at) VALUES
all_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 1 and `is_ignore` = 0 and room_type != 2'
...
...
@@ -8,12 +7,12 @@ your_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketInfo
your_wait_ticket_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 2 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and room_type != 2'
your_close_ticket_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 3 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and room_type != 2'