Spaces:
Running
Running
File size: 16,310 Bytes
e1915d8 9117bac 32a85e5 9117bac 5591bde 8390167 32a85e5 5591bde 32a85e5 5591bde 7c1b33e 32a85e5 5591bde 32a85e5 5591bde 32a85e5 5591bde 32a85e5 5591bde 32a85e5 e1915d8 9117bac 2e96a88 e1915d8 2e96a88 e1915d8 2e96a88 e1915d8 2e96a88 5591bde e1915d8 2e96a88 e1915d8 2e96a88 9117bac 2e96a88 5591bde 2e96a88 9117bac 5591bde 9117bac 8390167 9117bac 5591bde 9117bac 5591bde 9117bac 4995062 5591bde 4995062 8390167 5591bde 4995062 32a85e5 4995062 5591bde 32a85e5 5591bde 7c1b33e 5591bde 32a85e5 5591bde 7c1b33e 32a85e5 5591bde 7c1b33e 5591bde 32a85e5 5591bde 22f97a7 5591bde 32a85e5 5591bde 32a85e5 5591bde 7e09732 5591bde 7c1b33e 7e09732 7c1b33e 32a85e5 7c1b33e 32a85e5 7c1b33e 7e09732 32a85e5 7e09732 32a85e5 7e09732 8390167 32a85e5 e1915d8 |
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 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
[
{
"id": "fa36f2aea8694548",
"type": "tab",
"label": "流程 1",
"disabled": false,
"locked": true,
"info": "",
"env": []
},
{
"id": "7b954761b0d0c71d",
"type": "group",
"z": "fa36f2aea8694548",
"name": "天气预警",
"style": {
"label": true
},
"nodes": [
"f4826d0f354203d0",
"b649fa1a86929334",
"28ad21785d1d88ea",
"40f4dade103f33fb",
"d1a634b0775075f7"
],
"x": 34,
"y": 81.5,
"w": 912,
"h": 157
},
{
"id": "249a6593b77d86f9",
"type": "group",
"z": "fa36f2aea8694548",
"name": "停车计时",
"style": {
"label": true
},
"nodes": [
"3669dccf88588c53",
"1c6ca2674ef8a478",
"21747cce1c8e8b69",
"9a1af788832a1aea",
"0bcf5485bc36326e"
],
"x": 34,
"y": 279,
"w": 812,
"h": 82
},
{
"id": "d1a03a3787fecadc",
"type": "group",
"z": "fa36f2aea8694548",
"name": "ACQ",
"style": {
"label": true
},
"nodes": [
"9d78ce6e52ba16d5",
"af54b1e122b3b1be",
"74761521d6f20043",
"24a1438ad0c242f3",
"077de3e016c84c2b"
],
"x": 34,
"y": 439,
"w": 852,
"h": 82
},
{
"id": "d30d422ba83d2888",
"type": "mqtt-broker",
"name": "",
"broker": "https://dsm.727283671.xyz:18833",
"port": "18833",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": 60,
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "2be99c2fa62e6f44",
"type": "inject",
"z": "fa36f2aea8694548",
"name": "POST到",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 00 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "object",
"payloadType": "date",
"x": 140,
"y": 40,
"wires": [
[
"bfdbf3a6d111494f"
]
]
},
{
"id": "bfdbf3a6d111494f",
"type": "http request",
"z": "fa36f2aea8694548",
"name": "HuggingFace",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://push.727283671.xyz:4443/HuggingFace",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 330,
"y": 40,
"wires": [
[]
]
},
{
"id": "f4826d0f354203d0",
"type": "weather",
"z": "fa36f2aea8694548",
"g": "7b954761b0d0c71d",
"name": "银川",
"longitude": "106.183878",
"latitude": "38.499847",
"x": 290,
"y": 160,
"wires": [
[
"40f4dade103f33fb"
],
[],
[],
[],
[],
[],
[]
]
},
{
"id": "b649fa1a86929334",
"type": "inject",
"z": "fa36f2aea8694548",
"g": "7b954761b0d0c71d",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 180,
"wires": [
[
"f4826d0f354203d0"
]
]
},
{
"id": "28ad21785d1d88ea",
"type": "function",
"z": "fa36f2aea8694548",
"g": "7b954761b0d0c71d",
"name": "预警信息筛选",
"func": "\n\n// 检查预警数据有效性 \nif (!msg.payload.alerts || msg.payload.alerts.length === 0) {\n node.warn(\" 预警信息为空\");\n return null;\n}\n \ntry {\n // 解构赋值提取预警数据(含默认值)\n const { type = \"未知\", level = \"\", detail = \"暂无详细内容\" } = msg.payload.alerts[0] || {};\n \n // 重构 payload \n msg.payload = {\n title: `${type}${level}预警`,\n message: detail.replace(/\\n/g, \" \") // 去除换行符 \n };\n \n // 添加固定头部 \n msg.headers = {\n \"X-Title\": \"Weather_alerts\",\n \"X-Priority\": \"3\", // 根据目标服务调整优先级 \n \"tags\": \"house\"\n };\n \n return msg;\n} catch (error) {\n node.error(\" 预警数据处理失败:\", error);\n return null;\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 580,
"y": 140,
"wires": [
[
"d1a634b0775075f7"
]
]
},
{
"id": "3669dccf88588c53",
"type": "http request",
"z": "fa36f2aea8694548",
"g": "249a6593b77d86f9",
"name": "顺泊停车",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://yinchuan.ttpark.cn/MobileServer/general/order/calFee?parkID=0&plate=%E5%AE%81A0B7K2&plateColor=1&autoCancel=1&appServletRequestType=openid&payAppID=106&sceneType=9&wxlite_token=f69f798ac2a7e29fed0aa77c19b5e365",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 280,
"y": 320,
"wires": [
[
"21747cce1c8e8b69"
]
]
},
{
"id": "1c6ca2674ef8a478",
"type": "inject",
"z": "fa36f2aea8694548",
"g": "249a6593b77d86f9",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "150",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 320,
"wires": [
[
"3669dccf88588c53"
]
]
},
{
"id": "21747cce1c8e8b69",
"type": "json",
"z": "fa36f2aea8694548",
"g": "249a6593b77d86f9",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 410,
"y": 320,
"wires": [
[
"9a1af788832a1aea"
]
]
},
{
"id": "9d78ce6e52ba16d5",
"type": "http request",
"z": "fa36f2aea8694548",
"g": "d1a03a3787fecadc",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://api.zhileit.com/api/v1/web/bg/scpCarOwnerInfo/getShopBySwsKeyNew?cwsName=null&coordinate=106.18224662045463%2C38.49661166683154&pageSize=50&pageIndex=1",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "other",
"keyValue": "CWS_BELONGING_KEY",
"valueType": "other",
"valueValue": "75C642B47E0276CDDDA9A0BCA1BE65EB"
}
],
"x": 280,
"y": 480,
"wires": [
[
"74761521d6f20043"
]
]
},
{
"id": "af54b1e122b3b1be",
"type": "inject",
"z": "fa36f2aea8694548",
"g": "d1a03a3787fecadc",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "300",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 480,
"wires": [
[
"9d78ce6e52ba16d5"
]
]
},
{
"id": "74761521d6f20043",
"type": "json",
"z": "fa36f2aea8694548",
"g": "d1a03a3787fecadc",
"name": "",
"property": "payload",
"action": "",
"pretty": true,
"x": 410,
"y": 480,
"wires": [
[
"24a1438ad0c242f3"
]
]
},
{
"id": "9a1af788832a1aea",
"type": "function",
"z": "fa36f2aea8694548",
"g": "249a6593b77d86f9",
"name": "提取信息",
"func": "// 检查 msg.payload 和 msg.payload.data 是否存在\nif (!msg.payload || !msg.payload.data) {\n // 可以根据实际情况进行处理,这里舍弃信息\n return;\n}\n// 检查 orderList 是否存在且长度大于 0\nif (!msg.payload.data.orderList || msg.payload.data.orderList.length === 0) {\n // 可以根据实际情况进行处理,这里舍弃信息\n return;\n}\nvar plate = msg.payload.data.plate;\nvar images = msg.payload.data.orderList[0].imageURLs\nvar intime = msg.payload.data.orderList[0].inTime\nvar parkingTime = msg.payload.data.orderList[0].parkingTime\nvar amountPayable = msg.payload.data.orderList[0].amountPayable\n\n// 假设从 msg.payload 中获取分钟数 \nconst minutes = parkingTime; \n \n// 计算小时数 \nconst hours = Math.floor(minutes / 60); \n \n// 计算剩余分钟数 \nconst remainingMinutes = minutes % 60; \n \n// 格式化输出 \nconst formattedTime = `${hours} 小时 ${remainingMinutes} 分钟`; \n \n// 指定时长 (3小时25分钟)\nconst targetTime = \"205\"; \n \nlet tips; \nif (parkingTime >= 0 && parkingTime <= 5) { \n tips = \"A\"; \n} else if (parkingTime >= 25 && parkingTime <= 30) { \n tips = \"B\"; \n} else if (parkingTime >= 205 && parkingTime <= 210) { \n tips = \"C\"; \n} else if (parkingTime >= 325 && parkingTime <= 330) { \n tips = \"D\"; \n} else if (parkingTime >= 385 ) { \n tips = \"E\"; \n} else { \n // 不在上述范围的情况,可按需设置默认提示 \n tips = \"F\"; \n} \n\nmsg.payload = {\n plate: plate,\n imaUrl: images, // 入场照片\n intime: intime,\n parkingTime: formattedTime,\n tips: tips,\n amountPayable: amountPayable\n};\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 320,
"wires": [
[
"0bcf5485bc36326e"
]
]
},
{
"id": "24a1438ad0c242f3",
"type": "function",
"z": "fa36f2aea8694548",
"g": "d1a03a3787fecadc",
"name": "提取信息",
"func": "// 从 context 中获取历史数据,如果不存在则初始化为空数组 \nvar historyData = context.get('historyData') || []; \nvar data = msg.payload.data.list; \nvar extractedData = []; \nvar changedData = []; \n \n// 提取所需数据 \nfor (var i = 0; i < data.length; i++) { \n var item = data[i]; \n var newItem = { \n name: item.cws_name, \n address: item.cws_address, \n sum_count: item.swi_sum_count, \n using_count: item.swi_using_count\n }; \n\n // 有数据时添加 cwoiInTime 相关项\n if (item.swi_using_info && item.swi_using_info.length > 0) {\n newItem.cwoiInTime1 = item.swi_using_info[0].cwoiInTime;\n }\n if (item.swi_using_info && item.swi_using_info.length > 1) {\n newItem.cwoiInTime2 = item.swi_using_info[1].cwoiInTime;\n }\n if (item.swi_using_info && item.swi_using_info.length > 2) {\n newItem.cwoiInTime3 = item.swi_using_info[2].cwoiInTime;\n }\n\n extractedData.push(newItem); \n} \n \n// 对比新数据和历史数据,找出发生变化的数据 \nfor (var j = 0; j < extractedData.length; j++) { \n var isChanged = true; \n for (var k = 0; k < historyData.length; k++) { \n if (extractedData[j].name === historyData[k].name) { \n // 假设 name 是唯一标识,对比其他属性 \n if ( \n extractedData[j].address === historyData[k].address && \n extractedData[j].sum_count === historyData[k].sum_count && \n extractedData[j].using_count === historyData[k].using_count && \n extractedData[j].cwoiInTime1 === historyData[k].cwoiInTime1 && \n extractedData[j].cwoiInTime2 === historyData[k].cwoiInTime2 && \n extractedData[j].cwoiInTime3 === historyData[k].cwoiInTime3 \n ) { \n isChanged = false; \n break; \n } \n } \n } \n if (isChanged) { \n changedData.push(extractedData[j]); \n } \n} \n \n// 更新历史数据 \ncontext.set('historyData', extractedData); \n \n// 将发生变化的数据赋值给 msg.payload \nmsg.payload = changedData; \nreturn msg; ",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 480,
"wires": [
[
"077de3e016c84c2b"
]
]
},
{
"id": "40f4dade103f33fb",
"type": "rbe",
"z": "fa36f2aea8694548",
"g": "7b954761b0d0c71d",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload.alerts[0].pubTime",
"topi": "topic",
"x": 430,
"y": 140,
"wires": [
[
"28ad21785d1d88ea"
]
]
},
{
"id": "077de3e016c84c2b",
"type": "mqtt out",
"z": "fa36f2aea8694548",
"g": "d1a03a3787fecadc",
"name": "",
"topic": "MQTT/ACQdata",
"qos": "2",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "d30d422ba83d2888",
"x": 780,
"y": 480,
"wires": []
},
{
"id": "0bcf5485bc36326e",
"type": "mqtt out",
"z": "fa36f2aea8694548",
"g": "249a6593b77d86f9",
"name": "",
"topic": "MQTT/Parking",
"qos": "2",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "d30d422ba83d2888",
"x": 740,
"y": 320,
"wires": []
},
{
"id": "d1a634b0775075f7",
"type": "mqtt out",
"z": "fa36f2aea8694548",
"g": "7b954761b0d0c71d",
"name": "",
"topic": "MQTT/Weather_alerts",
"qos": "2",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "d30d422ba83d2888",
"x": 820,
"y": 140,
"wires": []
}
] |