This commit is contained in:
gongxh
2021-10-28 11:14:08 +08:00
11 changed files with 465 additions and 194 deletions

View File

@@ -856,7 +856,7 @@ select *from tempdb..tablepzck20210526
{
string sql = $@"
select *from (
select f.cCusAbbName,CONVERT(varchar(100),b.dDate, 23) as dDate ,b.cSOCode,a.cInvCode,a.cInvName,g.cInvStd, a.iQuantity - isnull(d.cqty,0) as wfiQuantity
select f.cCusAbbName,CONVERT(varchar(100),b.dDate, 23) as dDate ,b.cSOCode,a.cInvCode,a.cInvName,g.cInvStd, a.iQuantity - isnull(d.cqty,0) as wfiQuantity,b.cCloser
,
isnull(cs.qty,0) as xcl,
b.cVerifier
@@ -904,7 +904,7 @@ select *from tempdb..tablepzck20210526
// where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null ");
where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null and mm.cInvCode like '9%' ");
where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null and mm.cInvCode like '9%' and isnull( mm.cCloser ,'') ='' ");
if(info1 ==null)
{
info1 = new NX.ERP.Model.Request.SaleinvRequest();

View File

@@ -559,5 +559,46 @@ CREATE INDEX IX_test ON tempdb..tablepuapp20210625 (cinvcode)
return conn.Query<object>(sql, new { info.cpersonname, info.InvCodes, info.cday, info.BeginDate, info.EndDate });
}
}
public NX.ERP.Model.PmcWwInvlRes Purchasesuww()
{
var PmcWwInvlRes = new NX.ERP.Model.PmcWwInvlRes();
using (var conn = U8LoginContext.Instance.Connection)
{
var sql = @" select aa.TaskItemID,aa.materialid,dd.code,dd.name,dd.standard, CONVERT(DECIMAL(13,3),aa.Qua) as Qua , CONVERT(DECIMAL(13,3),bb.qty) as qty , CONVERT(DECIMAL(13,3),(isnull(aa.Qua,0)-isnull(bb.qty,0))) as diff from [10.0.0.230].wxnx2021.dbo.t_TaskItem aa left join (
select TaskItemID, sum(Qua) AS qty
from [10.0.0.230].wxnx2021.dbo.t_OutSourcing_SendItems a left join
[10.0.0.230].wxnx2021.dbo.t_OutSourcing_SendSheet b on a.SID_Sheet= b.SID_Sheet
where b.IsChecked =1 and isnull(b.IsDeleted,0)=0 group by TaskItemID ) bb on aa. SID_Item= bb.TaskItemID
left join [10.0.0.230].wxnx2021.dbo.t_TaskSheet cc on aa.SID_Sheet = cc.SID_Sheet
left join [10.0.0.230].wxnx2021.dbo.t_Material dd on dd.SysID=aa.materialid
where cc.IsChecked=1 and (isnull(aa.Qua,0)-isnull(bb.qty,0))>0 and cc.SheetType=3 and isnull(cc.IsDeleted,0)=0
";
PmcWwInvlRes.wfdetails=conn.Query< NX.ERP.Model.wfdetail> (sql,"" );
var sql2 = @" select b.sheetid,dd.code,dd.name,dd.standard, CONVERT(DECIMAL(13,3),a.Qua) as Qua, CONVERT(DECIMAL(13,3),a.ReceivedQua) as ReceivedQua , CONVERT(DECIMAL(13,3),a.Qua-a.ReceivedQua) as diff
from [10.0.0.230].wxnx2021.dbo.t_OutSourcing_SendItems a left join
[10.0.0.230].wxnx2021.dbo.t_OutSourcing_SendSheet b on a.SID_Sheet= b.SID_Sheet
left join [10.0.0.230].wxnx2021.dbo.t_Material dd on dd.SysID=a.materialid
where b.IsChecked =1 and isnull(b.IsDeleted,0)=0 and a.Qua<>a.ReceivedQua
";
PmcWwInvlRes.wsdetails = conn.Query<NX.ERP.Model.wsdetail>(sql2, "");
PmcWwInvlRes.wfjl = PmcWwInvlRes.wfdetails.Count();
PmcWwInvlRes.wsjl = PmcWwInvlRes.wsdetails.Count();
}
return PmcWwInvlRes;
}
}
}