Bläddra i källkod

风险防控-调整报错打印。

baoyubo 6 månader sedan
förälder
incheckning
7f2fbb51c6

+ 5 - 0
routers/api/riskManagement/risk_router.py

@@ -85,6 +85,7 @@ async def get_inspection_task_list(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -139,6 +140,7 @@ async def get_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e)=='':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -191,6 +193,7 @@ async def create_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -253,6 +256,7 @@ async def update_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e)=='':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -322,6 +326,7 @@ async def delete_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e) == '':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))

+ 7 - 0
routers/api/riskManagement/task.py

@@ -168,6 +168,7 @@ async def get_inspection_task_list(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -222,6 +223,7 @@ async def get_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e)=='':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -276,6 +278,7 @@ async def create_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -372,6 +375,7 @@ async def delete_inspection_tasks(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e) == '':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -407,6 +411,7 @@ async def delete_inspection_task(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e) == '':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -472,6 +477,7 @@ async def get_inspection_task_list(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -531,4 +537,5 @@ async def get_inspection_task_list(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))

+ 16 - 9
routers/api/riskManagement/user.py

@@ -80,6 +80,7 @@ async def get_inspection_user_list(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -126,6 +127,7 @@ async def get_inspection_user(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e)=='':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -140,19 +142,20 @@ async def create_inspection_user(
     user_id = Depends(valid_access_token)
 ):
     try:
-
+        user_id_1 = body['user_id']
+        area_code = body['area_code']
         # 创建新的预案记录
         new_user = RiskManagementInspectionUser(
             user_id=body['user_id'],
-            dept_id = body['dept_id'],
-            dept_name = body['dept_name'],
-            ancestors_names = body['ancestors_names'],
-            user_name = body['user_name'],
-            nick_name = body['nick_name'],
-            phonenumber = body['phonenumber'],
+            dept_id = '',#body['dept_id'],
+            dept_name = '',#body['dept_name'],
+            ancestors_names = '',#body['ancestors_names'],
+            user_name = '',#body['user_name'],
+            nick_name = '',#body['nick_name'],
+            phonenumber = '',#body['phonenumber'],
             area_code = body['area_code'],
-            area = body['area'],
-            yzy_account = body['yzy_account'],
+            area = '',#body['area'],
+            yzy_account = '',#body['yzy_account'],
             create_by = user_id
         )
         # 添加到数据库会话并提交
@@ -167,6 +170,7 @@ async def create_inspection_user(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         raise HTTPException(status_code=500, detail=str(e))
 
 
@@ -221,6 +225,7 @@ async def update_inspection_user(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e)=='':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -255,6 +260,7 @@ async def delete_inspection_users(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e) == '':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))
@@ -290,6 +296,7 @@ async def delete_inspection_user(
         }
     except Exception as e:
         # 处理异常
+        traceback.print_exc()
         if str(e) == '':
             e = detail
         raise HTTPException(status_code=500, detail=str(e))