屏蔽某些API
This commit is contained in:
@@ -11,8 +11,7 @@ namespace NX.ERP.U8.Purchase
|
||||
{
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
|
||||
string strSQL = @"select a.id,a.cCode as ArrivalCode,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode,a.dDate as date,A.cVenCode AS SupplierCode,
|
||||
string strSQL = @"select a.id AS ArrivalId,a.cCode as ArrivalCode,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode,a.dDate as ArrivalDate,A.cVenCode AS SupplierCode,
|
||||
B.Autoid as id,b.ID as ArrivalID,
|
||||
b.cInvCode AS MaterielCode,
|
||||
b.cBatch AS BatchNo,
|
||||
@@ -20,8 +19,7 @@ namespace NX.ERP.U8.Purchase
|
||||
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from
|
||||
pu_ArrHead as a
|
||||
left join pu_arrbody as b on a.id=b.id
|
||||
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID
|
||||
";
|
||||
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
strSQL += $" where {strWhere} ";
|
||||
@@ -30,16 +28,16 @@ namespace NX.ERP.U8.Purchase
|
||||
// return conn.Query<Model.Purchase.Arrival>(strSQL,null);
|
||||
var list = conn.Query<Model.Purchase.Arrival, Model.Purchase.ArrivalDetail, Model.Purchase.Arrival>(strSQL, (arrival, ArrivalDetail) =>
|
||||
{
|
||||
if (!lookup.TryGetValue(arrival.Id, out var _arrival))
|
||||
if (!lookup.TryGetValue(arrival.ArrivalId, out var _arrival))
|
||||
{
|
||||
lookup.Add(arrival.Id, arrival);
|
||||
lookup.Add(arrival.ArrivalId, arrival);
|
||||
}
|
||||
else
|
||||
{
|
||||
arrival = _arrival;
|
||||
}
|
||||
|
||||
arrival.Details.Add(ArrivalDetail);
|
||||
arrival.ArrivalDtlLst.Add(ArrivalDetail);
|
||||
return arrival;
|
||||
}, param, null, true, "id", 10, System.Data.CommandType.Text);
|
||||
return lookup.Values;
|
||||
@@ -52,6 +50,16 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<Model.Purchase.Arrival> Query(NX.ERP.Model.Request.Arrival arrival)
|
||||
{
|
||||
var where = "";
|
||||
if (!string.IsNullOrEmpty(arrival.ArrivalNo))
|
||||
{
|
||||
where = " a.cCode like @Code ";
|
||||
}
|
||||
|
||||
return this.GetList(where, new { Code = $"%{arrival.ArrivalNo}%" });
|
||||
}
|
||||
|
||||
public IEnumerable<Model.Purchase.Arrival> GetListByLastId(int Id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user