|
我是Au3初学者,请高手帮忙,一个小精灵的代码转换成Au3代码。
[General]
Description=进口报关V3
BeginHotkey=121
BeginHotkeyMod=0
PauseHotkey=122
PauseHotkeyMod=0
StopHotkey=123
StopHotkeyMod=0
RunOnce=1
EnableWindow=
Enable=1
AutoRun=0
[Repeat]
Type=0
Number=1
[Relative]
SetupOCXFile=
[Comment]
Content=
[Script]
UserVar TotalCustomListNo 集报号
UserVar prepInputNO 预录入编号
UserVar orderNO 航次号
UserVar packType=2 包装种类
UserVar BANO=DropList{PCZ:K57307D00003|CANON:K57307D00002} 备案号
UserVar CustomCorp=DropList{货通报关行:4404180023|燕霖报关行:4404180174|格力物流:4404151047} 申报单位
UserVar CustomCorp1=DropList{拱香洲办:5730|九洲海关:5750|拱白石办:5760|珠澳跨境:5791|湾仔海关:5740} 申报现场
UserVar CustomCorp2=DropList{拱香洲办:5730|九洲海关:5750|福保税关:5321|皇岗海关:5301|湾仔海关:5740} 进口口岸
UserVar startpage=1 从第几页开始输入
VBS dim count,pagenow
VBS count = 0
VBS pagenow=99999999999
VBS set conn = createobject("adodb.connection")
VBS conn.open "provider=sqloledb;server=192.168.1.10;database=BSVMI_V3;uid=sa;pwd=gree56_nmdfys_sky;"
VBS set rs1 = conn.execute("select GroupBy_NO page,sum(BoxNum) boxNum,round(sum(CustomGrossWeight),0) GW, CEILING(sum(CustomNetWeight)) NW from V_Atc_InCustom_Tools where TotalCustomListNo='" & TotalCustomListNo & "' group by GroupBy_NO")
VBS set rs2 = conn.execute("select GroupBy_NO as MyGroup_CustomRecord,Custom_Condition_SN,Custom_Condition,CAST(BASerialNO AS int),sourceCountry_id sc,CustomNetWeight NW,Custom_Unit_Tag tag1,Custom_Legal_Unit1_Tag tag2,Custom_Legal_Unit2_Tag tag3,GroupBy_NO page,BASerialNO,CustomQty Qty,CustomAmount Amount from V_Atc_InCustom_Tools where TotalCustomListNo='" & TotalCustomListNo & "' ORDER BY page,Custom_Condition_SN,Custom_Condition,CAST(BASerialNO AS int), sourceCountry_id")
VBS dim tomorrow,today,nextday
VBS today=date()
VBS nextday=DateAdd("d",1,today)
VBS tomorrow=year(nextday)&fix(month(nextday)/10)&(month(nextday)-fix(month(nextday)/10)*10)&fix(day(nextday)/10)&(day(nextday)-fix(day(nextday)/10)*10)
While startpage>1
If not rs1.eof
VBS rs1.movenext
VBS pagenow=rs1("page")
While not rs2.eof
If not pagenow=rs2("MyGroup_CustomRecord")
VBS rs2.movenext
Else
Goto NEXTMST
EndIf
EndWhile
EndIf
Rem NEXTMST
VBS startpage=startpage-1
EndWhile
While not rs1.eof
MoveTo 32,58
LeftClick 1
Delay 2000
MoveTo 119,106
LeftClick 1
If CustomCorp1="5730"
SayString "5730"
ElseIf CustomCorp1="5750"
SayString "5750"
ElseIf CustomCorp1="5760"
SayString "5760"
ElseIf CustomCorp1="5791"
SayString "5791"
ElseIf CustomCorp1="5740"
SayString "5740"
EndIf
Delay 1000
KeyPress 13,1
Delay 1500
MoveTo 475,201
LeftClick 1
SayString prepInputNO
Delay 1000
KeyPress 13,1
Delay 1500
MoveTo 475,217
LeftClick 1
If CustomCorp2="5730"
SayString "5730"
ElseIf CustomCorp2="5750"
SayString "5750"
ElseIf CustomCorp2="5321"
SayString "5321"
ElseIf CustomCorp2="5301"
SayString "5301"
ElseIf CustomCorp2="5740"
SayString "5740"
EndIf
Delay 2000
MoveTo 185,236
LeftClick 1
SayString BANO
Delay 500
KeyPress 13,1
Delay 3000
MoveTo 185,254
LeftDoubleClick 1
SayString tomorrow
Delay 1000
KeyPress 13,1
Delay 2000
MoveTo 185,304
LeftClick 1
SayString CustomCorp
Delay 1000
KeyPress 13,1
Delay 2000
MoveTo 539,271
LeftClick 1
SayString "2"
Delay 1000
KeyPress 13,1
Delay 1500
MoveTo 533,304
LeftClick 1
SayString orderNO
Delay 1000
MoveTo 333,321
LeftClick 1
SayString "1233"
Delay 1000
KeyPress 13,1
Delay 1500
MoveTo 245,358
LeftClick 1
SayString "110"
KeyPress 13,1
Delay 1000
MoveTo 333,358
LeftClick 1
SayString "110"
KeyPress 13,1
Delay 1500
MoveTo 528,358
LeftClick 1
Delay 500
SayString "44041"
KeyPress 13,1
Delay 1500
MoveTo 528,372
LeftClick 1
SayString "1"
KeyPress 13,1
Delay 1000
MoveTo 158,407
LeftClick 1
Delay 500
SayString rs1("boxNum")
Delay 500
MoveTo 287,407
LeftClick 1
Delay 500
SayString packType
Delay 500
MoveTo 433,407
LeftClick 1
Delay 500
SayString rs1("GW")
Delay 500
MoveTo 578,407
LeftClick 1
Delay 500
SayString rs1("NW")
Delay 500
MoveTo 202,442
LeftClick 1
SayString "有纸报关"
Delay 1000
MoveTo 354,442
LeftClick 1
Delay 500
SayString "全新。品牌、规格型号详见装箱单。"
Delay 500
While not rs2.eof
count = count + 1
VBS pagenow=rs2("MyGroup_CustomRecord")
If count = 21
Goto nextLoop
EndIf
MoveTo 289,561
LeftClick 1
Delay 500
SayString rs2("BASerialNO")
Delay 1500
KeyPress 13,1
Delay 4000
MoveTo 185,596
LeftClick 1
Delay 1000
Delay 0 #成交数量
If rs2("tag1")=1
SayString rs2("Qty")
Delay 1000
ElseIf rs2("tag1")=2
SayString rs2("NW")
Delay 1000
EndIf
MoveTo 529,596
LeftDoubleClick 1
Delay 1000
SayString rs2("Amount")
MoveTo 185,613
LeftClick 1
Delay 1000
Delay 0 #法定数量
If rs2("tag2")=1
SayString rs2("Qty")
ElseIf rs2("tag2")=2
SayString rs2("NW")
ElseIf rs2("tag2")=3
SayString rs2("Qty")*1000
ElseIf rs2("tag2")=4
SayString rs2("Qty")/1000
EndIf
MoveTo 185,629
LeftClick 1
Delay 1300
Delay 0 #第三数量
If rs2("tag3")=1
SayString rs2("Qty")
ElseIf rs2("tag3")=2
SayString rs2("NW")
ElseIf rs2("tag3")=3
SayString rs2("Qty")*1000
ElseIf rs2("tag3")=4
SayString rs2("Qty")/1000
EndIf
MoveTo 424,629
LeftClick 1
Delay 1000
Delay 0 #原产地
SayString rs2("sc")
Delay 500
KeyPress 13,1
Delay 1000
MoveTo 619,613
LeftClick 1
Delay 500
SayString "其它"
Delay 500
MoveTo 529,629
LeftClick 1
Delay 500
SayString "3"
Delay 1000
KeyPress 13,1
Delay 1000
KeyPress 13,1
VBS rs2.movenext
EndWhile
Rem nextLoop
count = 0
VBS rs1.movenext
MoveTo 312,58
LeftClick 1
Delay 12000
KeyPress 13,1
Delay 1000
VBS prepInputNO=prepInputNO+1
EndWhile
VBS rs1.close
VBS rs2.close
VBS conn.close
VBS set conn=nothing
MessageBox "成功完成录入!" |
|