From fb5a0683e980b6222f49bc2cfd812317cb24d7c4 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 22 Oct 2023 16:38:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9D=90=E6=A0=87=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E8=B5=B0?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=BB=BA=E6=A8=A1=E7=B3=BB=E7=BB=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E7=9A=84=E8=AF=9D=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E6=98=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/libs_db.py | 18 +++++++++++++++++- tools/gen_xmps.py | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) 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)')