修改接口
This commit is contained in:
@@ -7,11 +7,11 @@ namespace NX.ERP.Model.Request
|
|||||||
{
|
{
|
||||||
public class Inventoryall: BaseModel
|
public class Inventoryall: BaseModel
|
||||||
{
|
{
|
||||||
public IEnumerable<string> cInvCode { get; set; }
|
public IEnumerable<string> InvCodes { get; set; }
|
||||||
|
|
||||||
public string cInvStd { get; set; }
|
public string InvStd { get; set; }
|
||||||
|
|
||||||
public string socode { get; set; }
|
public string SoCode { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,11 +91,11 @@ namespace NX.ERP.U8.Pmc
|
|||||||
|
|
||||||
List<string> where = new List<string>();
|
List<string> where = new List<string>();
|
||||||
|
|
||||||
if (info.cInvCode != null)
|
if (info.InvCodes != null)
|
||||||
{
|
{
|
||||||
where.Add(" c.cinvcode in @cinvcode");
|
where.Add(" c.cinvcode in @cinvcode");
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(info.cInvStd))
|
if (!string.IsNullOrEmpty(info.InvStd))
|
||||||
{
|
{
|
||||||
where.Add(" c.cInvStd like @cInvStd ");
|
where.Add(" c.cInvStd like @cInvStd ");
|
||||||
}
|
}
|
||||||
@@ -112,12 +112,12 @@ namespace NX.ERP.U8.Pmc
|
|||||||
using (var conn = U8.U8LoginContext.Instance.Connection)
|
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 = $@"
|
string sql = $@"
|
||||||
SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitName, md.Qty, md.QualifiedInQty, ma.InvCode invcode1,
|
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
|
and m..mocode in @ins
|
||||||
order by m.mocode
|
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 = $@"
|
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
|
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,7 +315,7 @@ namespace NX.ERP.U8.Pmc
|
|||||||
|
|
||||||
List<string> where = new List<string>();
|
List<string> where = new List<string>();
|
||||||
|
|
||||||
if (info1.cInvCode != null)
|
if (info1.InvCodes != null)
|
||||||
{
|
{
|
||||||
where.Add(" c.cinvcode in @cinvcode");
|
where.Add(" c.cinvcode in @cinvcode");
|
||||||
}
|
}
|
||||||
@@ -328,14 +328,14 @@ namespace NX.ERP.U8.Pmc
|
|||||||
sql += "where " + aa;
|
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 = $@"
|
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
|
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>();
|
List<string> where = new List<string>();
|
||||||
|
|
||||||
if (info1.cInvCode != null)
|
if (info1.InvCodes != null)
|
||||||
{
|
{
|
||||||
where.Add(" a.cinvcode in @cinvcode");
|
where.Add(" a.cinvcode in @cinvcode");
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(info1.cInvStd))
|
if (!string.IsNullOrEmpty(info1.InvStd))
|
||||||
{
|
{
|
||||||
where.Add(" g.cInvStd like @cInvStd ");
|
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());
|
var aa = string.Join(" and ", where.ToArray());
|
||||||
@@ -386,9 +386,9 @@ namespace NX.ERP.U8.Pmc
|
|||||||
sql += "where " + aa;
|
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}%" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace NX.ERP.WebAPi.Controllers
|
|||||||
{
|
{
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("api/Pmc/Inventoryall")]
|
[Route("api/Pmc/Inventoryall")]
|
||||||
public IEnumerable<NX.ERP.Model.PmcInventoryallRes> Post1(NX.ERP.Model.Request.Inventoryall info)
|
public IEnumerable<NX.ERP.Model.PmcInventoryallRes> Inventoryall(NX.ERP.Model.Request.Inventoryall info)
|
||||||
{
|
{
|
||||||
var dal = new NX.ERP.U8.Pmc.PmcQuery();
|
var dal = new NX.ERP.U8.Pmc.PmcQuery();
|
||||||
return dal.GetPmcInventoryallRes(info);
|
return dal.GetPmcInventoryallRes(info);
|
||||||
@@ -21,26 +21,26 @@ namespace NX.ERP.WebAPi.Controllers
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("api/Pmc/Inventorymom")]
|
[Route("api/Pmc/Inventorymom")]
|
||||||
public IEnumerable<object> Post2([FromBody] List<string> info1)
|
public IEnumerable<object> Inventorymom([FromBody] List<string> invCodes)
|
||||||
{
|
{
|
||||||
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
|
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
|
||||||
return PmcQuery.Post2(info1);
|
return PmcQuery.Inventorymom(invCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("api/Pmc/Inventorymonth")]
|
[Route("api/Pmc/Inventorymonth")]
|
||||||
public IEnumerable<object> Post3(NX.ERP.Model.Request.Inventoryall info)
|
public IEnumerable<object> Inventorymonth(NX.ERP.Model.Request.Inventoryall info)
|
||||||
{
|
{
|
||||||
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
|
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
|
||||||
return PmcQuery.Post3(info);
|
return PmcQuery.Inventorymonth(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("api/Pmc/Inventorysocode")]
|
[Route("api/Pmc/Inventorysocode")]
|
||||||
public IEnumerable<object> Post4(NX.ERP.Model.Request.Inventoryall info)
|
public IEnumerable<object> Inventorysocode(NX.ERP.Model.Request.Inventoryall info)
|
||||||
{
|
{
|
||||||
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
|
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
|
||||||
return PmcQuery.Post4(info);
|
return PmcQuery.Inventorysocode(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
<add key="UserId" value="wx997" />
|
<add key="UserId" value="wx997" />
|
||||||
<add key="Password" value="1" />
|
<add key="Password" value="1" />
|
||||||
<add key="EaiPort" value="80" />
|
<add key="EaiPort" value="80" />
|
||||||
|
|
||||||
<add key="EaiPath" value="U8EAI/import.asp" />
|
<add key="EaiPath" value="U8EAI/import.asp" />
|
||||||
<add key="webpages:Version" value="3.0.0.0" />
|
<add key="webpages:Version" value="3.0.0.0" />
|
||||||
<add key="webpages:Enabled" value="false" />
|
<add key="webpages:Enabled" value="false" />
|
||||||
@@ -71,7 +70,6 @@
|
|||||||
</runtime>
|
</runtime>
|
||||||
<system.codedom>
|
<system.codedom>
|
||||||
<compilers>
|
<compilers>
|
||||||
|
|
||||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
||||||
</compilers>
|
</compilers>
|
||||||
</system.codedom>
|
</system.codedom>
|
||||||
|
|||||||
11
U8App.sln
11
U8App.sln
@@ -13,6 +13,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.U8.App", "NX.ERP.U8.
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.BLL", "NX.ERP.BLL\NX.ERP.BLL.csproj", "{C1FFE393-1879-4FC1-A99E-695F2882553D}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.BLL", "NX.ERP.BLL\NX.ERP.BLL.csproj", "{C1FFE393-1879-4FC1-A99E-695F2882553D}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0AB7F5D9-F8E9-4EA7-917F-283EF99CF16D}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{272C1F7E-66F7-4E92-9777-3A7CB2E9D7CC}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -85,6 +89,13 @@ Global
|
|||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{A958D236-BAD0-4A56-ADB1-CEA3A1EF452B} = {0AB7F5D9-F8E9-4EA7-917F-283EF99CF16D}
|
||||||
|
{5D012E0A-AFED-474E-81A9-5820890B1B29} = {0AB7F5D9-F8E9-4EA7-917F-283EF99CF16D}
|
||||||
|
{BD673DA9-0606-4BCF-A016-FB5C4E7B5D59} = {0AB7F5D9-F8E9-4EA7-917F-283EF99CF16D}
|
||||||
|
{8A6603B0-444A-49C7-80C9-195638129068} = {0AB7F5D9-F8E9-4EA7-917F-283EF99CF16D}
|
||||||
|
{C1FFE393-1879-4FC1-A99E-695F2882553D} = {0AB7F5D9-F8E9-4EA7-917F-283EF99CF16D}
|
||||||
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {8C57E044-32E1-444C-B548-E83838110953}
|
SolutionGuid = {8C57E044-32E1-444C-B548-E83838110953}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|||||||
Reference in New Issue
Block a user