From c0726a41d4057d837099e4bfd0c02b82b2f5390f Mon Sep 17 00:00:00 2001 From: supercjj2023 Date: Wed, 27 Aug 2025 09:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=83=E7=BD=AE=E5=9B=BE=E5=9B=BE=E4=BE=8B?= =?UTF-8?q?=E8=A7=84=E5=88=99=E6=9B=B4=E6=96=B0=EF=BC=8C=E9=92=88=E5=AF=B9?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E8=BF=9B=E8=A1=8C=E8=AE=BE=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E9=BB=98=E8=AE=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=A0=87=E8=AE=B0=EF=BC=8C=E5=9B=BE=E7=BA=B8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=9B=BE=E7=BA=B8=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=B1=9E=E6=80=A7=E4=BA=92=E6=96=A5BUG=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppApi/PlotLayoutApiController.cs | 17 +++++++--- .../Controllers/ec_report_fileController.cs | 4 --- .../ec_drawing_file/ec_drawing_fileBLL.cs | 33 ++++++++++++++++--- .../ZZDT_EC/ec_enginedata/ec_enginedataBLL.cs | 8 +++-- .../ec_enginedata/layoutTagInfoBrief.cs | 6 +++- .../ZZDT_EC/ec_objecttype/ec_objecttypeBLL.cs | 2 +- 6 files changed, 52 insertions(+), 18 deletions(-) diff --git a/Learun.Application.Web/AppApi/PlotLayoutApiController.cs b/Learun.Application.Web/AppApi/PlotLayoutApiController.cs index b798f166..ae5c6f49 100644 --- a/Learun.Application.Web/AppApi/PlotLayoutApiController.cs +++ b/Learun.Application.Web/AppApi/PlotLayoutApiController.cs @@ -173,6 +173,7 @@ namespace Learun.Application.Web.AppApi #region 判断是否满足特定条件 var fileId = tagInfo.DefaultLayoutLibFileID; var matched = false; + var isNotDefaultSymbol = true; foreach (var filter in allFilter.Where(x => x.ObjectTypeId == tagInfo.ObjectTypeID)) { if (matched) @@ -195,13 +196,20 @@ namespace Learun.Application.Web.AppApi //一个满足即可 matched = true; fileId = filter.LayoutLibFileID; + isNotDefaultSymbol = false; break; } + //如果是and,继续看下面的属性,先给图例,如果有一个不满足会break的,主要是避免只有一个条件的时候 + fileId = filter.LayoutLibFileID; + matched = true; + isNotDefaultSymbol = false; } else { if (filterOp.ToUpper() == "AND") { + matched = false; + isNotDefaultSymbol = true; //一个不满足都不满足 break; } @@ -211,21 +219,20 @@ namespace Learun.Application.Web.AppApi { //压根没这个属性,认为不符合 if (filterOp.ToUpper() == "AND") - { + { + matched = false; + isNotDefaultSymbol = true; break; } } } - - //能走到这里说明满足这个 - matched = true; - fileId = tagInfo.DefaultLayoutLibFileID; } #endregion var layoutTagInfo = new layoutTagInfoBrief() { EngineDataID = matchPointTagId, FileId = fileId, //2个优先级 + IsNotDefaultSymbol= isNotDefaultSymbol, PixelOnDwg = "", TagNumber = tagInfo.TagNumber, X = frameLists.FirstOrDefault(X => X.Num == Prop_Frame).Value, diff --git a/Learun.Application.Web/Areas/ZZDT_EC/Controllers/ec_report_fileController.cs b/Learun.Application.Web/Areas/ZZDT_EC/Controllers/ec_report_fileController.cs index 155585da..afed4293 100644 --- a/Learun.Application.Web/Areas/ZZDT_EC/Controllers/ec_report_fileController.cs +++ b/Learun.Application.Web/Areas/ZZDT_EC/Controllers/ec_report_fileController.cs @@ -808,10 +808,6 @@ namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers foreach (var cable in cables) //Where(x => x.TagNumber == "TEST-CABLE-001" || x.TagNumber == "1L11-7") { - if (cable.TagNumber == "3MAC-03") - { - var a = 1; - } try { diff --git a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_drawing_file/ec_drawing_fileBLL.cs b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_drawing_file/ec_drawing_fileBLL.cs index 72a5d3bc..324459e2 100644 --- a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_drawing_file/ec_drawing_fileBLL.cs +++ b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_drawing_file/ec_drawing_fileBLL.cs @@ -1046,7 +1046,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC sourceTag.UpdateTime = DateTime.Now; sourceTag.UpdateUserID = LoginUserInfo.Get().userId; sourceTag.EngineDataID = targetTagWithSameName.EngineDataID;//已经是新的了 - sourceTag.originId = sourceTag.EngineDataID; + //sourceTag.originId = sourceTag.EngineDataID; } else { @@ -1315,7 +1315,11 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC #region property //获取对应的工程数据属性 var sourceTagProps = PropServ.GetTagPropById(item.ProjectId, sourceTag.originId).ToList(); - var targetTagProps = PropServ.GetTagPropById(ProjectId, sourceTag.originId).ToList(); + var targetTagProps = PropServ.GetTagPropById(ProjectId, sourceTag.EngineDataID).ToList(); + + var updateList = new List(); + var hisInsertList = new List(); + if (sourceTagProps != null && sourceTagProps.Count > 0) { foreach (var property in sourceTagProps) @@ -1332,14 +1336,16 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC EngineDataID = tarProp.EngineDataID }; propHis.Create(); + hisInsertList.Add(propHis); //已有属性 tarProp.PropertyValue = property.PropertyValue; //新值 tarProp.MeasuringUnit = property.MeasuringUnit; tarProp.UpdateTime = System.DateTime.Now; tarProp.UpdateUserID = userInfo.userId; - Db.Updateable(tarProp).AS($"ec_enginedata_property_{targetProject.ProjectIndex}").ExecuteCommand(); - Db.Insertable(propHis).AS($"ec_enginedata_propertyhis_{targetProject.ProjectIndex}").ExecuteCommand(); + updateList.Add(tarProp); + //Db.Updateable(tarProp).AS($"ec_enginedata_property_{targetProject.ProjectIndex}").ExecuteCommand(); + //Db.Insertable(propHis).AS($"ec_enginedata_propertyhis_{targetProject.ProjectIndex}").ExecuteCommand(); } else { @@ -1354,6 +1360,25 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC //要和现有的比一下,没有的就插入,有的就更新 } } + if (updateList.Count > 0) + { + Db.Updateable(updateList) + .AS($"ec_enginedata_property_{targetProject.ProjectIndex}") + .UpdateColumns(x => new { + x.PropertyValue, + x.MeasuringUnit, + x.UpdateTime, + x.UpdateUserID + }) + .WhereColumns(x => x.EngineDataPropertyID) // 确保按主键更新 + .ExecuteCommand(); + } + if (hisInsertList.Count > 0) + { + Db.Insertable(hisInsertList) + .AS($"ec_enginedata_propertyhis_{targetProject.ProjectIndex}") + .ExecuteCommand(); + } #endregion #region pixel //获取工程数据对应的图元数据 diff --git a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/ec_enginedataBLL.cs b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/ec_enginedataBLL.cs index 91048fc6..40928255 100644 --- a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/ec_enginedataBLL.cs +++ b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/ec_enginedataBLL.cs @@ -421,6 +421,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC foreach (var tag in allTagByType) { var propCol2 = propCol;//这个开始列不能变 + var grpPropCol = propCol; //先横后纵(先位号) foreach (var group in groups) { @@ -507,9 +508,10 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC } //不满足 涂色 - curSheet.Cells[curRow, propCol, curRow, propCol2 - 1].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid; - curSheet.Cells[curRow, propCol, curRow, propCol2 - 1].Style.Fill.BackgroundColor.SetColor(color); - curSheet.Cells[curRow, propCol, curRow, propCol2 - 1].AddComment(strComment); + curSheet.Cells[curRow, grpPropCol, curRow, propCol2 - 1].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid; + curSheet.Cells[curRow, grpPropCol, curRow, propCol2 - 1].Style.Fill.BackgroundColor.SetColor(color); + curSheet.Cells[curRow, grpPropCol, curRow, propCol2 - 1].AddComment(strComment); + grpPropCol = propCol2; } } curRow++; diff --git a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/layoutTagInfoBrief.cs b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/layoutTagInfoBrief.cs index c2bb8950..e527b21a 100644 --- a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/layoutTagInfoBrief.cs +++ b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_enginedata/layoutTagInfoBrief.cs @@ -22,7 +22,11 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC /// /// 位号 /// - public string TagNumber { get; set; } = ""; + public string TagNumber { get; set; } = ""; + /// + /// 是否默认图标 + /// + public bool IsNotDefaultSymbol { get; set; } /// /// 图元文件Id /// diff --git a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_objecttype/ec_objecttypeBLL.cs b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_objecttype/ec_objecttypeBLL.cs index aa3fc67a..36e90c7d 100644 --- a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_objecttype/ec_objecttypeBLL.cs +++ b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_objecttype/ec_objecttypeBLL.cs @@ -201,7 +201,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC public List GetLayoutFilterList(string projId, string objTypeId) { var tbName = ProjectSugar.TableName(projId); - var res = Db.Queryable().AS(tbName).ToList(); + var res = Db.Queryable().AS(tbName).Where(x=>x.ObjectTypeId==objTypeId).ToList(); var tbFileName = ProjectSugar.TableName(projId); var fileBll = new ec_library_fileBLL(); var res2 = fileBll.GetList("{ProjectId:\"" + projId + "\"}").ToList();