修改处理
This commit is contained in:
1 parent
e255cb3ccb
commit
bd09b33337
3 files changed
+29
-14
No files matched your search
@@ -81,3 +81,4 @@ factory_sliceing/download_batch_data/utils/__pycache__/
|
|||||||
factory_sliceing/auto_sliceing_operate/utils/__pycache__/
|
factory_sliceing/auto_sliceing_operate/utils/__pycache__/
|
||||||
script/factory_sliceing/build/build_exe/
|
script/factory_sliceing/build/build_exe/
|
||||||
script/factory_sliceing_v2/build/build_exe/
|
script/factory_sliceing_v2/build/build_exe/
|
||||||
|
factory_sliceing/download_batch_data/__pycache__/
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
import os,shutil
|
import os,time,sys
|
||||||
import redis
|
|
||||||
import oss2,time,sys
|
|
||||||
import requests
|
|
||||||
import argparse,json
|
|
||||||
from .utils.funcs import requestApiToUpdateSliceStatus
|
from .utils.funcs import requestApiToUpdateSliceStatus
|
||||||
|
|
||||||
# from download_print_out import download_transform_save_by_json
|
|
||||||
from .utils.oss_redis import redisClient
|
from .utils.oss_redis import redisClient
|
||||||
from .utils.funcs import downloadJsonAndJpgFileAndMoveToCorrectDir, downloadDataByOssAndTransformSave
|
from .utils.funcs import downloadJsonAndJpgFileAndMoveToCorrectDir, downloadDataByOssAndTransformSave
|
||||||
# 默认使用脚本所在目录
|
# 默认使用脚本所在目录
|
||||||
@@ -132,13 +126,15 @@ def main(work_dir=None):
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
def testMain():
|
# def testMain():
|
||||||
global currentDir
|
# # global currentDir
|
||||||
currentDir = "/Users/dcx/code/make2/script/factory_sliceing_v2/tempData"
|
# # currentDir = "/Users/dcx/code/make2/script/factory_sliceing_v2/tempData"
|
||||||
versionId = '10153' #'10153 10158'
|
# # versionId = '10153' #'10153 10158'
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 正在处理版次ID={versionId}')
|
# # print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 正在处理版次ID={versionId}')
|
||||||
res = step1(versionId)
|
# # res = step1(versionId)
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 处理完成,res={res}')
|
# # print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 处理完成,res={res}')
|
||||||
|
|
||||||
|
# sendWechatMessage("18950403426", "测试企业微信通知")
|
||||||
|
|
||||||
# if __name__ == '__main__':
|
# if __name__ == '__main__':
|
||||||
# #testMain()
|
# #testMain()
|
||||||
|
|||||||
@@ -114,11 +114,13 @@ def requestApiToUpdateSliceStatus(versionId, downloadCounts):
|
|||||||
res = requests.post(api_url, timeout=60) # 60秒超时
|
res = requests.post(api_url, timeout=60) # 60秒超时
|
||||||
if res.status_code != 200:
|
if res.status_code != 200:
|
||||||
log(f'状态变更请求失败, res={res.text}')
|
log(f'状态变更请求失败, res={res.text}')
|
||||||
|
sendWechatMessage("18950403426", f"切片状态变更请求失败, res={res.text}")
|
||||||
return False
|
return False
|
||||||
log(f'状态变更请求成功, res={res.text}')
|
log(f'状态变更请求成功, res={res.text}')
|
||||||
#判断返回的code是否是1000
|
#判断返回的code是否是1000
|
||||||
if res.json()["code"] != 1000:
|
if res.json()["code"] != 1000:
|
||||||
log(f'状态变更请求失败, res={res.text}')
|
log(f'状态变更请求失败, res={res.text}')
|
||||||
|
sendWechatMessage("18950403426", f"切片状态变更请求失败, res={res.text}")
|
||||||
return False
|
return False
|
||||||
log(f'状态变更请求成功, res={res.text}')
|
log(f'状态变更请求成功, res={res.text}')
|
||||||
return True
|
return True
|
||||||
@@ -691,3 +693,19 @@ def findBpyModule():
|
|||||||
raise FileNotFoundError(error_msg)
|
raise FileNotFoundError(error_msg)
|
||||||
|
|
||||||
return blender_bin_path
|
return blender_bin_path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#发起企业微信通知
|
||||||
|
def sendWechatMessage(tel,content):
|
||||||
|
# 发起企业微信通知
|
||||||
|
api_url = f"https://mp.api.suwa3d.com/api/qyNotify"
|
||||||
|
data = {
|
||||||
|
"message": content,
|
||||||
|
"userId": tel
|
||||||
|
}
|
||||||
|
res = requests.post(api_url, data=json.dumps(data))
|
||||||
|
if res.status_code != 200:
|
||||||
|
log(f"发起企业微信通知失败, res={res.text}")
|
||||||
|
return False
|
||||||
|
return True
|
||||||
Reference in new issue
Block a user