diff --git a/.vs/ICSSoft.FromERP/v16/.suo b/.vs/ICSSoft.FromERP/v16/.suo index ba40920..e805599 100644 Binary files a/.vs/ICSSoft.FromERP/v16/.suo and b/.vs/ICSSoft.FromERP/v16/.suo differ diff --git a/ICSSoft.FromERP/App.config b/ICSSoft.FromERP/App.config index d0426ef..0330c59 100644 --- a/ICSSoft.FromERP/App.config +++ b/ICSSoft.FromERP/App.config @@ -2,8 +2,8 @@ - - + + @@ -37,9 +37,9 @@ - + - + diff --git a/ICSSoft.FromERP/IcsMo_Rhtyon.cs b/ICSSoft.FromERP/IcsMo_Rhtyon.cs index 5803563..c5df4f7 100644 --- a/ICSSoft.FromERP/IcsMo_Rhtyon.cs +++ b/ICSSoft.FromERP/IcsMo_Rhtyon.cs @@ -66,6 +66,7 @@ namespace ICSSoft.FromERP case when A.DocState=2 then 'mostatus_initial' when A.DocState=3 then 'mostatus_close' else 'mostatus_initial' end as MOStatus, + case when A.DocState=2 then '开工' when A.DocState=3 then '关闭' else '开工' end as DocState, A2.Description as MOMemo, '2' as ERPStatus, A.StartDate as StartDate, @@ -101,6 +102,7 @@ and b1.code not like 'K10%' ,A4.Name as MoDocType ,case when a.ActualCompleteDate is null then '' else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate +,a.IsFIClose 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]) @@ -168,7 +170,9 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate values.Add("CusItemCode", "a.EATTRIBUTE2"); values.Add("CusName", "a.EATTRIBUTE3"); values.Add("DocType", "a.MoDocType"); - // values.Add("Default3", "a.ActualCompleteDate"); + values.Add("Default3", "a.ActualCompleteDate"); + values.Add("Default5", "a.DocState"); + values.Add("Default6", "a.IsFIClose"); //更新存在数据 sql += ICSHelper.UpdateSQL("b", values) diff --git a/ICSSoft.FromERP/SyncMoHour_Rhyton.cs b/ICSSoft.FromERP/SyncMoHour_Rhyton.cs index 5fbf261..07c5822 100644 --- a/ICSSoft.FromERP/SyncMoHour_Rhyton.cs +++ b/ICSSoft.FromERP/SyncMoHour_Rhyton.cs @@ -127,6 +127,8 @@ left join IcsItem2Route h with(nolock) on b.ItemCode=h.ItemCode and d.RouteCod left join IcsItemRoute2Op h1 with(nolock) on h.ItemCode=h1.ItemCode and h.RouteCode=h1.RouteCode and e.OpCode=h1.OpCode and h.TenantId=h1.TenantId left join IcsMoHourData h2 with(nolock) on a.mocode=h2.mocode and e.OpCode=h2.OpCode where 1=1 +and a.MoStatus='mostatus_close' +and a.Default6='0' and a.TenantId='{0}' and e.OpControl='10000000' and (h2.id is null) @@ -149,6 +151,7 @@ order by a.MoCode, a.OpSeq asc ,ManualTime ,MachiningTotalTime ,ResQty +,HourDiff ,Status ,TenantId ,CreationTime @@ -167,6 +170,7 @@ a.MoCode ,a.ManualTime ,(a.PTime+cast( a.ManualTime as decimal(18,6) )) ,a.ResQty +,(a.PTime+cast( a.ManualTime as decimal(18,6) )-a.TotalTime) ,a.Status ,a.TenantId ,a.MTIME