Merge branch 'master' into net6.0
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using ZR.Model.System;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.System;
|
||||
using ZR.Repository;
|
||||
|
||||
namespace ZR.Service.System.IService
|
||||
@@ -10,6 +11,6 @@ namespace ZR.Service.System.IService
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public int AddTaskLog(string jobId);
|
||||
SysTasksLog AddTaskLog(string jobId, SysTasksLog tasksLog);
|
||||
Task<SysTasksLog> AddTaskLog(string jobId, SysTasksLog tasksLog);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,14 +51,15 @@ namespace ZR.Service.System
|
||||
|
||||
using (var stream = new FileStream(finalFilePath, FileMode.Create))
|
||||
{
|
||||
await formFile.CopyToAsync(stream);
|
||||
await formFile.CopyToAsync(stream);//await 不能少
|
||||
}
|
||||
string accessPath = string.Concat(OptionsSetting.Upload.UploadUrl, "/", filePath.Replace("\\", "/"), "/", fileName);
|
||||
SysFile file = new(formFile.FileName, fileName, fileExt, fileSize + "kb", filePath, accessPath, userName)
|
||||
SysFile file = new(formFile.FileName, fileName, fileExt, fileSize + "kb", filePath, userName)
|
||||
{
|
||||
StoreType = (int)Infrastructure.Enums.StoreType.LOCAL,
|
||||
FileType = formFile.ContentType,
|
||||
FileUrl = finalFilePath
|
||||
FileUrl = finalFilePath,
|
||||
AccessUrl = accessPath
|
||||
};
|
||||
file.Id = await InsertFile(file);
|
||||
return file;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model;
|
||||
using ZR.Model.System;
|
||||
using ZR.Repository;
|
||||
@@ -12,7 +13,7 @@ namespace ZR.Service.System
|
||||
/// 任务日志
|
||||
/// </summary>
|
||||
[AppService(ServiceLifetime = LifeTime.Transient, ServiceType = typeof(ISysTasksLogService))]
|
||||
public class SysTasksLogService : BaseRepository<SysTasksLog>, ISysTasksLogService
|
||||
public class SysTasksLogService : BaseService<SysTasksLog>, ISysTasksLogService
|
||||
{
|
||||
private ISysTasksQzService _tasksQzService;
|
||||
public SysTasksLogService(ISysTasksQzService tasksQzService)
|
||||
@@ -20,10 +21,10 @@ namespace ZR.Service.System
|
||||
_tasksQzService = tasksQzService;
|
||||
}
|
||||
|
||||
public SysTasksLog AddTaskLog(string jobId, SysTasksLog logModel)
|
||||
public async Task<SysTasksLog> AddTaskLog(string jobId, SysTasksLog logModel)
|
||||
{
|
||||
//获取任务信息
|
||||
var model = _tasksQzService.GetId(jobId);
|
||||
var model = await _tasksQzService.GetSingleAsync(f => f.ID == jobId);
|
||||
|
||||
if (model != null)
|
||||
{
|
||||
@@ -33,7 +34,7 @@ namespace ZR.Service.System
|
||||
logModel.CreateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
Add(logModel);
|
||||
await InsertAsync(logModel);
|
||||
return logModel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user