libushang 4 месяцев назад
Родитель
Сommit
fafbee000e
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      utils/riskManagement_uitl.py

+ 7 - 7
utils/riskManagement_uitl.py

@@ -188,7 +188,7 @@ def create_children_task(db,task_info,corn_query):
     for user_info in user_list:
         to_user_id = user_info.user_id
         yzy_account = user_info.yzy_account
-        task_title = get_task_title_by_type(task_info.type)
+        task_title = get_task_title_by_type(task_info.inspection_business)
         description = f"你有一个{task_title}任务需要处理,点击处理"
         detail_url = "{}/yjxp/#/worker/inspectionWork".format(settings.YZY_WEB_ROOT)
         foreign_key = "0"
@@ -197,16 +197,16 @@ def create_children_task(db,task_info,corn_query):
         send_yzy_msg(db, to_user_id, task_info.id, yzy_account, description, detail_url, foreign_key, from_scenario)
 
 def get_task_title_by_type(type: int) -> str:
-    if type == 0:
+    if type == '0':
         return '城市隐患巡查'
-    if type == 1:
+    elif type == '1':
         return '森林防火巡查'
-    if type == 2:
+    elif type == '2':
         return '重点危化企业巡查'
-    if type == 3:
+    elif type == '3':
         return '重点水库水位巡查'
-    
-    return str(type)
+    else:
+        return str(type)
 
 # 发送粤政易消息
 def send_yzy_msg(db: Session, to_user_id: int, task_id: int, yzy_account: str, description: str, detail_url: str, foreign_key:str, from_scenario: str) -> None: