|
|
@ -103,6 +103,7 @@ and b1.code not like 'K10%' |
|
|
|
,case when a.ActualCompleteDate is null then '' |
|
|
|
else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
|
,a.IsFIClose |
|
|
|
,e3.Name AlternateTypeName |
|
|
|
INTO #TempMO |
|
|
|
from {1}.dbo.MO_MO as A With(NoLock) |
|
|
|
left join {1}.dbo.[MO_MOMemo] as A1 With(NoLock) on (A.[ID] = A1.[MO]) |
|
|
@ -116,6 +117,9 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
|
left join {1}.dbo.[CBO_Department] as A13 With(NoLock) on (A.[Department] = A13.[ID]) |
|
|
|
left join {1}.dbo.[CBO_Department_Trl] as A14 With(NoLock) on (A14.SysMlFlag = 'zh-CN') and (A13.[ID] = A14.[ID]) |
|
|
|
LEFT JOIN {1}.dbo.[CBO_Wh] AS A22 With(NoLock) ON A22.ID=A.CompleteWh |
|
|
|
left join {1}.dbo.UBF_Sys_ExtEnumType e1 on e1.Code = 'UFIDA.U9.CBO.MFG.Enums.AlternateTypesEnum' |
|
|
|
left join {1}.dbo.UBF_Sys_ExtEnumValue e2 on e1.ID=e2.ExtEnumType and e2.evalue=a.BOMAlternate |
|
|
|
left join {1}.dbo.UBF_Sys_ExtEnumValue_Trl e3 on e2.id=e3.ID and e3.SysMLFlag='zh-CN' |
|
|
|
where (A.DocState=2 OR A.DocState=3) and A.[BusinessType] != 50 and (A.[BusinessType] != 52) |
|
|
|
and (A.[BusinessType] != 2417) and (A.[IsMultiRouting] != 1) and A.[ItemMaster] is not null --and (A.[IsStartMO] != 1) |
|
|
|
and ISNULL(A.ModifiedOn,A.BusinessCreatedOn)>=@LastTime AND A12.id='{0}' |
|
|
@ -157,7 +161,6 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
|
values.Add("WHCode", "a.WHCode");//仓库
|
|
|
|
values.Add("MoPlanStartDate", "a.StartDate");//开工日
|
|
|
|
values.Add("MoPlanEndDate", "a.DueDate");//完工日
|
|
|
|
|
|
|
|
values.Add("MOMemo", "a.MOMemo");//生产订单状态
|
|
|
|
values.Add("MoUser", "a.CreatePerson");//生产订单状态
|
|
|
|
values.Add("MODOWNDATE", "a.CreateDateTime");//生产订单状态
|
|
|
@ -173,6 +176,7 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
|
values.Add("Default3", "a.ActualCompleteDate"); |
|
|
|
values.Add("Default5", "a.DocState"); |
|
|
|
values.Add("Default6", "a.IsFIClose"); |
|
|
|
values.Add("Alternate", "a.AlternateTypeName"); |
|
|
|
|
|
|
|
//更新存在数据
|
|
|
|
sql += ICSHelper.UpdateSQL("b", values) |
|
|
|