Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

灵活使用配置文件

Ciel edited this page Aug 16, 2020 · 1 revision

配置文件中的 tasks 列表为程序执行的任务列表,列表中每个对象可以指定下列五个参数,这些参数也可以指定在配置文件根对象下,作为全局缺省配置。

其中的字符串参数,如果任务对象中没有规定,则会使用全局配置;其中的键值对集参数,会先与全局配置合并后应用(局部覆盖全局)。

参数 类型 描述
username 必要,字符串 用于登录网上办事大厅的吉大邮箱帐号(不含域)
password 必要,字符串 用于登录网上办事大厅的吉大邮箱密码
transaction 必要,字符串 指定本任务要办理的事务
fields 可选,键值对集 在系统下发的表单上要填入的表单项
conditions 可选,键值对集 对应表单项应用的条件

例子:同一账号多个事务

{
	"username": "zhangsan2119",
	"password": "pASSw0rd",
	"tasks": [
		{
			"transaction": "BKSMRDK"
		},
		{
			"transaction": "JLDX_BK_XNYQSB"
		}
	]
}

例子:同一事务不同帐号

{
	"transaction": "BKSMRDK",
	"fields": {
		"fieldZtw": "1",
		"fieldZhongtw": "1",
		"fieldWantw": "1"
	},
	"conditions": {
		"fieldZtw": "int(time()%86400/3600)==(7-8)%24",
		"fieldZhongtw": "int(time()%86400/3600)==(11-8)%24",
		"fieldWantw": "int(time()%86400/3600)==(17-8)%24"
	},
	"tasks": [
		{
			"username": "zhangsan2119",
			"password": "pASSw0rd"
		},
		{
			"username": "lisi2119",
			"password": "pASSw0rd",
			"conditions": {
				"fieldZtw": "True",
				"fieldZhongtw": "False"
			}
		},
		{
			"username": "luoxiang2333",
			"password": "pASSw0rd",
			"transaction": "YJSMRDK"
		}
	]
}

例子:单一事务

{
	"username": "zhangsan2119",
	"password": "pASSw0rd",
	"transaction": "BKSMRDK",
	"fields": {
		"fieldZtw": "1",
		"fieldZhongtw": "1",
		"fieldWantw": "1",
		"fieldSQxq": "233",
		"fieldSQgyl": "233",
		"fieldSQqsh": "2333"
	},
	"conditions": {
		"fieldZtw": "int(time()%86400/3600)==(7-8)%24",
		"fieldZhongtw": "int(time()%86400/3600)==(11-8)%24",
		"fieldWantw": "int(time()%86400/3600)==(17-8)%24"
	},
	"tasks": [{}]
}