修改刷新库存量
This commit is contained in:
@@ -11,6 +11,10 @@ namespace NX.ERP.Model.Request
|
|||||||
private string _name;
|
private string _name;
|
||||||
|
|
||||||
public string MaterialCode { get => _code; set => _code = value; }
|
public string MaterialCode { get => _code; set => _code = value; }
|
||||||
|
|
||||||
|
public IEnumerable<string> MaterialCodes { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public string MaterialName { get => _name; set => _name = value; }
|
public string MaterialName { get => _name; set => _name = value; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,12 +52,16 @@ from InvPositionSum as a left join Inventory as b on a.cInvCode=b.cInvCode where
|
|||||||
where.Add(" b.cInvName like @MaterialName ");
|
where.Add(" b.cInvName like @MaterialName ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stock.MaterialCodes != null)
|
||||||
|
{
|
||||||
|
where.Add(" cInvCode in @MaterialCodes ");
|
||||||
|
}
|
||||||
|
|
||||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||||
{
|
{
|
||||||
MaterialCode = stock.MaterialCode,
|
MaterialCode = stock.MaterialCode,
|
||||||
MaterialName = $"%{stock.MaterialName}%",
|
MaterialName = $"%{stock.MaterialName}%",
|
||||||
|
stock.MaterialCodes
|
||||||
|
|
||||||
}); ;
|
}); ;
|
||||||
|
|
||||||
@@ -103,18 +107,25 @@ left join
|
|||||||
List<string> where = new List<string>();
|
List<string> where = new List<string>();
|
||||||
if (!string.IsNullOrEmpty(stock.MaterialCode))
|
if (!string.IsNullOrEmpty(stock.MaterialCode))
|
||||||
{
|
{
|
||||||
where.Add(" cInvCode = @MaterialCode ");
|
where.Add(" MaterialCode = @MaterialCode ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (stock.MaterialCodes != null)
|
||||||
|
{
|
||||||
|
where.Add(" MaterialCode in @MaterialCodes ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(stock.MaterialName))
|
if (!string.IsNullOrEmpty(stock.MaterialName))
|
||||||
{
|
{
|
||||||
where.Add(" cInvName like @MaterialName ");
|
where.Add(" MaterialName like @MaterialName ");
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.GetStock(string.Join(" and ", where.ToArray()), new
|
return this.GetStock(string.Join(" and ", where.ToArray()), new
|
||||||
{
|
{
|
||||||
MaterialCode = stock.MaterialCode,
|
MaterialCode = stock.MaterialCode,
|
||||||
MaterialName = $"%{stock.MaterialName}%",
|
MaterialName = $"%{stock.MaterialName}%",
|
||||||
|
stock.MaterialCodes
|
||||||
|
|
||||||
|
|
||||||
}); ;
|
}); ;
|
||||||
|
|||||||
Reference in New Issue
Block a user