refactor(工单日志): 修改工单日志接口返回类型并优化实现
将WorkOrderLog方法的返回类型从int改为List<ProWorkorderUpdateLog>,并实现查询工单变更日志功能
This commit is contained in:
@@ -348,13 +348,13 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
|
||||
//TODO 工单变更日志
|
||||
[HttpGet("workorder_log")]
|
||||
public IActionResult WorkOrderLog(string workorder, string log)
|
||||
public IActionResult WorkOrderLog(string workorder)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workorder))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _ProWorkorderService.WorkOrderLog(workorder, log, HttpContext.GetName());
|
||||
var response = _ProWorkorderService.WorkOrderLog(workorder);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace DOAN.Service.MES.product.IService
|
||||
|
||||
List<WorkOrderBom> SearchBOMNum(string workorder_num);
|
||||
|
||||
int WorkOrderLog(string workorder, string log, string Operator);
|
||||
List<ProWorkorderUpdateLog> WorkOrderLog(string workorder);
|
||||
|
||||
Task<(string, Stream)> ExportPDFByQuestPDFDemo(string[] workorderArray);
|
||||
Task<CustomException> PrintTicketsByTemplate(ProWorkorderExportDto param);
|
||||
|
||||
@@ -34,13 +34,13 @@ namespace DOAN.Service.MES.product.IService
|
||||
List<WorkOrderBom> SearchBOMNum(string workorder_num);
|
||||
|
||||
/// <summary>
|
||||
/// 工单日志
|
||||
/// 工单变更日志
|
||||
/// </summary>
|
||||
/// <param name="workorder"></param>
|
||||
/// <param name="log"></param>
|
||||
/// <param name="Operator"></param>
|
||||
/// <returns></returns>
|
||||
int WorkOrderLog(string workorder, string log, string Operator);
|
||||
List<ProWorkorderUpdateLog> WorkOrderLog(string workorder);
|
||||
|
||||
/// <summary>
|
||||
/// 导出PDF
|
||||
|
||||
@@ -222,9 +222,9 @@ namespace DOAN.Service.MES.product
|
||||
/// <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 _utilityService.WorkOrderLog(workorder, log, Operator);
|
||||
return _utilityService.WorkOrderLog(workorder);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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