修改接口

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

@@ -7,11 +7,11 @@ namespace NX.ERP.Model.Request
{
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; }
}
}

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}%" });
}
}

View File

@@ -12,7 +12,7 @@ namespace NX.ERP.WebAPi.Controllers
{
[HttpPost]
[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();
return dal.GetPmcInventoryallRes(info);
@@ -21,26 +21,26 @@ namespace NX.ERP.WebAPi.Controllers
[HttpPost]
[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();
return PmcQuery.Post2(info1);
return PmcQuery.Inventorymom(invCodes);
}
[HttpPost]
[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();
return PmcQuery.Post3(info);
return PmcQuery.Inventorymonth(info);
}
[HttpPost]
[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();
return PmcQuery.Post4(info);
return PmcQuery.Inventorysocode(info);
}

View File

@@ -4,75 +4,73 @@
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<appSettings>
<add key="server" value="10.0.0.12" />
<add key="AccId" value="u8-2@001" />
<add key="UserId" value="wx997" />
<add key="Password" value="1" />
<add key="EaiPort" value="80" />
<add key="EaiPath" value="U8EAI/import.asp" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<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=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<appSettings>
<add key="server" value="10.0.0.12" />
<add key="AccId" value="u8-2@001" />
<add key="UserId" value="wx997" />
<add key="Password" value="1" />
<add key="EaiPort" value="80" />
<add key="EaiPath" value="U8EAI/import.asp" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<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=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
</configuration>

View File

@@ -13,6 +13,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.U8.App", "NX.ERP.U8.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NX.ERP.BLL", "NX.ERP.BLL\NX.ERP.BLL.csproj", "{C1FFE393-1879-4FC1-A99E-695F2882553D}"
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
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -85,6 +89,13 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
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
SolutionGuid = {8C57E044-32E1-444C-B548-E83838110953}
EndGlobalSection