refactor(工单日志): 修改工单日志接口返回类型并优化实现
将WorkOrderLog方法的返回类型从int改为List<ProWorkorderUpdateLog>,并实现查询工单变更日志功能
This commit is contained in:
@@ -348,13 +348,13 @@ namespace DOAN.Admin.WebApi.Controllers
|
|||||||
|
|
||||||
//TODO 工单变更日志
|
//TODO 工单变更日志
|
||||||
[HttpGet("workorder_log")]
|
[HttpGet("workorder_log")]
|
||||||
public IActionResult WorkOrderLog(string workorder, string log)
|
public IActionResult WorkOrderLog(string workorder)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(workorder))
|
if (string.IsNullOrEmpty(workorder))
|
||||||
{
|
{
|
||||||
return SUCCESS(null);
|
return SUCCESS(null);
|
||||||
}
|
}
|
||||||
var response = _ProWorkorderService.WorkOrderLog(workorder, log, HttpContext.GetName());
|
var response = _ProWorkorderService.WorkOrderLog(workorder);
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace DOAN.Service.MES.product.IService
|
|||||||
|
|
||||||
List<WorkOrderBom> SearchBOMNum(string workorder_num);
|
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<(string, Stream)> ExportPDFByQuestPDFDemo(string[] workorderArray);
|
||||||
Task<CustomException> PrintTicketsByTemplate(ProWorkorderExportDto param);
|
Task<CustomException> PrintTicketsByTemplate(ProWorkorderExportDto param);
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ namespace DOAN.Service.MES.product.IService
|
|||||||
List<WorkOrderBom> SearchBOMNum(string workorder_num);
|
List<WorkOrderBom> SearchBOMNum(string workorder_num);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工单日志
|
/// 工单变更日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="workorder"></param>
|
/// <param name="workorder"></param>
|
||||||
/// <param name="log"></param>
|
/// <param name="log"></param>
|
||||||
/// <param name="Operator"></param>
|
/// <param name="Operator"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
int WorkOrderLog(string workorder, string log, string Operator);
|
List<ProWorkorderUpdateLog> WorkOrderLog(string workorder);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导出PDF
|
/// 导出PDF
|
||||||
|
|||||||
@@ -222,9 +222,9 @@ namespace DOAN.Service.MES.product
|
|||||||
/// <param name="log"></param>
|
/// <param name="log"></param>
|
||||||
/// <param name="Operator"></param>
|
/// <param name="Operator"></param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// <summary>
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ namespace DOAN.Service.MES.product
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工单工具服务
|
/// 工单工具服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AppService(ServiceType = typeof(IProWorkorderUtilityService), ServiceLifetime = LifeTime.Transient)]
|
[AppService(
|
||||||
|
ServiceType = typeof(IProWorkorderUtilityService),
|
||||||
|
ServiceLifetime = LifeTime.Transient
|
||||||
|
)]
|
||||||
public class ProWorkorderUtilityService : BaseService<ProWorkorder>, IProWorkorderUtilityService
|
public class ProWorkorderUtilityService : BaseService<ProWorkorder>, IProWorkorderUtilityService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -109,17 +112,20 @@ namespace DOAN.Service.MES.product
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工单日志
|
/// 工单变更日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="workorder"></param>
|
/// <param name="workorder"></param>
|
||||||
/// <param name="log"></param>
|
/// <param name="log"></param>
|
||||||
/// <param name="Operator"></param>
|
/// <param name="Operator"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int WorkOrderLog(string workorder, string log, string Operator)
|
public List<ProWorkorderUpdateLog> WorkOrderLog(string workorder)
|
||||||
{
|
{
|
||||||
// 这里需要实现工单日志记录逻辑
|
var result = Context
|
||||||
// 暂时返回成功
|
.Queryable<ProWorkorderUpdateLog>()
|
||||||
return 1;
|
.Where(it => it.Workorder == workorder)
|
||||||
|
.OrderByDescending(it => it.ChangeTime)
|
||||||
|
.ToList();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user