Browse Source

fix 策略命中 datavalus

dev
巴林闲侠 2 years ago
parent
commit
3936378b8b
  1. 8
      api/.vscode/launch.json
  2. 15
      api/app/lib/controllers/alarm/data.js
  3. 2
      api/app/lib/utils/dataRange.js

8
api/.vscode/launch.json

@ -16,14 +16,16 @@
"-p 4600",
"-f http://localhost:4600",
//
"-g postgres://postgres:123@10.8.30.32:5432/orational_service",
// "-g postgres://postgres:123@10.8.30.32:5432/orational_service",
//
// "-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS",
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS",
"-k node35:6667,node36:6667,node37:6667",
"--redisHost 10.8.30.112",
"--redisPort 6379",
"--axyApiUrl http://127.0.0.1:4100",
"--apiEmisUrl http://10.8.30.112:14000",
// "--apiEmisUrl http://10.8.30.112:14000",
//
"--apiEmisUrl http://10.8.30.161:1111",
"--godUrl https://restapi.amap.com/v3",
"--godKey 21c2d970e1646bb9a795900dd00093ce",
"--mqttVideoServer mqtt://10.8.30.71:30883",

15
api/app/lib/controllers/alarm/data.js

@ -155,12 +155,14 @@ async function list (ctx) {
alarmRes.forEach(ar => {
ar.pomsProject = (anxinStruc.find(as => as.strucId == ar.StructureId) ||
{
pomsProject: [
// TODO: 开发临时添加
]
}).pomsProject
ar.pomsProject = (
anxinStruc.find(as => as.strucId == ar.StructureId) ||
{
pomsProject: [
// TODO: 开发临时添加
]
}
).pomsProject
// 最新告警详情 - 确认信息
let corConfirmedData = (confirmedAlarmDetailMax.find(cdm => cdm.AlarmId == ar.AlarmId) || {});
@ -175,6 +177,7 @@ async function list (ctx) {
// 告警详情的数量
ar.detailCount = (alarmDetailCount.find(adc => adc.AlarmId == ar.AlarmId) || { count: 0 }).count
})
ctx.status = 200;
ctx.body = {
count: countAlarm[0].count,
rows: alarmRes

2
api/app/lib/utils/dataRange.js

@ -128,7 +128,7 @@ module.exports = function (app, opts) {
for (let s of undelStrucRes) {
if (!undelStruc.some(us => us.strucId == s.strucId)) {
let pomsProject = []
for (let br of bindRes) {
for (let { dataValues: br } of bindRes) {
if (br.anxinProjectId.some(braId => braId == s.projectId)) {
let corPepProject = pepProjectRes.find(pp => pp.id == br.pepProjectId)
pomsProject.push({

Loading…
Cancel
Save