From a83a400d0dc6a61453cbcdad4d5f6df78dbe3fb4 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Wed, 26 Jun 2024 13:47:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=B4=AF=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/appsettings.Development.json | 2 +- ZR.Service/MES/andon/AndonDataAnalysisServcie.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ZR.Admin.WebApi/appsettings.Development.json b/ZR.Admin.WebApi/appsettings.Development.json index 8a7c2ac..561c243 100644 --- a/ZR.Admin.WebApi/appsettings.Development.json +++ b/ZR.Admin.WebApi/appsettings.Development.json @@ -86,7 +86,7 @@ "bool": [ "bit" ] } }, - 邮箱配置信息 + // 邮箱配置信息 "MailOptions": { //发件人名称 "FromName": "3143976203", diff --git a/ZR.Service/MES/andon/AndonDataAnalysisServcie.cs b/ZR.Service/MES/andon/AndonDataAnalysisServcie.cs index bc6dfac..7513a91 100644 --- a/ZR.Service/MES/andon/AndonDataAnalysisServcie.cs +++ b/ZR.Service/MES/andon/AndonDataAnalysisServcie.cs @@ -15,6 +15,7 @@ using ZR.Model.MES.dev; using ZR.Repository; using ZR.Service.MES.andon.IService; using static System.Runtime.InteropServices.JavaScript.JSType; +using System.Security.Claims; namespace ZR.Service.MES.andon { @@ -37,6 +38,18 @@ namespace ZR.Service.MES.andon var response = Queryable() .Where(predicate.ToExpression()) .ToPage(parm); + if (response.Result.Count > 0) + { + foreach (var item in response.Result) + { + if (item.Duration <= 0) + { + + item.Duration= (decimal)Math.Round((DateTime.Now-item.StartTime.Value).TotalHours,2); + } + } + } + return response; }