修改订
This commit is contained in:
@@ -444,34 +444,50 @@ namespace NX.ERP.U8.Purchase
|
||||
public IEnumerable<object> Purchasesummom(NX.ERP.Model.Request.PurchasesumRequest info)
|
||||
{
|
||||
string sql = $@"
|
||||
select *from (
|
||||
select a.*,isnull(f.cMaker,'其他') as cpersonname ,inv.cInvName,inv.cInvStd from (
|
||||
select a.InvCode as CINVCODE ,1 as RQTY , iqty,cur.iQuantity, (cur.iQuantity-iqty) as bull From (
|
||||
SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) iqty
|
||||
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join
|
||||
mom_morder mor WITH (NOLOCK) ON ma.MoDId= mor.MoDId
|
||||
DECLARE @RdRecord table(
|
||||
CINVCODE nvarchar(200),
|
||||
RQTY int,
|
||||
iqty int,
|
||||
iQuantity int,
|
||||
bull int,
|
||||
cpersonname nvarchar(200),
|
||||
cInvName nvarchar(200),
|
||||
cInvStd nvarchar(500)
|
||||
)
|
||||
insert into @RdRecord
|
||||
select *from (
|
||||
select a.*,isnull(f.cMaker,'其他') as cpersonname ,inv.cInvName,inv.cInvStd from (
|
||||
select a.InvCode as CINVCODE ,1 as RQTY , iqty,cur.iQuantity, (cur.iQuantity-iqty) as bull From (
|
||||
SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) iqty
|
||||
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
|
||||
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join
|
||||
mom_morder mor WITH (NOLOCK) ON ma.MoDId= mor.MoDId
|
||||
|
||||
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0 and
|
||||
mor.DueDate between @beginDate and @endDate
|
||||
GROUP BY ma.InvCode
|
||||
) a left join
|
||||
CurrentStock cur WITH (NOLOCK) ON cur.cInvCode = a.InvCode where (cur.iQuantity -iqty) <0
|
||||
) a left join
|
||||
(select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid)
|
||||
as c where c.rownumber=1) f on a.CINVCODE=f.cInvCode
|
||||
left join Inventory inv WITH (NOLOCK) on a.CINVCODE=inv.cInvCode )pumo
|
||||
WHERE md.Status <> 4 AND ma.Qty - ISNULL(ma.IssQty, 0) > 0 and
|
||||
mor.DueDate between @beginDate and @endDate
|
||||
GROUP BY ma.InvCode
|
||||
) a left join
|
||||
CurrentStock cur WITH (NOLOCK) ON cur.cInvCode = a.InvCode where (cur.iQuantity -iqty) <0
|
||||
) a left join
|
||||
(select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid)
|
||||
as c where c.rownumber=1) f on a.CINVCODE=f.cInvCode
|
||||
left join Inventory inv WITH (NOLOCK) on a.CINVCODE=inv.cInvCode )pumo
|
||||
|
||||
update @RdRecord set cpersonname ='其他' where cpersonname not in ( select cPsn_Name from hr_v_HR31_show where cDepCode ='52' and rEmployState ='在职')
|
||||
|
||||
|
||||
select *From @RdRecord
|
||||
";
|
||||
|
||||
List<string> where = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(info.cpersonname))
|
||||
{
|
||||
where.Add(" pumo.cpersonname = @cpersonname");
|
||||
where.Add(" cpersonname = @cpersonname");
|
||||
}
|
||||
if (info.InvCodes != null)
|
||||
{
|
||||
where.Add(" pumo.cInvCode = @InvCodes");
|
||||
where.Add(" cInvCode = @InvCodes");
|
||||
}
|
||||
|
||||
var aa = string.Join(" and ", where.ToArray());
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<div>
|
||||
<Row :gutter="16">
|
||||
<Col span="3">
|
||||
<label>生产订单期间1</label>
|
||||
<label>第一生产期间</label>
|
||||
<div>
|
||||
<DatePicker v-model="filter.dates" type="daterange"></DatePicker>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="3">
|
||||
<label>生产订单期间2</label>
|
||||
<label>第二生产期间</label>
|
||||
<div>
|
||||
<DatePicker v-model="filter.dates2" type="daterange"></DatePicker>
|
||||
</div>
|
||||
@@ -267,7 +267,7 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "两个月内计划工单缺品种数",
|
||||
title: "第一期间内计划工单缺件品种数",
|
||||
align: "center",
|
||||
key: "mommouth02",
|
||||
render: (h, params) => {
|
||||
@@ -295,7 +295,7 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "四个月内计划工单缺品种数",
|
||||
title: "第二期间内计划工单缺件品种数",
|
||||
align: "center",
|
||||
key: "mommouth04",
|
||||
render: (h, params) => {
|
||||
|
||||
Reference in New Issue
Block a user