版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、JobDone數(shù)據(jù)處理源代碼# JobDone處理web中間件傳回的數(shù)據(jù) 同時(shí)操作本地sql數(shù)據(jù)庫Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) If Job.Success = True Then Select Job.JobName Case "Job1" 'print the result to the logs 'Log(Job.GetString)Di
2、m JSON As JSONParser Dim Map1 As Map JSON.Initialize(Job.GetString)Map1 = JSON.NextObjectDim m1 As StringDim m As Map 'helper map for navigatingDim MenuItems As List'log("success":False,"message":"用戶名或密碼錯(cuò)誤!"Log(11111111111111111111111111111111111) m1 = Map1.Get(
3、"success") Log( m1)'Log(m.Get(m.GetKeyAt(0) If m1=False Then mymsg("用戶名或密碼錯(cuò)誤!") Return End Ifm = Map1.Get("data")id=m.Get("ID")Name =m.Get("UserName")sj =m.Get("ExpirationDate")ppxtp1t.Text ="系統(tǒng)("&Name&")"If
4、jcsj(sj) =1 Thenmymsg("軟件已經(jīng)到期,過期日期:"&sj)ReturnEnd Ifmymsg(Name&"登錄成功"&CRLF&"id:"&id&CRLF&"過期日期:"&sj)Log(Name&"登錄成功"&"id"&id&"過期日期"&sj)If pxtc.Checked=True ThenFile.WriteString(Fi
5、le.DirInternal,"dl.txt",Job.GetString)End IfPxt.Visible=False'加密jm'For i = 0 To m.Size - 1''m = m.GetKeyAt(i) 'Log( m.GetKeyAt(i)'Log( m.Get(m.GetKeyAt(i)'Next''=Case "Job9"Log(Job.GetString)If Job.GetString<>"1" ThenExitApplica
6、tionEnd If'=Case "Job4" 'Log(Job.GetString)Dim JSON As JSONParser Dim Map1 As Map JSON.Initialize(Job.GetString)Map1 = JSON.NextObjectDim m1 As StringDim m As Map 'helper map for navigatingDim MenuItems As List m1 = Map1.Get("success") Log( m1)'Log(m.Get(m.GetKeyA
7、t(0) If m1=False Then mymsg("新建用戶不成功!") Return Else mymsg("新建成功!") Dim m As Map 'helper map for navigatingDim ml As Listm = Map1.Get("data") Dim Query As String Query = "INSERT INTO bd " _&"(Name,OrgGroupName,CallName,ChildrenName,Email,OrgGroup,C
8、hildrenSchool,ID,Organization,PhoneNo,WeiXin,Birthday,Address) " _&"VALUES ('"&m.Get("Name")&"','"&m.Get("OrgGroupName")&"','"&m.Get("CallName")&"','"&m.Get("Ch
9、ildrenName")&"','"&m.Get("Email")&"','"&m.Get("OrgGroup")&"','"&m.Get("ChildrenSchool")&"','"&m.Get("ID")&"','"&m.Get("O
10、rganization")&"','"&m.Get("PhoneNo")&"','"&m.Get("WeiXin")&"','"&m.Get("Birthday")&"','"&m.Get("Address")&"')" SQL1.ExecNonQuery(Quer
11、y)mymsg("同步完成") p4.Visible =False End If'= Case "Job3" 'print the result to the logs 'Log(Job.GetString)Dim JSON As JSONParserDim Map1 As MapJSON.Initialize(Job.GetString)Map1 = JSON.NextObjectDim m As Map 'helper map for navigatingDim ml As Listml = Map1.Get(&quo
12、t;data")'Map1.SizeDim Query2 As String Query2 = "DELETE FROM bd" SQL1.ExecNonQuery(Query2)Query2 = "update sqlite_sequence set seq=0 where Name='bd'"SQL1.ExecNonQuery(Query2)For i = 0 To ml.Size - 1m=ml.Get(i) Dim Query As String Query = "INSERT INTO bd &quo
13、t; _&"(Name,OrgGroupName,CallName,ChildrenName,Email,OrgGroup,ChildrenSchool,ID,Organization,PhoneNo) " _&"VALUES ('"&m.Get("Name")&"','"&m.Get("OrgGroupName")&"','"&m.Get("CallName"
14、)&"','"&m.Get("ChildrenName")&"','"&m.Get("Email")&"','"&m.Get("OrgGroup")&"','"&m.Get("ChildrenSchool")&"','"&m.Get("ID"
15、;)&"','"&m.Get("Organization")&"','"&m.Get("PhoneNo")&"')" SQL1.ExecNonQuery(Query)DoEventsNextmymsg("同步完成")ppxtan1.Enabled=Truepb.Visible =FalseDim sjsj As String sjsj=DateTime.Date(DateTime.Now)&
16、;" "& DateTime.time(DateTime.Now)ppxtl3.Text="數(shù)據(jù)同步至:"&sjsjFile.WriteString(File.DirInternal,"ytsj.txt",sjsj)'=同步計(jì)劃 Case "Job5" 'print the result to the logs 'Log(Job.GetString)Dim JSON As JSONParserDim Map1 As MapJSON.Initialize(Job.GetStri
17、ng)Map1 = JSON.NextObjectDim m As Map 'helper map for navigatingDim ml As Listml = Map1.Get("data")'Map1.SizeDim Query2 As String Query2 = "DELETE FROM PL" SQL1.ExecNonQuery(Query2)Query2 = "update sqlite_sequence set seq=0 where Name='PL'"SQL1.ExecNonQu
18、ery(Query2) For i = 0 To ml.Size - 1 m=ml.Get(i)Log(m.Get("ID")&"-"&m.Get("PlanName") Dim ml2 As ListDim ml3 As List ml2 = m.Get("SendPlanDetailList")ml3 = m.Get("SendPlanContractList")Dim yhs As Stringyhs=ml3.SizeFor ii = 0 To ml2.Size - 1 D
19、im map2 As Map map2=ml2.Get(ii) Log(map2.Get("SendDate")&"-"&map2.Get("Content") Dim sj As String Dim sj1 As StringDim sj2 As StringDateTime.DateFormat="yyyy-MM-dd"DateTime.timeFormat="HH:mm:ss"sj=map2.Get("SendDate")If sj.IndexOf (
20、"T")>0 Then sj1=sj.SubString2(0,10)sj2=sj.SubString2(11,19)sj=sj1&" "&sj2Log(sj)Elsesj="1900-01-01 00:00:00"End If Dim Query As String Query = "INSERT INTO PL " _&"(ID,PlanName,Content,SendDate,CID) " _&"VALUES ('"&am
21、p;m.Get("ID")&"','"&m.Get("PlanName")&"','"&map2.Get("Content")&"','"&sj&"','"&yhs&"')"Log(Query) SQL1.ExecNonQuery(Query)Dim Cursor7 As CursorDim s
22、qls As String Dim wenben As String sqls="Select Max(id2) As ok FROM pl"Cursor7 = SQL1.ExecQuery(sqls)If Cursor7.RowCount > 0 ThenCursor7.Position = 0For iii = 0 To ml3.Size - 1 Dim Query As String Query = "INSERT or ignore INTO PLC " _&"(jhid,id,pid,k) " _&&q
23、uot;VALUES ('"&m.Get("ID")&"','"&ml3.Get(iii)&"','"&Cursor7.GetString("ok")&"','"&m.Get("ID")&ml3.Get(iii)&Cursor7.GetString("ok")&"')" SQL1.Ex
24、ecNonQuery(Query)DoEvents Next End IfCursor7.CloseNext Next mymsg("同步完成")SQL1.ExecNonQuery("update PL SET zt='運(yùn)行' where SendDate>datetime('now','localtime')")Log("update PL SET zt='運(yùn)行' where SendDate>datetime('now','localtime
25、')")ppxtan3.Enabled=Truepb.Visible =FalseDim sjsj As String sjsj=DateTime.Date(DateTime.Now)&" "& DateTime.time(DateTime.Now)ppxtl3.Text="數(shù)據(jù)同步至:"&sjsjFile.WriteString(File.DirInternal,"ytsj.txt",sjsj)'=Case "Job7"Dim JSON As JSONParser
26、 Dim Map1 As Map JSON.Initialize(Job.GetString)Map1 = JSON.NextObjectDim m1 As StringDim m2 As Int m1 = Map1.Get("success") Log( m1)'Log(m.Get(m.GetKeyAt(0) If m1=False Then mymsg("數(shù)據(jù)讀取錯(cuò)誤!") Return End Ifm2 = Map1.Get("data")Log( m2)SQL1.ExecNonQuery("update wh SET s="&m2)StopService(fuwu)StartService(fuwu)L
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年上半年貴州荔波縣事業(yè)單位引進(jìn)高層次和急需緊缺專業(yè)人才易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年貴州省黔東南州直屬事業(yè)單位招聘214人筆試重點(diǎn)基礎(chǔ)提升(共500題)附帶答案詳解-1
- 2025年上半年貴州盤江煤電集團(tuán)醫(yī)院招聘69人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年貴州習(xí)酒投資控股集團(tuán)限責(zé)任公司校園招聘200人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年西城區(qū)事業(yè)單位招聘易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年第一季度廣西南寧潮慶產(chǎn)業(yè)投資限公司公開招聘9人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年特色文印服務(wù)與創(chuàng)意設(shè)計(jì)合作協(xié)議3篇
- 2025年商業(yè)地產(chǎn)和解協(xié)議書
- 校長年度述職報(bào)告全校師生同心同德、攜手奮進(jìn)出色完成了學(xué)校各項(xiàng)教育工作
- 2025年度綠色環(huán)保型臨建施工合同4篇
- 抗心律失常藥物臨床應(yīng)用中國專家共識(shí)
- 考級(jí)代理合同范文大全
- 2024解析:第三章物態(tài)變化-講核心(原卷版)
- DB32T 1590-2010 鋼管塑料大棚(單體)通 用技術(shù)要求
- 安全行車知識(shí)培訓(xùn)
- 2024年安徽省高校分類對(duì)口招生考試數(shù)學(xué)試卷真題
- 第12講 語態(tài)一般現(xiàn)在時(shí)、一般過去時(shí)、一般將來時(shí)(原卷版)
- 2024年采購員年終總結(jié)
- 2024年新疆區(qū)公務(wù)員錄用考試《行測》試題及答案解析
- 肺動(dòng)脈高壓的護(hù)理查房課件
- 2025屆北京巿通州區(qū)英語高三上期末綜合測試試題含解析
評(píng)論
0/150
提交評(píng)論