Browse Source

工单同步(U9)修改

Branch_PaiNaWeiSJob
徐莉 3 months ago
parent
commit
57a7a9a82a
  1. 14
      ICSSoft.FromERP/ICSMo.cs

14
ICSSoft.FromERP/ICSMo.cs

@ -71,7 +71,9 @@ namespace ICSSoft.FromERP
A.ID as MOID,
A.ID as MODetailID,
ISNULL(A.ModifiedOn,A.BusinessCreatedOn) as MTIME,
isnull(A11.Code,'') ProjectCode,isnull(A19.LotCode,'') cBatch,'' version ,'' brand,
isnull(A11.Code,'') ProjectCode,
--isnull(A19.LotCode,'') cBatch,
'' version ,'' brand,
'' as cFree1,
'' as cFree2,
'' as cFree3,
@ -102,7 +104,7 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate
left join {1}.dbo.[MO_MOMemo_Trl] as A2 With(NoLock) on (A2.SysMlFlag = 'zh-CN') and (A1.[ID] = A2.[ID])
left join {1}.dbo.[MO_MODocType] as A3 With(NoLock) on (A.[MODocType] = A3.[ID])
left join {1}.dbo.[MO_MODocType_Trl] as A4 With(NoLock) on (A4.SysMlFlag = 'zh-CN') and (A3.[ID] = A4.[ID])
left join {1}.dbo.[MO_MOTaskPlan] as A5 With(NoLock) on (A.[ID] = A5.[MO])
left join {1}.dbo.[Base_User] as A6 With(NoLock) on (A.ModifiedBy = A6.Code)
left join {1}.dbo.[CBO_ItemMaster] as A7 With(NoLock) on (A.[ItemMaster] = A7.[ID])
left join {1}.dbo.[MO_MO_Trl] as A8 With(NoLock) on (A8.SysMlFlag = 'zh-CN') and (A.[ID] = A8.[ID])
@ -112,13 +114,7 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate
left join {1}.dbo.[Base_Organization] as A12 With(NoLock) on (A.[Org] = A12.[ID])
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. MO_MO As A16 With(NoLock) on A16.[MODocType]=1001603110990023 and A.[Project]=A16.Project and A.ItemMaster=A16.ItemMaster
left join {1}.dbo.[CBO_ItemMaster] as A17 With(NoLock) on (A16.[ItemMaster] = A17.[ID])
left join {1}.dbo.[CBO_ItemMaster_Trl] as A18 With(NoLock) on (A18.SysMlFlag = 'zh-CN') and (A17.[ID] = A16.[ID])
left join {1}.dbo.[MO_MOLot] as A19 With(NoLock) on (A16.[ID] = A19.[MO])
left join (select * from (select ROW_NUMBER() over( partition by dept order by code desc ) row,* from {1}.dbo.CBO_Operators with(nolock) ) bb
where bb.row='1' )as A20 on A20.dept=A.Department and a20.Org=a.Org
left join {1}.dbo.[MO_IssueDoc] as A21 With(NoLock) on A21.[SourceDoc_SrcDocNo]=A.DocNo
LEFT JOIN {1}.dbo.[CBO_Wh] AS A22 With(NoLock) ON A22.ID=A.CompleteWh
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)

Loading…
Cancel
Save