From 5b3a377dd8c66a10eb8cf86dc714d1e67fcefc35 Mon Sep 17 00:00:00 2001 From: xusc Date: Fri, 25 Oct 2024 09:56:17 +0800 Subject: [PATCH] .. --- .vs/ICSSoft.FromERP/v16/.suo | Bin 330752 -> 330752 bytes ICSSoft.FromERP/App.config | 4 +- ICSSoft.FromERP/SyncMoHour_Rhyton.cs | 88 +++++---------------------- ICSSoft.Test/Program.cs | 2 +- 4 files changed, 18 insertions(+), 76 deletions(-) diff --git a/.vs/ICSSoft.FromERP/v16/.suo b/.vs/ICSSoft.FromERP/v16/.suo index cc3669ad3cc5cb82c2a523a78bda12c455961567..56a09ac8b4b6428ee3d2ed82aac47c26abd62c47 100644 GIT binary patch delta 6777 zcmc(j4O~=J`p4(F=gtU-$jg98pnxQ-0uBg@%HlYJD7uE3ibTeXvT8)Wfcb(j_?8K+ zFxQ>K$8{Bn27B2S9p$>(;z+Dn>w8vcYS^}Ixz%6&qm?G^?;sYb_4nWQ*}Z(e^PKbC zbI(2Jc{%4?%vE}GmA)d?`_q5xO4aR*O=t>9HK18e|Gl~J;nQ!Ppz6< zY|1Wqr1uT9s79?9X*8oC7l8AMv$k)E5hZs?qq&4T$tb@7PJstOBuE3I|22^BfLxFc z;(^dV3Yh_Vq7P9Y*r{)UY)8EpStYBVNIAu3zIXy5~01Nk5a90TQG z09XrN2I3{hG1yfoKMfWtpK4b+8@iQzViv}<7wWdqlb*OCOeh*}g>>pHi@LbFnpMN8MN){gUQf|ad!1VDg6W=RHGx|12LUW zA2?t4-orGSz2G(QXV3`tDd%0h6xZ%!AAA?J_rUw$6gUmU;Lbpv1?NQFzNGsyi7J&V zJ#Lbxa>cELnv}wxCA8murDusm4yDkugcRk9XNmTCyg$Ic#A}&+cYEjk=uG%rqulU# z`tHY+C0@_l{rx}ETGlL;n$4A2fkx@HY4hI3QB=4HOQ7H^Ey#OwdCi z*~=poH8BivokaO7W&6QUWpU{2K3}7D9lQv>0XIN9xCu05Z+}SAS&9mDFGw2AVcEX4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YX716}5Pz9UgN@ai-6(+3uA_KRj3#TAnRQJI69!qy9b|PFg<9U;Z?r>J yuJ1>Aw;AR7hu-Yj`@QD-EwI+=aFf*=+V;(JC4S_Zq3=-(O5o-pMxa#y?SBD5<~+&( diff --git a/ICSSoft.FromERP/App.config b/ICSSoft.FromERP/App.config index 85b5e34..583e0de 100644 --- a/ICSSoft.FromERP/App.config +++ b/ICSSoft.FromERP/App.config @@ -37,9 +37,9 @@ - + - + diff --git a/ICSSoft.FromERP/SyncMoHour_Rhyton.cs b/ICSSoft.FromERP/SyncMoHour_Rhyton.cs index 3b22aa5..6848503 100644 --- a/ICSSoft.FromERP/SyncMoHour_Rhyton.cs +++ b/ICSSoft.FromERP/SyncMoHour_Rhyton.cs @@ -64,10 +64,6 @@ namespace ICSSoft.FromERP if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempSyncMoHour_Rhyton') and type='U') DROP TABLE #tempSyncMoHour_Rhyton - --工单工时同步表 - if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempSyncMoHourYesData_Rhyton') and type='U') -DROP TABLE #tempSyncMoHourYesData_Rhyton - select a.MoCode ,a.ItemCode @@ -75,6 +71,7 @@ a.MoCode ,a.MoPlanQty ,a.STime ,a.Rtime +,a.ResQty ,((a.STime*a.MoPlanQty)+a.Rtime) as TotalTime ,cast( cast( isnull( a.ProduceTime,0) as decimal(18,6)) /cast( 3600 as decimal(18,6)) as decimal(18,6)) as PTime ,a.ManualTime @@ -95,30 +92,11 @@ from ,e.OpSeq --,e2.OPName ,a.MoPlanQty - , - ( - select sum(isnull( f.Stime,0)) Stime - from IcsItem2Route h with(nolock) - join IcsItemRoute2Op f with(nolock) on h.ItemCode=f.ItemCode and h.RouteCode=f.RouteCode - where h.IsRef='Y' - and h.ItemCode=a.ItemCode - and f.OpCode=e.OpCode - group by h.ItemCode,f.OpCode - ) - as STime - , - ( - select sum(isnull( f.Rtime,0)) Rtime - from IcsItem2Route h with(nolock) - join IcsItemRoute2Op f with(nolock) on h.ItemCode=f.ItemCode and h.RouteCode=f.RouteCode - where h.IsRef='Y' - and h.ItemCode=a.ItemCode - and f.OpCode=e.OpCode - group by h.ItemCode,f.OpCode - ) - as Rtime - ,g.ProduceTime - ,f.RecordingHours as ManualTime + ,isnull( h1.Stime,0) STime + ,isnull( h1.Rtime,0) RTime + ,isnull(h1.ResQty,0) ResQty + ,isnull( g.ProduceTime,0) ProduceTime + ,isnull(f.RecordingHours,0) as ManualTime --,0.00 as AlterTime ,'No' as Status ,'{0}' as TenantId @@ -128,7 +106,7 @@ from from IcsMo a with(nolock) join IcsInventory b with(nolock) on a.ItemCode=b.ItemCode and a.TenantId=b.TenantId join IcsMo2Route d with(nolock) on a.MoCode=d.MoCode and d.IsMRoute='Y' and a.TenantId=d.TenantId - join IcsMoRoute2Op e with(nolock) on d.MoCode=e.MoCode and d.RouteId=e.RouteId and d.TenantId=e.TenantId + join IcsMoRoute2Op e with(nolock) on d.MoCode=e.MoCode and d.RouteCode=e.RouteCode and d.TenantId=e.TenantId join IcsOP e2 with(nolock) on e.OpCode=e2.OPCode and e.TenantId=e2.TenantId left join ( @@ -144,21 +122,20 @@ and t.IsHistory='N' and t.CollectForm='Standard' group by t.MoCode,t.OpCode ) g on a.MoCode=g.MoCode and e.OpCode=g.OpCode + +left join IcsItem2Route h with(nolock) on b.ItemCode=h.ItemCode and d.RouteCode=h.RouteCode and b.TenantId=h.TenantId +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.TenantId='{0}' ---and a.CreationTime>@LastTime +and e.OpControl='10000000' +and (h2.id is null) ) a where 1=1 order by a.MoCode, a.OpSeq asc -delete from IcsMoHourData -where Status='No' -select * into #tempSyncMoHourYesData_Rhyton from IcsMoHourData -where Status='Yes' - -truncate table IcsMoHourData insert into IcsMoHourData ( MoCode @@ -171,6 +148,7 @@ truncate table IcsMoHourData ,RealTime ,ManualTime ,MachiningTotalTime +,ResQty ,Status ,TenantId ,CreationTime @@ -188,50 +166,14 @@ a.MoCode ,a.PTime ,a.ManualTime ,(a.PTime+a.ManualTime) +,a.ResQty ,a.Status ,a.TenantId ,a.MTIME ,a.CreatorUserId ,a.CreatorUserName from #tempSyncMoHour_Rhyton a -left join IcsMoHourData b with(nolock) on a.MoCode=b.MoCode and a.OpCode=b.OpCode -where b.MoCode is null and b.OpCode is null - - - insert into IcsMoHourData ( - MoCode - ,ItemCode - ,OpCode - ,Qty - ,STime - ,RTime - ,TotalTime - ,RealTime - ,ManualTime - ,AlterTime - ,MachiningTotalTime - ,EqpTotalTime - ,Status - ,TenantId - ,CreationTime - ,CreatorUserId - ,CreatorUserName - ,VerifyUser - ,VerifyDate - ,LastModificationTime - ,LastModifierUserId - ,LastModifierUserName - ) - select a.MoCode,a.ItemCode,a.OpCode,a.Qty,a.STime,a.RTime,a.TotalTime - ,a.RealTime,a.ManualTime - ,a.AlterTime - ,a.MachiningTotalTime - ,a.EqpTotalTime - ,a.Status,a.TenantId - ,a.CreationTime,a.CreatorUserId,a.CreatorUserName,a.VerifyUser,a.VerifyDate - ,a.LastModificationTime,a.LastModifierUserId,a.LastModifierUserName - from #tempSyncMoHourYesData_Rhyton a "; diff --git a/ICSSoft.Test/Program.cs b/ICSSoft.Test/Program.cs index 60cec7a..20172ab 100644 --- a/ICSSoft.Test/Program.cs +++ b/ICSSoft.Test/Program.cs @@ -13,7 +13,7 @@ namespace ICSSoft.Test //ICSVendor test = new ICSVendor(); //test.Execute(); - SyncSO_WeiMas test = new SyncSO_WeiMas(); + SyncMoHour_Rhyton test = new SyncMoHour_Rhyton(); test.Execute(); // var ss= ICSHelper.ApiSign("sj_w_id", "70FF7F01C5899A5ACAAD4ECB7FA5B3C5", 1724650261);