您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 汽车理论 > JobDone数据处理源代码
JobDone数据处理源代码#JobDone处理web中间件传回的数据同时操作本地sql数据库SubJobDone(JobAsHttpJob)Log(JobName=&Job.JobName&,Success=&Job.Success)IfJob.Success=TrueThenSelectJob.JobNameCaseJob1'printtheresulttothelogs'Log(Job.GetString)DimJSONAsJSONParserDimMap1AsMapJSON.Initialize(Job.GetString)Map1=JSON.NextObjectDimm1AsStringDimmAsMap'helpermapfornavigatingDimMenuItemsAsList'log({success:False,message:用户名或密码错误!}Log(11111111111111111111111111111111111)m1=Map1.Get(success)Log(m1)'Log(m.Get(m.GetKeyAt(0)))Ifm1=FalseThenmymsg(用户名或密码错误!)ReturnEndIfm=Map1.Get(data)id=m.Get(ID)Name=m.Get(UserName)sj=m.Get(ExpirationDate)ppxtp1t.Text=系统(&Name&)Ifjcsj(sj)=1Thenmymsg(软件已经到期,过期日期:&sj)ReturnEndIfmymsg(Name&登录成功&CRLF&id:&id&CRLF&过期日期:&sj)Log(Name&登录成功&id&id&过期日期&sj)Ifpxtc.Checked=TrueThenFile.WriteString(File.DirInternal,dl.txt,Job.GetString)EndIfPxt.Visible=False'加密jm'Fori=0Tom.Size-1''m=m.GetKeyAt(i)'Log(m.GetKeyAt(i))'Log(m.Get(m.GetKeyAt(i)))'Next''====================================================CaseJob9Log(Job.GetString)IfJob.GetString1ThenExitApplicationEndIf'===================================CaseJob4'Log(Job.GetString)DimJSONAsJSONParserDimMap1AsMapJSON.Initialize(Job.GetString)Map1=JSON.NextObjectDimm1AsStringDimmAsMap'helpermapfornavigatingDimMenuItemsAsListm1=Map1.Get(success)Log(m1)'Log(m.Get(m.GetKeyAt(0)))Ifm1=FalseThenmymsg(新建用户不成功!)ReturnElsemymsg(新建成功!)DimmAsMap'helpermapfornavigatingDimmlAsListm=Map1.Get(data)DimQueryAsStringQuery=INSERTINTObd_&(Name,OrgGroupName,CallName,ChildrenName,Email,OrgGroup,ChildrenSchool,ID,Organization,PhoneNo,WeiXin,Birthday,Address)_&VALUES('&m.Get(Name)&','&m.Get(OrgGroupName)&','&m.Get(CallName)&','&m.Get(ChildrenName)&','&m.Get(Email)&','&m.Get(OrgGroup)&','&m.Get(ChildrenSchool)&','&m.Get(ID)&','&m.Get(Organization)&','&m.Get(PhoneNo)&','&m.Get(WeiXin)&','&m.Get(Birthday)&','&m.Get(Address)&')SQL1.ExecNonQuery(Query)mymsg(同步完成)p4.Visible=FalseEndIf'=====================================================CaseJob3'printtheresulttothelogs'Log(Job.GetString)DimJSONAsJSONParserDimMap1AsMapJSON.Initialize(Job.GetString)Map1=JSON.NextObjectDimmAsMap'helpermapfornavigatingDimmlAsListml=Map1.Get(data)'Map1.SizeDimQuery2AsStringQuery2=DELETEFROMbdSQL1.ExecNonQuery(Query2)Query2=updatesqlite_sequencesetseq=0whereName='bd'SQL1.ExecNonQuery(Query2)Fori=0Toml.Size-1m=ml.Get(i)DimQueryAsStringQuery=INSERTINTObd_&(Name,OrgGroupName,CallName,ChildrenName,Email,OrgGroup,ChildrenSchool,ID,Organization,PhoneNo)_&VALUES('&m.Get(Name)&','&m.Get(OrgGroupName)&','&m.Get(CallName)&','&m.Get(ChildrenName)&','&m.Get(Email)&','&m.Get(OrgGroup)&','&m.Get(ChildrenSchool)&','&m.Get(ID)&','&m.Get(Organization)&','&m.Get(PhoneNo)&')SQL1.ExecNonQuery(Query)DoEventsNextmymsg(同步完成)ppxtan1.Enabled=Truepb.Visible=FalseDimsjsjAsStringsjsj=DateTime.Date(DateTime.Now)&&DateTime.time(DateTime.Now)ppxtl3.Text=数据同步至:&sjsjFile.WriteString(File.DirInternal,ytsj.txt,sjsj)'=====================================================同步计划CaseJob5'printtheresulttothelogs'Log(Job.GetString)DimJSONAsJSONParserDimMap1AsMapJSON.Initialize(Job.GetString)Map1=JSON.NextObjectDimmAsMap'helpermapfornavigatingDimmlAsListml=Map1.Get(data)'Map1.SizeDimQuery2AsStringQuery2=DELETEFROMPLSQL1.ExecNonQuery(Query2)Query2=updatesqlite_sequencesetseq=0whereName='PL'SQL1.ExecNonQuery(Query2)Fori=0Toml.Size-1m=ml.Get(i)Log(m.Get(ID)&--&m.Get(PlanName))Dimml2AsListDimml3AsListml2=m.Get(SendPlanDetailList)ml3=m.Get(SendPlanContractList)DimyhsAsStringyhs=ml3.SizeForii=0Toml2.Size-1Dimmap2AsMapmap2=ml2.Get(ii)Log(map2.Get(SendDate)&--&map2.Get(Content))DimsjAsStringDimsj1AsStringDimsj2AsStringDateTime.DateFormat=yyyy-MM-ddDateTime.timeFormat=HH:mm:sssj=map2.Get(SendDate)Ifsj.IndexOf(T)0Thensj1=sj.SubString2(0,10)sj2=sj.SubString2(11,19)sj=sj1&&sj2Log(sj)Elsesj=1900-01-0100:00:00EndIfDimQueryAsStringQuery=INSERTINTOPL_&(ID,PlanName,Content,SendDate,CID)_&VALUES('&m.Get(ID)&','&m.Get(PlanName)&','&map2.Get(Content)&','&sj&','&yhs&')Log(Query)SQL1.ExecNonQuery(Query)DimCursor7AsCursorDimsqlsAsStringDimwenbenAsStringsqls=SelectMax(id2)AsokFROMplCursor7=SQL1.ExecQuery(sqls)IfCursor7.RowCount0ThenCursor7.Position=0Foriii=0Toml3.Size-1DimQueryAsStringQuery=INSERTorignoreINTOPLC_&(jhid,id,pid,k)_&VALUES('&m.Get(ID)&','&ml3.Get(iii)&','&Cursor7.GetString(ok)&','&m.Get(ID)&ml3.Get(iii)&Cursor7.GetString(ok)&')SQL1.ExecNonQuery(Query)DoEventsNextEndIfCursor7.CloseNextNextmymsg(同步完成)SQL1.ExecNonQuery(updatePLSETzt='运行'whereSendDatedatetime('now','localtime'))Log(updatePLSETzt='运行'whereSendDatedatetime('now','localtime'))ppxtan3.Enabled=Truepb.Visible=FalseDimsjsjAsStringsjsj=DateTime.Date(DateTime.Now)&&DateTime.time(DateTime.Now)ppxtl3.Text=数据同步至:&sjsjFile.WriteString(File.DirInternal,ytsj.txt,sjsj)'============================CaseJob7DimJSONAsJSONParserDimMap1AsMapJSON.Initialize(Job.GetString)Map1=JSON.NextObjectDimm1AsStringDimm2AsIntm1=Map1.Get(success)Log(m1)'Log(m.Get(m.GetKeyAt(0)))Ifm1=FalseThenmymsg(数据读取错误!)ReturnEndIfm2=Map1.Get(data)Log(m2)SQL1.ExecNonQuery(updatewhSET
本文标题:JobDone数据处理源代码
链接地址:https://www.777doc.com/doc-8637844 .html