diff --git a/.vs/ICSSoft.FromERP/v16/.suo b/.vs/ICSSoft.FromERP/v16/.suo index 6bd0dac..29cb8c0 100644 Binary files a/.vs/ICSSoft.FromERP/v16/.suo and b/.vs/ICSSoft.FromERP/v16/.suo differ diff --git a/ICSSoft.FromERP/IcsSBom.cs b/ICSSoft.FromERP/IcsSBom.cs index 9aadcea..5e078ec 100644 --- a/ICSSoft.FromERP/IcsSBom.cs +++ b/ICSSoft.FromERP/IcsSBom.cs @@ -81,7 +81,7 @@ left join {1}.dbo.[CBO_ItemMaster_Trl] as A5 on (A5.SysMlFlag = 'zh-CN') and (A3 left join {1}.dbo.[CBO_Project] as A6 on (A.[CompProject] = A6.[ID]) LEFT JOIN {1}.dbo.[Base_Organization] AS I ON ( A1.[Org] = I.[ID] ) LEFT JOIN {1}.dbo.[Base_Organization_Trl] AS J ON ( I.[ID] = J.[ID] AND J.SysMLFlag='zh-CN') -where 1=1 and IsEffective=1 and A.ModifiedOn>=@LastTime AND I.id={0} and A.ComponentType=0 +where 1=1 and A1.AlternateType=0 and IsEffective=1 and A.ModifiedOn>=@LastTime AND I.id={0} and A.ComponentType=0 IF NOT EXISTS(SELECT * FROM #TempBOM) RETURN"; @@ -147,7 +147,7 @@ left join IcsMainCategoryCode d on c.ItemMainCategoryCode=d.ItemMainCategoryCode sql += " DROP TABLE #TempBOM " + "DROP TABLE #tableICSSBOM"; sql = string.Format(sql, TenantId, erpName, ErpId); - // return; + //return; ICSHelper.ExecuteDate(conStr, sql); #endregion } @@ -159,112 +159,6 @@ left join IcsMainCategoryCode d on c.ItemMainCategoryCode=d.ItemMainCategoryCode } -// public void Execute_bak20201201() -// { -// try -// { -// string conStr = ICSHelper.GetConnectString(); -// string Namespace = this.GetType().Namespace; -// string Class = this.GetType().Name; -// #region SQL -// string sql = @" SELECT g.cInvDefine1,--存货自定义项1 -// a.Version,--Version 版本号 -// a.VersionDesc,--VersionDesc 版本说明 -// a.VersionEffDate,--VersionEffDate 版本生效日 -// a.VersionEndDate,--VersionEndDate 版本失效日 -// c.InvCode as cInvCode ,--存货编码 -// f.InvCode as SubcInvCode ,--存货编码 -// e.WIPType, --WIPType WIP属性(1入库/2工序/3领料/4虚拟) -// d.SortSeq, --SortSeq 序号 -// d.BaseQtyN, --AuxBaseQtyN 辅助基本用量 -// d.BaseQtyD, --BaseQtyD 基本用量-分母 -// d.ByproductFlag, --ByproductFlag 是否联副产品 -// d.ProductType, --ProductType 产出类型(1:空/2:联产品/3:副产品) -// d.CompScrap, --CompScrap 子件损耗率 -// a.CreateDate,a.CreateUser,a.ModifyDate,a.ModifyUser,a.cCurrentAuditor,--当前审批人 -// a.RelsTime as cAuditDate, --审核时间 -// i.ReplaceFlag,--是否替换料 -// i.OpComponentId,-- 子件Id -// i.Sequence ReplaceSequence,--替代序号 -// K.InvCode as ReplaceInvCode ,--替代料编码 -// i.Factor ReplaceFactor,--替代比例 -// i.EffBegDate ReplaceEffBegDate,--生效日期 -// i.EffEndDate ReplaceEffEndDate,--失效日期 -// ISNULL(a.ModifyDate, a.CreateDate) AS MTIME -// into #TempBOM -// FROM {1}.dbo.bom_bom a -- BOM资料 -// INNER JOIN {1}.dbo.bom_parent b on a.BomId = b.BomId --BOM母件资料 -// INNER JOIN {1}.dbo.bas_part c on b.ParentId = c.PartId --物料表 -// INNER JOIN {1}.dbo.bom_opcomponent d on a.BomId=d.BomId --BOM子件资料 -// INNER JOIN {1}.dbo.bas_part f on d.ComponentId = f.PartId -// INNER JOIN {1}.dbo.bom_opcomponentopt e ON d.OptionsId=e.OptionsId -- 子件选项资料 -// left JOIN {1}.dbo.bom_opcomponentsub i ON d.OpComponentId =i.OpComponentId --子件替代料 -// left join {1}.dbo.inventory g on c.InvCode=g.cInvCode --存货档案 -// LEFT JOIN {1}.dbo.bas_part K ON K.PartId=i.PartId -// -// WHERE ISNULL(a.ModifyDate, a.CreateDate)>=@LastTime -// IF NOT EXISTS(SELECT * FROM #TempBOM) -// RETURN"; - - -// sql = ICSHelper.Time(Namespace, Class, TenantId, sql, "#TempBOM"); -// sql += "\r\n"; -// sql += @"--删除数据 -// DELETE ICSBOM WHERE cInvCode NOT IN (SELECT InvCode FROM {1}.dbo.bas_part) "; -// Dictionary values = new Dictionary(); -// values.Add("Version", "a.Version"); -// values.Add("VersionDesc", "a.VersionDesc"); -// values.Add("VersionEffDate", "a.VersionEffDate"); -// values.Add("VersionEndDate", "a.VersionEndDate"); -// values.Add("cInvCode", "a.cInvCode"); -// values.Add("SubcInvCode", "a.SubcInvCode"); -// values.Add("WIPType", "a.WIPType"); -// values.Add("SortSeq", "a.SortSeq"); -// values.Add("BaseQtyN", "a.BaseQtyN"); -// values.Add("BaseQtyD", "a.BaseQtyD"); -// values.Add("ByproductFlag", "a.ByproductFlag"); -// values.Add("ProductType", "a.ProductType"); -// values.Add("CompScrap", "a.CompScrap"); -// values.Add("CreateDate", "a.CreateDate"); -// values.Add("CreateUser", "a.CreateUser"); -// values.Add("ModifyDate", "a.ModifyDate"); -// values.Add("ModifyUser", "a.ModifyUser"); -// values.Add("cCurrentAuditor", "a.cCurrentAuditor"); -// values.Add("cAuditDate", "a.cAuditDate"); -// values.Add("ReplaceFlag", "a.ReplaceFlag"); -// values.Add("OpComponentId", "a.OpComponentId"); -// values.Add("ReplaceSequence", "a.ReplaceSequence"); -// values.Add("ReplaceInvCode", "a.ReplaceInvCode"); -// values.Add("ReplaceFactor", "a.ReplaceFactor"); -// values.Add("ReplaceEffBegDate", "a.ReplaceEffBegDate"); -// values.Add("ReplaceEffEndDate", "a.ReplaceEffEndDate"); -// values.Add("MTIME", "a.MTIME"); - -// //更新存在数据 -// sql += ICSHelper.UpdateSQL("b", values) -// + @" #TempBOM a -// INNER JOIN ICSBOM b ON a.cInvCode=b.cInvCode "; - -// values.Add("MUSER", "'" + ConstWorkPoint.Muser + "'"); -// values.Add("MUSERName", "'" + ConstWorkPoint.Musername + "'"); -// values.Add("TenantId", "'" + TenantId + "'"); -// sql += "\r\n"; -// //插入新增数据 -// sql += ICSHelper.InsertSQL("ICSBOM", values) -// + @" #TempBOM a -// LEFT JOIN ICSBOM b ON a.cInvCode=b.cInvCode -// WHERE b.cInvCode IS NULL -// "; -// sql += "DROP TABLE #TempBOM"; -// sql = string.Format(sql, ICSHelper.GetConfigString()["ERPDB"]); -// ICSHelper.ExecuteDate(conStr, sql); -// #endregion -// } -// catch (Exception ex) -// { -// log.Error(ex.ToString()); -// } -// } } } diff --git a/ICSSoft.Test/Program.cs b/ICSSoft.Test/Program.cs index 08b3f02..d523b48 100644 --- a/ICSSoft.Test/Program.cs +++ b/ICSSoft.Test/Program.cs @@ -13,7 +13,7 @@ namespace ICSSoft.Test //ICSVendor test = new ICSVendor(); //test.Execute(); - SyncVendor_WeiMas test = new SyncVendor_WeiMas(); + IcsSBom test = new IcsSBom(); test.Execute();