😭更改产品管理查询条件
This commit is contained in:
parent
fcd70fd027
commit
5fc2ccf669
@ -557,4 +557,10 @@ public class ConfigurationData
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "fld005298", ColumnDescription = "", Length = -1)]
|
||||
public long? fld005298 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "fld005586", ColumnDescription = "", Length = -1)]
|
||||
public string? fld005586 { get; set; }
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class Obj110
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CheckedStatus", ColumnDescription = "")]
|
||||
public bool? CheckedStatus { get; set; }
|
||||
public int? CheckedStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@ -751,4 +751,11 @@ public class Obj110
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "fld005288", ColumnDescription = "", Length = -1)]
|
||||
public string? fld005288 { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "fld005324", ColumnDescription = "", Length = -1)]
|
||||
public string? fld005324 { get; set; }
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public class ProductManagementBaseInput
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public virtual bool? CheckedStatus { get; set; }
|
||||
public virtual int? CheckedStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@ -545,6 +545,7 @@ public class PageProductManagementInput : BasePageInput
|
||||
/// 创建时间范围
|
||||
/// </summary>
|
||||
public DateTime?[] fld004494Range { get; set; }
|
||||
|
||||
|
||||
public string? fld005324 { get; set; }
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class ProductManagementOutput
|
||||
{
|
||||
public long idRecord { get; set; }
|
||||
|
||||
public bool? CheckedStatus { get; set; }
|
||||
public int? CheckedStatus { get; set; }
|
||||
|
||||
public int? VersionIndex { get; set; }
|
||||
|
||||
@ -254,5 +254,6 @@ public class ProductManagementOutput
|
||||
|
||||
public DateTime? fld004945 { get; set; }
|
||||
public string? fld005288 { get; set; }
|
||||
public string? fld005324 { get; set; }
|
||||
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
public async Task<SqlSugarPagedList<ProductManagementOutput>> Page(PageProductManagementInput input)
|
||||
{
|
||||
var query = await _obj110Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == false && x.deleted == false && x.IsLatestVersion == true)
|
||||
.Where(x => (x.CheckedStatus == 0||x.CheckedStatus==1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input._System_objNBS), u => u._System_objNBS.Contains(input._System_objNBS.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.fld004484), u => u.fld004484.Contains(input.fld004484.Trim()))
|
||||
.WhereIF(input.fld004494Range != null && input.fld004494Range.Length == 2, u => u.fld004494 >= input.fld004494Range[0] && u.fld004494 <= input.fld004494Range[1])
|
||||
@ -185,7 +185,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 110 && x.ConfigLabel == "mBOM").FirstAsync();
|
||||
var parent = await _obj110Rep.AsQueryable().Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false).MaxAsync(x => x.VersionIndex);
|
||||
var BomData = await _configurationDataRep.AsQueryable()
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent)
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && x.fld005586 !="不包含")
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim()))
|
||||
.Select<ProductManagementBomOutput>().ToPagedListAsync(input.Page, input.PageSize);
|
||||
@ -237,7 +237,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
if (!string.IsNullOrEmpty(ParentData.fld005288))
|
||||
{
|
||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 110 && x.ConfigLabel == "mBOM").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.fld005288)).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.fld005288)&&x.fld005586!="不包含").ToListAsync();
|
||||
for (int i = 0; i < BomData.Count; i++)
|
||||
{
|
||||
|
||||
@ -444,7 +444,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
public async Task<List<SapOutput>> TimingSyncToSAP()
|
||||
{
|
||||
var input = await _obj110Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == false && x.deleted == false && x.IsLatestVersion == true && (x.fld004312 == "A" || x.fld004312 == "M"))
|
||||
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && (x.fld004312 == "A" || x.fld004312 == "M"))
|
||||
.ToListAsync();
|
||||
const string lengthError = "物料描述长度大于40,请检查!";
|
||||
var SapOutputList = new List<SapOutput>();
|
||||
@ -557,7 +557,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 110 && x.ConfigLabel == "mBOM").FirstAsync();
|
||||
|
||||
var materialData = await _obj110Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == false && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && (x.fld004316 == "A" || x.fld004316 == "M"))
|
||||
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && (x.fld004316 == "A" || x.fld004316 == "M"))
|
||||
.ToListAsync();
|
||||
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
||||
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
|
||||
@ -571,7 +571,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
var ecnGuid = item.fld004944_Rec;
|
||||
// 查询 BOM
|
||||
var bomData = await _configurationDataRep.AsQueryable()
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex).ToListAsync();
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && x.fld005586 != "不包含").ToListAsync();
|
||||
if (bomData.Count == 0)
|
||||
{
|
||||
continue;
|
||||
@ -789,7 +789,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
|
||||
//查询需要同步的产品
|
||||
var materialData = await _obj110Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == false && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && (x.fld004320 == "A" || x.fld004320 == "M"))
|
||||
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && (x.fld004320 == "A" || x.fld004320 == "M"))
|
||||
.ToListAsync();
|
||||
//分组查询最大版本的物料
|
||||
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
||||
@ -802,7 +802,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
||||
var versionIndex = item.VersionIndex;
|
||||
// 查询 BOM
|
||||
var processRouteData = await _configurationDataRep.AsQueryable()
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex).ToListAsync();
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex ).ToListAsync();
|
||||
if (processRouteData.Count == 0)
|
||||
{
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user