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();