Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化报废和返工

# Conflicts:
#	sf_tool_management/models/base.py
This commit is contained in:
jinling.yang
2024-06-06 09:44:53 +08:00
3 changed files with 42 additions and 19 deletions

View File

@@ -1151,21 +1151,13 @@ class CNCprocessing(models.Model):
logging.info('splitext(f):%s' % os.path.splitext(f)[1])
if os.path.splitext(f)[1] == ".pdf":
full_path = os.path.join(serverdir, root, f)
logging.info('full_path:%s' % full_path)
logging.info('routing_type:%s' % cnc_processing.workorder_id.routing_type)
logging.info('cnc_worksheet:%s' % cnc_processing.workorder_id.cnc_worksheet)
# with open(full_path, 'rb') as pdf_file:
# file_content = pdf_file.read()
# cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(file_content)
if not cnc_processing.workorder_id.cnc_worksheet:
logging.info('full_path111555:%s' % full_path)
cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(
open(full_path, 'rb').read())
else:
if f in program_path:
# if cnc_processing.program_name == f.split('.')[0]:
cnc_file_path = os.path.join(serverdir, root, f)
self.write_file(cnc_file_path, cnc_processing)
cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(
open(full_path, 'rb').read())
else:
if f in program_path:
# if cnc_processing.program_name == f.split('.')[0]:
cnc_file_path = os.path.join(serverdir, root, f)
self.write_file(cnc_file_path, cnc_processing)
# 创建附件(nc文件)
def attachment_create(self, name, data):