|
@@ -2454,6 +2454,7 @@ namespace MainForm
|
|
|
string staion_id = xiaomiParm.stationCode;
|
|
|
string bucket =
|
|
|
$"{file_category}/{file_type}/{project}/{product_mode}/{run_mode}/{pass_result}/{device_code}/{sn}/{staion_id}";
|
|
|
+ // 获取所有图片文件
|
|
|
|
|
|
if (guid == "")
|
|
|
{
|
|
@@ -2463,17 +2464,27 @@ namespace MainForm
|
|
|
{
|
|
|
if (GlobalContext.MESIsSendUpFile)
|
|
|
{
|
|
|
+ List<string> imageFiles = GetAllImageFiles(path);
|
|
|
+
|
|
|
string toPath = GlobalContext.MqttFileBackupLogDir;
|
|
|
- string toFileName = $"[{xiaomiParm.workstation}]_{file_type}_{sn}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.zip";
|
|
|
+ filename = $"{xiaomiParm.workstation}_{file_type}_{sn}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.zip";
|
|
|
//string directoryPath = Path.GetDirectoryName(path);
|
|
|
- string strFilePath = toPath+ "\\"+ toFileName;
|
|
|
- var r=CompressFolder(path, strFilePath);
|
|
|
- if (r.Item1 == 0)
|
|
|
+ string strFilePath = toPath+ "\\"+ filename;
|
|
|
+
|
|
|
+ if (imageFiles.Count > 0)
|
|
|
{
|
|
|
- return (0, r.Item2);
|
|
|
+ var r = CompressFolder(path, strFilePath);
|
|
|
+ if (r.Item1 == 0)
|
|
|
+ {
|
|
|
+ return (0, r.Item2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ msg = r.Item2 + "\r\n";
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
- msg = r.Item2+"\r\n";
|
|
|
+ else {
|
|
|
+ return (0, "文件不存在!");
|
|
|
}
|
|
|
|
|
|
FileUpload_X5 fileUpload_X5 = new FileUpload_X5();
|
|
@@ -2515,8 +2526,7 @@ namespace MainForm
|
|
|
msg = msg + fileresult.Item2 + "\r\n";
|
|
|
}
|
|
|
|
|
|
- // 获取所有图片文件
|
|
|
- List<string> imageFiles = GetAllImageFiles(path);
|
|
|
+
|
|
|
foreach (var imageFile in imageFiles) {
|
|
|
if (File.Exists(imageFile))
|
|
|
{
|
|
@@ -2533,7 +2543,7 @@ namespace MainForm
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
- return (1,
|
|
|
+ return (0,
|
|
|
filename + $"文件上传错误!载具码:{BarcodeSet.strCarrierBarcode}产品码{BarcodeSet.strProductBarcode},错误原因:" +
|
|
|
e.Message);
|
|
|
}
|
|
@@ -5217,11 +5227,10 @@ namespace MainForm
|
|
|
stopwatch2.Start();
|
|
|
|
|
|
//测试数据
|
|
|
- // stPLC_MesData.mesCommFrmPLC.cmd = 1;
|
|
|
- // stPLC_MesData.BarcodeSet.strCarrierBarcode = "A123456";
|
|
|
- // stPLC_MesData.BarcodeSet.strPCBBarcode = "123456";
|
|
|
- // stPLC_MesData.iotData.BeatAction = 1;
|
|
|
- // stPLC_MesData.iotData.BeatAction = 2;
|
|
|
+ stPLC_MesData.mesCommFrmPLC.cmd = 2;
|
|
|
+ stPLC_MesData.BarcodeSet.strCarrierBarcode = "A123456";
|
|
|
+ stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
|
+ stPLC_MesData.iotData.BeatAction = 1;
|
|
|
|
|
|
#region 一次性读取所有数据
|
|
|
|