From 868be5f58ea16659831dd6078279e051dea3aec6 Mon Sep 17 00:00:00 2001 From: xuli Date: Mon, 28 Oct 2024 11:22:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=EF=BC=9AICSVendorFromU8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/ICSSoft.FromERP/v14/.suo | Bin 246272 -> 258048 bytes ICSSoft.FromERP/ICSSoft.FromERP.csproj | 1 + ICSSoft.FromERP/ICSVendorFromU8.cs | 168 +++++++++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 ICSSoft.FromERP/ICSVendorFromU8.cs diff --git a/.vs/ICSSoft.FromERP/v14/.suo b/.vs/ICSSoft.FromERP/v14/.suo index e274849d5dbd607e05b535dbe4252a83632904fa..a8549eae55835bc5abde7fd81f7456e63e550d3d 100644 GIT binary patch delta 14983 zcmeHO3tUxI)<0{X3tZlBL>_uUQp7+&6flL0AW8Y)p=b_1Q1CG+qM+lOtCnNs3y!hP zH<;*5<|r_nYRs@4KgTCI&19wJBQ=|unj9# z*IIj@jp+$j(^=Qmk=*SZ*&Ey>X@Mk3cEGLMw{Ihm2=E6c1CdISSC>77CMsi7T98_aKbN{HpR*x)85!*WzNm;om0~$v?}e0TL(6d%<;8$_Mk}QARE)Oz z5@)1309SxHfasqg^Z*dO{RIel6!Ggo2oMZ>3ETt>z-b^1@B;#Xf8w1$ggt>&zz66I z%mj*nu7D%Z4e*sDCf!mt>e~56Avq4{0*EGD5sL1WqdH&b5YQkJ*F>m%rt|D-kK$w? z1y~4(af#Ur2Sm-r=NTnwRHu^9t#WfLaVLa{miXfc3()pFOF9=}GSWs%dMd&Rz(imY z&=qBZNby7<{ac_ASOpXSQ&Bz~;dEfG7;-2w9FTYtm<4nK^uTOj1|S+TAyls0^qK4e zM!5ol6YdB-EO9S{-hdC#4)6uq1Ac%%5C8-M;=PUt4VHK?!cLa>0|+}?;-NL+w&OLC zT0MPklSoNsk?QhoL`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d`iwt3i1}>4 z+Yv40Mg8UM#v$i(myPnb?DIHAyLu_QDJ#NHL=lRSPvFPAU9RV{Lvn#jHwDX@=_Y{> zuaG91&m(ror|-nxL_WL|xvRVH8Ho3LI^bz*YLmK{zsjNKtq8pbn1DQ*#GPKKq- zQxZAmGI4s2N95uBDdi2-Iu9WhGGFYnJBGCzRqS=eV;|nU4zo}lHfh=)=Rim8um-hu zxeN{tVdR=kP(OsTxKaL#lq8;05?;%-8kR3OOg}C;1Ub8mCsTthR=)|IPgXxLzy^c* zTU6wPH_@-P0R3V(lewTuc2eTWre}D|5X{O{h>917!)Oy~(5>}67QPvE(jA87-*vgC%rGaaktB|KlX5;Y}+erjv8U(wpV3)Z9}1% zi!aNTdPR+>5WMn=90!ew7TWl&f&A%jgq^n>5dJ*jirmQYS0S4lAIRCBBS%FiU)!?& z#wN~RjFZLa0z`njSdRYE7CBFF>3JEYM;(^8rH)XX-9oQ9f_>3{!U%q}Kn4DfR3f@F xb)I?|zEg5l)@bv(w&R5NMGL-ACj)fxdpUt + diff --git a/ICSSoft.FromERP/ICSVendorFromU8.cs b/ICSSoft.FromERP/ICSVendorFromU8.cs new file mode 100644 index 0000000..dde2c3a --- /dev/null +++ b/ICSSoft.FromERP/ICSVendorFromU8.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Quartz; + +using System.Data; + +namespace ICSSoft.FromERP +{ + /// + /// 供应商 + /// + public class ICSVendorFromU8 : IJob + { + private static object key = new object(); + private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public void Execute(IJobExecutionContext context) + { + try + { + lock (key) + { + log.Info("开始……………………………………………………………………"); + Execute(); + log.Info("结束……………………………………………………………………"); + } + } + catch (Exception ex) + { + log.Error(ex.ToString()); + } + } + + public void Execute() + { + try + { + + //string conERPStr = ICSHelper.GetERPConnectString(); + string conStr = ICSHelper.GetConnectString(); + string Namespace = this.GetType().Namespace; + //string Class = this.GetType().Name; + + DataTable dt = ICSHelper.GetERPDB(conStr); + + + string erpNames = ICSHelper.GetConfigString()["Workpoint_ERPDB"]; + List DBS = erpNames.Split(',').ToList(); + List ListDB = new List(); + foreach (string DB in DBS) + { + if (DB.Split('|') != null && DB.Split('|').Count() > 1) + { + WorkpointERPDBLink wd = new WorkpointERPDBLink(); + wd.Workpoint = DB.Split('|')[0]; + wd.ERPDB = DB.Split('|')[1]; + ListDB.Add(wd); + } + } + + + foreach (DataRow dr in dt.Rows) + { + string TenantId = dr["TenantId"].ToString(); + string TenantCode = dr["TenantCode"].ToString(); + string ErpId = dr["ErpID"].ToString(); //erpID + string Class = this.GetType().Name + TenantCode; + + WorkpointERPDBLink dblink = ListDB.FindLast(a => a.Workpoint == TenantCode); + if (dblink == null) + { + return; + } + string erpName = dblink.ERPDB; + + + #region SQL + string sql = @" + + + + select + a.cVenCode AS cVenCode , + NEWID() AS ID, + a.cVenName AS cVenName , + a.cVenAbbName AS cVenAbbName , + a.cVCCode AS cVCCode , + a.cMemo as cMemo, + a.dModifyDate AS MTIME + + INTO #TempVendor + from {1}.dbo.Vendor a + -- LEFT JOIN {1}.dbo.VendorClass b ON a.cVCCode = b.cVCCode + -- LEFT JOIN {1}.dbo.PayCondition c ON a.cVenPayCond = c.cPayCode + where a.dModifyDate>=@LastTime + ORDER BY a.cVenCode + + IF NOT EXISTS(SELECT * FROM #TempVendor) + RETURN + + + + IF NOT EXISTS(SELECT * FROM #TempVendor) + RETURN"; + sql = ICSHelper.Time(Namespace, Class, TenantId, sql, "#TempVendor"); + + sql += @"--删除数据 + + + SELECT a.VendorCode INTO #tableICSVendor + FROM ICSVendor a With(NoLock) + LEFT JOIN {1}.dbo.Vendor B With(NoLock) ON a.VendorCode=b.cVenCode + WHERE a.TenantId='{0}' and b.cVenCode IS NULL + + DELETE ICSVendor + WHERE TenantId='{0}' and VendorCode IN ( SELECT VendorCode from #tableICSVendor) + + "; + + //Id TenantId VendorCode VendorName VendorShortName VendorDesc Memo + //Default1 Default2 Default3 Default4 Default5 + //CreationTime CreatorUserId LastModificationTime LastModifierUserId + ////LastModifierUserName CreatorUserName + + Dictionary values = new Dictionary(); + + values.Add("VendorName", "a.cVenName");//供应商名称 + values.Add("VendorShortName", "a.cVenAbbName");//供应商简称 + values.Add("Memo", "a.cMemo");//供应商分类名称 + values.Add("LastModifierUserId", "'" + ConstWorkPoint.Muser + "'"); + values.Add("LastModifierUserName", "'" + ConstWorkPoint.Musername + "'"); + values.Add("LastModificationTime", "a.Mtime");//操作时间 + + + + + //更新存在数据 + sql += ICSHelper.UpdateSQL("b", values) + + @" #TempVendor a + INNER JOIN ICSVendor b ON a.cVenCode=b.VendorCode and b.TenantId='{0}' "; + + values.Add("VendorCode", "a.cVenCode");//供应商代码 + values.Add("CreationTime", "a.MTime");//操作人 + values.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人 + values.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称 + values.Add("TenantId", "'" + TenantId + "'");//站点 + + //插入新增数据 + sql += ICSHelper.InsertSQL("ICSVendor", values) + + @" #TempVendor a + LEFT JOIN ICSVendor b ON a.cVenCode=b.VendorCode and b.TenantId='{0}' + WHERE b.VendorCode IS NULL + "; + sql += " DROP TABLE #TempVendor" + + " DROP TABLE #tableICSVendor";//删除零时表 + sql = string.Format(sql, TenantId, erpName); + ICSHelper.ExecuteDate(conStr, sql); + #endregion + } + } + catch (Exception ex) + { + log.Error(ex.ToString()); + } + } + } +}