From 5916e609703014b708285b56f580a386409e2136 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Wed, 18 Dec 2024 18:30:38 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20=20=20=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C=E5=88=97=E8=A1=A8=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=E9=99=84=E5=8A=A0=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=98=AF=E6=A3=80=E6=9F=A5=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E4=BF=9D=E5=85=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MES/Device/DeviceTaskExecuteController.cs | 3 +++ DOAN.Model/MES/Device/Dto/DeviceTaskExecuteDto.cs | 5 +++++ .../MES/Device/DeviceTaskExecuteService.cs | 15 +++++++++++++++ .../Device/IService/IDeviceTaskExecuteService.cs | 2 +- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/DOAN.Admin.WebApi/Controllers/MES/Device/DeviceTaskExecuteController.cs b/DOAN.Admin.WebApi/Controllers/MES/Device/DeviceTaskExecuteController.cs index 03c4d9e..37c18b4 100644 --- a/DOAN.Admin.WebApi/Controllers/MES/Device/DeviceTaskExecuteController.cs +++ b/DOAN.Admin.WebApi/Controllers/MES/Device/DeviceTaskExecuteController.cs @@ -221,6 +221,8 @@ namespace DOAN.Admin.WebApi.Controllers } + + /// /// 获取任务执行绑定的巡检任务和点检任务绑定的设备 @@ -244,6 +246,7 @@ namespace DOAN.Admin.WebApi.Controllers /// 获取设备绑定的检查项 /// /// device_rel_account_inspect表的fk_account_id 属性 + /// 保养,检查 /// [HttpGet("get_bind_inspect")] public IActionResult AchieveDevicebindInspect(int? fk_account_id,string fkPlanId,int planType) diff --git a/DOAN.Model/MES/Device/Dto/DeviceTaskExecuteDto.cs b/DOAN.Model/MES/Device/Dto/DeviceTaskExecuteDto.cs index 11be306..7c870f1 100644 --- a/DOAN.Model/MES/Device/Dto/DeviceTaskExecuteDto.cs +++ b/DOAN.Model/MES/Device/Dto/DeviceTaskExecuteDto.cs @@ -156,5 +156,10 @@ namespace DOAN.Model.MES.dev.Dto [ExcelColumn(Name = "更新时间", Format = "yyyy-MM-dd HH:mm:ss")] [ExcelColumnName("更新时间")] public DateTime? UpdatedTime { get; set; } + + [ExcelColumn(Name = "保养或检查")] + [ExcelColumnName("保养或检查")] + public int InnerType { get; set; } + } } diff --git a/DOAN.Service/MES/Device/DeviceTaskExecuteService.cs b/DOAN.Service/MES/Device/DeviceTaskExecuteService.cs index 9feb8fb..8afaf27 100644 --- a/DOAN.Service/MES/Device/DeviceTaskExecuteService.cs +++ b/DOAN.Service/MES/Device/DeviceTaskExecuteService.cs @@ -30,6 +30,7 @@ namespace DOAN.Service.MES.dev { /// /// 查询任务执行列表 + /// 附加每个任务是检查还是保养 /// /// /// @@ -66,7 +67,21 @@ namespace DOAN.Service.MES.dev double minutes = timeDifference.TotalMinutes; double roundedMinutes = Math.Round(minutes, 1); item.ConsumeTime = roundedMinutes; + } + int InnerType=0; + if (item.Type==1) + { + InnerType = Context.Queryable().Where(it => it.Id == item.PlanId) + .Select(it => it.InnerType??0).First(); + }else if (item.Type==2) + { + InnerType = Context.Queryable().Where(it => it.Id == item.PlanId) + .Select(it => it.InnerType ?? 0).First(); + } + item.InnerType = InnerType; + + } return response; diff --git a/DOAN.Service/MES/Device/IService/IDeviceTaskExecuteService.cs b/DOAN.Service/MES/Device/IService/IDeviceTaskExecuteService.cs index b041621..b217c26 100644 --- a/DOAN.Service/MES/Device/IService/IDeviceTaskExecuteService.cs +++ b/DOAN.Service/MES/Device/IService/IDeviceTaskExecuteService.cs @@ -31,7 +31,7 @@ namespace DOAN.Service.MES.dev.IService int ExecutionTask_point(string id); - + List AchieveTaskbindDevice(string id); List AchieveDevicebindInspect(int fk_device_id, string fkPlanId, int planType);