质量检测,包装,首检表格处添加开始时间显示
This commit is contained in:
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.POIFS.Crypt.Dsig;
|
||||
using Org.BouncyCastle.Asn1.X509;
|
||||
using System.Text.Json;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
@@ -24,12 +25,14 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
public class FirstFQCController : BaseController
|
||||
{
|
||||
private readonly IFirstFQCService fQCService;
|
||||
private readonly IQcQualityStatisticsFirstService qQCQualityStatisticsFirstService;
|
||||
private readonly IHubContext<MessageHub> hubContext;
|
||||
|
||||
public FirstFQCController(IFirstFQCService fQCService, IHubContext<MessageHub> hubContext)
|
||||
public FirstFQCController(IFirstFQCService fQCService, IHubContext<MessageHub> hubContext, IQcQualityStatisticsFirstService qQCQualityStatisticsFirstService)
|
||||
{
|
||||
this.fQCService = fQCService;
|
||||
this.hubContext = hubContext;
|
||||
this.qQCQualityStatisticsFirstService = qQCQualityStatisticsFirstService;
|
||||
}
|
||||
|
||||
|
||||
@@ -311,6 +314,21 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取工单号的开始时间
|
||||
/// </summary>
|
||||
/// <param name="workOrderId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getQcQualityStatisticsFirstStartTime")]
|
||||
public IActionResult GetQcQualityStatisticsFirstStartTime(string workOrderId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workOrderId))
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "工单号传入异常!", "工单号传入异常!"));
|
||||
}
|
||||
var result = qQCQualityStatisticsFirstService.GetQcQualityStatisticsFirstStartTime(workOrderId);
|
||||
return ToResponse(new ApiResult(200, result, result));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ namespace ZR.Service.mes.qc.IService
|
||||
QcQualityStatisticsFirst AddQcQualityStatisticsFirst(QcQualityStatisticsFirst parm);
|
||||
|
||||
int UpdateQcQualityStatisticsFirst(QcQualityStatisticsFirst parm);
|
||||
/// <summary>
|
||||
/// 获取首检工单的开始时间
|
||||
/// </summary>
|
||||
/// <param name="workOrderId">工单号</param>
|
||||
/// <returns>有则返回时间字符串,无或有问题则返回空字符串</returns>
|
||||
String GetQcQualityStatisticsFirstStartTime(string workOrderId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using ZR.Service.mes.qc.IService;
|
||||
using ZR.Model.MES.qc;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model;
|
||||
using ZR.Model.MES.pro;
|
||||
|
||||
namespace ZR.Service.mes.qc
|
||||
{
|
||||
@@ -134,6 +135,25 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
}
|
||||
|
||||
public string GetQcQualityStatisticsFirstStartTime(string workOrderId)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProWorkordertimeStep proWorkordertime = Context.Queryable<ProWorkordertimeStep>()
|
||||
.Where(it=>it.WorkoderId == workOrderId)
|
||||
.First();
|
||||
if(proWorkordertime == null)
|
||||
{
|
||||
return "工单无开始时间!";
|
||||
}
|
||||
string timeStr = proWorkordertime.FirstInspectTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
return timeStr;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "工单无开始时间!";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user