Accept Merge Request #2015: (feature/6694 -> develop)

Merge Request: 增加打印模块,增加工单下发后打印程序单

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2015?initial=true
This commit is contained in:
胡尧
2025-04-18 16:07:01 +08:00
committed by Coding
3 changed files with 23 additions and 108 deletions

View File

@@ -132,9 +132,9 @@ class FtpController:
def transfer_nc_files(source_ftp_info, target_ftp_info, source_dir, target_dir, keep_dir=False):
def transfer_nc_files(source_ftp_info, target_ftp_info, source_dir, target_dir, end_with='.nc', keep_dir=False):
"""
从源FTP服务器下载所有.nc文件并上传到目标FTP服务器,保持目录结构
从源FTP服务器下载所有{end_with}结尾的文件并上传到目标FTP服务器,保持目录结构
Args:
source_ftp_info: dict, 源FTP连接信息 {host, port, username, password}
@@ -184,7 +184,7 @@ def transfer_nc_files(source_ftp_info, target_ftp_info, source_dir, target_dir,
source_ftp.ftp.cwd('..')
except:
# 如果是.nc文件则传输
if item.lower().endswith('.nc'):
if item.lower().endswith(end_with):
# 下载到临时文件
temp_path = f"/tmp/{item}"
with open(temp_path, 'wb') as f: