From 381b8b5af10f201c4752c2eb1421234cbdebe880 Mon Sep 17 00:00:00 2001 From: xusc Date: Tue, 12 Nov 2024 15:56:13 +0800 Subject: [PATCH] .. --- .vs/ICSSoft.FromERP/v16/.suo | Bin 347136 -> 346624 bytes ICSSoft.FromERP/SyncMoHour_Rhyton.cs | 49 +++++++++++++++++++++++---- ICSSoft.Test/Program.cs | 2 +- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/.vs/ICSSoft.FromERP/v16/.suo b/.vs/ICSSoft.FromERP/v16/.suo index d850f420dd8efc0a803a40fbf7e7406ca4a0a9ea..bdb9766d40714dc54c0c1d4fded42908d10742f2 100644 GIT binary patch delta 6125 zcmc(j3sh9q8pr25`-}`QAo3iQ5b?24L4s>jQOCZz(V`#|(AAN2H;ok|tg9w!CJomJ99u5bk$|hftI0TKDEz>&M>v+t2U6 z_xbi2^d%npEgpsHAX&%bB9rlywHtX@rYp zkqKGc%Ul6x`kwQFK~i7oiKU7s2}fcjQA0@fgOt7`jOP1-MVP@)93rQ38c|1_Ch`a* zCJ^rv!NfqqL8#_e*q@}_XGDPzF86|b;aT|rk7_Faix^CJ5etYDLXq4JE(m+&W0cNR zUO}h{;cL0x$?_#1*M0GcGSl}xTp_3jHMu9Pk{-#CzEqa-k|Un&d8sTp)ai(K1C=EA z{z2>}0!TM+N(%^K3GdHKJ__3uDyOavDaoM_l{DK-s`jEj;gmj4Op%%^BO0svA@C~xBBGwSE5*vhF4sIqFhjb2F%9pN%QWvhmCBqIr7M6SE zLWA%f{k?2ju3`XNg{DlV*g;-}@>Q$7DEOAfVib%3xZ z&)al7CIU)*or_f&-Nq60)BQ|->L$BlpNt-hsKZdTDcff~l!m!i%=3mwY5zW;;m#80 zh!2T6;yiJIs3)X07b(5eo|noUG?Gn7$~|Km9DA)-@%oiq9dF7mrSVf$#m>Xz*)-z^ zLeRbeLcFufwB00F3Rw;jX9?*o+CRd?w}^eje&PV}HX*ey7s{R8 zCRI?$L>wk62{R!QM~HWcqr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+ + select a.MoCode ,a.ItemCode @@ -75,13 +88,14 @@ a.MoCode ,((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 + ,a.Status ,a.TenantId ,a.CreationTime MTIME ,a.CreatorUserId ,a.CreatorUserName + ,a.EqpCalcType - into #tempSyncMoHour_Rhyton from ( select @@ -103,6 +117,7 @@ from ,GETDATE() CreationTime ,'job' as CreatorUserId ,'job' CreatorUserName + ,h1.EqpCalcType 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 @@ -131,10 +146,11 @@ and a.MoStatus='mostatus_close' and a.Default6='0' and a.TenantId='{0}' and e.OpControl='10000000' -and (h2.id is null) +and h2.Status='No' ) a where 1=1 -order by a.MoCode, a.OpSeq asc +) a + @@ -169,17 +185,36 @@ a.MoCode ,a.TotalTime ,a.PTime ,a.ManualTime -,(a.PTime+cast( a.ManualTime as decimal(18,6) )) -,case when a.ResQty>0 then (a.PTime+cast( a.ManualTime as decimal(18,6) ))/a.ResQty -else 0 end as EqpTotalTime +,a.MachiningTotalTime +,a.EqpTotalTime ,a.ResQty -,(a.PTime+cast( a.ManualTime as decimal(18,6) )-a.TotalTime) +,a.HourDiff ,a.Status ,a.TenantId ,a.MTIME ,a.CreatorUserId ,a.CreatorUserName from #tempSyncMoHour_Rhyton a +left join IcsMoHourData b on a.MoCode=b.MoCode and a.OpCode=b.OpCode +where b.Id is null + + +update IcsMoHourData +set STime=a.STime + ,Rtime=a.Rtime + ,TotalTime=a.TotalTime + ,RealTime=a.PTime + ,ManualTime=a.ManualTime +,MachiningTotalTime=a.MachiningTotalTime +,EqpTotalTime=a.EqpTotalTime +,ResQty=a.ResQty +,HourDiff=a.HourDiff +from #tempSyncMoHour_Rhyton a + join IcsMoHourData b on a.MoCode=b.MoCode and a.OpCode=b.OpCode + where 1=1 + and b.Status='No' + + diff --git a/ICSSoft.Test/Program.cs b/ICSSoft.Test/Program.cs index 09b8fbd..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(); - IcsMo_Rhtyon test = new IcsMo_Rhtyon(); + SyncMoHour_Rhyton test = new SyncMoHour_Rhyton(); test.Execute(); // var ss= ICSHelper.ApiSign("sj_w_id", "70FF7F01C5899A5ACAAD4ECB7FA5B3C5", 1724650261);