refactor(工单日志): 修改工单日志接口返回类型并优化实现
将WorkOrderLog方法的返回类型从int改为List<ProWorkorderUpdateLog>,并实现查询工单变更日志功能
This commit is contained in:
@@ -9,7 +9,10 @@ namespace DOAN.Service.MES.product
|
||||
/// <summary>
|
||||
/// 工单工具服务
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProWorkorderUtilityService), ServiceLifetime = LifeTime.Transient)]
|
||||
[AppService(
|
||||
ServiceType = typeof(IProWorkorderUtilityService),
|
||||
ServiceLifetime = LifeTime.Transient
|
||||
)]
|
||||
public class ProWorkorderUtilityService : BaseService<ProWorkorder>, IProWorkorderUtilityService
|
||||
{
|
||||
/// <summary>
|
||||
@@ -109,17 +112,20 @@ namespace DOAN.Service.MES.product
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单日志
|
||||
/// 工单变更日志
|
||||
/// </summary>
|
||||
/// <param name="workorder"></param>
|
||||
/// <param name="log"></param>
|
||||
/// <param name="Operator"></param>
|
||||
/// <returns></returns>
|
||||
public int WorkOrderLog(string workorder, string log, string Operator)
|
||||
public List<ProWorkorderUpdateLog> WorkOrderLog(string workorder)
|
||||
{
|
||||
// 这里需要实现工单日志记录逻辑
|
||||
// 暂时返回成功
|
||||
return 1;
|
||||
var result = Context
|
||||
.Queryable<ProWorkorderUpdateLog>()
|
||||
.Where(it => it.Workorder == workorder)
|
||||
.OrderByDescending(it => it.ChangeTime)
|
||||
.ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user