From 647d00f201ed584e218ff517a7a6f6cbf08f7fc1 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Wed, 14 May 2025 23:08:03 +0800 Subject: [PATCH] =?UTF-8?q?2025-5-14=20=E9=99=84=E4=BB=B6=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E4=B8=8A=E4=BC=A0=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AttachFile/webuploader2.aspx.cs | 56 +++++++++++++------ .../Evaluation/EvaluationNew.aspx.cs | 2 +- FCL/FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- FCL/FineUIPro.Web/Web.config | 2 +- FCL/WebApi/WebApi.csproj.user | 2 +- 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/FCL/FineUIPro.Web/AttachFile/webuploader2.aspx.cs b/FCL/FineUIPro.Web/AttachFile/webuploader2.aspx.cs index 9728e84..cec72b5 100644 --- a/FCL/FineUIPro.Web/AttachFile/webuploader2.aspx.cs +++ b/FCL/FineUIPro.Web/AttachFile/webuploader2.aspx.cs @@ -7,6 +7,9 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; +using NPOI.SS.Formula.Functions; +using Microsoft.JScript; +using System.Security.Policy; namespace FineUIPro.Web.AttachFile { @@ -278,25 +281,44 @@ namespace FineUIPro.Web.AttachFile //合同管理附件名重复提醒 if (MenuId == BLL.Const.SESRelatedDateMenuId) { - string newName = attachUrl.Substring(attachUrl.LastIndexOf("\\")); - string n = newName.Substring(newName.IndexOf("_") + 1); - foreach (var item in sour) + if (!string.IsNullOrEmpty(attachUrl)) { - if (item.AttachUrl.Contains(n)) + string newName = attachUrl.Substring(attachUrl.LastIndexOf("\\")); + string n = newName.Substring(newName.IndexOf("_") + 1); + + string fc_id = Request.QueryString["fcid"]; + string fileTypeId = Request.QueryString["fileTypeId"]; + var conLists = from x in Funs.DB.FC_ContractManagement where x.FC_ID.ToString() == fc_id && x.FileTypeId == fileTypeId select x; + foreach (var item in conLists) { - Alert.ShowInTop(n + "已存在!", MessageBoxIcon.Warning); - return; - } - } - string fc_id = Request.QueryString["fcid"]; - string fileTypeId = Request.QueryString["fileTypeId"]; - var conLists = from x in Funs.DB.FC_ContractManagement where x.FC_ID.ToString() == fc_id && x.FileTypeId == fileTypeId select x; - foreach (var item in conLists) - { - if (item.AttachUrl.Contains(n)) - { - Alert.ShowInTop(n + "已存在!", MessageBoxIcon.Warning); - return; + if (item.FileId != ToKeyId) + { + if (item.AttachUrl.Contains(n)) + { + Alert.ShowInTop(n + "已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + List newNames = new List(); + var list = attachUrl.Split(',').ToList(); + foreach (var l in list) + { + string oldname = l.Substring(l.LastIndexOf("\\")); + string oldn = oldname.Substring(oldname.IndexOf("_") + 1); + newNames.Add(oldn); + } + var query = newNames.GroupBy(x => x).Where(g => g.Count() > 1).ToDictionary(x => x.Key, y => y.Count()); + foreach (var i in query) + { + if (i.Value > 1) + { + Alert.ShowInTop(i.Key + "已存在!", MessageBoxIcon.Warning); + return; + } + } + } } } } diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs index 7a19da3..c0ebab3 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs @@ -1004,7 +1004,7 @@ namespace FineUIPro.Web.Evaluation else { sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == FoNo && p.Requisitioner == CurrUser.Account && (p.Blocked == null || p.Blocked == "") && (p.Deleted == null || p.Deleted == "")).ToList(); - } + } Grid2.DataSource = sesList.OrderByDescending(x=>x.ShowViolationDegree); Grid2.DataBind(); } diff --git a/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user b/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user index accb770..fcf3204 100644 --- a/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ ShowAllFiles - Release|Any CPU + Debug|Any CPU true diff --git a/FCL/FineUIPro.Web/Web.config b/FCL/FineUIPro.Web/Web.config index c97a2b2..4a08f09 100644 --- a/FCL/FineUIPro.Web/Web.config +++ b/FCL/FineUIPro.Web/Web.config @@ -55,7 +55,7 @@ - + diff --git a/FCL/WebApi/WebApi.csproj.user b/FCL/WebApi/WebApi.csproj.user index 643f3e5..ca0d73e 100644 --- a/FCL/WebApi/WebApi.csproj.user +++ b/FCL/WebApi/WebApi.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU