Commit e0e684b3 by 夏超

[fix] 大东联推送

parent dcf1adeb
...@@ -64,7 +64,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -64,7 +64,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
if v.id in insert_id: if v.id in insert_id:
continue continue
insert_sql_data.append(f""" insert_sql_data.append(f"""
({_uuid}, '{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}', ('{_uuid}', '{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}',
'{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}', '{em.code or ""}', '{em.name or ""}') '{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}', '{em.code or ""}', '{em.name or ""}')
""") """)
sql = """ sql = """
...@@ -75,11 +75,10 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -75,11 +75,10 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
return super(InheritRokeResultPutWarehouseWizard, self).default_get(field_names) return super(InheritRokeResultPutWarehouseWizard, self).default_get(field_names)
sql += " , ".join(insert_sql_data) sql += " , ".join(insert_sql_data)
try: try:
_logger.info(f"数据SQL{sql}")
cur.execute(sql) cur.execute(sql)
conn.commit() conn.commit()
# cur.execute(f"EXEC sp_pp_kcrkdj @psUUID='{_uuid}'") cur.execute(f"EXEC sp_pp_kcrkdj @psUUID='{_uuid}'")
# conn.commit() conn.commit()
except Exception as e: except Exception as e:
_logger.info("数据上传失败") _logger.info("数据上传失败")
raise ValidationError("数据上传失败") raise ValidationError("数据上传失败")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment