-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path输出详设.txt
289 lines (261 loc) · 16.3 KB
/
输出详设.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
### 页面原型
![关系库输出](./images/mysqlOut.png)
### 交互操作
- 用户拖动目的数据源中关系数据库节点到作业画布,打开该界面进行新增节点设置。
- 用户点击画布中的目的关系数据库节点,打开该页面进行设置修改。
- 新增节点设置时,用户选择数据库类型,输入数据库名称、连接地址、端口、用户名、密码,勾选输出字段添加输出关系,点击”确定“按钮,在系统新增一个关系数据库系统节点。
- 修改设置时,用户修改输入数据库名称、连接地址、端口、用户名、密码,勾选输出字段添加输出关系,点击”确定“按钮,将更新后的节点设置信息保存到系统。
- 点击”取消“按钮,退出当前页面。
1. 添加文件系统节点
**输入**:文件类型、文件名路径。
**输出**:系统中新增一个文件对象节点。
**正常流程**:用户输入新增所需的信息,然后提交操作,在系统新增一个文件对象节点。
- 文件类型包括:CSV、JSON、XML、TXT
- 文件来源包括:本地文件、网络文件(SFTP)
"benthos_yaml": "input: {}\npipeline: {}\noutput: {}\nlogger:\n level: ALL\n format: json\n add_timestamp: true\n file:\n path: /usr/local/hsm-os/data/hsm-io-it/data/benthos/json/job_gnmqafan.json\n rotate: true\n",
"benthos_yaml": "input:\n generate:\n count: 1\n interval: 0s\n mapping: root = {}\n processors:\n - http:\n basic_auth:\n enabled: false\n password: \"\"\n username: \"\"\n headers:\n Content-Type: application/json\n namespace: hsm_io_it\n retries: 0\n timeout: 60s\n url: http://172.21.215.39:6130/hsm-io-it/#/layout/job-flow\n verb: GET\npipeline:\n processors:\n - branch:\n processors:\n - label: fieldmapping_1\n mapping: >\n map mapping {\n\n order_no = this.\"OrderNo\"\n\n cmd_time = this.\"CmdTime\"\n\n order_priority = this.\"OrderPriority\"\n\n order_batch = this.\"OrderBatch\"\n\n order_type = this.\"OrderType\"\n\n mat_code = this.\"MatCode\"\n\n order_num = this.\"OrderNum\"\n\n unit = this.\"Unit\"\n\n plant = this.\"Plant\"\n\n plan_starttime = this.\"PlanStarttime\"\n\n plan_endtime = this.\"PlanEndtime\"\n\n process_code = this.\"ProcessCode\"\n\n pbom_code = this.\"PbomCode\"\n\n order_status = this.\"OrderStatus\"\n\n is_delete = this.\"IsDelete\"\n\n }\n\n root = if this.catch(root).type() == \"array\" { this.catch(root).map_each(item -> item.apply(\"mapping\"))} else { this.catch(root).catch({}).apply(\"mapping\") }\n - mapping: root =\n {\"data\":this,\"process_map\":{\"start_process\":\"search\",\"process\":{\"search\":{\"precondition\":[],\"postcondition\":[{\"path\":\"data\",\"result\":true,\"branch\":[\"delete\",\"edit\"]},{\"path\":\"data\",\"result\":false,\"branch\":[\"add\"]}],\"send_body\":false,\"body_type\":\"\",\"interface\":\"MES_SEARCHORDER_INTERFACE\",\"arg_map\":{\"plant\":\"plant\",\"order_no\":\"order_no\"}},\"add\":{\"precondition\":[],\"postcondition\":[],\"send_body\":true,\"body_type\":\"\",\"interface\":\"MES_ADDORDER_INTERFACE\",\"arg_map\":{}},\"edit\":{\"precondition\":[],\"postcondition\":[],\"send_body\":true,\"body_type\":\"\",\"interface\":\"MES_EDITORDER_INTERFACE\",\"arg_map\":{}},\"delete\":{\"precondition\":[{\"path\":\"is_delete\",\"result\":1}],\"postcondition\":[],\"send_body\":false,\"body_type\":\"\",\"interface\":\"MES_DELETEORDER_INTERFACE\",\"arg_map\":{\"order_no\":\"order_no\",\"plant\":\"plant\"}}}}}\n - http:\n url: http://172.21.215.39:6120/api/hsm-io-it/sap/gateway\n verb: POST\n headers:\n Content-Type: application/json\n timeout: 60s\n retries: 0\noutput:\n broker:\n outputs:\n - label: log\n test_stdout:\n codec: lines\n - http_client:\n basic_auth:\n enabled: false\n password: \"\"\n username: \"\"\n headers:\n Content-Type: application/json\n namespace: hsm_io_it\n retries: 0\n timeout: 60s\n url: http://172.21.215.39:6130/hsm-io-it/#/layout/job-flow\n verb: POST\n label: httpclient\nlogger:\n level: ALL\n format: json\n add_timestamp: true\n file:\n path: /usr/local/hsm-os/data/hsm-io-it/data/benthos/json/job_kwgyb0jh.json\n rotate: true\n",
"benthos_yaml": "",
// 正则表达式:匹配 count 的值并替换为 1
countRegexp := regexp.MustCompile(`(?m)count:\s*\d+`)
benthosYaml = countRegexp.ReplaceAllString(benthosYaml, "count: 1")
// 正则表达式:匹配 interval 的值并替换为 "0s"
intervalRegexp := regexp.MustCompile(`(?m)interval:\s*[0-9a-zA-Z]+`)
benthosYaml = intervalRegexp.ReplaceAllString(benthosYaml, `interval: "0s"`)
// 输出替换后的字符串
fmt.Println(benthosYaml)
"benthos_yaml": "input:\n label: interval\n generate:\n interval: 14 54 15 * 7,5 *\n mapping: root = {}\npipeline:\n processors:\n - branch:\n processors:\n - sql_raw:\n args_mapping: \"[0]\"\n driver: postgres\n dsn: postgres://postgres:123456@172.21.222.10:5432/postgres?sslmode=disable\n query: SELECT id,job_name FROM public.zhaopan where 1 = $1 or id in('1')\n result_map: root.database = this\noutput:\n broker:\n outputs:\n - label: log\n test_stdout:\n codec: lines\n - http_client:\n basic_auth:\n enabled: false\n password: \"\"\n username: \"\"\n headers:\n Content-Type: application/json\n namespace: hsm_io_it\n retries: 0\n timeout: 60s\n url: http://172.21.215.39:6130/hsm-io-it/#/layout/job-flow\n verb: POST\n label: httpclient\nlogger:\n level: ALL\n format: json\n add_timestamp: true\n file:\n path: /usr/local/hsm-os/data/hsm-io-it/data/benthos/json/job_qpqaa2ja.json\n rotate: true\n",
countRegexp := regexp.MustCompile(`(?m)(generate:\s*\n\s*interval:.*)(\n\s*mapping:)`)
benthosYaml = countRegexp.ReplaceAllString(benthosYaml, `$1\n count: 0$2`)
intervalRegexp := regexp.MustCompile(`(?m)(interval:\s*)([^ \n]+(?: [^ \n]+)*)`)
benthosYaml = intervalRegexp.ReplaceAllString(benthosYaml, `$1"0s"`)
CREATE TABLE "ioit"."job_info" (
"namespace" varchar(255) COLLATE "pg_catalog"."default",
"s_node" varchar(255) COLLATE "pg_catalog"."default",
"code" varchar(255) COLLATE "pg_catalog"."default",
"name" varchar(255) COLLATE "pg_catalog"."default",
"describe" varchar(255) COLLATE "pg_catalog"."default",
"schedule" varchar(255) COLLATE "pg_catalog"."default",
"schedule_details" varchar(255) COLLATE "pg_catalog"."default",
"schedule_cycle" varchar(255) COLLATE "pg_catalog"."default",
"schedule_unit" varchar(255) COLLATE "pg_catalog"."default",
"content" jsonb,
"cron_id" varchar(255) COLLATE "pg_catalog"."default",
"is_http" bool,
"canvas" jsonb,
"job_type" varchar(255) COLLATE "pg_catalog"."default",
"job_class" varchar(255) COLLATE "pg_catalog"."default",
"template" varchar(255) COLLATE "pg_catalog"."default",
"id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"status" int8,
"create_time" varchar(255) COLLATE "pg_catalog"."default",
"edite_time" varchar(255) COLLATE "pg_catalog"."default",
"create_user" varchar(255) COLLATE "pg_catalog"."default",
"is_auto_select_id" bool,
"cron_detail" jsonb,
"period_detail" jsonb
)
;
{"url": "${ip:hollycon-scheduler-back-end}:18082/eam/deviceFileInfoScheduler/sparePartsReplaceReminder", "status": "1", "jobname": "备件更换提醒", "jobtype": "http", "timeout": 3000, "authtype": "none", "describe": "备件更换提醒", "executor": "默认执行器", "jobclass": "备件更换类", "returnkey": "data", "createuser": "ganguoqiang", "integrated": "KangYuan", "retrycount": 1, "isautostart": true, "requesttype": "GET", "returnvalue": "true", "scheduletype": "cron", "retryinterval": 3000, "cronexpression": "0 10 14 * * ?"}
{"benthos_yaml": "input:\n label: interval\n generate:\n interval: 0s\n count: 1\n mapping: root = {}\npipeline:\n processors:\n - branch:\n processors:\n - sql_raw:\n driver: postgres\n dsn: postgres://postgres:123456@172.21.222.10:5432/postgres?sslmode=disable\n query: SELECT\n id,jobname,createuser,executor,describe,jobclass,url,jobtype,status,scheduletype,cronexpression,jobparams,requesttype,responsecode,responsetype,returnkey,returnvalue,createtime,editetime,integrated,isautostart,every,each,token,authorization,authtype,lastinstanceid,timeout,retrycount,retryinterval\n FROM hsm_scheduling.tasks where 1 = $1 or id\n in('1725585403205298931')\n args_mapping: \"[0]\"\n result_map: root.database = this\noutput:\n broker:\n outputs:\n - label: log\n test_stdout:\n codec: lines\n - label: httpclient\n http_client:\n url: http://172.21.215.39:6130/#/layout/job-flow\n verb: POST\n headers:\n Content-Type: application/json\n namespace: hsm_io_it\n basic_auth:\n enabled: false\n username: \"\"\n password: \"\"\n timeout: 60s\n retries: 0\nlogger:\n level: ALL\n format: json\n add_timestamp: true\n file:\n path: /usr/local/hsm-os/data/hsm-io-it/data/benthos/json/job_an5twh9e.json\n rotate: true\n", "canvas_param": [], "node_data_map": {"database": [{"id": "1725585403205298931", "url": "/api/hsm-io-it/job/excute", "each": "{\"time\": \"\", \"type\": \"\", \"dayOfWeek\": \"\", \"dayOfMonth\": \"\", \"effectiveDate\": \"\"}", "every": 0, "token": "", "status": "1", "jobname": "cw32", "jobtype": "http", "timeout": 60000, "authtype": "none", "describe": "", "executor": "默认执行器", "jobclass": "cate_rootroot", "editetime": "2024-09-06T09:16:43+08:00", "jobparams": "", "returnkey": "data", "createtime": "2024-09-06T09:16:43+08:00", "createuser": "admin", "integrated": "IOIT@hsm_io_it@job_scqavpi26", "retrycount": 1, "isautostart": false, "requesttype": "POST", "returnvalue": "true", "responsecode": "0", "responsetype": "json", "scheduletype": "period", "authorization": "", "retryinterval": 3000, "cronexpression": "@every 60s", "lastinstanceid": ""}]}, "node_yaml_map": {"input": {"77N6k53a5TbPkVHi0QOpO": {"branch": {"processors": [{"sql_raw": {"dsn": "postgres://postgres:123456@172.21.222.10:5432/postgres?sslmode=disable", "query": "SELECT id,jobname,createuser,executor,describe,jobclass,url,jobtype,status,scheduletype,cronexpression,jobparams,requesttype,responsecode,responsetype,returnkey,returnvalue,createtime,editetime,integrated,isautostart,every,each,token,authorization,authtype,lastinstanceid,timeout,retrycount,retryinterval FROM hsm_scheduling.tasks where 1 = $1 or id in('1725585403205298931')", "driver": "postgres", "args_mapping": "[0]"}}], "result_map": "root.database = this"}}}, "output": {"NWlfsyerGJzJnukeHB40k": {"broker": {"outputs": [{"label": "log", "test_stdout": {"codec": "lines"}}, {"label": "httpclient", "http_client": {"url": "http://172.21.215.39:6130/#/layout/job-flow", "verb": "POST", "headers": {"namespace": "hsm_io_it", "Content-Type": "application/json"}, "retries": 0, "timeout": "60s", "basic_auth": {"enabled": false, "password": "", "username": ""}}}]}}}, "transform": {}}, "benthos_componnet": null}
// 定义正则表达式匹配 interval 和 count
intervalRegexp := regexp.MustCompile(`(?m)(interval:\s*)([^ \n]+)`)
countRegexp := regexp.MustCompile(`(?m)(count:\s*\d+)`)
// 处理 jobtype 为 cron 的情况
if jobtype == "cron" {
// 替换 interval 为 cronexpression,并添加双引号
benthosYaml = intervalRegexp.ReplaceAllString(benthosYaml, `$1"`+cronexpression+`"`)
// 删除 count: 1
benthosYaml = countRegexp.ReplaceAllString(benthosYaml, ``)
} else if jobtype == "period" {
if scheduletype == "times" {
// 替换 count 为 times 的值
benthosYaml = countRegexp.ReplaceAllString(benthosYaml, `count: `+times)
// 替换 interval 并添加双引号
benthosYaml = intervalRegexp.ReplaceAllString(benthosYaml, `$1"`+cronexpression+`"`)
} else if scheduletype == "endless" {
// 替换 interval 并添加双引号
benthosYaml = intervalRegexp.ReplaceAllString(benthosYaml, `$1"`+cronexpression+`"`)
// 删除 count: 1
benthosYaml = countRegexp.ReplaceAllString(benthosYaml, ``)
}
}
{
"bom":{
"free1":"",
"free3":"",
"define1":"",
"free2":"",
"versionenddate":"2099-12-3100:00:00.0",
"define2":"",
"free5":"",
"define3":"",
"createdate":"2014-12-0200:00:00.0",
"free4":"",
"define4":"",
"define5":"",
"parentid":"55",
"free7":"",
"define6":"",
"free6":"",
"define16":"",
"define7":"",
"free9":"",
"define8":"",
"cinvcode":"1006",
"free8":"",
"free10":"",
"define9":"",
"version":"10",
"cinvname":"复印机",
"createuser":"demo",
"parentscrap":"0.000",
"versiondesc":"10",
"bomtype":"1",
"versioneffdate":"2000-01-0100:00:00.0",
"cinvcname":"办公用品",
"bomid":"1000000027",
"status":"3",
"cinvstd":"",
"closedate":"",
"cinvccode":"10",
"define15":"",
"define14":"",
"define13":"",
"identcode":"",
"define12":"",
"define11":"",
"define10":"",
"entry":[
{
"recursiveflag":"0",
"remark":"",
"whcode":"30",
"cinvcode":"01019002063",
"cinvname":"主板",
"optionalflag":"0",
"cwhname":"PC原材料仓",
"opcomponentid":"1000000009",
"producttype":"1",
"drawdeptcode":"0501",
"cdepname":"一车间",
"bomid":"1000000003",
"effenddate":"2099-12-3100:00:00.0",
"fvflag":"1",
"componentid":"81",
"define29":"",
"define27":"",
"define28":"",
"baseqtyd":"1.000000",
"auxbaseqtyn":"",
"define33":"",
"define32":"",
"define31":"",
"define30":"",
"define37":"",
"define36":"",
"define35":"",
"define34":"",
"sortseq":"20",
"wiptype":"3",
"costwiprel":"0",
"changerate":"",
"free1":"",
"free3":"",
"free2":"",
"free5":"",
"accucostflag":"1",
"free4":"",
"free7":"",
"dsubflag":"0",
"free6":"",
"free9":"",
"free8":"",
"free10":"",
"define24":"",
"define23":"",
"compscrap":"0.000",
"define26":"",
"define25":"",
"define22":"",
"offset":"0",
"baseqtyn":"1.000000",
"cinvcname":"PC原辅材料",
"cinvstd":"超微X8DTL-3f-B",
"byproductflag":"0",
"opseq":"0000",
"cinvccode":"0101",
"mutexrule":"2",
"auxunitcode":"",
"planfactor":"100.000",
"effbegdate":"2000-01-0100:00:00.0"
},
{
"recursiveflag":"0",
"remark":"",
"whcode":"30",
"cinvcode":"01019002063",
"cinvname":"主板",
"optionalflag":"0",
"cwhname":"PC原材料仓",
"opcomponentid":"1000000086",
"producttype":"1",
"drawdeptcode":"0501",
"cdepname":"一车间",
"bomid":"1000000014",
"effenddate":"2099-12-3100:00:00.0",
"fvflag":"1",
"componentid":"81",
"define29":"",
"define27":"",
"define28":"",
"baseqtyd":"1.000000",
"auxbaseqtyn":"",
"define33":"",
"define32":"",
"define31":"",
"define30":"",
"define37":"",
"define36":"",
"define35":"",
"define34":"",
"sortseq":"20",
"wiptype":"3",
"costwiprel":"0",
"changerate":"",
"free1":"",
"free3":"",
"free2":"",
"free5":"",
"accucostflag":"1",
"free4":"",
"free7":"",
"dsubflag":"0",
"free6":"",
"free9":"",
"free8":"",
"free10":"",
"define24":"",
"define23":"",
"compscrap":"0.000",
"define26":"",
"define25":"",
"define22":"",
"offset":"0",
"baseqtyn":"1.000000",
"cinvcname":"PC原辅材料",
"cinvstd":"超微X8DTL-3f-B",
"byproductflag":"0",
"opseq":"0000",
"cinvccode":"0101",
"mutexrule":"2",
"auxunitcode":"",
"planfactor":"100.000",
"effbegdate":"2000-01-0100:00:00.0"
}
],
"identdesc":"",
"closeuser":""
},
"errmsg":"",
"errcode":"0"
}