1
This commit is contained in:
1 parent
0121c22b79
commit
b7f60afea6
1 file changed
+12
-3
@@ -64,8 +64,8 @@ def redisClient():
|
|||||||
|
|
||||||
|
|
||||||
# 根据批次id,进行切片中的状态变更
|
# 根据批次id,进行切片中的状态变更
|
||||||
def requestApiToUpdateSliceStatus(versionId):
|
def requestApiToUpdateSliceStatus(versionId,downloadCounts):
|
||||||
api_url = f"{url}/api/typeSettingPrintOrder/updateBatchSliceing?batch_id={versionId}"
|
api_url = f"{url}/api/typeSettingPrintOrder/updateBatchSliceing?batch_id={versionId}&download_counts="+downloadCounts
|
||||||
print(f'发起状态变更请求url={api_url}, versionId={versionId}')
|
print(f'发起状态变更请求url={api_url}, versionId={versionId}')
|
||||||
res = requests.post(api_url)
|
res = requests.post(api_url)
|
||||||
if res.status_code != 200:
|
if res.status_code != 200:
|
||||||
@@ -144,7 +144,16 @@ def main(work_dir=None):
|
|||||||
jsonFilePath = os.path.join(currentDir, 'batchPrint', versionId, 'json', f'{versionId}.json')
|
jsonFilePath = os.path.join(currentDir, 'batchPrint', versionId, 'json', f'{versionId}.json')
|
||||||
step2(jsonFilePath, versionId)
|
step2(jsonFilePath, versionId)
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 数据处理完成,等待10秒')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 数据处理完成,等待10秒')
|
||||||
requestApiToUpdateSliceStatus(versionId)
|
|
||||||
|
#判断下载的obj文件数量和json里的是否一致,排除arrange文件夹
|
||||||
|
objFilePath = os.path.join(currentDir, 'batchPrint', versionId, 'data')
|
||||||
|
objCounts = 0
|
||||||
|
for file in os.listdir(objFilePath):
|
||||||
|
if file == 'arrange':
|
||||||
|
continue
|
||||||
|
if file.endswith('.obj'):
|
||||||
|
objCounts += 1
|
||||||
|
requestApiToUpdateSliceStatus(versionId,objCounts)
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user