bug #10021,平行电缆与其他位号重复
This commit is contained in:
parent
9ea7efaeb7
commit
23a5ea20ee
@ -334,7 +334,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
|
||||
addEnginedata.EngineDataID = BreakerID;
|
||||
addEnginedata.ObjectTypeID = ec_objtype.ObjectTypeID;
|
||||
addEnginedata.TagNumber = entity.Name;
|
||||
addEnginedata.TagNumber = entity.Name; //entity.Tag.TagNumber
|
||||
addEnginedata.CaseID = "0";
|
||||
|
||||
SqlSugarHelper.Db.Insertable(addEnginedata).AS(tagTbName).ExecuteCommand();
|
||||
@ -352,7 +352,8 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
#region prop
|
||||
var propBll = new ec_enginedata_propertyBLL();
|
||||
//属性还是要去存enginedata_prop表
|
||||
var TagProps = propBll.ConvertPropToEngineProp<ec_CircuitBreakerEntity>(ProjectId, ec_objtype.ObjectTypeID, addEnginedata.EngineDataID, entity);
|
||||
var TagProps = entity.Tag.EngineDataProperty;
|
||||
//propBll.ConvertPropToEngineProp<ec_CircuitBreakerEntity>(ProjectId, ec_objtype.ObjectTypeID, addEnginedata.EngineDataID, entity);
|
||||
propBll.SaveEngineProp(ProjectId, TagProps);
|
||||
|
||||
|
||||
|
@ -15,31 +15,31 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
[SugarTable(TableName = "ec_CircuitBreaker")]
|
||||
public class ec_CircuitBreakerEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 生成需要的属性去存储到ec enginedata property
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<ec_enginedata_propertyEntity> InitEngProp(ec_CircuitBreakerEntity entity)
|
||||
{
|
||||
List<ec_enginedata_propertyEntity> res = new List<ec_enginedata_propertyEntity>();
|
||||
//entity.CB_Type
|
||||
ec_enginedata_propertyEntity newProp = new ec_enginedata_propertyEntity()
|
||||
{
|
||||
//CaseID = "0",
|
||||
EngineDataID = entity.EngineerDataID,
|
||||
PropertyName = "输入/输出",
|
||||
PropertyValue = entity.CB_Type,
|
||||
///// <summary>
|
||||
///// 生成需要的属性去存储到ec enginedata property
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//public static List<ec_enginedata_propertyEntity> InitEngProp(ec_CircuitBreakerEntity entity)
|
||||
//{
|
||||
// List<ec_enginedata_propertyEntity> res = new List<ec_enginedata_propertyEntity>();
|
||||
// //entity.CB_Type
|
||||
// ec_enginedata_propertyEntity newProp = new ec_enginedata_propertyEntity()
|
||||
// {
|
||||
// //CaseID = "0",
|
||||
// EngineDataID = entity.EngineerDataID,
|
||||
// PropertyName = "输入/输出",
|
||||
// PropertyValue = entity.CB_Type,
|
||||
|
||||
};
|
||||
res.Add(newProp);
|
||||
// };
|
||||
// res.Add(newProp);
|
||||
|
||||
newProp.Create();
|
||||
// newProp.Create();
|
||||
|
||||
return res;
|
||||
}
|
||||
// return res;
|
||||
//}
|
||||
#region 实体成员
|
||||
/// <summary>
|
||||
/// 分电箱的Id(不在Enginedata_rel中存储)
|
||||
/// 分电箱的enginedata Id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string PDBId { get; set; }
|
||||
@ -77,7 +77,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 目前只有在本表里有,不会在<see cref="ec_Archive_enginedata"/>表里出现对应的记录
|
||||
/// 因为开关也是在ec_enginedata里存一份的,所以这个是对应的ec_enginedata的ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
@ -133,114 +133,114 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
#region 扩展字段
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否需要起动器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public int? NeedStarter { get; set; }
|
||||
/// <summary>
|
||||
/// 起动类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public string StartType { get; set; }
|
||||
/// <summary>
|
||||
/// 顺序起动分组结果
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public string SequentialStartGroup { get; set; }
|
||||
/// <summary>
|
||||
/// 是否带交流电流表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public int? ACAmmeter { get; set; }
|
||||
/// <summary>
|
||||
/// 起动方式
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public string StartModel { get; set; }
|
||||
/// <summary>
|
||||
/// 可逆
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public int? REV { get; set; }
|
||||
/// <summary>
|
||||
/// 是否自动起动
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public int? AutoStart { get; set; }
|
||||
/// <summary>
|
||||
/// 是否带运行时间表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public int? RHM { get; set; }
|
||||
/// <summary>
|
||||
/// 欠压方式
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public string UVMode { get; set; }
|
||||
///// <summary>
|
||||
///// 是否需要起动器
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public int? NeedStarter { get; set; }
|
||||
///// <summary>
|
||||
///// 起动类型
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public string StartType { get; set; }
|
||||
///// <summary>
|
||||
///// 顺序起动分组结果
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public string SequentialStartGroup { get; set; }
|
||||
///// <summary>
|
||||
///// 是否带交流电流表
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public int? ACAmmeter { get; set; }
|
||||
///// <summary>
|
||||
///// 起动方式
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public string StartModel { get; set; }
|
||||
///// <summary>
|
||||
///// 可逆
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public int? REV { get; set; }
|
||||
///// <summary>
|
||||
///// 是否自动起动
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public int? AutoStart { get; set; }
|
||||
///// <summary>
|
||||
///// 是否带运行时间表
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public int? RHM { get; set; }
|
||||
///// <summary>
|
||||
///// 欠压方式
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public string UVMode { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// GUFO里有
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string Relay_Type { get; set; } = "";
|
||||
/// <summary>
|
||||
/// GUFO里有
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public double? Delay_Time { get; set; } = 0.0;
|
||||
///// <summary>
|
||||
///// GUFO里有
|
||||
///// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//public string Relay_Type { get; set; } = "";
|
||||
///// <summary>
|
||||
///// GUFO里有
|
||||
///// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//public double? Delay_Time { get; set; } = 0.0;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// GUFO里有
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string Power_Opening { get; set; } = "";
|
||||
///// <summary>
|
||||
///// GUFO里有
|
||||
///// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//public string Power_Opening { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// GUFO里有
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string Power_Closing { get; set; } = "";
|
||||
///// <summary>
|
||||
///// GUFO里有
|
||||
///// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//public string Power_Closing { get; set; } = "";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 相数
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public int Phase { get; set; }
|
||||
///// <summary>
|
||||
///// 相数
|
||||
///// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public int Phase { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 额定电压
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[AttrInEnginePropTable]
|
||||
public string Rated_Voltage { get; set; } = "";
|
||||
///// <summary>
|
||||
///// 额定电压
|
||||
///// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//[AttrInEnginePropTable]
|
||||
//public string Rated_Voltage { get; set; } = "";
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -813,13 +813,13 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
#region shared
|
||||
var allAnnexesFile = Db.Queryable<AnnexesFileEntity>().ToList();
|
||||
#endregion
|
||||
#region resource数据
|
||||
var resourceTypeAll = objectTypeBll.GetList("{ProjectId:\"" + sourceProject.ProjectId + "\"}").ToList();
|
||||
var sourceTags = ec_enginedataService.GetListSingleTable(sourceProject.ProjectId, null);
|
||||
var sourceCables = Db.Queryable<ec_CableEntity>().AS($"ec_cable_{sourceProject.ProjectIndex}").ToList();
|
||||
#region source数据
|
||||
var sourceTypeAll = objectTypeBll.GetList("{ProjectId:\"" + sourceProject.ProjectId + "\"}").ToDictionary(x => x.ObjectTypeID, x => x);
|
||||
var sourceTags = ec_enginedataService.GetListSingleTable(sourceProject.ProjectId, null).ToDictionary(x => x.EngineDataID, x => x);
|
||||
var sourceCables = Db.Queryable<ec_CableEntity>().AS($"ec_cable_{sourceProject.ProjectIndex}").ToList().ToDictionary(x => x.EngineerDataID, x => x);
|
||||
var sourceCableSets = Db.Queryable<ec_CableSetEntity>().AS($"ec_Cable_Set_{sourceProject.ProjectIndex}").ToList();
|
||||
var sourceCableWires = Db.Queryable<ec_CableSetWireEntity>().AS($"ec_Cable_Set_Wire_{sourceProject.ProjectIndex}").ToList();
|
||||
var sourcePanelAll = Db.Queryable<ec_PanelEntity>().AS($"ec_Panel_{sourceProject.ProjectIndex}").ToList();
|
||||
var sourcePanelAll = Db.Queryable<ec_PanelEntity>().AS($"ec_Panel_{sourceProject.ProjectIndex}").ToList().ToDictionary(x => x.EngineerDataID, x => x);
|
||||
var sourceStripAll = Db.Queryable<ec_PanelStripEntity>().AS($"ec_Panel_Strip_{sourceProject.ProjectIndex}").ToList();
|
||||
var sourceTermAll = Db.Queryable<ec_PanelStripTermEntity>().AS($"ec_Panel_Strip_Term_{sourceProject.ProjectIndex}").ToList();
|
||||
var sourceChAll = Db.Queryable<ec_PanelChannelEntity>().AS($"ec_Panel_Channel_{sourceProject.ProjectIndex}").ToList();
|
||||
@ -856,9 +856,9 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
var targetStageDropDown = targetDropDown.FirstOrDefault(x => x.DataItemCode == GlobalObject.enumlist_DrawingStage);
|
||||
var targetStages = targetDropDownDetail.Where(x => x.DataItemID == targetStageDropDown.DataItemID).OrderBy(x => x.OrderID).ToList();
|
||||
|
||||
var targetTypeAll = objectTypeBll.GetList("{ProjectId:\"" + ProjectId + "\"}").ToList();
|
||||
var targetTypeAll = objectTypeBll.GetList("{ProjectId:\"" + ProjectId + "\"}").ToList().ToDictionary(x => x.FullPathCN, x => x);
|
||||
var TargetDrawingFile = drawingBll.GetList("{ProjectId:\"" + ProjectId + "\"}").ToList();
|
||||
var targetTags = ec_enginedataService.GetListSingleTable(ProjectId, null);
|
||||
var targetTags = ec_enginedataService.GetListSingleTable(ProjectId, null).ToDictionary(x => x.TagNumber.ToUpper(), x => x);
|
||||
var targetConnRelType = Db.Queryable<ec_reltypeEntity>().AS($"ec_reltype_{targetProject.ProjectIndex}").ToList().FirstOrDefault(x => x.RelType == enum_RelType.设备_电缆);
|
||||
if (targetConnRelType == null)
|
||||
{
|
||||
@ -990,36 +990,36 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
if (resourcePixelList != null && resourcePixelList.Count() > 0)//不包含deleteflg的
|
||||
{
|
||||
//获取拷贝图纸所有的工程数据ID
|
||||
List<string> sourceTagsOnDrawing = resourcePixelList.Select(x => x.EngineDataID).Distinct().ToList();
|
||||
List<string> sourceTagIdsOnDrawing = resourcePixelList.Select(x => x.EngineDataID).Distinct().ToList();
|
||||
//提前处理下originID,免的rel里面有问题
|
||||
foreach (var sourceTag in sourceTags)
|
||||
{
|
||||
sourceTag.originId = sourceTag.EngineDataID;
|
||||
sourceTag.Value.originId = sourceTag.Value.EngineDataID;
|
||||
}
|
||||
foreach (var oldSourceTagId in sourceTagsOnDrawing)
|
||||
foreach (var sourceTagIdOnDrawing in sourceTagIdsOnDrawing)
|
||||
{
|
||||
//获取拷贝图纸工程数据实体,由于EngineDataID经常会改变,这里用originid保险点
|
||||
var sourceTag = sourceTags.FirstOrDefault(x => x.originId == oldSourceTagId);
|
||||
sourceTags.TryGetValue(sourceTagIdOnDrawing, out ec_enginedataEntity sourceTag);
|
||||
if (sourceTag == null)
|
||||
{
|
||||
resourcePixelList.RemoveAll(x => x.EngineDataID == oldSourceTagId);
|
||||
resourcePixelList.RemoveAll(x => x.EngineDataID == sourceTagIdOnDrawing);
|
||||
continue;//无效的pixel,下一个位号
|
||||
|
||||
}
|
||||
//sourceTag.originId = oldSourceTagId;
|
||||
//对象类型ID根据对象类型库的完整路径(中文)判断。
|
||||
ec_objecttypeEntity resourceType = resourceTypeAll.FirstOrDefault(x => x.ObjectTypeID == sourceTag.ObjectTypeID);
|
||||
if (resourceType != null)
|
||||
sourceTypeAll.TryGetValue(sourceTag.ObjectTypeID, out ec_objecttypeEntity sourceType);
|
||||
if (sourceType != null)
|
||||
{
|
||||
//对象类型的匹配
|
||||
ec_objecttypeEntity curObjectTypeData = targetTypeAll.FirstOrDefault(x => x.FullPathCN == resourceType.FullPathCN);
|
||||
targetTypeAll.TryGetValue(sourceType.FullPathCN, out ec_objecttypeEntity curObjectTypeData);
|
||||
if (curObjectTypeData != null)
|
||||
{
|
||||
sourceTag.ObjectTypeID = curObjectTypeData.ObjectTypeID;//新的对象类型ID //会影响sourceTags这个原始集合
|
||||
|
||||
#region enginedata
|
||||
//判断当前项目中工程数据是否存在
|
||||
ec_enginedataEntity targetTagWithSameName = targetTags.FirstOrDefault(x => x.TagNumber.ToUpper() == sourceTag.TagNumber.ToUpper());
|
||||
targetTags.TryGetValue(sourceTag.TagNumber.ToUpper(), out ec_enginedataEntity targetTagWithSameName);
|
||||
if (targetTagWithSameName != null)
|
||||
{
|
||||
//如果重复,位号 = 原来位号 + from + 原项目名称
|
||||
@ -1077,7 +1077,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
tagRel.RelTypeID = targetConnRelType.RelTypeID;
|
||||
//ID2
|
||||
//这个时候的ID2无法从 targetTags 里查到,因为id可能已经变了
|
||||
var otherTag = sourceTags.FirstOrDefault(x => x.originId == tagRel.RelEngineData2ID);//非电缆的
|
||||
sourceTags.TryGetValue(tagRel.RelEngineData2ID, out var otherTag);//非电缆的
|
||||
if (otherTag != null)
|
||||
{
|
||||
if (otherTag.originId != otherTag.EngineDataID)
|
||||
@ -1086,7 +1086,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
}
|
||||
else
|
||||
{
|
||||
var targetTagNumber = targetTags.FirstOrDefault(x => x.TagNumber.ToUpper() == otherTag.TagNumber.ToUpper());
|
||||
targetTags.TryGetValue(otherTag.TagNumber.ToUpper(), out var targetTagNumber);
|
||||
//只有目标项目里面没有这个设备才去新建,给新ID,不然还是给目标项目的ID
|
||||
if (targetTagNumber == null)
|
||||
{
|
||||
@ -1116,7 +1116,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
tagRel.RelTypeID = targetConnRelType.RelTypeID;
|
||||
//ID2
|
||||
//这个时候的ID2无法从 targetTags 里查到,因为id可能已经变了
|
||||
var otherTag = sourceTags.FirstOrDefault(x => x.originId == tagRel.RelEngineData1ID);
|
||||
sourceTags.TryGetValue(tagRel.RelEngineData1ID, out var otherTag);
|
||||
if (otherTag != null)
|
||||
{
|
||||
if (otherTag.originId != otherTag.EngineDataID)
|
||||
@ -1125,7 +1125,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
}
|
||||
else
|
||||
{
|
||||
var targetTagNumber = targetTags.FirstOrDefault(x => x.TagNumber.ToUpper() == otherTag.TagNumber.ToUpper());
|
||||
targetTags.TryGetValue(otherTag.TagNumber.ToUpper(), out var targetTagNumber);
|
||||
//只有目标项目里面没有这个设备才去新建,给新ID,不然还是给目标项目的ID
|
||||
if (targetTagNumber == null)
|
||||
{
|
||||
@ -1182,7 +1182,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//cable
|
||||
//set
|
||||
//wire
|
||||
var sourceCable = sourceCables.FirstOrDefault(x => x.EngineerDataID == sourceTag.originId);
|
||||
sourceCables.TryGetValue(sourceTag.originId, out ec_CableEntity sourceCable);
|
||||
if (sourceCable != null)
|
||||
{
|
||||
|
||||
@ -1233,7 +1233,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//STRIP
|
||||
//CHANNEL
|
||||
//TERM
|
||||
var sourcePanel = sourcePanelAll.FirstOrDefault(x => x.EngineerDataID == sourceTag.originId);
|
||||
sourcePanelAll.TryGetValue(sourceTag.originId, out var sourcePanel);
|
||||
if (sourcePanel != null)
|
||||
{
|
||||
|
||||
@ -1247,7 +1247,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
foreach (var sourceStrip in sourceStrips)
|
||||
{
|
||||
var sourceTerms = sourceTermAll.Where(x => x.StripID == sourceStrip.StripID).ToList();
|
||||
var sourceCHs = sourceChAll.Where(x => x.StripID == sourceStrip.StripID).ToList();
|
||||
var sourceCHs = sourceChAll.Where(x => x.StripID == sourceStrip.StripID).ToList().ToDictionary(x => x.ChannelID, x => x);
|
||||
|
||||
sourceStrip.Create();
|
||||
sourceStrip.PanelID = sourcePanel.PanelID;
|
||||
@ -1257,9 +1257,9 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
{
|
||||
foreach (var ch in sourceCHs)
|
||||
{
|
||||
ch.Create();
|
||||
ch.StripID = sourceStrip.StripID;
|
||||
addChList.Add(ch);
|
||||
ch.Value.Create();
|
||||
ch.Value.StripID = sourceStrip.StripID;
|
||||
addChList.Add(ch.Value);
|
||||
}
|
||||
}
|
||||
if (sourceTerms != null)
|
||||
@ -1271,7 +1271,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
if (term.ChannelID != "-1")
|
||||
{
|
||||
//有通道
|
||||
var existCh = sourceCHs.FirstOrDefault(x => x.ChannelID == term.ChannelID);
|
||||
sourceCHs.TryGetValue(term.ChannelID, out var existCh);
|
||||
if (existCh != null)
|
||||
{
|
||||
term.ChannelID = existCh.ChannelID;
|
||||
@ -1296,17 +1296,15 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//已有的,单纯属性覆盖就行
|
||||
#region property
|
||||
//获取对应的工程数据属性
|
||||
var sourceTagProps = PropServ.GetTagPropById(item.ProjectId, sourceTag.originId).ToList();
|
||||
var targetTagProps = PropServ.GetTagPropById(ProjectId, sourceTag.EngineDataID).ToList();
|
||||
var sourceTagProps = PropServ.GetTagPropById(item.ProjectId, sourceTag.originId);
|
||||
var targetTagProps = PropServ.GetTagPropById(ProjectId, sourceTag.EngineDataID).ToDictionary(x => x.PropertyName, x => x);
|
||||
|
||||
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)
|
||||
{
|
||||
var tarProp = targetTagProps.FirstOrDefault(x => x.PropertyName == property.PropertyName);
|
||||
targetTagProps.TryGetValue(property.PropertyName, out var tarProp);
|
||||
if (tarProp != null)
|
||||
{
|
||||
|
||||
@ -1341,12 +1339,13 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
|
||||
//要和现有的比一下,没有的就插入,有的就更新
|
||||
}
|
||||
}
|
||||
|
||||
if (updateList.Count > 0)
|
||||
{
|
||||
Db.Updateable(updateList)
|
||||
.AS($"ec_enginedata_property_{targetProject.ProjectIndex}")
|
||||
.UpdateColumns(x => new {
|
||||
.UpdateColumns(x => new
|
||||
{
|
||||
x.PropertyValue,
|
||||
x.MeasuringUnit,
|
||||
x.UpdateTime,
|
||||
@ -1385,7 +1384,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
else
|
||||
{
|
||||
|
||||
msg = sourceTag.TagNumber + $"对象类型不匹配!。老项目为{resourceType.FullPathCN},新项目则没有该类型。";
|
||||
msg = sourceTag.TagNumber + $"对象类型不匹配!。老项目为{sourceType.FullPathCN},新项目则没有该类型。";
|
||||
log.Error(msg);
|
||||
|
||||
}
|
||||
|
@ -1485,7 +1485,6 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
/// <param name="caseID">工程数据实体</param>
|
||||
public void UpdatePixelAndProp(string projectId, ec_enginedataEntity entity)
|
||||
{
|
||||
var caseID = "0";//entity.CaseID;
|
||||
var ec_relDataBLL = new ec_enginedata_relBLL();
|
||||
Db.BeginTran();
|
||||
try
|
||||
@ -1511,8 +1510,8 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
var reldataTableName = TableName<ec_enginedata_relEntity>(ProjectEntity.ProjectIndex.ToString());
|
||||
|
||||
var lookupBll = new ec_REFLOOKUPTABLEBLL();
|
||||
|
||||
var curEnginedata = GetList(("{\"ProjectId\":\"" + projectId + "\",\"TagNumber\":\"" + entity.TagNumber + "\"}")).FirstOrDefault();
|
||||
var allTags = Db.Queryable<ec_enginedataEntity>().AS(TableName<ec_enginedataEntity>(projectId)).ToList();
|
||||
var curEnginedata = allTags.FirstOrDefault(x => x.TagNumber == entity.TagNumber);
|
||||
|
||||
string engineDataID = "";
|
||||
|
||||
@ -1575,7 +1574,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
|
||||
var cableSystemObj = entity.EngineDataProperty.FirstOrDefault(x => x.PropertyName == GlobalObject.propName_System);
|
||||
string systemNameAfterDealWith = string.Empty;
|
||||
var cableSystem =string.Empty;
|
||||
var cableSystem = string.Empty;
|
||||
var topDataItemDetailIDofDwg = string.Empty;
|
||||
var topDataItemDetailIDofEng = string.Empty;
|
||||
if (cableSystemObj != null)
|
||||
@ -1586,7 +1585,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//获取图纸系统的最上级ID
|
||||
topDataItemDetailIDofDwg = GetTopParentDataItemDetailByID(dataitemdetailTableName, dwgObj.DrawingSystem);
|
||||
//获取位号系统的最上级ID
|
||||
topDataItemDetailIDofEng= GetTopParentDataItemDetailByID(dataitemdetailTableName, cableSystem);
|
||||
topDataItemDetailIDofEng = GetTopParentDataItemDetailByID(dataitemdetailTableName, cableSystem);
|
||||
if (topDataItemDetailIDofDwg == topDataItemDetailIDofEng && !string.IsNullOrEmpty(dwgObj.DrawingSystem))
|
||||
{
|
||||
//可以修改
|
||||
@ -1659,6 +1658,20 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
{
|
||||
entity.EngineDataProperty = new List<ec_enginedata_propertyEntity>();
|
||||
}
|
||||
else
|
||||
{
|
||||
var parallelCable = entity.EngineDataProperty.FirstOrDefault(X => X.PropertyName == GlobalObject.propName_parallelCableList && !string.IsNullOrEmpty(X.PropertyValue));
|
||||
if (parallelCable != null)
|
||||
{
|
||||
var parallelCableNames = parallelCable.PropertyValue.ToUpper().Split(',');
|
||||
var duplicatedTag = allTags.Where(x => parallelCableNames.Contains(x.TagNumber.ToUpper())).ToList();
|
||||
if (duplicatedTag != null || duplicatedTag.Count > 0)
|
||||
{
|
||||
throw new Exception("平行电缆中存在和已有其他电缆的名字重复。" + string.Join(",", duplicatedTag.Select(x => x.TagNumber)));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
entity = lookupBll.ApplyLookup(projectId, entity, true);
|
||||
foreach (var prop in entity.EngineDataProperty.
|
||||
|
@ -45,6 +45,10 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
|
||||
//.WhereIF(!string.IsNullOrEmpty(CaseID), (a, b) => a.CaseID == CaseID)
|
||||
.WhereIF(EngineDataIDs != null && EngineDataIDs.Length > 0, (a, b) => EngineDataIDs.Contains(a.EngineDataID)
|
||||
&& a.PropertyName != "HKSK_POSITION_NUM").ToList();
|
||||
if (list == null)
|
||||
{
|
||||
list = new List<ec_enginedata_propertyEntity>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -21,8 +21,8 @@ namespace Learun.Cache.Redis
|
||||
/// 24 9 4新增。
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="cacheKey"></param>
|
||||
/// <param name="dbQuery"></param>
|
||||
/// <param name="cacheKey">redis的缓存key</param>
|
||||
/// <param name="dbQuery">委托,一般是key里没有的时候,去执行一次db查询</param>
|
||||
/// <param name="expireTime"></param>
|
||||
/// <param name="dbId"></param>
|
||||
/// <returns></returns>
|
||||
|
Loading…
x
Reference in New Issue
Block a user