diff --git a/Learun.Application.Web/AppApi/PlotBOMApiController.cs b/Learun.Application.Web/AppApi/PlotBOMApiController.cs index 1f4f4bd9..e663e0fe 100644 --- a/Learun.Application.Web/AppApi/PlotBOMApiController.cs +++ b/Learun.Application.Web/AppApi/PlotBOMApiController.cs @@ -88,7 +88,11 @@ namespace Learun.Application.Web.AppApi TagNumber = tag.TagNumber, Group = GroupName,// 如 A-B1,A-B2, vendor = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "厂商")?.PropertyValue ?? "", - Spec = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "设备型号")?.PropertyValue ?? "", + Model = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "设备型号")?.PropertyValue ?? "", + Volt = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "电制")?.PropertyValue ?? "", + RatingPower = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "额定功率")?.PropertyValue ?? "", + IPLevel = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "IP等级")?.PropertyValue ?? "", + ExplosionProofLevel = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "防爆等级")?.PropertyValue ?? "", Name = "", Seq = seq }; @@ -106,7 +110,18 @@ namespace Learun.Application.Web.AppApi } - var groups = TagsInBOM.GroupBy(x => new { x.objectTypeId, x.Group, x.vendor, x.Spec, x.Name }).ToList(); + var groups = TagsInBOM.GroupBy(x => new + { + x.objectTypeId, + x.Group, + x.vendor, + x.Model, + x.Volt, + x.IPLevel, + x.RatingPower, + x.ExplosionProofLevel, + x.Name + }).ToList(); #endregion foreach (var group in groups) { @@ -141,14 +156,15 @@ namespace Learun.Application.Web.AppApi #endregion var typeInfo = allType.FirstOrDefault(x => x.ObjectTypeID == group.Key.objectTypeId); - + var specCombine = $"{group.Key.Volt} {group.Key.RatingPower} {group.Key.IPLevel} {group.Key.ExplosionProofLevel}"; var BOMGroupInfo = new BOMGroupInfo { upper_text = upper_text_Part1 + upper_text_Part2, lower_text = GroupName.Split('-')[0],//A Count = group.Count(), Remark = group.Key.vendor, - Spec = group.Key.Spec, + Model = group.Key.Model, + Spec = specCombine, FileId = GetSymbolForBOM(typeInfo, allLib) }; @@ -232,15 +248,40 @@ namespace Learun.Application.Web.AppApi { public string objectTypeId { set; get; } public string TagNumber { set; get; } + /// + /// 去除数字后的内容,大概率是A-B。A为system,B为tag + /// public string Group { set; get; } /// /// 正常情况下 Group + Seq = TagNumber /// public string Seq { set; get; } - public string vendor { set; get; } - public string Spec { set; get; } /// - /// 中文名称 + /// 厂商,对应 + /// + public string vendor { set; get; } + /// + /// 设备型号,对应 + /// + public string Model { set; get; } + /// + /// 电制 + /// + public string Volt { set; get; } + /// + /// 额定功率 + /// + public string RatingPower { set; get; } + /// + /// ip等级 + /// + public string IPLevel { set; get; } + /// + /// 防爆等级 + /// + public string ExplosionProofLevel { set; get; } + /// + /// 中文名称(针对某些特殊类型的分组需要用到) /// public string Name { set; get; } } @@ -252,10 +293,24 @@ namespace Learun.Application.Web.AppApi /// 每一行用的symbol是什么 /// public string FileId { set; get; } + /// + /// 个数 + /// public int Count { set; get; } + /// + /// 备注(由 厂商) + /// public string Remark { set; get; } + /// + /// 规格(由 电制 额定功率 ip等级 防爆等级等属性拼接而成) + /// public string Spec { set; get; } + /// + /// 型号 + /// + public string Model { set; get; } + } } \ No newline at end of file