|
|
|
@ -24,7 +24,7 @@ def down_obj_fromoss(pid,order_id): |
|
|
|
# print_type:// 打印状态 1:正常打印 2:重打 3:加打,4: 样品 |
|
|
|
# print_type:// 打印状态 1:正常打印 2:重打 3:加打,4: 样品 |
|
|
|
print('开始下载obj文件...' , pid) |
|
|
|
print('开始下载obj文件...' , pid) |
|
|
|
#请求接口 获取 对应的 oss 地址 |
|
|
|
#请求接口 获取 对应的 oss 地址 |
|
|
|
tempUrl = f'https://mp.api.suwa3d.com/api/order/getOssSuffixByOrderId?order_id={order_id}' |
|
|
|
tempUrl = f'https://mp.gray.api.suwa3d.com/api/order/getOssSuffixByOrderId?order_id={order_id}' |
|
|
|
#发起请求 |
|
|
|
#发起请求 |
|
|
|
res = requests.get(tempUrl) |
|
|
|
res = requests.get(tempUrl) |
|
|
|
ossPath = "" |
|
|
|
ossPath = "" |
|
|
|
@ -74,7 +74,7 @@ def down_obj_fromoss(pid,order_id): |
|
|
|
# time.sleep(10) |
|
|
|
# time.sleep(10) |
|
|
|
|
|
|
|
|
|
|
|
def getPidFromOrderId(orderId): |
|
|
|
def getPidFromOrderId(orderId): |
|
|
|
getPidFromOrderId_url = 'https://mp.api.suwa3d.com/api/printOrder/info' |
|
|
|
getPidFromOrderId_url = 'https://mp.gray.api.suwa3d.com/api/printOrder/info' |
|
|
|
print(f'{getPidFromOrderId_url}?id={orderId}') |
|
|
|
print(f'{getPidFromOrderId_url}?id={orderId}') |
|
|
|
res = requests.get(f'{getPidFromOrderId_url}?id={orderId}') |
|
|
|
res = requests.get(f'{getPidFromOrderId_url}?id={orderId}') |
|
|
|
resCode = res.json()['code'] |
|
|
|
resCode = res.json()['code'] |
|
|
|
@ -154,7 +154,7 @@ def team_check(r): |
|
|
|
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} 生成团队审核模型 end') |
|
|
|
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} 生成团队审核模型 end') |
|
|
|
|
|
|
|
|
|
|
|
def get_p3d_info(pid): |
|
|
|
def get_p3d_info(pid): |
|
|
|
url = "https://mp.api.suwa3d.com/api/customerP3dLog/info?id="+pid |
|
|
|
url = "https://mp.gray.api.suwa3d.com/api/customerP3dLog/info?id="+pid |
|
|
|
res = requests.get(url) |
|
|
|
res = requests.get(url) |
|
|
|
res = res.json() |
|
|
|
res = res.json() |
|
|
|
if res["code"] == 1000: |
|
|
|
if res["code"] == 1000: |
|
|
|
@ -166,7 +166,7 @@ def create_redis_connection(): |
|
|
|
"""创建 Redis 连接,若连接失败则重试""" |
|
|
|
"""创建 Redis 连接,若连接失败则重试""" |
|
|
|
while True: |
|
|
|
while True: |
|
|
|
try: |
|
|
|
try: |
|
|
|
r = redis.Redis(host='106.14.158.208', password='kcV2000', port=6379, db=6) |
|
|
|
r = redis.Redis(host='mark.api.suwa3d.com', password='kcV2000', port=6379, db=6) |
|
|
|
# 尝试进行一次操作,检查连接是否有效 |
|
|
|
# 尝试进行一次操作,检查连接是否有效 |
|
|
|
r.ping() # ping 操作是一个简单的连接测试 |
|
|
|
r.ping() # ping 操作是一个简单的连接测试 |
|
|
|
print("Redis连接成功!") |
|
|
|
print("Redis连接成功!") |
|
|
|
@ -194,12 +194,12 @@ if __name__ == '__main__': |
|
|
|
Endpoint = 'oss-cn-shanghai.aliyuncs.com' |
|
|
|
Endpoint = 'oss-cn-shanghai.aliyuncs.com' |
|
|
|
Bucket = 'suwa3d-securedata' |
|
|
|
Bucket = 'suwa3d-securedata' |
|
|
|
oss_client = oss2.Bucket(oss2.Auth(AccessKeyId, AccessKeySecret), Endpoint, Bucket) |
|
|
|
oss_client = oss2.Bucket(oss2.Auth(AccessKeyId, AccessKeySecret), Endpoint, Bucket) |
|
|
|
update_check_url = 'https://mp.api.suwa3d.com/api/customerP3dLog/updateStatusToWaitingPlatformCheckingStatus' |
|
|
|
update_check_url = 'https://mp.gray.api.suwa3d.com/api/customerP3dLog/updateStatusToWaitingPlatformCheckingStatus' |
|
|
|
update_team_check_url = 'https://mp.api.suwa3d.com/api/customerP3dLog/updateStatusToWaitingTeamCheckingStatus' |
|
|
|
update_team_check_url = 'https://mp.gray.api.suwa3d.com/api/customerP3dLog/updateStatusToWaitingTeamCheckingStatus' |
|
|
|
update_status_printstatus_url = 'https://mp.api.suwa3d.com/api/customerP3dLog/updateBuildPrintModelStatus' |
|
|
|
update_status_printstatus_url = 'https://mp.gray.api.suwa3d.com/api/customerP3dLog/updateBuildPrintModelStatus' |
|
|
|
update_makeprintobj_status_url = 'https://mp.api.suwa3d.com/api/printOrder/updateMakePrintObjSucceed' |
|
|
|
update_makeprintobj_status_url = 'https://mp.gray.api.suwa3d.com/api/printOrder/updateMakePrintObjSucceed' |
|
|
|
getRepairInfo_url = 'https://repair.api.suwa3d.com/api/modelRepairOrder/teamCheckGLBInfo' |
|
|
|
getRepairInfo_url = 'https://repair.gray.api.suwa3d.com/api/modelRepairOrder/teamCheckGLBInfo' |
|
|
|
update_repair_status_url = 'https://repair.api.suwa3d.com/api/modelRepairOrder/updateStatusToWaitingTeamCheckingStatus' |
|
|
|
update_repair_status_url = 'https://repair.gray.api.suwa3d.com/api/modelRepairOrder/updateStatusToWaitingTeamCheckingStatus' |
|
|
|
if platform.system() == 'Windows': |
|
|
|
if platform.system() == 'Windows': |
|
|
|
workdir = 'D:\\' |
|
|
|
workdir = 'D:\\' |
|
|
|
else: |
|
|
|
else: |
|
|
|
|