application.yml 15.2 KB
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
spring:
  application:
    name: iot-scheduler
  main:
    banner-mode: off
  data:
    redis:
      cluster:
        nodes: # 集群节点列表
          - 10.9.1.252:16380
          - 10.9.1.252:16381
          - 10.9.1.252:16382
        max-redirects: 3  # 最大重定向次数
      password: "Qixiao@redis20240410.com"  # 如果有密码

server:
  port: 33221

logging:
  level:
    root: INFO
    com.iot.scheduler: DEBUG

# Scheduler Configuration (Cron Expressions)
# Format: sec min hour day month day-of-week
scheduler:
  chizhou:
    pull: "0 0/5 * * * ?"   # Every 5 minutes
    push: "0 0/10 * * * ?"  # Every 10 minutes
  huaining:
    pull: "0 0/1 * * * ?"
    push: "0 0/1 * * * ?"
  panji:
    pull: "0 0/5 * * * ?"
    push: "0 0/10 * * * ?"
  hsq:
    push: "0 0 0/1 * * ?"
  pj:
    push: "0 0/10 * * * ?"
    energyPush: "0 0 0 * * ?"
  jmdq:
    pull: "0 0/10 * * * ?"
    push: "0 0/10 * * * ?"
  nanqiao:
    pull: "0 0/1 * * * ?"
    push: "0 0/1 * * * ?"
  xp:
    pull: "0 0/1 * * * ?"
    push: "0 0/1 * * * ?"
  sjgyhlwpt:
    pull: "0 0/5 * * * ?"   # Every 5 minutes

hn:
  third:
    domain: "http://220.180.204.38:1803/report-property"
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT
                  dc.credentials_id AS sn,
                  tkl1.str_v AS status,
                  tkl2.dbl_v AS cumulativeOutput
                FROM
                  device de
                  LEFT JOIN device_credentials dc on de.id = dc.device_id
                  LEFT JOIN ts_kv_latest tkl1 ON de.id = tkl1.entity_id
                  AND tkl1.key = 61
                  LEFT JOIN ts_kv_latest tkl2 ON de.id = tkl2.entity_id
                  AND tkl2.key = 175
                  WHERE
                  de.organization_id IN(
                  'f82530a0-93e4-4aeb-9339-f5b6d1127840',
                  '752a7621-b59b-477c-b15e-e06d412e02d5',
                  '00690478-b836-4986-88fd-1dd8cb87ed1d',
                  '7985002f-53c5-41bf-98d6-58ef422dadfd',
                  '9de73a7a-61e7-481f-8aab-df39253770d8',
                  'eaa6f152-9ef5-4ad2-b12c-ac10e47a110e',
                  '378f6df7-6a72-4c6d-8d09-b14834b3e824'
                  )
                  UNION all
                  
SELECT
dc.credentials_id AS sn,
CASE
    WHEN ak2.long_v IS NULL OR (ak.bool_v = FALSE AND ak2.long_v IS NOT NULL) THEN 'OFF'
    WHEN tkl.long_v = 1 THEN 'ERROR'
    WHEN tkl2.long_v = 1 THEN 'STAND'
    WHEN tkl3.long_v = 1 THEN 'RUN'
    ELSE 'OFF'
  END AS status,
