修改了BOM接口的分组条件
This commit is contained in:
parent
1242b32386
commit
26e699c05e
@ -88,7 +88,11 @@ namespace Learun.Application.Web.AppApi
|
|||||||
TagNumber = tag.TagNumber,
|
TagNumber = tag.TagNumber,
|
||||||
Group = GroupName,// 如 A-B1,A-B2,
|
Group = GroupName,// 如 A-B1,A-B2,
|
||||||
vendor = allProp.FirstOrDefault(x => x.EngineDataID == tag.EngineDataID && x.PropertyName == "厂商")?.PropertyValue ?? "",
|
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 = "",
|
Name = "",
|
||||||
Seq = seq
|
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
|
#endregion
|
||||||
foreach (var group in groups)
|
foreach (var group in groups)
|
||||||
{
|
{
|
||||||
@ -141,14 +156,15 @@ namespace Learun.Application.Web.AppApi
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var typeInfo = allType.FirstOrDefault(x => x.ObjectTypeID == group.Key.objectTypeId);
|
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
|
var BOMGroupInfo = new BOMGroupInfo
|
||||||
{
|
{
|
||||||
upper_text = upper_text_Part1 + upper_text_Part2,
|
upper_text = upper_text_Part1 + upper_text_Part2,
|
||||||
lower_text = GroupName.Split('-')[0],//A
|
lower_text = GroupName.Split('-')[0],//A
|
||||||
Count = group.Count(),
|
Count = group.Count(),
|
||||||
Remark = group.Key.vendor,
|
Remark = group.Key.vendor,
|
||||||
Spec = group.Key.Spec,
|
Model = group.Key.Model,
|
||||||
|
Spec = specCombine,
|
||||||
FileId = GetSymbolForBOM(typeInfo, allLib)
|
FileId = GetSymbolForBOM(typeInfo, allLib)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -232,15 +248,40 @@ namespace Learun.Application.Web.AppApi
|
|||||||
{
|
{
|
||||||
public string objectTypeId { set; get; }
|
public string objectTypeId { set; get; }
|
||||||
public string TagNumber { set; get; }
|
public string TagNumber { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 去除数字后的内容,大概率是A-B。A为system,B为tag
|
||||||
|
/// </summary>
|
||||||
public string Group { set; get; }
|
public string Group { set; get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 正常情况下 Group + Seq = TagNumber
|
/// 正常情况下 Group + Seq = TagNumber
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Seq { set; get; }
|
public string Seq { set; get; }
|
||||||
public string vendor { set; get; }
|
|
||||||
public string Spec { set; get; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 中文名称
|
/// 厂商,对应<see cref="BOMGroupInfo.Remark"/>
|
||||||
|
/// </summary>
|
||||||
|
public string vendor { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 设备型号,对应<see cref="BOMGroupInfo.Model"/>
|
||||||
|
/// </summary>
|
||||||
|
public string Model { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 电制
|
||||||
|
/// </summary>
|
||||||
|
public string Volt { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 额定功率
|
||||||
|
/// </summary>
|
||||||
|
public string RatingPower { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// ip等级
|
||||||
|
/// </summary>
|
||||||
|
public string IPLevel { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 防爆等级
|
||||||
|
/// </summary>
|
||||||
|
public string ExplosionProofLevel { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 中文名称(针对某些特殊类型的分组需要用到)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { set; get; }
|
public string Name { set; get; }
|
||||||
}
|
}
|
||||||
@ -252,10 +293,24 @@ namespace Learun.Application.Web.AppApi
|
|||||||
/// 每一行用的symbol是什么
|
/// 每一行用的symbol是什么
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FileId { set; get; }
|
public string FileId { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 个数
|
||||||
|
/// </summary>
|
||||||
public int Count { set; get; }
|
public int Count { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 备注(由 厂商)
|
||||||
|
/// </summary>
|
||||||
public string Remark { set; get; }
|
public string Remark { set; get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 规格(由 电制 额定功率 ip等级 防爆等级等属性拼接而成)
|
||||||
|
/// </summary>
|
||||||
public string Spec { set; get; }
|
public string Spec { set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 型号
|
||||||
|
/// </summary>
|
||||||
|
public string Model { set; get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user