😭修改产品设计库Bom查询条件

This commit is contained in:
bairubing 2024-11-12 10:38:25 +08:00
parent 7871fd905c
commit 4dac24916b

View File

@ -192,7 +192,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
.Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")) .Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW"))
.MaxAsync(x => x.VersionIndex); .MaxAsync(x => x.VersionIndex);
var BomData = await _configurationDataRep.AsQueryable() var BomData = await _configurationDataRep.AsQueryable()
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含" || x.fld005577 == null)&&x.isSuppressed==false) .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含" || x.fld005577 == null)&&x.isSuppressed== false && x.inContext == false)
.WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim()))
.Select<ProductDesignLibraryBomOutput>().ToPagedListAsync(input.Page, input.PageSize); .Select<ProductDesignLibraryBomOutput>().ToPagedListAsync(input.Page, input.PageSize);
@ -244,7 +244,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
if (!string.IsNullOrEmpty(ParentData.fld005686)) if (!string.IsNullOrEmpty(ParentData.fld005686))
{ {
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync(); var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync(); var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false && x.inContext == false).ToListAsync();
for (int i = 0; i < BomData.Count; i++) for (int i = 0; i < BomData.Count; i++)
{ {
@ -582,7 +582,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
var ecnGuid = item.fld005679_Rec; var ecnGuid = item.fld005679_Rec;
// 查询 BOM // 查询 BOM
var bomData = await _configurationDataRep.AsQueryable() var bomData = await _configurationDataRep.AsQueryable()
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync(); .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false && x.inContext == false).ToListAsync();
if (bomData.Count == 0) if (bomData.Count == 0)
{ {
continue; continue;
@ -622,7 +622,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
if (!string.IsNullOrEmpty(ParentData.fld005686)) if (!string.IsNullOrEmpty(ParentData.fld005686))
{ {
var configidold = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync(); var configidold = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configidold.ConfigID && x.ParentGuid == bomData[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync(); var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configidold.ConfigID && x.ParentGuid == bomData[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false && x.inContext==false).ToListAsync();
for (int i = 0; i < BomData.Count; i++) for (int i = 0; i < BomData.Count; i++)
{ {