diff --git a/sf_base/commons/common.py b/sf_base/commons/common.py index 27b56038..30c06b6d 100644 --- a/sf_base/commons/common.py +++ b/sf_base/commons/common.py @@ -167,10 +167,10 @@ class PrintingUtils(models.AbstractModel): # 设置字体 if font_found: - c.setFont('SimSun', 14) # 增大字体大小到14pt + c.setFont('SimSun', 10) # 增大字体大小到14pt else: # 如果没有找到中文字体,使用默认字体 - c.setFont('Helvetica', 14) + c.setFont('Helvetica', 10) logging.warning("未找到中文字体,将使用默认字体") # 在右下角绘制二维码,预留边距 @@ -182,7 +182,7 @@ class PrintingUtils(models.AbstractModel): if buttom_text: # 在二维码下方绘制文字 text = buttom_text - text_width = c.stringWidth(text, "SimSun" if font_found else "Helvetica", 14) # 准确计算文字宽度 + text_width = c.stringWidth(text, "SimSun" if font_found else "Helvetica", 10) # 准确计算文字宽度 text_x = page_width - qr_size - margin + (qr_size - text_width) / 2 # 文字居中对齐 text_y = margin + 20 # 文字位置靠近底部 c.drawString(text_x, text_y, text) diff --git a/sf_machine_connect/controllers/controllers.py b/sf_machine_connect/controllers/controllers.py index 692fa10b..cefa4ba8 100644 --- a/sf_machine_connect/controllers/controllers.py +++ b/sf_machine_connect/controllers/controllers.py @@ -1360,9 +1360,9 @@ class Sf_Dashboard_Connect(http.Controller): if result[0]: if float(result[0]) >= 28800: continue - alarm_last_24_time = float(result[0]) + alarm_last_24_time += float(result[0]) else: - alarm_last_24_time = 0.0 + alarm_last_24_time += 0.0 alarm_all_nums = [] with conn.cursor() as cur: diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index c30d3d53..a5d8d7c7 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -95,7 +95,7 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): logging.info('panel_file_path:%s' % panel_file_path) # 向编程单中添加二维码 - request.env['printing.utils'].add_qr_code_to_pdf(panel_file_path, model_id, "扫码获取工单") + request.env['printing.utils'].add_qr_code_to_pdf(panel_file_path, model_id, "模型ID:%s" % model_id) cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())}) pre_workorder = productions.workorder_ids.filtered( lambda ap: ap.routing_type in ['装夹预调', '人工线下加工'] and ap.state not in ['done', 'rework'