tkl4.dbl_v AS cumulativeOutput
FROM device de 
LEFT JOIN ts_kv_latest tkl on de.id = tkl.entity_id AND tkl.key = '64'
LEFT JOIN ts_kv_latest tkl2 on de.id = tkl2.entity_id AND tkl2.key = '535'
LEFT JOIN ts_kv_latest tkl3 on de.id = tkl3.entity_id AND tkl3.key = '534'
LEFT JOIN ts_kv_latest tkl4 ON de.id = tkl4.entity_id AND tkl4.key = '175'
LEFT JOIN attribute_kv ak ON de.id = ak.entity_id AND ak.entity_type = 'DEVICE' AND ak.attribute_key = 'active'
LEFT JOIN attribute_kv ak2 ON de.id = ak2.entity_id AND ak2.entity_type = 'DEVICE' AND ak2.attribute_key = 'lastActivityTime'
LEFT JOIN device_credentials dc ON de.id = dc.device_id
WHERE (de.organization_id = '875a4841-c7f2-4e2c-88a2-ea62d4642132' or de.organization_id = '3304ebd5-71ae-448a-91a2-e3b4d6ae258a')
AND de.device_profile_id = '1f2183a0-0562-11f1-9cb8-e3376d1e7978'
UNION ALL
SELECT
dc.credentials_id,
CASE
    WHEN ak2.long_v IS NULL OR (ak.bool_v = FALSE AND ak2.long_v IS NOT NULL) THEN 'OFF'
    WHEN tkl.str_v = 'ERROR' THEN 'ERROR'
    WHEN tkl.str_v = 'STAND' THEN 'STAND'
    ELSE 'RUN'
  END AS status,
tkl2.dbl_v AS cumulativeOutput
FROM device de 
LEFT JOIN ts_kv_latest tkl on de.id = tkl.entity_id AND tkl.key = '61'
LEFT JOIN ts_kv_latest tkl2 ON de.id = tkl2.entity_id AND tkl2.key = '175'
LEFT JOIN attribute_kv ak ON de.id = ak.entity_id AND ak.entity_type = 'DEVICE' AND ak.attribute_key = 'active'
LEFT JOIN attribute_kv ak2 ON de.id = ak2.entity_id AND ak2.entity_type = 'DEVICE' AND ak2.attribute_key = 'lastActivityTime'
LEFT JOIN device_credentials dc ON de.id = dc.device_id
WHERE de.organization_id = '3304ebd5-71ae-448a-91a2-e3b4d6ae258a'
AND de.device_profile_id = '63042200-02fe-11f1-9cb8-e3376d1e7978'"

hnhsq:
  third:
    reportUrl: "http://58.243.79.51:31357/mainApi/formEngine/formData/batchAddOrUpate"
    tokenUrl: "http://58.243.79.51:32210/auth/oauth/token"
    tokenUser: "hnsq"
    tokenPwd: "abc@1234"
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT d.name,d.sn,kv.ts,kv.long_v as value
        from ts_kv kv
        INNER JOIN device d on d.id = kv.entity_id and kv.key=61
        where tenant_id='5b6a05a0-f020-11f0-9cb8-e3376d1e7978'"
pj:
  third:
    reportUrl: "http://111.39.171.168:12280/mainApi/formEngine/formData/batchAddOrUpate"
    tokenUrl: "http://111.39.171.168:15555/auth/oauth/token"
    username: "adminhnjt"
    password: "admin@1234"
    formId: "t6937bc62e4332f00072a0849"
    uniqueKeys: "entName,deviceCode"
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT
                  tko.name AS entName,
                  de.name AS deviceName,
                  dc.credentials_id AS deviceCode,
                  tkl.long_v AS status
                FROM
                  device de
                  LEFT JOIN tk_organization tko ON de.organization_id = tko.id
                  LEFT JOIN ts_kv_latest tkl ON de.id = tkl.entity_id AND tkl.KEY = 61
                  LEFT JOIN device_credentials dc on de.id = dc.device_id
                WHERE
                  de.tenant_id = '0414df80-f01d-11f0-9cb8-e3376d1e7978'
                  AND de.device_profile_id = '0418b010-f01d-11f0-9cb8-e3376d1e7978';"
    energyFormId: "t69393ccde4332f00072a08e8"
    energyUniqueKeys: "entName,deviceCode,timeSpan,collectTime,energyType"
    selectEnergySql: "SELECT
                  tko.name AS entName,
                  de.name AS deviceName,
                  dc.credentials_id AS deviceCode,
                  case tkl.key 
                  when 544 then '电'
                  when 545 then '水' 
                  when 546 then '天然气' end AS energyType,
                  COALESCE (tkl.dbl_v, tkl.long_v, 0) AS deviceValue
                FROM
                  device de
                  LEFT JOIN tk_organization tko ON de.organization_id = tko.id
                  LEFT JOIN ts_kv_latest tkl ON de.id = tkl.entity_id
                  AND tkl.KEY IN (544, 545, 546)
                  LEFT JOIN device_credentials dc ON de.id = dc.device_id
                WHERE
                  de.tenant_id = '0414df80-f01d-11f0-9cb8-e3376d1e7978'
                  AND de.device_profile_id IN ('b1845b90-6634-11f1-9cb8-e3376d1e7978', '8c195900-6634-11f1-9cb8-e3376d1e7978', '5eb07070-6634-11f1-9cb8-e3376d1e7978');"

