Commit be462c93 by Neo Turing

功能优化

parent 5aade965
......@@ -11,7 +11,7 @@ namespace Kivii.Sample.ImageUploader
public const string TableUiSetting = "ui_settings";
public const string RouteFilesUploadAndDownload = "/Storages";
public const string RouteFilesUploadAndDownload = "/Storages.json";
public const string RouteReportRequest = "/Restful/Kivii.Lims.Entities.Report/Query";
}
}
......@@ -392,7 +392,13 @@ namespace Kivii.Sample.ImageUploader
}
else
{
currentReport = resp.Results[0];
if (resp.Results[0].Status != 100)
{
MessageBox.Show($"此编号{tbxReportId.Text}不在受理状态");
tbxReportId.Text = "";
currentReport = null;
}
else currentReport = resp.Results[0];
}
}
else
......@@ -600,8 +606,12 @@ namespace Kivii.Sample.ImageUploader
photo.Image.Save(filename);
if (!File.Exists(filename)) continue;
var request = new FileRequest();
request.OwnerKvid = currentReport.Kvid;
request.OwnerKvid = currentReport.SampleKvid;
request.FolderPath = "/Samples/Images";
request.FolderType = "Jst.Lims.Entities.Sample";
request.Tags = "底页图片";
try
{
var response = _client.PostFileWithRequest<FileResponse>(new FileInfo(filename), request);
if (response.Results != null && response.Results.Count >= 1)
{
......@@ -618,6 +628,13 @@ namespace Kivii.Sample.ImageUploader
}
}
}
catch (Exception ex)
{
var msg = ex.GetResponseStatus().Message;
MessageBox.Show($"当前文件{photo.Name}上传失败,将跳过此文件继续上传剩余文件。{msg}");
continue;
}
}
}
}
......
......@@ -21,12 +21,13 @@ namespace Kivii.Sample.ImageUploader
public class FileRequestBase
{
public bool Override { get; set; }
public string Description { get; set; }
//public bool Override { get; set; }
//public string Description { get; set; }
public Guid OwnerKvid { get; set; }
public string OwnerName { get; set; }
public string Name { get; set; }
//public string OwnerName { get; set; }
//public string Name { get; set; }
public string FolderPath { get; set; }
public string FolderType { get; set; }
public string Tags { get; set; }
}
......
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