diff --git a/libs/libs_db.py b/libs/libs_db.py index cc9b1b5..59572c7 100644 --- a/libs/libs_db.py +++ b/libs/libs_db.py @@ -116,4 +116,20 @@ def is_new_make_psid(psid): except Exception as e: print(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行is_new_make_psid()异常: {str(e)}") return "error" - \ No newline at end of file + +#判断影棚是否走的新的建模系统,不是的话修改成走新的建模系统 +def change_to_new_make_psid(psid): + try: + with pymysqlAlias() as conn: + cursor = conn.cursor() + sql = f'select count(*) from new_make_psid where studio_id = {psid}' + cursor.execute(sql) + result = cursor.fetchone() + if result[0] == 0: + sql = f'insert into new_make_psid (studio_id,createTime) values ({psid},now())' + cursor.execute(sql) + conn.commit() + print(f'修改影棚{psid}为走新的建模系统') + except Exception as e: + print(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行change_to_new_make_psid()异常: {str(e)}") + return "error" \ No newline at end of file diff --git a/tools/gen_xmps.py b/tools/gen_xmps.py index 8848b7e..3e598b0 100644 --- a/tools/gen_xmps.py +++ b/tools/gen_xmps.py @@ -92,6 +92,8 @@ def main(pid, lock=False): upload_or_not = input('是否上传oss?(y/n)') if upload_or_not == 'y': upload_xmp(pid) + #上传坐标的话要判断该影棚是否走新的建模系统,如果不是走新的建模系统,就要更新为走新的建模系统 + libs_db.change_to_new_make_psid(psid): print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} xmp文件上传完成,共费时{libs.diff_time(start_time)}') delete_or_not = input('是否删除本地文件?(y/n)')