任务增加日志记录与查询功能

usertest
嵇文龙 4 months ago
parent 9f115f2bda
commit 89a3997c06

@ -0,0 +1,105 @@
using System.ComponentModel;
using System.Runtime.Serialization;
using DS.Module.Core;
using SqlSugar;
namespace DS.WMS.Core.Op.Entity.TaskInteraction
{
/// <summary>
/// 业务任务日志表
/// </summary>
[SugarTable("business_task_log", "业务任务日志表")]
public class BusinessTaskLog
{
/// <summary>
/// ID
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true), IgnoreDataMember]
public long Id { get; set; }
/// <summary>
/// 动作类型
/// </summary>
[SugarColumn(ColumnDescription = "动作类型", IsNullable = false)]
public ActionType? ActionType { get; set; }
/// <summary>
/// 业务ID
/// </summary>
[SugarColumn(ColumnDescription = "业务ID", IsNullable = false)]
public long BusinessId { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[SugarColumn(ColumnDescription = "业务类型", IsNullable = false)]
public BusinessType BusinessType { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[SugarColumn(ColumnDescription = "任务类型", IsNullable = false)]
public TaskBaseTypeEnum TaskType { get; set; }
/// <summary>
/// 任务状态
/// </summary>
[SugarColumn(ColumnDescription = "任务状态", IsNullable = true)]
public TaskStatusEnum? TaskStatus { get; set; }
/// <summary>
/// 审核状态
/// </summary>
[SugarColumn(ColumnDescription = "审核状态", IsNullable = true)]
public FlowStatusEnum? AuditStatus { get; set; }
/// <summary>
/// 接收人
/// </summary>
[SugarColumn(ColumnDescription = "接收人", IsNullable = true)]
public string? RecvUsers { get; set; }
/// <summary>
/// 获取接收人列表
/// </summary>
[SugarColumn(IsIgnore = true)]
public long[] RecvUserIdArray => RecvUsers == null ? [] :
RecvUsers.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", IsNullable = true, ColumnDataType = "text")]
public string? Remark { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnDescription = "创建人", IsNullable = false)]
public long CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDescription = "创建时间", IsNullable = false)]
public DateTime CreateTime { get; set; }
}
/// <summary>
/// 动作类型
/// </summary>
public enum ActionType
{
/// <summary>
/// 新增
/// </summary>
[Description("新增")]
Create = 1,
/// <summary>
/// 状态变更
/// </summary>
[Description("状态变更")]
StatusChanged = 2
}
}

@ -0,0 +1,44 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
namespace DS.WMS.Core.Op.Interface.TaskInteraction
{
/// <summary>
/// 海运出口交互任务
/// </summary>
public interface ITaskLogService
{
/// <summary>
/// 读取业务日志
/// </summary>
/// <param name="id">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <returns></returns>
Task<DataResult<List<BusinessTaskLog>>> ReadLogAsync(long id, BusinessType businessType);
/// <summary>
/// 写入任务日志
/// </summary>
/// <param name="request"></param>
/// <param name="remark">备注</param>
/// <returns></returns>
Task WriteLogAsync(TaskUpdateRequest request, string? remark = null);
/// <summary>
/// 写入任务日志
/// </summary>
/// <param name="task"></param>
/// <param name="remark">备注</param>
/// <returns></returns>
Task WriteLogAsync(BusinessTask task, string? remark = null);
/// <summary>
/// 写入任务日志
/// </summary>
/// <param name="logs"></param>
/// <returns></returns>
Task WriteLogAsync(params BusinessTaskLog[] logs);
}
}

@ -44,6 +44,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
string tenatName = Db.Queryable<SysTenant>().Where(x => x.Id == tenatId).Select(x => x.Name).First();
var dt = DateTime.Now;
var taskList = new List<BusinessTask>();
var taskLogList = new List<BusinessTaskLog>();
var first = request.First();
var defaultUsers = await GetRecvUsers(first.RecvUserIdList);
@ -104,9 +105,20 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
CreateTime = dt
};
taskList.Add(task);
taskLogList.Add(new BusinessTaskLog
{
BusinessId = task.BusinessId,
BusinessType = task.BusinessType,
CreateBy = long.Parse(User.UserId),
CreateTime = DateTime.Now,
RecvUsers = info.Main.RecvUserInfoList == null ? null : string.Join(",", info.Main.RecvUserInfoList.Select(x => x.RecvUserName)),
TaskStatus = task.TaskStatus,
TaskType = task.TaskType
});
}
await TenantDb.Insertable(taskList).ExecuteCommandAsync();
await TenantDb.Insertable(taskLogList).ExecuteCommandAsync();
}
/// <summary>

