布置图图例规则更新,针对对象进行设置,增加是否默认图标标记,图纸导入修改,图纸检查属性互斥BUG修正

This commit is contained in:
supercjj2023 2025-08-27 09:57:40 +08:00
parent fd11db648d
commit c0726a41d4
6 changed files with 52 additions and 18 deletions

View File

@ -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,

View File

@ -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
{

View File

@ -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<ec_enginedata_propertyEntity>();
var hisInsertList = new List<ec_enginedata_propertyhisEntity>();
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
//获取工程数据对应的图元数据

View File

@ -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++;

View File

@ -22,7 +22,11 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
/// <summary>
/// 位号
/// </summary>
public string TagNumber { get; set; } = "";
public string TagNumber { get; set; } = "";
/// <summary>
/// 是否默认图标
/// </summary>
public bool IsNotDefaultSymbol { get; set; }
/// <summary>
/// 图元文件Id
/// </summary>

View File

@ -201,7 +201,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
public List<ec_objTypeLayoutFilter> GetLayoutFilterList(string projId, string objTypeId)
{
var tbName = ProjectSugar.TableName<ec_objTypeLayoutFilter>(projId);
var res = Db.Queryable<ec_objTypeLayoutFilter>().AS(tbName).ToList();
var res = Db.Queryable<ec_objTypeLayoutFilter>().AS(tbName).Where(x=>x.ObjectTypeId==objTypeId).ToList();
var tbFileName = ProjectSugar.TableName<ec_library_fileEntity>(projId);
var fileBll = new ec_library_fileBLL();
var res2 = fileBll.GetList("{ProjectId:\"" + projId + "\"}").ToList();