wuwei:
  third:
    domain: "http://60.169.172.121:1804/report-property"
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT
  dc.credentials_id AS sn,
  CASE
    WHEN ak2.long_v IS NULL OR (ak.bool_v = FALSE AND ak2.long_v IS NOT NULL) THEN 'OFF'
    WHEN tkl.long_v = 1 THEN 'RUN'
    ELSE 'STAND'
  END AS status
FROM
  device de
  LEFT JOIN attribute_kv ak ON de.id = ak.entity_id
  AND ak.entity_type = 'DEVICE'
  AND ak.attribute_key = 'active'
  LEFT JOIN attribute_kv ak2 ON de.id = ak2.entity_id
  AND ak2.entity_type = 'DEVICE'
  AND ak2.attribute_key = 'lastActivityTime'
  LEFT JOIN ts_kv_latest tkl ON de.id = tkl.entity_id
  AND KEY = '525'
  LEFT JOIN device_credentials dc ON de.id = dc.device_id
WHERE
  de.device_profile_id = '091b8450-00cd-11f1-9cb8-e3376d1e7978'
  UNION ALL
SELECT
  dc.credentials_id as sn,
  tkl.str_v AS status
FROM
  device de
  LEFT JOIN device_credentials dc ON de.id = dc.device_id
  LEFT JOIN ts_kv_latest tkl ON de.id = tkl.entity_id
  AND KEY = 61
WHERE
  (de.device_profile_id = 'e717b260-025d-11f1-9cb8-e3376d1e7978'
  OR de.device_profile_id = '01bbfaf0-12c5-11f1-9cb8-e3376d1e7978')"

sh:
  iot:
    organizeId: "f82530a0-93e4-4aeb-9339-f5b6d1127840"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "shzh"
    password: "Shzh@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

sl:
  iot:
    organizeId: "752a7621-b59b-477c-b15e-e06d412e02d5"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "slzy"
    password: "Slzy@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

gh:
  iot:
    organizeId: "875a4841-c7f2-4e2c-88a2-ea62d4642132"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "ghxcl"
    password: "Ghxcl@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

shzz:
  iot:
    organizeId: "3304ebd5-71ae-448a-91a2-e3b4d6ae258a"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "shzz"
    password: "Shzz@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

jmdq:
  iot:
    organizeId: "80108826-48af-48ff-b120-41d1a5722e9a"
    profileId: "e717b260-025d-11f1-9cb8-e3376d1e7978"
    deviceProfileId: "e717b260-025d-11f1-9cb8-e3376d1e7978"
    userName: "wwyq"
    password: "Wwyq@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"
yxw:
  iot:
    organizeId: "a5d98b44-6e1c-4ed6-a4fa-269e4a89f58b"
    profileId: "829f4a10-1481-11f1-9cb8-e3376d1e7978"
    deviceProfileId: "829f4a10-1481-11f1-9cb8-e3376d1e7978"
    userName: "yxw"
    password: "Yxw@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

sy:
  iot:
    organizeId: "8340c4df-9d44-4490-a474-9028748ece86"
    profileId: "e717b260-025d-11f1-9cb8-e3376d1e7978"
    deviceProfileId: "e717b260-025d-11f1-9cb8-e3376d1e7978"
    userName: "wwyq"
    password: "Wwyq@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

