diff --git a/.vs/ICSSoft.FromERP/v16/.suo b/.vs/ICSSoft.FromERP/v16/.suo index 56c61f4..f39d84e 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 7b62e13..b71d9d8 100644 --- a/ICSSoft.FromERP/App.config +++ b/ICSSoft.FromERP/App.config @@ -19,8 +19,8 @@ - + diff --git a/ICSSoft.FromERP/SyncItem_WeiMas.cs b/ICSSoft.FromERP/SyncItem_WeiMas.cs index f78ebcf..33d4373 100644 --- a/ICSSoft.FromERP/SyncItem_WeiMas.cs +++ b/ICSSoft.FromERP/SyncItem_WeiMas.cs @@ -147,13 +147,7 @@ from dics.Add("ItemUnit", item.ItemUnit); dics.Add("Itemmodel", item.Itemmodel); dics.Add("GR", item.GR); - dics.Add("SGFS", item.SGFS); - dics.Add("TGFS", item.TGFS); - dics.Add("WG", item.WG); - dics.Add("NI", item.NI); - dics.Add("MA", item.MA); dics.Add("Mtime", item.Mtime.ToString("yyyy-MM-dd HH:mm:ss")); - dics.Add("Other", item.Other); dics.Add("Free1", item.Free1); dics.Add("Free2", item.Free2); dics.Add("Free3", item.Free3); @@ -182,11 +176,11 @@ from insertSql += @" insert into IcsInventory (ItemCode,ItemName,ItemDesc,ItemStd,ItemType,ItemControlType,ItemContype -,ItemAttribute,ItemUnit,ItemMainCategoryCode,ItemModel,ItemCasNo,ItemMolecularFormula,GR,SGFS,TGFS,WG,NI,MA,Other,Default1,Default2,Default3,Default4 +,ItemAttribute,ItemUnit,ItemMainCategoryCode,ItemModel,ItemCasNo,ItemMolecularFormula,GR,Default1,Default2,Default3,Default4 ,CreationTime,CreatorUserId,CreatorUserName,TenantId) select a.ItemCode,a.ItemName,a.ItemDesc,a.ItemStd,'itemtype_finishedproduct','item_control_lot','item_control_nocontrol' -,a.ItemAttribute,a.ITEMUnit,a.ItemMainCategoryCode,a.ITEMMODEL,a.ItemCasNo,a.ItemMolecularFormula,a.GR,a.SGFS,a.TGFS,a.WG,a.NI,a.MA,a.Other,a.Free1,a.Free2,a.Free3,a.Free4 +,left( a.ItemAttribute,1),a.ITEMUnit,a.ItemMainCategoryCode,a.ITEMMODEL,a.ItemCasNo,a.ItemMolecularFormula,a.GR,a.Free1,a.Free2,a.Free3,a.Free4 ,Mtime,'job','job','{0}' from #tempFromErp4ItemCode a left join IcsInventory b with(nolock) on a.itemcode=b.itemcode @@ -198,7 +192,7 @@ and b.id is null update IcsInventory set -ItemName=a.ItemName,ItemDesc=a.ItemDesc,ItemStd=a.ItemStd,ItemAttribute=a.ItemAttribute ,ITEMUnit=a.ITEMUnit,ItemMainCategoryCode=a.ItemMainCategoryCode,ITEMMODEL=a.ITEMMODEL +ItemName=a.ItemName,ItemDesc=a.ItemDesc,ItemStd=a.ItemStd,ItemAttribute=left( a.ItemAttribute,1) ,ITEMUnit=a.ITEMUnit,ItemMainCategoryCode=a.ItemMainCategoryCode,ITEMMODEL=a.ITEMMODEL ,ItemCasNo=a.ItemCasNo,ItemMolecularFormula=a.ItemMolecularFormula,Default1=a.Free1,Default2=a.Free2,Default3=a.Free3,Default4=a.Free4 ,LastModificationTime=a.Mtime,LastModifierUserId='job',LastModifierUserName='job' from #tempFromErp4ItemCode a diff --git a/ICSSoft.FromERP/SyncMoHour_Rhyton.cs b/ICSSoft.FromERP/SyncMoHour_Rhyton.cs index 3dee8b5..9261a7c 100644 --- a/ICSSoft.FromERP/SyncMoHour_Rhyton.cs +++ b/ICSSoft.FromERP/SyncMoHour_Rhyton.cs @@ -130,12 +130,15 @@ group by t.MoCode,t.OpCode ) g on a.MoCode=g.MoCode and e.OpCode=g.OpCode where 1=1 and a.TenantId='{0}' -and a.CreationTime>@LastTime +--and a.CreationTime>@LastTime ) a where 1=1 order by a.MoCode, a.OpSeq asc +delete from IcsMoHourData +where Status='No' + insert into IcsMoHourData ( MoCode @@ -151,7 +154,10 @@ order by a.MoCode, a.OpSeq asc ,CreatorUserId ,CreatorUserName ) -select * from #tempSyncMoHour_Rhyton "; +select a.* 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 +"; sql = string.Format(sql, TenantId); sql = ICSHelper.Time(Namespace, Class, TenantId, sql, "#tempSyncMoHour_Rhyton"); 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);