@ -0,0 +1,111 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.Sys.Entity;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
/// <summary>
/// 任务日志服务
/// </summary>
public class TaskLogService : ServiceBase, ITaskLogService
{
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public TaskLogService(IServiceProvider provider) : base(provider)
{
}
/// <summary>
/// 读取业务日志
/// </summary>
/// <param name="id">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <returns></returns>
public async Task<DataResult<List<BusinessTaskLog>>> ReadLogAsync(long id, BusinessType businessType)
{
var list = await TenantDb.Queryable<BusinessTaskLog>().Where(x => x.BusinessId == id && x.BusinessType == businessType)
.OrderBy(x => x.CreateTime).ToListAsync();
var result = DataResult<List<BusinessTaskLog>>.Success(list);
result.Count = list.Count;
return result;
}
/// <summary>
/// 写入任务日志
/// </summary>
/// <param name="request"></param>
/// <param name="remark">备注</param>
/// <returns></returns>
public async Task WriteLogAsync(TaskUpdateRequest request, string? remark = null)
{
long userId = long.Parse(User.UserId);
string userName = await Db.Queryable<SysUser>().Where(x => x.Id == userId).Select(
x => x.UserName).FirstAsync();
BusinessTaskLog taskLog = new BusinessTaskLog
{
ActionType = ActionType.StatusChanged,
BusinessId = request.BusinessId,
BusinessType = request.BusinessType,
CreateBy = long.Parse(User.UserId),
CreateTime = DateTime.Now,
TaskStatus = request.TaskStatus,
TaskType = request.TaskType,
Remark = remark,
RecvUsers = userName
};
await WriteLogAsync(taskLog);
}
/// <summary>
/// 写入任务日志
/// </summary>
/// <param name="task"></param>
/// <param name="remark">备注</param>
/// <returns></returns>
public async Task WriteLogAsync(BusinessTask task, string? remark = null)
{
string userNames = string.Empty;
if (task.RecvUserIdArray?.Length > 0)
{
var list = await Db.Queryable<SysUser>().Where(x => task.RecvUserIdArray.Contains(x.Id)).Select(
x => x.UserName).ToListAsync();
userNames = string.Join(",", list);
}
BusinessTaskLog taskLog = new BusinessTaskLog
{
ActionType = ActionType.Create,
BusinessId = task.BusinessId,
BusinessType = task.BusinessType,
CreateBy = long.Parse(User.UserId),
CreateTime = DateTime.Now,
RecvUsers = userNames,
TaskStatus = task.TaskStatus,
TaskType = task.TaskType,
Remark = remark
};
await WriteLogAsync(taskLog);
}
/// <summary>
/// 写入任务日志
/// </summary>
/// <param name="logs">任务日志</param>
/// <exception cref="ArgumentNullException"><paramref name="logs"/>为null</exception>
/// <returns></returns>
public async Task WriteLogAsync(params BusinessTaskLog[] logs)
{
ArgumentNullException.ThrowIfNull(logs, nameof(logs));
await TenantDb.Insertable(logs).ExecuteCommandAsync();
}
}
}

