|
@@ -226,26 +226,7 @@ namespace SAGA.MBI.JsonConvert
|
|
|
return DalCMBTreeView.ConvertToDataSource(json); ;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 获取数据字典的某一信息点的定义
|
|
|
- /// </summary>
|
|
|
- /// <param name="json"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static MInfoCode GetMInfoCode(string json)
|
|
|
- {
|
|
|
- MInfoCode mInfo = new MInfoCode();
|
|
|
- JObject jObject = JObject.Parse(json);
|
|
|
- foreach (PropertyInfo property in mInfo.GetType().GetProperties())
|
|
|
- {
|
|
|
- var description = property.GetCustomAttribute<DescriptionAttribute>();
|
|
|
- if (description?.Description != null)
|
|
|
- {
|
|
|
- property.SetValue(mInfo, jObject[description.Description].ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- return mInfo;
|
|
|
|
|
|
- }
|
|
|
/// <summary>
|
|
|
/// 建筑 信息点的数据源
|
|
|
/// </summary>
|
|
@@ -254,30 +235,12 @@ namespace SAGA.MBI.JsonConvert
|
|
|
[CacheAspect]
|
|
|
public static List<CMBTreeNodeItem<ICMBTreeNodeItem>> BuildingInfoDS(string infoPointCode)
|
|
|
{
|
|
|
- MInfoCode infoCode = BuildingDic().FirstOrDefault(t => t.InfoPointCode == infoPointCode);
|
|
|
- return DalCMBTreeView.ConvertToDataSource(infoCode?.DataSource); ;
|
|
|
+ string code = "building";
|
|
|
+ var pdtb = PEPCodeConvert.GetPropertyDefineTb(code);
|
|
|
+ var infoDefine = pdtb.PropertyDefineItems.FirstOrDefault(t => t.CodeName == infoPointCode);
|
|
|
+ return DalCMBTreeView.ConvertToDataSource(infoDefine?.EnumSource);
|
|
|
}
|
|
|
- /// <summary>
|
|
|
- /// 建筑体的数据字典
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [CacheAspect]
|
|
|
- public static List<MInfoCode> BuildingDic()
|
|
|
- {
|
|
|
- List<MInfoCode> list = new List<MInfoCode>();
|
|
|
- string json = CmbDataSourceRequest.BuildingDic();
|
|
|
- if (!json.IsSuccessRequest()) return list;
|
|
|
-
|
|
|
- JObject jObject = JObject.Parse(json);
|
|
|
- foreach (JObject contentJObject in (JArray)jObject["Content"])
|
|
|
- {
|
|
|
- MInfoCode mInfo = GetMInfoCode(contentJObject.ToString());
|
|
|
|
|
|
- list.Add(mInfo);
|
|
|
- }
|
|
|
-
|
|
|
- return list;
|
|
|
- }
|
|
|
/// <summary>
|
|
|
/// 楼层 信息点的数据源
|
|
|
/// </summary>
|
|
@@ -286,31 +249,12 @@ namespace SAGA.MBI.JsonConvert
|
|
|
[CacheAspect]
|
|
|
public static List<CMBTreeNodeItem<ICMBTreeNodeItem>> FloorInfoDS(string infoPointCode)
|
|
|
{
|
|
|
- List<MInfoCode> list = FloorDic();
|
|
|
- MInfoCode infoCode = list.FirstOrDefault(t => t.InfoPointCode == infoPointCode);
|
|
|
- return DalCMBTreeView.ConvertToDataSource(infoCode?.DataSource);
|
|
|
+ string code = "floor";
|
|
|
+ var pdtb = PEPCodeConvert.GetPropertyDefineTb(code);
|
|
|
+ var infoDefine = pdtb.PropertyDefineItems.FirstOrDefault(t => t.CodeName == infoPointCode);
|
|
|
+ return DalCMBTreeView.ConvertToDataSource(infoDefine?.EnumSource);
|
|
|
}
|
|
|
- /// <summary>
|
|
|
- /// 楼层的数据字典
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [CacheAspect]
|
|
|
- public static List<MInfoCode> FloorDic()
|
|
|
- {
|
|
|
- List<MInfoCode> list = new List<MInfoCode>();
|
|
|
- string json = CmbDataSourceRequest.FloorDic();
|
|
|
- if (!json.IsSuccessRequest()) return list;
|
|
|
-
|
|
|
- JObject jObject = JObject.Parse(json);
|
|
|
- foreach (JObject contentJObject in (JArray)jObject["Content"])
|
|
|
- {
|
|
|
- MInfoCode mInfo = GetMInfoCode(contentJObject.ToString());
|
|
|
|
|
|
- list.Add(mInfo);
|
|
|
- }
|
|
|
-
|
|
|
- return list;
|
|
|
- }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 设备种族类型编码
|