修改接口

This commit is contained in:
gongxh
2021-04-30 11:51:19 +08:00
parent f4044f46be
commit ad23ae5dcb
5 changed files with 109 additions and 100 deletions

View File

@@ -91,11 +91,11 @@ namespace NX.ERP.U8.Pmc
List<string> where = new List<string>();
if (info.cInvCode != null)
if (info.InvCodes != null)
{
where.Add(" c.cinvcode in @cinvcode");
}
if (!string.IsNullOrEmpty(info.cInvStd))
if (!string.IsNullOrEmpty(info.InvStd))
{
where.Add(" c.cInvStd like @cInvStd ");
}
@@ -111,13 +111,13 @@ namespace NX.ERP.U8.Pmc
using (var conn = U8.U8LoginContext.Instance.Connection)
{
return conn.Query<NX.ERP.Model.PmcInventoryallRes>(sql, new { cinvcode = info.cInvCode, info.cInvStd });
return conn.Query<NX.ERP.Model.PmcInventoryallRes>(sql, new { cinvcode = info.InvCodes, cInvStd = $"%{info.InvStd}%" });
}
}
public IEnumerable<object> Post2(List<string> info1)
public IEnumerable<object> Inventorymom(List<string> invCodes)
{
string sql = $@"
SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty, ma.InvCode invcode1,
@@ -193,14 +193,14 @@ namespace NX.ERP.U8.Pmc
and m..mocode in @ins
order by m.mocode
";
using (var conn = new System.Data.SqlClient.SqlConnection("Data Source =10.0.0.12;Initial Catalog =UFDATA_001_2019;User Id = sa;Password =1qaz@WSX;"))
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
return conn.Query<object>(sql, new { ins = info1 });
return conn.Query<object>(sql, new { ins = invCodes });
}
}
public IEnumerable<object> Post3(NX.ERP.Model.Request.Inventoryall info1)
public IEnumerable<object> Inventorymonth(NX.ERP.Model.Request.Inventoryall info1)
{
string sql = $@"
select a.cInvCode,c.cInvName,c.cInvStd,LL.cComUnitName , CASE WHEN c.bPurchase = 1 AND c.bProxyForeign = 1 THEN '委外' WHEN c.bPurchase = 1 THEN '外购' WHEN c.bself = 1 THEN '自制' ELSE '其它' END AS std
@@ -315,11 +315,11 @@ namespace NX.ERP.U8.Pmc
List<string> where = new List<string>();
if (info1.cInvCode != null)
if (info1.InvCodes != null)
{
where.Add(" c.cinvcode in @cinvcode");
}
var aa = string.Join(" and ", where.ToArray());
@@ -328,14 +328,14 @@ namespace NX.ERP.U8.Pmc
sql += "where " + aa;
}
using (var conn = new System.Data.SqlClient.SqlConnection("Data Source =10.0.0.12;Initial Catalog =UFDATA_001_2019;User Id = sa;Password =1qaz@WSX;"))
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
return conn.Query<object>(sql, new { cinvcode = info1.cInvCode });
return conn.Query<object>(sql, new { cinvcode = info1.InvCodes });
}
}
public IEnumerable<object> Post4(NX.ERP.Model.Request.Inventoryall info1)
public IEnumerable<object> Inventorysocode(NX.ERP.Model.Request.Inventoryall info1)
{
string sql = $@"
select j.cSTName,b.cSOCode,b.dDate,a.iRowNo,f.cCusAbbName,a.cInvCode,a.cInvName,g.cInvStd,a.iQuantity,isnull( h.dDate,'') as fhdDate ,isnull(c.fqty,0)fqty,isnull(d.cqty,0)cqty
@@ -366,17 +366,17 @@ namespace NX.ERP.U8.Pmc
List<string> where = new List<string>();
if (info1.cInvCode != null)
if (info1.InvCodes != null)
{
where.Add(" a.cinvcode in @cinvcode");
}
if (!string.IsNullOrEmpty(info1.cInvStd))
if (!string.IsNullOrEmpty(info1.InvStd))
{
where.Add(" g.cInvStd like @cInvStd ");
}
if (!string.IsNullOrEmpty(info1.socode))
if (!string.IsNullOrEmpty(info1.SoCode))
{
where.Add(" b.cSOCode like @socode ");
where.Add(" b.cSOCode like @cSOCode ");
}
var aa = string.Join(" and ", where.ToArray());
@@ -386,9 +386,9 @@ namespace NX.ERP.U8.Pmc
sql += "where " + aa;
}
using (var conn = new System.Data.SqlClient.SqlConnection("Data Source =10.0.0.12;Initial Catalog =UFDATA_001_2019;User Id = sa;Password =1qaz@WSX;"))
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
return conn.Query<object>(sql, new { cinvcode = info1.cInvCode, info1.cInvStd, info1.socode });
return conn.Query<object>(sql, new { cinvcode = info1.InvCodes, cInvStd = $"%{info1.InvStd}%", cSOCode = $"%{info1.SoCode}%" });
}
}