|
|
|
@ -154,7 +154,7 @@ def base_fix(pid,order_ids): |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 模型基础校正完成') |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 模型基础校正完成') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def export_and_update_glbs(pid): |
|
|
|
def export_and_update_glbs(pid,order_ids): |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 开始导出并上传审核模型和3D相册模型glb文件...') |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 开始导出并上传审核模型和3D相册模型glb文件...') |
|
|
|
start_time = time.time() |
|
|
|
start_time = time.time() |
|
|
|
#headcount = libs.getHeadCount(pid) |
|
|
|
#headcount = libs.getHeadCount(pid) |
|
|
|
@ -182,8 +182,8 @@ def export_and_update_glbs(pid): |
|
|
|
model_info['weight'] = round(model_info['volume'] * 1.226, 2) |
|
|
|
model_info['weight'] = round(model_info['volume'] * 1.226, 2) |
|
|
|
print(f'{pid}的模型数据:{model_info}') |
|
|
|
print(f'{pid}的模型数据:{model_info}') |
|
|
|
|
|
|
|
|
|
|
|
res = requests.get(f'{config.urls["upload_model_info_url"]}?pid={pid}&headcount={headcount}&faces={model_info["faces"]}&volume={model_info["volume"]}&weight={model_info["weight"]}&height={model_info["height"]}') |
|
|
|
#res = requests.get(f'{config.urls["upload_model_info_url"]}?pid={pid}&headcount={headcount}&faces={model_info["faces"]}&volume={model_info["volume"]}&weight={model_info["weight"]}&height={model_info["height"]}') |
|
|
|
print('上传模型数据:', res.text) |
|
|
|
#print('上传模型数据:', res.text) |
|
|
|
# with open(os.path.join(config.sharedir, 'model_info', f'{pid}.json'), 'w') as f: |
|
|
|
# with open(os.path.join(config.sharedir, 'model_info', f'{pid}.json'), 'w') as f: |
|
|
|
# json.dump(model_info, f) |
|
|
|
# json.dump(model_info, f) |
|
|
|
# f.close() |
|
|
|
# f.close() |
|
|
|
@ -230,6 +230,7 @@ def export_and_update_glbs(pid): |
|
|
|
|
|
|
|
|
|
|
|
#更新该笔订单的状态为 3000 |
|
|
|
#更新该笔订单的状态为 3000 |
|
|
|
# order_ids 逗号隔开 |
|
|
|
# order_ids 逗号隔开 |
|
|
|
|
|
|
|
print(order_ids) |
|
|
|
order_ids = ",".join(order_ids) |
|
|
|
order_ids = ",".join(order_ids) |
|
|
|
requests.post("https://shop.api.suwa3d.com/api/printOrder/updateExternalOrderStatusV2", data={'pid': pid,"order_ids":order_ids}) |
|
|
|
requests.post("https://shop.api.suwa3d.com/api/printOrder/updateExternalOrderStatusV2", data={'pid': pid,"order_ids":order_ids}) |
|
|
|
|
|
|
|
|
|
|
|
@ -237,7 +238,7 @@ def createGlb(pid,order_ids): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base_fix(pid,order_ids) |
|
|
|
base_fix(pid,order_ids) |
|
|
|
export_and_update_glbs(pid) |
|
|
|
export_and_update_glbs(pid,order_ids) |
|
|
|
#移除文件夹 |
|
|
|
#移除文件夹 |
|
|
|
# try: |
|
|
|
# try: |
|
|
|
# shutil.rmtree(os.path.join(config.workdir,'print',pid)) |
|
|
|
# shutil.rmtree(os.path.join(config.workdir,'print',pid)) |
|
|
|
@ -283,13 +284,13 @@ if __name__ == '__main__': |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = json.loads(info) |
|
|
|
info = json.loads(info) |
|
|
|
pid = int(info['pid']) |
|
|
|
pid = info['pid'] |
|
|
|
order_ids = info['order_id'] |
|
|
|
order_ids = info['order_id'] |
|
|
|
|
|
|
|
|
|
|
|
if not pid.isdigit(): |
|
|
|
# if not pid.isdigit(): |
|
|
|
continue |
|
|
|
# continue |
|
|
|
|
|
|
|
|
|
|
|
createGlb(pid,order_ids) |
|
|
|
createGlb(str(pid),order_ids) |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
print(f'错误:{e}') |
|
|
|
print(f'错误:{e}') |
|
|
|
time.sleep(10) |
|
|
|
time.sleep(10) |
|
|
|
|