|
|
@ -2709,7 +2709,7 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null |
|
|
|
,a.WHCode,detail.LocationCode AS Area,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,c.MUSERName |
|
|
|
,Case When a.WHCode+';'+detail.LocationCode in (select F_Define1+';'+F_Define2 from Sys_SRM_ItemsDetail where F_Define3='HGAreaConfig') |
|
|
|
THEN '货柜' ELSE '平库' END AS AreaType |
|
|
|
THEN '货柜' ELSE '平库' END AS AreaType,LotD.EATTRIBUTE1 AS LotDLocationCode |
|
|
|
from ICSMOApplyNegDetail a |
|
|
|
left join ICSMOApplyNeg d on a.ApplyNegCode=d.ApplyNegCode and a.WorkPoint=d.WorkPoint |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
@ -2721,6 +2721,15 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null |
|
|
|
)c |
|
|
|
on a.ApplyNegCode=c.TransCode and a.Sequence=c.TransSequence and a.WorkPoint=c.WorkPoint |
|
|
|
left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint |
|
|
|
|
|
|
|
left join(SELECT [TransCode], [TransSequence],WorkPoint, |
|
|
|
STUFF((SELECT ','''+[EATTRIBUTE1] |
|
|
|
FROM (select DISTINCT [EATTRIBUTE1] from [ICSInventoryLotDetail] |
|
|
|
where [TransCode]=b.[TransCode] and [TransSequence]=b.[TransSequence] and WorkPoint=b.WorkPoint |
|
|
|
)a for xml path(''))+'',1,2,'') AS [EATTRIBUTE1] |
|
|
|
FROM [ICSInventoryLotDetail] b where ISNULL([EATTRIBUTE1],'')<>'' |
|
|
|
GROUP BY [TransCode], [TransSequence],WorkPoint) LotD on a.ApplyNegCode=LotD.TransCode and a.Sequence=LotD.TransSequence and a.WorkPoint=LotD.WorkPoint |
|
|
|
|
|
|
|
WHERE d.Type='2'";
|
|
|
|
sql = string.Format(sql, Figure); |
|
|
|
sql = string.Format(sql, DbHelper.GetErpIp(), DbHelper.GetErpName()); |
|
|
|
xxxxxxxxxx