修改库存查询接口

This commit is contained in:
gongxh
2021-05-20 10:18:42 +08:00
parent 8b420a6b68
commit 4550c925da
2 changed files with 3 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ namespace NX.ERP.Model.Response.Store
private string _Qty; private string _Qty;
public string MaterialCode { get => materialCode; set => materialCode = value; } public string MaterialCode { get => materialCode; set => materialCode = value; }
public string BinName { get => binName; set => binName = value; } public string BinCode { get => binName; set => binName = value; }
public string Qty { get => _Qty; set => _Qty = value; } public string Qty { get => _Qty; set => _Qty = value; }
} }

View File

@@ -18,12 +18,7 @@ namespace NX.ERP.U8.Store
{ {
using (var conn = U8LoginContext.Instance.Connection) using (var conn = U8LoginContext.Instance.Connection)
{ {
var sql = @"select a.cInvCode as MaterialCode ,c.cPosName as BinName,(isnull(a.iQuantity,0)-isnull(b.iQuantity,0)) as Qty from ( var sql = @"select cInvCode as MaterialCode ,cPosCode as BinCode,iQuantity as Qty from InvPositionSum where ISNULL(iQuantity,0)<>0";
select cInvCode,cPosCode , sum(iQuantity)as iQuantity from InvPosition where bRdFlag=1 group by cInvCode,cPosCode
)a full join (
select cInvCode,cPosCode , sum(iQuantity)as iQuantity from InvPosition where bRdFlag=0 group by cInvCode,cPosCode)
b on isnull(a.cInvCode,'')=isnull(b.cInvCode,'') and a.cPosCode=b.cPosCode
left join Position c on a.cPosCode=c.cPosCode where a.iQuantity<>b.iQuantity";
if (!string.IsNullOrEmpty(strwhere)) if (!string.IsNullOrEmpty(strwhere))
{ {
sql += $" and {strwhere}"; sql += $" and {strwhere}";
@@ -38,7 +33,7 @@ namespace NX.ERP.U8.Store
/// <returns></returns> /// <returns></returns>
public IEnumerable<Model.Response.Store.Stock> GetListByMaterialCode(string Code) public IEnumerable<Model.Response.Store.Stock> GetListByMaterialCode(string Code)
{ {
return this.GetList(" a.cInvCode like @Code", new { Code = $"%{Code}%" }); return this.GetList(" cInvCode like @Code", new { Code = $"%{Code}%" });
} }