布置图生成逻辑取值BUG修改,因为ROOMNO的增加,逻辑发生一定的变更,优先级ROOMNO更高,布置图图例规则窗口修改。
This commit is contained in:
parent
0748365cdb
commit
f525a8d408
@ -160,6 +160,7 @@ namespace Learun.Application.Web.AppApi
|
||||
|
||||
res.Add(layoutTag);
|
||||
}
|
||||
res = res.OrderByDescending(x => x.RoomNo).ToList();
|
||||
// 找出area和deck列组合重复的行
|
||||
var duplicateGroups = res
|
||||
.GroupBy(r => new { r.area, r.deck, r.RoomNo })
|
||||
@ -179,7 +180,7 @@ namespace Learun.Application.Web.AppApi
|
||||
var validSystems = keyValue.Split(';').ToList();
|
||||
matchedTagIds = propAll.Where(item =>
|
||||
item.PropertyName == keyProp &&
|
||||
validSystems.Any(prefix => item.PropertyValue == prefix) || validSystems.Any(prefix => item.PropertyValue.StartsWith(prefix + GlobalObject.enum_separator))
|
||||
(validSystems.Any(prefix => item.PropertyValue == prefix) || validSystems.Any(prefix => item.PropertyValue.StartsWith(prefix + GlobalObject.enum_separator)))
|
||||
).Select(X => X.EngineDataID).Distinct().ToList();
|
||||
//}
|
||||
//else
|
||||
@ -200,15 +201,22 @@ namespace Learun.Application.Web.AppApi
|
||||
.ToList();
|
||||
|
||||
//有效范围的设备的所有属性
|
||||
var EquipPropAll = propAll.Where(x => matchedTags.Select(y => y.EngineDataID).Contains(x.EngineDataID)).ToList();
|
||||
var EquipPropAll = propAll.Where(x => matchedTags.Select(y => y.EngineDataID).Contains(x.EngineDataID))
|
||||
.Select(x=>new ec_enginedata_propertyEntity {
|
||||
PropertyName=x.PropertyName,
|
||||
PropertyValue=x.PropertyValue,
|
||||
EngineDataID=x.EngineDataID,
|
||||
Marker = false
|
||||
}).ToList();
|
||||
foreach (var basePoint in res)
|
||||
{
|
||||
#region 每个基点关联的设备
|
||||
//甲板 区域都和基点一致的设备
|
||||
var DeckMatchedTagIds = EquipPropAll.Where(x => x.PropertyName == "甲板号" && (x.PropertyValue?.Split(new[] { "||" }, StringSplitOptions.None)[0] == basePoint.deck)).Select(X => X.EngineDataID).ToList();
|
||||
var DeckMatchedTagIds = EquipPropAll.Where(x => x.PropertyName == "甲板号" && (x.PropertyValue?.Split(new[] { "||" }, StringSplitOptions.None)[0] == basePoint.deck) && x.Marker==false).Select(X => X.EngineDataID).ToList();
|
||||
//var AreaMatchedTagIds = EquipPropAll.Where(x => x.PropertyName == "区域" && x.PropertyValue == basePoint.area).Select(X => X.EngineDataID).ToList();
|
||||
//#task 9542
|
||||
var matchPointTagIds = DeckMatchedTagIds;//.Intersect(AreaMatchedTagIds).ToList();
|
||||
var matchPointTagIdSet = new System.Collections.Generic.HashSet<string>(matchPointTagIds);
|
||||
|
||||
foreach (var matchPointTagId in matchPointTagIds)
|
||||
{
|
||||
@ -225,7 +233,7 @@ namespace Learun.Application.Web.AppApi
|
||||
Prop_RoomNo = Prop_RoomNo.Split(new string[] { GlobalObject.enum_separator }, StringSplitOptions.None)[0];//插件端对于下拉列表 都是 name || nameEN
|
||||
}
|
||||
var matchedFrame = frameLists.FirstOrDefault(X => X.Num == Prop_Frame);
|
||||
var matchedRoom = roomLists.FirstOrDefault(x => x.DataItemName == Prop_RoomNo);
|
||||
var matchedRoom = roomLists.FirstOrDefault(x => x.DataItemName == Prop_RoomNo || x.DataItemName+" "+ x.DataItemNameEN==Prop_RoomNo);
|
||||
if (matchedFrame == null && matchedRoom == null)
|
||||
{
|
||||
var layoutTagInfoInvalid = new layoutTagInfoBrief()
|
||||
@ -236,6 +244,11 @@ namespace Learun.Application.Web.AppApi
|
||||
area = "ERR",
|
||||
};
|
||||
basePoint.Tags.Add(layoutTagInfoInvalid);
|
||||
foreach (var item in EquipPropAll)
|
||||
{
|
||||
if (matchPointTagIdSet.Contains(item.EngineDataID))
|
||||
item.Marker = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
double xValue = 0;
|
||||
@ -352,6 +365,11 @@ namespace Learun.Application.Web.AppApi
|
||||
RoomNo = strRoom
|
||||
};
|
||||
basePoint.Tags.Add(layoutTagInfo);
|
||||
foreach (var item in EquipPropAll)
|
||||
{
|
||||
if (matchPointTagIdSet.Contains(item.EngineDataID))
|
||||
item.Marker = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -22,8 +22,7 @@ var bootstrap = function ($, learun) {
|
||||
url: top.$.rootUrl + '/ZZDT_EC/ec_library_file/GetTreeDataByObjectType',//获取数据地址
|
||||
param: { ProjectId: ProjectId, ObjectTypeID: objectTypeId }, //请求后台参数
|
||||
type: 'tree',//数据展示类型: 1.default:普通;2.tree:树形数据;3. treemultiple:树形多选;multiple:普通多选
|
||||
allowSearch: true,
|
||||
maxHeight: 225
|
||||
allowSearch: true
|
||||
}).lrselectSet(LayoutLibFileID);//lrselectSet获取下拉框选择的值,传入objectTypeId
|
||||
},
|
||||
initData: function () {
|
||||
|
@ -118,6 +118,11 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string ObjectTypeName { get; set; }
|
||||
/// <summary>
|
||||
/// 标记是否已使用,布置图自动放置时用
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool Marker { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user