Accept Merge Request #870: (feature/修复质检接口 -> develop)

Merge Request: 修复质检接口

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/870?initial=true
This commit is contained in:
杨金灵
2024-02-28 16:47:00 +08:00
committed by Coding

View File

@@ -631,9 +631,9 @@ class ResMrpWorkOrder(models.Model):
# 将FTP的检测报告文件下载到临时目录 # 将FTP的检测报告文件下载到临时目录
def download_reportfile_tmp(self, workorder, reportpath): def download_reportfile_tmp(self, workorder, reportpath):
logging.info('reportpath:%s' % reportpath) logging.info('reportpath:%s' % reportpath)
production_no = workorder.production_id.name.replace('/', '_') production_no = reportpath.split('/')
# ftp地址 # ftp地址
remotepath = os.path.join('/', production_no, 'detection') remotepath = os.path.join('/', production_no[1], 'detection')
logging.info('ftp地址:%s' % remotepath) logging.info('ftp地址:%s' % remotepath)
if remotepath in reportpath: if remotepath in reportpath:
# 服务器内临时地址 # 服务器内临时地址
@@ -664,6 +664,7 @@ class CNCprocessing(models.Model):
_name = 'sf.cnc.processing' _name = 'sf.cnc.processing'
_description = "CNC加工" _description = "CNC加工"
_rec_name = 'program_name' _rec_name = 'program_name'
_order = 'sequence_number,id'
cnc_id = fields.Many2one('ir.attachment') cnc_id = fields.Many2one('ir.attachment')
sequence_number = fields.Char('序号') sequence_number = fields.Char('序号')
@@ -718,15 +719,11 @@ class CNCprocessing(models.Model):
# 根据程序名和加工面匹配到ftp里对应的Nc程序名 # 根据程序名和加工面匹配到ftp里对应的Nc程序名
def get_cnc_processing_file(self, serverdir, cnc_processing, program_path): def get_cnc_processing_file(self, serverdir, cnc_processing, program_path):
# logging.info('program_path_tmp:%s' % program_path_tmp)
# serverdir = os.path.join('/tmp', folder_name, 'return', processing_panel)
logging.info('serverdir:%s' % serverdir) logging.info('serverdir:%s' % serverdir)
for root, dirs, files in os.walk(serverdir): for root, dirs, files in os.walk(serverdir):
for f in files: for f in files:
logging.info('f:%s' % f)
if os.path.splitext(f)[1] == ".pdf": if os.path.splitext(f)[1] == ".pdf":
full_path = os.path.join(serverdir, root, f) full_path = os.path.join(serverdir, root, f)
logging.info('pdf:%s' % full_path)
if full_path is not False: if full_path is not False:
if not cnc_processing.workorder_id.cnc_worksheet: if not cnc_processing.workorder_id.cnc_worksheet:
cnc_processing.workorder_id.cnc_worksheet = base64.b64encode( cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(