Browse Source

U8同步3

Branch_PaiNaWeiSJob
徐莉 4 months ago
parent
commit
28a86a20b1
  1. 1
      ICSSoft.FromERP/App.config
  2. 4
      ICSSoft.FromERP/ICSInventoryFromU8.cs
  3. 5
      ICSSoft.FromERP/ICSMoFromU8.cs
  4. 4
      ICSSoft.FromERP/IcsMainCategoryCodeFromU8.cs
  5. 2
      ICSSoft.FromERP/IcsSBomFromU8.cs

1
ICSSoft.FromERP/App.config

@ -2,6 +2,7 @@
<configuration> <configuration>
<appSettings> <appSettings>
<add key="ERPDB" value="[U9Ctest]"/> <add key="ERPDB" value="[U9Ctest]"/>
<add key="Workpoint_ERPDB" value="zhc|[MESTOU8].[UFDATA_001_2017]"/>
</appSettings> </appSettings>
<connectionStrings> <connectionStrings>
<add name="SysConnectionString" connectionString="Data Source=119.3.29.177;Database=ICSMESBase;Uid=gitea;Pwd=aA123456;"/> <add name="SysConnectionString" connectionString="Data Source=119.3.29.177;Database=ICSMESBase;Uid=gitea;Pwd=aA123456;"/>

4
ICSSoft.FromERP/ICSInventoryFromU8.cs

@ -82,7 +82,7 @@ namespace ICSSoft.FromERP
a.cEngineerFigNo ItemDrawingNo, a.cEngineerFigNo ItemDrawingNo,
'' ItemDesc, '' ItemDesc,
dbo.GetReplaceStr(isnull(cInvAddCode,'')+'|'+isnull(cInvStd,'')) AS ItemStd, dbo.GetReplaceStr(isnull(cInvAddCode,'')+'|'+isnull(cInvStd,'')) AS ItemStd,
a.cInvAddCode INVPARSETYPE,
c.cComUnitName AS ItemUnit, c.cComUnitName AS ItemUnit,
a.cInvCCode ItemMainCategoryCode, a.cInvCCode ItemMainCategoryCode,
b.cInvCName ClassName, b.cInvCName ClassName,
@ -94,7 +94,7 @@ namespace ICSSoft.FromERP
INTO #TempINV INTO #TempINV
FROM {1}.dbo.Inventory a with(nolock) FROM {1}.dbo.Inventory a with(nolock)
LEFT JOIN {1}.dbo.InventoryClass b with(nolock) ON a.cInvCCode = b.cInvCCode
LEFT JOIN {1}.dbo.InventoryClass b with(nolock) ON a.cInvCCode = b.cInvCCode
LEFT JOIN {1}.dbo.ComputationUnit c with(nolock) ON a.cComUnitCode = c.cComunitCode LEFT JOIN {1}.dbo.ComputationUnit c with(nolock) ON a.cComUnitCode = c.cComunitCode
WHERE a.dEDate IS NULL AND a.dModifyDate>=@LastTime WHERE a.dEDate IS NULL AND a.dModifyDate>=@LastTime
ORDER BY cInvCode ORDER BY cInvCode

5
ICSSoft.FromERP/ICSMoFromU8.cs

@ -137,8 +137,9 @@ ELSE ISNULL(b.CloseTime,ISNULL(b.RelsTime,ISNULL(a.ModifyTime, a.CreateTime))) E
SELECT a.ID INTO #tableICSMO SELECT a.ID INTO #tableICSMO
FROM ICSMO a With(NoLock) FROM ICSMO a With(NoLock)
LEFT JOIN {1}.dbo.[mom_order] b With(NoLock) ON a.Mocode=b.MoCode AND A.MoSeq=B.SortSeq
WHERE a.TenantId='{0}' and b.MoCode IS NULL
LEFT JOIN {1}.dbo.[mom_order] b With(NoLock) ON a.Mocode=b.MoCode
left JOIN {1}.dbo.mom_orderdetail b2 ON b.MoId = b2.MoId AND A.MoSeq=B2.SortSeq
WHERE a.TenantId='{0}' and B2.SortSeq IS NULL
DELETE FROM ICSMO DELETE FROM ICSMO
WHERE TenantId='{0}' and ID IN ( SELECT ID from #tableICSMO ) WHERE TenantId='{0}' and ID IN ( SELECT ID from #tableICSMO )

4
ICSSoft.FromERP/IcsMainCategoryCodeFromU8.cs

@ -71,7 +71,7 @@ namespace ICSSoft.FromERP
#region SQL #region SQL
string sql = @" select a.cInvCCode as ItemMainCategoryCode string sql = @" select a.cInvCCode as ItemMainCategoryCode
,b.cInvCCode as ItemMainCategoryName
,a.cInvCName as ItemMainCategoryName
,'' as ItemMainCategoryDesc ,'' as ItemMainCategoryDesc
,getdate() MTime ,getdate() MTime
,p.parentCode ,p.parentCode
@ -85,7 +85,7 @@ namespace ICSSoft.FromERP
and cc.iInvCGrade=cc_p.iInvCGrade+1 and cc.iInvCGrade=cc_p.iInvCGrade+1
) p ON a.cInvCCode=p.cInvCCode ) p ON a.cInvCCode=p.cInvCCode
where 1=1 where 1=1
and A.ModifiedOn>=@LastTime
-- and A.ModifiedOn>=@LastTime
ORDER BY A.cInvCCode ORDER BY A.cInvCCode
IF NOT EXISTS(SELECT * FROM #TempItemCategory) IF NOT EXISTS(SELECT * FROM #TempItemCategory)

2
ICSSoft.FromERP/IcsSBomFromU8.cs

@ -115,7 +115,7 @@ namespace ICSSoft.FromERP
SELECT a.ErpId INTO #tableICSSBOM SELECT a.ErpId INTO #tableICSSBOM
FROM ICSSBOM a With(NoLock) FROM ICSSBOM a With(NoLock)
left join {1}.dbo.bom_opcomponent d With(NoLock) on a.ErpId=d.OpComponentId left join {1}.dbo.bom_opcomponent d With(NoLock) on a.ErpId=d.OpComponentId
WHERE d.id is null
WHERE d.OpComponentId is null
and a.TenantId='{0}' and a.TenantId='{0}'

Loading…
Cancel
Save