yjhb:
  iot:
    organizeId: "00690478-b836-4986-88fd-1dd8cb87ed1d"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "yjhb"
    password: "Yjhb@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

kjzs:
  iot:
    organizeId: "7985002f-53c5-41bf-98d6-58ef422dadfd"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "kjzs"
    password: "Kjzs@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

ahajr:
  iot:
    organizeId: "378f6df7-6a72-4c6d-8d09-b14834b3e824"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "ahajr"
    password: "Ahajr@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

ynzy:
  iot:
    organizeId: "eaa6f152-9ef5-4ad2-b12c-ac10e47a110e"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "ynzy"
    password: "Ynzy@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

ahhm:
  iot:
    organizeId: "9de73a7a-61e7-481f-8aab-df39253770d8"
    profileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    deviceProfileId: "f2292f60-f738-11f0-9cb8-e3376d1e7978"
    userName: "ahhm"
    password: "Ahhm@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

device:
  token:
    url: "https://iotgc.cniot.vip/auth/token"
    userName: "chuzhoult"
    password: "111111"
  info:
    url: "https://iotgc.cniot.vip/triColorLamp/userGroupDtuSns"
  detail:
    url: "https://iotgc.cniot.vip/triColorLamp/dtuSnState"

tc:
  iot:
    organizeId: "eef879b9-45cd-41ec-a069-47ae6c511ca5"
    profileId: "39b1d900-5264-11f1-9cb8-e3376d1e7978"
    deviceProfileId: "39b1d900-5264-11f1-9cb8-e3376d1e7978"
    userName: "tckj"
    password: "Tckj@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

xml:
  iot:
    organizeId: "3f2cefad-1b04-4839-a591-8eb9df591f47"
    profileId: "39b1d900-5264-11f1-9cb8-e3376d1e7978"
    deviceProfileId: "39b1d900-5264-11f1-9cb8-e3376d1e7978"
    userName: "xml"
    password: "Xml@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    infoUrl: "https://iot.hzzlyun.com/api/yt/device"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

xp:
  third:
    domain: "http://220.180.204.38:1803/report-property"
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT
  'XP251111720' AS sn,
  tkl1.str_v AS STATUS,
  tkl2.dbl_v AS cumulativeOutput
FROM
  device de
  LEFT JOIN device_credentials dc ON de.id = dc.device_id
  LEFT JOIN ts_kv_latest tkl1 ON de.id = tkl1.entity_id
  AND tkl1.KEY = 61
  LEFT JOIN ts_kv_latest tkl2 ON de.id = tkl2.entity_id
  AND tkl2.KEY = 175
WHERE
  de.organization_id IN ('f82530a0-93e4-4aeb-9339-f5b6d1127840') and dc.credentials_id='AGX251111720'"

djxc:
  third:
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT
  dc.credentials_id AS deviceCode
FROM
  device de
  LEFT JOIN device_credentials dc ON de.id = dc.device_id
WHERE
  de.device_profile_id = '9e8257b0-3982-11f1-9cb8-e3376d1e7978';"
  iot:
    userName: "djxc"
    password: "Djxc@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"

wwnj:
  third:
    jdbcUrl: "jdbc:postgresql://106.15.73.210:5433/thingskit"
    jdbcUserName: "postgres"
    jdbcPassword: "postgres"
    selectSql: "SELECT
  dc.credentials_id AS deviceCode
FROM
  device de
  LEFT JOIN device_credentials dc ON de.id = dc.device_id
WHERE
  de.device_profile_id = '9bb44bc0-394f-11f1-9cb8-e3376d1e7978';"
  iot:
    userName: "wwnj"
    password: "Wwnj@123.com"
    tokenUrl: "https://iot.hzzlyun.com/api/auth/login"
    detailUrl: "https://iot.hzzlyun.com/api/v1/"