修改了各个入库函数的返回状态

This commit is contained in:
XinYi Song 2022-02-16 09:23:49 +08:00
parent ade23d85ee
commit f2cda17eaf

View File

@ -131,7 +131,7 @@ def scan_VJ102_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -192,6 +192,10 @@ def scan_VJ102_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_VJ103_dir(collectionCode, path):
@ -210,7 +214,7 @@ def scan_VJ103_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
xmlPath = Config.XML_PATH # 解析出的xml文件保存的路径
@ -270,6 +274,10 @@ def scan_VJ103_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_GF1_PMS2_dir(collectionCode, path):
@ -286,7 +294,7 @@ def scan_GF1_PMS2_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
xmlPath = Config.XML_PATH # 解析出的xml文件保存的路径
@ -347,6 +355,10 @@ def scan_GF1_PMS2_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_GF3MDJ_dir(collectionCode, path):
@ -363,7 +375,7 @@ def scan_GF3MDJ_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
xmlPath = Config.XML_PATH # 解析出的xml文件保存的路径
@ -424,6 +436,10 @@ def scan_GF3MDJ_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_H08_dir(collectionCode, path):
@ -439,7 +455,7 @@ def scan_H08_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -502,6 +518,10 @@ def scan_H08_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_Sentinel1_dir(collectionCode, path):
@ -518,7 +538,7 @@ def scan_Sentinel1_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -582,6 +602,10 @@ def scan_Sentinel1_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_Sentinel2_dir(collectionCode, path):
@ -598,7 +622,7 @@ def scan_Sentinel2_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -661,6 +685,10 @@ def scan_Sentinel2_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_Sentinel3OL_dir(collectionCode, path):
@ -677,7 +705,7 @@ def scan_Sentinel3OL_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -742,6 +770,10 @@ def scan_Sentinel3OL_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_HJ1_dir(collectionCode, path):
@ -759,7 +791,7 @@ def scan_HJ1_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -824,6 +856,10 @@ def scan_HJ1_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_ZY3_dir(collectionCode, path):
@ -841,7 +877,7 @@ def scan_ZY3_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -904,6 +940,10 @@ def scan_ZY3_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
def scan_SNPP_dir(collectionCode, path):
@ -921,7 +961,7 @@ def scan_SNPP_dir(collectionCode, path):
task = dms_task_record(token_s, collectionCode)
# 如果不是空说明正在进行
if task is not None and len(task) > 0:
return
return 1
file_total_size = ""
file_total_name = ""
@ -987,6 +1027,10 @@ def scan_SNPP_dir(collectionCode, path):
res = requests.post(url=Config.DATA_END_TASK_URL,
params={"taskCode": task_code}, headers=header).json()
if res_data.json()['status'] == 0:
return 0
else:
return 2
if __name__ == '__main__':