增加状态返回接口,增加调用京东接口

This commit is contained in:
mgw
2023-02-09 08:50:48 +08:00
parent cba007b374
commit 38f67d98f8
6 changed files with 174 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import base64
import logging
import os
import json
import hashlib
import time
@@ -261,6 +261,17 @@ class WorkCenterBarcode(models.Model):
此函数用于将NC代码全部下发到机床
:return:
"""
try:
filepath = '/nc2machine'
del_list = os.listdir(filepath)
_logger.info("=====================================", del_list)
for f in del_list:
file_path = os.path.join(filepath, f)
if os.path.isfile(file_path):
os.remove(file_path)
except Exception as e:
_logger.info("=====================================", e)
raise UserError('程序删除失败,请重试')
# host="192.168.2.158", port=8080, username="MITSUBISHI", password="CNC"
host = self.workcenter_id.machine_tool_id.ftp_host
port = self.workcenter_id.machine_tool_id.ftp_port