|
|
|
|
@ -64,8 +64,8 @@ def redisClient():
@@ -64,8 +64,8 @@ def redisClient():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 根据批次id,进行切片中的状态变更 |
|
|
|
|
def requestApiToUpdateSliceStatus(versionId): |
|
|
|
|
api_url = f"{url}/api/typeSettingPrintOrder/updateBatchSliceing?batch_id={versionId}" |
|
|
|
|
def requestApiToUpdateSliceStatus(versionId,downloadCounts): |
|
|
|
|
api_url = f"{url}/api/typeSettingPrintOrder/updateBatchSliceing?batch_id={versionId}&download_counts="+downloadCounts |
|
|
|
|
print(f'发起状态变更请求url={api_url}, versionId={versionId}') |
|
|
|
|
res = requests.post(api_url) |
|
|
|
|
if res.status_code != 200: |
|
|
|
|
@ -144,7 +144,16 @@ def main(work_dir=None):
@@ -144,7 +144,16 @@ def main(work_dir=None):
|
|
|
|
|
jsonFilePath = os.path.join(currentDir, 'batchPrint', versionId, 'json', f'{versionId}.json') |
|
|
|
|
step2(jsonFilePath, versionId) |
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|