|
|
@ -601,14 +601,19 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; |
|
|
|
else '已合并' |
|
|
|
end as IsNew, |
|
|
|
case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, |
|
|
|
case when sum(a.Quantity) =sum(IssueQuantity) then '已过账' |
|
|
|
when sum(a.Quantity)!=sum(IssueQuantity) AND sum(IssueQuantity)>0 then '已配料' |
|
|
|
else '未配料' end as Status, |
|
|
|
g.Status as Status1, |
|
|
|
f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID |
|
|
|
from ICSOApply a |
|
|
|
left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint |
|
|
|
left join ICSExtension f on a.ExtensionID = f.ID and a.WorkPoint = f.WorkPoint |
|
|
|
left join (SELECT ApplyCode, |
|
|
|
case when sum(Quantity) =sum(IssueQuantity) AND sum(IssueQuantity)>0 then '已过账' |
|
|
|
|
|
|
|
else '未过账' end as Status |
|
|
|
from ICSOApply |
|
|
|
where WorkPoint='{WorkPoint}' |
|
|
|
group by ApplyCode) g on a.ApplyCode = g.ApplyCode |
|
|
|
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint |
|
|
|
left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLotInfoLog ) k on a.ApplyCode=k.TransCode and a.WorkPoint=k.WorkPoint and k.TransType='15' |
|
|
@ -641,7 +646,20 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo |
|
|
|
} |
|
|
|
sqlString.Append(@"group by a.ApplyCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,
|
|
|
|
f.BatchCode,f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4,f.cFree5, |
|
|
|
f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID ) t where row=1");
|
|
|
|
f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,g.Status ) t where row=1");
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(queryParam["Status"].ToString())) |
|
|
|
{ |
|
|
|
if (queryParam["Status1"].ToString() == "1") |
|
|
|
{ |
|
|
|
sqlString.Append($@" AND t.Status1='已过账' "); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
sqlString.Append($@" AND t.Status1='未过账' "); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam); |
|
|
@ -931,13 +949,13 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo |
|
|
|
else '已合并' |
|
|
|
end as IsNew, |
|
|
|
case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, |
|
|
|
case when sum(a.Quantity)=sum(a.OutQuantity) then '已过帐' |
|
|
|
when sum(a.Quantity)!=sum(a.OutQuantity) and sum(a.OutQuantity)>0 then '已配料' |
|
|
|
else '未配料' END AS Status, |
|
|
|
g.Status as Status1, |
|
|
|
f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID |
|
|
|
from ICSOtherOut a |
|
|
|
left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint |
|
|
|
left join (SELECT OutCode,case when sum(Quantity) =sum(OutQuantity) AND sum(OutQuantity)>0 then '已过账' else '未过账' end as Status |
|
|
|
from ICSOtherOut where WorkPoint='{WorkPoint}' group by OutCode) g on a.OutCode = g.OutCode |
|
|
|
left join ICSExtension f on a.ExtensionID = f.ID and a.WorkPoint = f.WorkPoint |
|
|
|
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint |
|
|
@ -973,7 +991,19 @@ f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
} |
|
|
|
sqlString.Append(@" group by a.OutCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,f.BatchCode,
|
|
|
|
f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6, |
|
|
|
f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID) t where t.row=1");
|
|
|
|
f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,g.Status) t where t.row=1");
|
|
|
|
if (!string.IsNullOrWhiteSpace(queryParam["Status"].ToString())) |
|
|
|
{ |
|
|
|
if (queryParam["Status1"].ToString() == "1") |
|
|
|
{ |
|
|
|
sqlString.Append($@" AND t.Status1='已过账' "); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
sqlString.Append($@" AND t.Status1='未过账' "); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam); |
|
|
|
} |
|
|
@ -1119,21 +1149,17 @@ f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
// sql += " WHERE 1=1 and e.ID is null ";
|
|
|
|
sqlString.Append($@"select * from (select row_number() over(partition by a.TransferNO order by a.TransferNO) row,
|
|
|
|
a.TransferNO as Code,a.ID,CONVERT(varchar(100),a.CreateDateTime,23) as MTIME,a.CreatePerson as MUSER, |
|
|
|
case |
|
|
|
when max(e.SourceID) is null then '未合并' |
|
|
|
else '已合并' |
|
|
|
end as IsNew, |
|
|
|
case when max(k.TransCode) is null then '未占料' else '已占料' end as IsOccupy, |
|
|
|
case when sum(a.Quantity)=sum(a.TransferQuantity) then '已过帐' |
|
|
|
when sum(a.Quantity)!=sum(a.TransferQuantity) and sum(a.TransferQuantity)>0 then '已配料' |
|
|
|
else '未配料' END AS Status, |
|
|
|
g.Status as Status1, |
|
|
|
f.Colspan,f.ProjectCode,f.BatchCode,f.Version,f.Brand,f.cFree1, |
|
|
|
f.cFree2,f.cFree3,f.cFree4,f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10 |
|
|
|
from ICSTransfer a |
|
|
|
left join ICSMOPickMerge e on a.ID = e.SourceID and a.WorkPoint = e.WorkPoint |
|
|
|
left join ICSExtension f on a.ExtensionID = f.ID and a.WorkPoint = f.WorkPoint |
|
|
|
left join (SELECT TransferNO,case when sum(Quantity) =sum(TransferQuantity) AND sum(TransferQuantity)>0 then '已过账' else '未过账' end as Status |
|
|
|
from ICSTransfer where WorkPoint='{WorkPoint}' group by TransferNO) g on a.TransferNO = g.TransferNO |
|
|
|
|
|
|
|
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.ToWarehouseCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.FromWarehouseCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint |
|
|
|
left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLotInfoLog ) k on a.TransferNO=k.TransCode and a.WorkPoint=k.WorkPoint and k.TransType='15' |
|
|
|
where a.WorkPoint = '{WorkPoint}' and a.Status = '2'");
|
|
|
|
if (!string.IsNullOrWhiteSpace(queryJson)) |
|
|
@ -1164,7 +1190,20 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo |
|
|
|
} |
|
|
|
sqlString.Append(@"group by a.TransferNO,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,
|
|
|
|
f.BatchCode,f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4, |
|
|
|
f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,a.TransferQuantity) t where t.row=1");
|
|
|
|
f.cFree5,f.cFree6,f.cFree7,f.cFree8,f.cFree9,f.cFree10,a.ID,a.TransferQuantity,g.Status) t where t.row=1");
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(queryParam["Status"].ToString())) |
|
|
|
{ |
|
|
|
if (queryParam["Status1"].ToString() == "1") |
|
|
|
{ |
|
|
|
sqlString.Append($@" AND t.Status1='已过账' "); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
sqlString.Append($@" AND t.Status1='未过账' "); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam); |
|
|
|