|
@@ -31,6 +31,7 @@ def info(request):
|
|
|
order = Order_models.objects.get(id=body['id'])
|
|
|
except Order_models.DoesNotExist:
|
|
|
return JsonResponse(setError("Order not found"))
|
|
|
+
|
|
|
def get_txt_data(name):
|
|
|
base_path = 'Rdata/' + str(order.id) + '/'
|
|
|
txt_data = []
|
|
@@ -41,6 +42,7 @@ def info(request):
|
|
|
return txt_data
|
|
|
|
|
|
# 将订单信息转换为字典形式
|
|
|
+
|
|
|
order_dict = {
|
|
|
"id": order.id,
|
|
|
"user_id": order.user_id,
|
|
@@ -53,19 +55,19 @@ def info(request):
|
|
|
"status": order.status,
|
|
|
"create_time": order.create_time,
|
|
|
"update_time": order.update_time,
|
|
|
- "DL_GRS": "http://localhost:8000/order/img/"+ str(order.id) +"/DL_GRS.png",
|
|
|
+ "DL_GRS": "http://localhost:8000/order/img/" + str(order.id) + "/DL_GRS.png",
|
|
|
"DL_GRS_list": get_txt_data('DL_GRS'),
|
|
|
- "DL_GRS_prob_pre": "http://localhost:8000/order/img/"+ str(order.id) +"/DL_GRS_prob_pre.png",
|
|
|
- "OR_GRS": "http://localhost:8000/order/img/"+ str(order.id) +"/OR_GRS.png",
|
|
|
+ "DL_GRS_prob_pre": "http://localhost:8000/order/img/" + str(order.id) + "/DL_GRS_prob_pre.png",
|
|
|
+ "OR_GRS": "http://localhost:8000/order/img/" + str(order.id) + "/OR_GRS.png",
|
|
|
"OR_GRS_list": get_txt_data('OR_GRS'),
|
|
|
- "OR_GRS_prob_pre": "http://localhost:8000/order/img/"+ str(order.id) +"/OR_GRS_prob_pre.png",
|
|
|
- "SC_GRS": "http://localhost:8000/order/img/"+ str(order.id) +"/SC_GRS.png",
|
|
|
+ "OR_GRS_prob_pre": "http://localhost:8000/order/img/" + str(order.id) + "/OR_GRS_prob_pre.png",
|
|
|
+ "SC_GRS": "http://localhost:8000/order/img/" + str(order.id) + "/SC_GRS.png",
|
|
|
"SC_GRS_list": get_txt_data('SC_GRS'),
|
|
|
- "SC_GRS_prob_pre": "http://localhost:8000/order/img/"+ str(order.id) +"/SC_GRS_prob_pre.png",
|
|
|
- "t_alt_count": "http://localhost:8000/order/img/"+ str(order.id) +"/t_alt_count.png",
|
|
|
- "t_depth": "http://localhost:8000/order/img/"+ str(order.id) +"/t_depth.png",
|
|
|
- "t_ref_count": "http://localhost:8000/order/img/"+ str(order.id) +"/t_ref_count.png",
|
|
|
- "Variant_Type": "http://localhost:8000/order/img/"+ str(order.id) +"/Variant_Type.png",
|
|
|
+ "SC_GRS_prob_pre": "http://localhost:8000/order/img/" + str(order.id) + "/SC_GRS_prob_pre.png",
|
|
|
+ "t_alt_count": "http://localhost:8000/order/img/" + str(order.id) + "/t_alt_count.png",
|
|
|
+ "t_depth": "http://localhost:8000/order/img/" + str(order.id) + "/t_depth.png",
|
|
|
+ "t_ref_count": "http://localhost:8000/order/img/" + str(order.id) + "/t_ref_count.png",
|
|
|
+ "Variant_Type": "http://localhost:8000/order/img/" + str(order.id) + "/Variant_Type.png",
|
|
|
}
|
|
|
|
|
|
# 返回 JSON 格式的响应
|
|
@@ -106,6 +108,7 @@ def add(request):
|
|
|
'source': body.get('source', None),
|
|
|
'desc': body.get('desc', None),
|
|
|
'user_id': body.get('user_id', None),
|
|
|
+ 'is_run_now': body.get('isRunNow', None),
|
|
|
}
|
|
|
fileListID = body.get('fileListID', [])
|
|
|
fileListID2 = body.get('fileListID2', [])
|
|
@@ -159,6 +162,7 @@ def add(request):
|
|
|
def update(request):
|
|
|
return JsonResponse(setSuccess(msg='更新成功', data=True))
|
|
|
|
|
|
+
|
|
|
@csrf_exempt
|
|
|
@require_http_methods(["POST"])
|
|
|
def list(request):
|
|
@@ -199,7 +203,8 @@ def list(request):
|
|
|
'num_pages': paginator.num_pages,
|
|
|
'list': [{'id': item.id, 'create_time': item.create_time, 'update_time': item.update_time,
|
|
|
'start_time': item.start_time, 'desc': item.desc, 'name': item.name, 'source': item.source,
|
|
|
- 'run_time': item.run_time, 'status': item.status, } for item in data]
|
|
|
+ 'run_time': item.run_time, 'status': item.status,
|
|
|
+ 'is_run_now': 'true' if item.is_run_now == 'True' else 'false'} for item in data]
|
|
|
}
|
|
|
return JsonResponse(setSuccess(msg='更新成功', data=data_json))
|
|
|
|
|
@@ -214,6 +219,7 @@ def create_order(request):
|
|
|
body.setdefault('is_sick', body['isSick'])
|
|
|
return JsonResponse(setSuccess(msg='更新成功', data=True))
|
|
|
|
|
|
+
|
|
|
@csrf_exempt
|
|
|
@require_http_methods(["POST"])
|
|
|
def delete(request):
|