Explorar o código

250417-1代码。

baoyubo hai 1 mes
pai
achega
df3e929c06
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      routers/api/riskManagement/task.py

+ 4 - 2
routers/api/riskManagement/task.py

@@ -182,10 +182,12 @@ async def create_inspection_task(
         # 创建新的预案记录
         start_time = body['start_time']
         if start_time =='':
-            start_time = datetime.now().strftime("%Y-%m-%d 00:00:00")
+            start_time = body['end_time']
         end_time = body['end_time']
         if end_time =='':
-            end_time= '9999-12-31 00:00:00'
+            end_time= body['start_time']
+        if start_time == '' and end_time=='':
+            start_time = end_time = datetime.now().strftime("%Y-%m-%d 00:00:00")
         new_task = RiskManagementInspectionTask(
             inspection_business=body['business'],
             start_time = start_time,