@ -16,7 +16,6 @@ using DS.WMS.Core.TaskPlat.Interface;
using Masuit.Tools;
using Masuit.Tools.Systems;
using Microsoft.Extensions.DependencyInjection;
using Org.BouncyCastle.Crypto;
using SqlSugar;
namespace DS.WMS.Core.Op.Method.TaskInteraction
@ -33,6 +32,11 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
/// </summary>
protected ITaskManageService ManagerService { get; private set; }
/// <summary>
/// 日志服务
/// </summary>
protected ITaskLogService LogService { get; private set; }
/// <summary>
/// 工作流服务
/// </summary>
@ -45,6 +49,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public TaskService(IServiceProvider provider) : base(provider)
{
ManagerService = provider.GetRequiredService<ITaskManageService>();
LogService = provider.GetRequiredService<ITaskLogService>();
FlowService = new Lazy<IClientFlowInstanceService>(provider.GetRequiredService<IClientFlowInstanceService>());
}
@ -117,15 +122,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
await TenantDb.Ado.BeginTranAsync();
try
{
//重置任务为待处理
var result = await SetTaskStatusAsync(new TaskUpdateRequest
var req = new TaskUpdateRequest
{
AutoCreateNext = false,
BusinessId = request.BusinessId,
BusinessType = request.BusinessType,
TaskStatus = TaskStatusEnum.Create,
TaskTypeName = TaskBaseTypeEnum.WAIT_ORDER_AUDIT.ToString()
}, false);
};
//重置任务为待处理
var result = await SetTaskStatusAsync(req, false);
if (!result.Succeeded)
return DataResult.Failed(result.Message, result.MultiCode);
@ -138,6 +144,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
.Where(x => x.BusinessId == request.BusinessId && x.BusinessType == request.BusinessType && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
.ExecuteCommandAsync();
//记录日志
await LogService.WriteLogAsync(req, "重新审批");
await TenantDb.Ado.CommitTranAsync();
return result2;
}
@ -309,6 +317,9 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
if (!result.Succeeded)
return result;
//记录日志
await LogService.WriteLogAsync(task);
if (useTransaction)
await TenantDb.Ado.CommitTranAsync();
@ -436,6 +447,9 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
}
//记录日志
await LogService.WriteLogAsync(request);
if (useTransaction)
await TenantDb.Ado.CommitTranAsync();
@ -473,14 +487,28 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
long userId = long.Parse(User.UserId);
var users = await GetRecvUsers(userId);
var dt = DateTime.Now;
await ManagerService.SetTaskUserStatus(
callback.BusinessId,
TaskBaseTypeEnum.WAIT_ORDER_AUDIT,
TaskStatusEnum.Complete,
//callback.Status == FlowStatusEnum.Approve ? TaskStatusEnum.Complete : TaskStatusEnum.Pending
DateTime.Now,
dt,
users);
//记录日志
await LogService.WriteLogAsync(new BusinessTaskLog
{
AuditStatus = callback.Status,
BusinessId = callback.BusinessId,
BusinessType = callback.BusinessType.Value,
CreateBy = userId,
CreateTime = dt,
TaskStatus = TaskStatusEnum.Complete,
TaskType = TaskBaseTypeEnum.WAIT_ORDER_AUDIT,
RecvUsers = users.Count > 0 ? users[0].RecvUserName : null
});
}
/// <summary>
@ -493,14 +521,31 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
{
ArgumentNullException.ThrowIfNull(callback, nameof(callback));
//根据审批结果更新任务状态
await SetTaskStatusAsync(new TaskUpdateRequest
var req = new TaskUpdateRequest
{
BusinessId = callback.BusinessId,
BusinessType = callback.BusinessType.Value,
TaskTypeName = TaskBaseTypeEnum.WAIT_ORDER_AUDIT.ToString(),
TaskStatus = callback.FlowStatus == FlowStatusEnum.Approve ? TaskStatusEnum.Complete : TaskStatusEnum.Pending,
AutoCreateNext = false //审批完成后需根据业务需要自定义任务类型,因此设置为不自动创建下一任务
};
//根据审批结果更新任务状态
await SetTaskStatusAsync(req);
long userId = long.Parse(User.UserId);
var users = await GetRecvUsers(userId);
//记录日志
await LogService.WriteLogAsync(new BusinessTaskLog
{
AuditStatus = callback.FlowStatus,
BusinessId = callback.BusinessId,
BusinessType = callback.BusinessType.Value,
CreateBy = userId,
CreateTime = DateTime.Now,
TaskStatus = req.TaskStatus,
TaskType = req.TaskType,
RecvUsers = users.Count > 0 ? users[0].RecvUserName : null,
Remark = "终审完成"
});
if (callback.FlowStatus == FlowStatusEnum.Reject)

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-07-24T08:45:58.2272340Z||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<History>True|2024-08-05T03:37:07.3133020Z||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -4,6 +4,7 @@ using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Microsoft.AspNetCore.Mvc;
@ -32,11 +33,24 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="businessType">业务类型</param>
/// <returns></returns>
[HttpGet, Route("GetList")]
public async Task<DataResult<List<BusinessTaskDto>>> GetListAsync([FromQuery]long businessId, [FromQuery] BusinessType businessType)
public async Task<DataResult<List<BusinessTaskDto>>> GetListAsync([FromQuery] long businessId, [FromQuery] BusinessType businessType)
{
return await taskService.GetTasks(businessId, businessType);
}
/// <summary>
/// 获取指定业务的任务日志
/// </summary>
/// <param name="logService"></param>
/// <param name="businessId">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <returns></returns>
[HttpGet, Route("GetLogs")]
public async Task<DataResult<List<BusinessTaskLog>>> GetLogsAsync([FromServices] ITaskLogService logService, [FromQuery] long businessId, [FromQuery] BusinessType businessType)
{
return await logService.ReadLogAsync(businessId, businessType);
}
/// <summary>
/// 创建关联任务
/// </summary>
@ -71,7 +85,7 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("SubmitAudit")]
public async Task<DataResult> SubmitAuditAsync(TaskRequest request)
public async Task<DataResult> SubmitAuditAsync(TaskRequest request)
{
return await taskService.SubmitAuditAsync(request);
}

Loading…
Cancel
Save