This commit is contained in:
gongxh
2021-06-07 16:50:39 +08:00
4 changed files with 33 additions and 26 deletions

View File

@@ -21,34 +21,41 @@ namespace NX.ERP.U8.Finance
public IEnumerable<object> ArrivalGet(NX.ERP.Model.Request.Arrival arrival) public IEnumerable<object> ArrivalGet(NX.ERP.Model.Request.Arrival arrival)
{ {
string sql = @"select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode,CONVERT(varchar(100), a.dDate, 23) as ArrivalDate,A.cVenCode AS SupplierCode, string sql = @"IF EXISTS (SELECT NAME FROM tempdb..SYSOBJECTS WHERE NAME ='tablearrive20210603' AND Xtype='U') DROP Table tempdb..tablearrive20210603
B.Autoid as id,b.ID as ArrivalID,b.cinvname,b.cinvstd, create table tempdb..tablearrive20210603 (
cinvcode nvarchar(120),
cPosName nvarchar(2000),
)
CREATE INDEX IX_test ON tempdb..tablearrive20210603 (cinvcode)
insert into tempdb..tablearrive20210603
SELECT cinvcode,
STUFF(
(
SELECT ','+ cPosName FROM ( select b.cPosName,a.cInvCode,a.iQuantity from InvPositionSum a WITH (NOLOCK) , Position b WITH (NOLOCK)
where a.iQuantity <>0 and a.cPosCode=b.cPosCode ) a WHERE b.cinvcode = a.cinvcode order by a.iQuantity desc FOR XML PATH('')
),1 ,1, '') cPosName
FROM InvPositionSum b
GROUP BY cinvcode
select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,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 MaterialCode, b.cInvCode AS MaterialCode,
b.cBatch AS BatchNo, b.cBatch AS BatchNo,
b.fvalidinquan as RealQuantity, b.fvalidinquan as RealQuantity,
b.ccomunitcode AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,b.isum as sum, b.ccomunitcode AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,b.isum as sum,
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid,b.iNum,b.ccomunitcode,b.cunitid,b.cinva_unit,b.cinvm_unit,b.inspecexchrate, B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid,b.iNum,b.ccomunitcode,b.cunitid,b.cinva_unit,b.cinvm_unit,b.inspecexchrate,
Pos.cPosName Pos.cPosName
FROM pu_ArrBody b WITH (NOLOCK) inner join pu_ArrHead a WITH (NOLOCK) on a.id=b.id FROM pu_ArrBody b , pu_ArrHead a
inner join (select cinvcode as cinvcode1,iId from inventory WITH (NOLOCK)) inventory on b.cinvcode=inventory.cinvcode1 , (select cinvcode as cinvcode1,iId from inventory) inventory
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID , , PO_Podetails C WITH (NOLOCK) ,
(SELECT cinvcode, tempdb..tablearrive20210603 Pos -- on isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
STUFF(
(
SELECT ','+ cPosName FROM ( select b.cPosName,a.cInvCode,a.iQuantity from InvPositionSum a WITH (NOLOCK) left join Position b WITH (NOLOCK) on a.cPosCode=b.cPosCode
where a.iQuantity <>0) a WHERE b.cinvcode = a.cinvcode order by a.iQuantity desc FOR XML PATH('')
),1 ,1, '') cPosName
FROM InvPositionSum b
GROUP BY cinvcode
) Pos -- on isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工') and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'') Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工') and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
And (1=1) and isnull(b.cbcloser,N'')=N'' And isnull(a.cverifier,'')<>'' And (1=1) and isnull(b.cbcloser,N'')=N'' And isnull(a.cverifier,'')<>'' and a.id=b.id and b.cinvcode=inventory.cinvcode1 and B.iPOsID = C.ID
And a.iBillType =N'0' and isnull(b.bGsp,N'')=N'0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (b.igrouptype=2 And a.iBillType =N'0' and isnull(b.bGsp,N'')=N'0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (b.igrouptype=2
and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(a.bStorageArrivalOrder,1)=1 and 1=1 and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(a.bStorageArrivalOrder,1)=1 and 1=1
"; ";
List<string> where = new List<string>(); List<string> where = new List<string>();

View File

@@ -10,7 +10,7 @@ namespace NX.ERP.WebAPi.Controllers
{ {
public class WhreportController : ApiController public class WhreportController : ApiController
{ {
[Obsolete]
[HttpPost] [HttpPost]
[Route("api/Whreport/ArrivalGet")] [Route("api/Whreport/ArrivalGet")]
public IEnumerable<object> ArrivalGet(NX.ERP.Model.Request.Arrival info) public IEnumerable<object> ArrivalGet(NX.ERP.Model.Request.Arrival info)

View File

@@ -10,7 +10,7 @@ namespace NX.ERP.WebAPi.Controllers.System
public class SystemController:ApiController public class SystemController:ApiController
{ {
[Obsolete]
[HttpPost] [HttpPost]
[Route("api/System/Login")] [Route("api/System/Login")]
public string Login(LoginEntity loginEntity) public string Login(LoginEntity loginEntity)

View File

@@ -5,11 +5,11 @@
--> -->
<configuration> <configuration>
<appSettings> <appSettings>
<add key="server" value="10.0.0.12" /> <add key="server" value="10.0.0.12" />
<add key="AccId" value="u8-2@002" /> <add key="AccId" value="u8-2@001" />
<add key="UserId" value="wx995" /> <add key="UserId" value="wx898" />
<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" />