Browse Source

apI 调整

master
wenlele 1 year ago
parent
commit
d912d192c2
  1. 1
      api/app/lib/controllers/bigScreen/index .js
  2. 50
      api/app/lib/routes/organization/index.js
  3. 770
      api/app/lib/schedule/workorder_statistics.js
  4. 2
      web/client/src/sections/bigScreen/actions/index.js

1
api/app/lib/controllers/bigScreen/index .js

@ -88,7 +88,6 @@ const getPumpStation = async function (ctx) {
ctx.status = 200; ctx.status = 200;
ctx.body = JSON.parse(res) ctx.body = JSON.parse(res)
// ctx.body = []
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;

50
api/app/lib/routes/organization/index.js

@ -4,51 +4,41 @@ const data = require('../../controllers/bigScreen/index ');
module.exports = function (app, router, opts) { module.exports = function (app, router, opts) {
try {
app.fs.api.logAttr['GET/pump1/station1'] = { content: '获取所有站点信息', visible: true };
router.get('/pump1/station1', data.getPumpStation); app.fs.api.logAttr['GET/pump/station'] = { content: '获取所有站点信息', visible: true };
router.get('/pump/station', data.getPumpStation);
app.fs.api.logAttr['POST/axyData'] = { content: '获取安心云数据', visible: true }; app.fs.api.logAttr['POST/axyData'] = { content: '获取安心云数据', visible: true };
router.post('/axyData', data.axyData); router.post('/axyData', data.axyData);
// app.fs.api.logAttr['GET/pumpInformation'] = { content: '获取泵站信息', visible: true }; app.fs.api.logAttr['GET/pumpInformation'] = { content: '获取泵站信息', visible: true };
// router.get('/pumpInformation', data.pumpInformation); router.get('/pumpInformation', data.pumpInformation);
app.fs.api.logAttr['GET/videoUrl'] = { content: '获取视频监控url', visible: true }; app.fs.api.logAttr['GET/videoUrl'] = { content: '获取视频监控url', visible: true };
router.get('/videoUrl', data.getVideoUrl); router.get('/videoUrl', data.getVideoUrl);
app.fs.api.logAttr['GET/water/level/all'] = { content: '获取所有泵站七天内最新集水池液位', visible: true };
router.get('/water/level/all', data.getPumpStation);
console.log('获取视频监控url'); app.fs.api.logAttr['GET/water/level/six'] = { content: '获取泵站6h最新集水池液位', visible: true };
router.get('/water/level/six', data.getPumpStation);
console.log('获取所有站点信息');
// app.fs.api.logAttr['get/water/level/all'] = { content: '获取所有泵站七天内最新集水池液位', visible: true };
// router.get('/water/level/all', data.getPumpStation);
// app.fs.api.logAttr['get/water/level/six'] = { content: '获取泵站6h最新集水池液位', visible: true };
// router.get('/water/level/six', data.getPumpStation);
// app.fs.api.logAttr['get/water/pump/state/all'] = { content: '获取水泵状态', visible: true };
// router.get('/water/pump/state/all', data.getPumpStation);
// app.fs.api.logAttr['get/capacity'] = { content: '获取能耗监测数据', visible: true }; app.fs.api.logAttr['GET/water/pump/state/all'] = { content: '获取水泵状态', visible: true };
// router.get('/capacity', data.getPumpStation); router.get('/water/pump/state/all', data.getPumpStation);
// app.fs.api.logAttr['get/currentSix'] = { content: '获取水泵数据', visible: true }; app.fs.api.logAttr['GET/capacity'] = { content: '获取能耗监测数据', visible: true };
// router.get('/currentSix', data.getPumpStation); router.get('/capacity', data.getPumpStation);
// app.fs.api.logAttr['get/cabinet'] = { content: '获取进线柜数据', visible: true }; app.fs.api.logAttr['GET/currentSix'] = { content: '获取水泵数据', visible: true };
// router.get('/cabinet', data.getPumpStation); router.get('/currentSix', data.getPumpStation);
// app.fs.api.logAttr['get/threePhase'] = { content: '获取三相电流数据', visible: true }; app.fs.api.logAttr['GET/cabinet'] = { content: '获取进线柜数据', visible: true };
router.get('/cabinet', data.getPumpStation);
// router.get('/threePhase', data.getPumpStation); app.fs.api.logAttr['GET/threePhase'] = { content: '获取三相电流数据', visible: true };
} catch (error) { router.get('/threePhase', data.getPumpStation);
console.log(error.response);
}
}; };

770
api/app/lib/schedule/workorder_statistics.js

@ -28,398 +28,398 @@ module.exports = function (app, opts) {
let structureList = await app.fs.anxinyun.get(`organizations/${data.orgId}/structures?token=${data.token}`) || [] let structureList = await app.fs.anxinyun.get(`organizations/${data.orgId}/structures?token=${data.token}`) || []
console.log('获取所有泵站', structureList); // console.log('获取所有泵站', structureList);
await app.redis.set("pumpStation_structure", JSON.stringify(structureList)) await app.redis.set("pumpStation_structure", JSON.stringify(structureList))
let daty = await app.redis.get("pumpStation_structure") let daty = await app.redis.get("pumpStation_structure")
console.log(222, JSON.parse(daty)); console.log(222, JSON.parse(daty));
// if (structureList.length) { if (structureList.length) {
// let waterLevelData = [] //七天内每个泵站的集水池液位 let waterLevelData = [] //七天内每个泵站的集水池液位
// let waterLevelSix = {} //泵站最新6h的集水池液位 let waterLevelSix = {} //泵站最新6h的集水池液位
// let waterPumpStateAll = [] //所有水泵的状态 let waterPumpStateAll = [] //所有水泵的状态
// let capacity = {} //能耗监测 let capacity = {} //能耗监测
// let currentSix = {} //水泵六小时数据 let currentSix = {} //水泵六小时数据
// let cabinet = {} //进线柜 let cabinet = {} //进线柜
// let threePhase = {} //三相电流 let threePhase = {} //三相电流
// for (let index = 0; index < structureList.length; index++) { for (let index = 0; index < structureList.length; index++) {
// const strucOne = structureList[index]; const strucOne = structureList[index];
// //单个泵站 //单个泵站
// let pumpOne = await app.fs.anxinyun.get(`structures/${strucOne.id}/factors?token=${data.token}`) || [] let pumpOne = await app.fs.anxinyun.get(`structures/${strucOne.id}/factors?token=${data.token}`) || []
// if (pumpOne.length) { if (pumpOne.length) {
// let pump = [] //能耗监测--水泵 let pump = [] //能耗监测--水泵
// let cabinetSun = [] //能耗监测--进线柜 let cabinetSun = [] //能耗监测--进线柜
// let sun = {} let sun = {}
// let day1 = 0 let day1 = 0
// let day30 = 0 let day30 = 0
// let day365 = 0 let day365 = 0
// let daySun = 0 let daySun = 0
// //泵站信息 //泵站信息
// let informationId = pumpOne.find(v => v.name == '泵站信息').id let informationId = pumpOne.find(v => v.name == '泵站信息').id
// if (informationId) { if (informationId) {
// let pumpInformation = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: informationId } }) || [] let pumpInformation = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: informationId } }) || []
// if (pumpInformation.length > 0 && pumpInformation[0].groups.length && pumpInformation[0].groups[0].stations[0].id) { if (pumpInformation.length > 0 && pumpInformation[0].groups.length && pumpInformation[0].groups[0].stations[0].id) {
// //七天内该泵站最新的集水池液位 //七天内该泵站最新的集水池液位
// let waterLevel = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { let waterLevel = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, {
// query: { query: {
// stations: pumpInformation[0].groups[0].stations[0].id, stations: pumpInformation[0].groups[0].stations[0].id,
// startTime: moment().startOf('week').format('YYYY-MM-DD HH:mm:ss'), startTime: moment().startOf('week').format('YYYY-MM-DD HH:mm:ss'),
// endTime: moment().endOf('week').format('YYYY-MM-DD HH:mm:ss'), endTime: moment().endOf('week').format('YYYY-MM-DD HH:mm:ss'),
// limit: 1 limit: 1
// } }
// }) || {} }) || {}
// let findOne = waterLevel.stations[0].data[0] || {} let findOne = waterLevel.stations[0].data[0] || {}
// sun.sHumidity = findOne.sHumidity sun.sHumidity = findOne.sHumidity
// sun.sTEMP = findOne.sTEMP sun.sTEMP = findOne.sTEMP
// sun.sGrille_level = findOne.sGrille_level sun.sGrille_level = findOne.sGrille_level
// waterLevelData.push({ waterLevelData.push({
// strucId: strucOne.id, name: strucOne.name, level: findOne.sLiquid_level || 0 strucId: strucOne.id, name: strucOne.name, level: findOne.sLiquid_level || 0
// }) })
// //该泵站最新6h的集水池液位 //该泵站最新6h的集水池液位
// let waterLevel6 = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { let waterLevel6 = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, {
// query: { query: {
// stations: pumpInformation[0].groups[0].stations[0].id, stations: pumpInformation[0].groups[0].stations[0].id,
// startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'), startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'),
// endTime: moment().format('YYYY-MM-DD HH:mm:ss'), endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
// limit: 1440 limit: 1440
// } }
// }) || {} }) || {}
// waterLevelSix['struc' + strucOne.id] = waterLevel6.stations[0] && JSON.stringify(waterLevel6.stations[0].data) waterLevelSix['struc' + strucOne.id] = waterLevel6.stations[0] && JSON.stringify(waterLevel6.stations[0].data)
// } }
// } }
// //水泵信息 //水泵信息
// let waterId = pumpOne.find(v => v.name == '泵站水泵').id let waterId = pumpOne.find(v => v.name == '泵站水泵').id
// if (waterId) { if (waterId) {
// let waterpPmpInformation = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: waterId } }) || [] let waterpPmpInformation = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: waterId } }) || []
// let dataId = [] let dataId = []
// waterpPmpInformation.forEach(v => { waterpPmpInformation.forEach(v => {
// v.groups.forEach(s => { v.groups.forEach(s => {
// s.stations.forEach(f => { s.stations.forEach(f => {
// dataId.push(f.id) dataId.push(f.id)
// }) })
// }) })
// }) })
// if (dataId.length) { if (dataId.length) {
// // 当前时间 // 当前时间
// let todayOne = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { let todayOne = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
// endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'), endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
// limit: 1 limit: 1
// } }
// }) || [] }) || []
// waterPumpStateAll.push({ strucId: strucOne.id, name: strucOne.name, data: todayOne.stations }) waterPumpStateAll.push({ strucId: strucOne.id, name: strucOne.name, data: todayOne.stations })
// pump = todayOne.stations || [] pump = todayOne.stations || []
// todayOne.stations && todayOne.stations.forEach(d => { todayOne.stations && todayOne.stations.forEach(d => {
// daySun += d.data[0] && d.data[0].eMotor_EQ || 0 daySun += d.data[0] && d.data[0].eMotor_EQ || 0
// }) })
// // 今天 // 今天
// let dayCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { let dayCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// begin: moment().startOf('day').format('x'), begin: moment().startOf('day').format('x'),
// end: moment().endOf('day').format('x'), end: moment().endOf('day').format('x'),
// aggtype: "h", aggtype: "h",
// method: 'diff' method: 'diff'
// } }
// }) || [] }) || []
// if (dayCollect.length) { if (dayCollect.length) {
// dayCollect[0].stations.forEach(f => { dayCollect[0].stations.forEach(f => {
// f.data.forEach(h => { f.data.forEach(h => {
// if (!h.changData) { if (!h.changData) {
// day1 += h.values.eMotor_EQ day1 += h.values.eMotor_EQ
// } }
// }) })
// }) })
// } }
// // 本月 // 本月
// let monthCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { let monthCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// begin: moment().startOf('month').format('x'), begin: moment().startOf('month').format('x'),
// end: moment().endOf('month').format('x'), end: moment().endOf('month').format('x'),
// aggtype: "d", aggtype: "d",
// method: 'diff' method: 'diff'
// } }
// }) || [] }) || []
// if (monthCollect.length) { if (monthCollect.length) {
// monthCollect[0].stations.forEach(f => { monthCollect[0].stations.forEach(f => {
// f.data.forEach(h => { f.data.forEach(h => {
// if (!h.changData) { if (!h.changData) {
// day30 += h.values.eMotor_EQ day30 += h.values.eMotor_EQ
// } }
// }) })
// }) })
// } }
// // 今年 // 今年
// let yearCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { let yearCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// begin: moment().startOf('year').format('x'), begin: moment().startOf('year').format('x'),
// end: moment().endOf('year').format('x'), end: moment().endOf('year').format('x'),
// aggtype: "d", aggtype: "d",
// method: 'diff' method: 'diff'
// } }
// }) || [] }) || []
// if (yearCollect.length) { if (yearCollect.length) {
// yearCollect[0].stations.map(f => { yearCollect[0].stations.map(f => {
// f.data.forEach(h => { f.data.forEach(h => {
// if (!h.changData) { if (!h.changData) {
// day365 += h.values.eMotor_EQ day365 += h.values.eMotor_EQ
// } }
// }) })
// }) })
// } }
// let current = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { let current = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'), startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'),
// endTime: moment().format('YYYY-MM-DD HH:mm:ss'), endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
// limit: 1440 limit: 1440
// } }
// }) || {} }) || {}
// currentSix['struc' + strucOne.id] = JSON.stringify(current.stations) currentSix['struc' + strucOne.id] = JSON.stringify(current.stations)
// // let threedata = [] let threedata = []
// // let timeSet = new Set() let timeSet = new Set()
// // if (current.stations && current.stations.length) { if (current.stations && current.stations.length) {
// // current.stations.map(p => { current.stations.map(p => {
// // p.data.map(s => { p.data.map(s => {
// // timeSet.add(moment(s.time).format('YYYY-MM-DD HH:mm:ss')) timeSet.add(moment(s.time).format('YYYY-MM-DD HH:mm:ss'))
// // }) })
// // }) })
// // let time = [...timeSet].sort((a, b) => moment(a).isBefore(b) ? -1 : 1) let time = [...timeSet].sort((a, b) => moment(a).isBefore(b) ? -1 : 1)
// // time.map(x => { time.map(x => {
// // let A = [] let A = []
// // let B = [] let B = []
// // let C = [] let C = []
// // current.stations.map((s, index) => { current.stations.map((s, index) => {
// // let abcData = s.data.find(f => moment(f.time).format('YYYY-MM-DD HH:mm:ss') == x) || {} let abcData = s.data.find(f => moment(f.time).format('YYYY-MM-DD HH:mm:ss') == x) || {}
// // let a = abcData.eMotor_A_A let a = abcData.eMotor_A_A
// // let b = abcData.eMotor_B_A let b = abcData.eMotor_B_A
// // let c = abcData.eMotor_C_A let c = abcData.eMotor_C_A
// // if (a) A.push(a) if (a) A.push(a)
// // if (b) B.push(b) if (b) B.push(b)
// // if (c) C.push(c) if (c) C.push(c)
// // }) })
// // const sum = (arr) => { const sum = (arr) => {
// // let sum = 0 let sum = 0
// // arr.map(h => { arr.map(h => {
// // sum += h sum += h
// // }) })
// // return sum return sum
// // } }
// // threedata.push({ threedata.push({
// // A: A.length && (sum(A) / A.length) || null, A: A.length && (sum(A) / A.length) || null,
// // B: B.length && (sum(B) / B.length) || null, B: B.length && (sum(B) / B.length) || null,
// // C: C.length && (sum(C) / C.length) || null, C: C.length && (sum(C) / C.length) || null,
// // time: x time: x
// // }) })
// // }) })
// // } }
// // threePhase['struc' + strucOne.id] = JSON.stringify(threedata) threePhase['struc' + strucOne.id] = JSON.stringify(threedata)
// } }
// } }
// //进线柜 //进线柜
// let wireCabinetId = pumpOne.find(v => v.name == '泵站进线柜').id let wireCabinetId = pumpOne.find(v => v.name == '泵站进线柜').id
// if (wireCabinetId) { if (wireCabinetId) {
// let dataList = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: wireCabinetId } }) || [] let dataList = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: wireCabinetId } }) || []
// let dataId = [] let dataId = []
// dataList.map(v => { dataList.map(v => {
// v.groups.map(s => { v.groups.map(s => {
// s.stations.map(f => { s.stations.map(f => {
// dataId.push(f.id) dataId.push(f.id)
// }) })
// }) })
// }) })
// if (dataId.length) { if (dataId.length) {
// // 当前时间 // 当前时间
// let todayOne = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { let todayOne = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
// endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'), endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
// limit: 1 limit: 1
// } }
// }) || {} }) || {}
// let cabinetOne = todayOne.stations && todayOne.stations || [] let cabinetOne = todayOne.stations && todayOne.stations || []
// cabinet['struc' + strucOne.id] = JSON.stringify(cabinetOne) cabinet['struc' + strucOne.id] = JSON.stringify(cabinetOne)
// cabinetOne.forEach(d => { cabinetOne.forEach(d => {
// let todayFindOne = d.data[0] || {} let todayFindOne = d.data[0] || {}
// daySun += todayFindOne.eQF_EQ || 0 daySun += todayFindOne.eQF_EQ || 0
// cabinetSun.push({ cabinetSun.push({
// today: 0, today: 0,
// sameMonth: 0, sameMonth: 0,
// thisYear: 0, thisYear: 0,
// eQF_EQ: todayFindOne.eQF_EQ || 0, eQF_EQ: todayFindOne.eQF_EQ || 0,
// id: d.id, id: d.id,
// name: d.name, name: d.name,
// sQF_CLOSING: todayFindOne.sQF_CLOSING sQF_CLOSING: todayFindOne.sQF_CLOSING
// }) })
// }) })
// // 今天 // 今天
// let dayCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { let dayCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// begin: moment().startOf('day').format('x'), begin: moment().startOf('day').format('x'),
// end: moment().endOf('day').format('x'), end: moment().endOf('day').format('x'),
// aggtype: "h", aggtype: "h",
// method: 'diff' method: 'diff'
// } }
// }) || [] }) || []
// cabinetSun.forEach(p => { cabinetSun.forEach(p => {
// if (dayCollect.length) { if (dayCollect.length) {
// dayCollect[0].stations.forEach(f => { dayCollect[0].stations.forEach(f => {
// if (p.id == f.id) { if (p.id == f.id) {
// f.data.forEach(h => { f.data.forEach(h => {
// if (!h.changData) { if (!h.changData) {
// p.today = p.today + h.values.eQF_EQ p.today = p.today + h.values.eQF_EQ
// p.sameMonth = p.sameMonth + h.values.eQF_EQ p.sameMonth = p.sameMonth + h.values.eQF_EQ
// p.thisYear = p.thisYear + h.values.eQF_EQ p.thisYear = p.thisYear + h.values.eQF_EQ
// day1 += h.values.eQF_EQ day1 += h.values.eQF_EQ
// } }
// }) })
// } }
// }) })
// } }
// }) })
// // 本月 // 本月
// let monthCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { let monthCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// begin: moment().startOf('month').format('x'), begin: moment().startOf('month').format('x'),
// end: moment().endOf('month').format('x'), end: moment().endOf('month').format('x'),
// aggtype: "d", aggtype: "d",
// method: 'diff' method: 'diff'
// } }
// }) || [] }) || []
// cabinetSun.forEach(p => { cabinetSun.forEach(p => {
// if (monthCollect.length) { if (monthCollect.length) {
// monthCollect[0].stations.forEach(f => { monthCollect[0].stations.forEach(f => {
// if (p.id == f.id) { if (p.id == f.id) {
// f.data.forEach(h => { f.data.forEach(h => {
// if (!h.changData) { if (!h.changData) {
// p.sameMonth = p.sameMonth + h.values.eQF_EQ p.sameMonth = p.sameMonth + h.values.eQF_EQ
// day30 += h.values.eQF_EQ day30 += h.values.eQF_EQ
// } }
// }) })
// } }
// }) })
// } }
// }) })
// // 今年 // 今年
// let yearCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { let yearCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, {
// query: { query: {
// stations: dataId.join(), stations: dataId.join(),
// begin: moment().startOf('year').format('x'), begin: moment().startOf('year').format('x'),
// end: moment().endOf('year').format('x'), end: moment().endOf('year').format('x'),
// aggtype: "d", aggtype: "d",
// method: 'diff' method: 'diff'
// } }
// }) || [] }) || []
// cabinetSun.forEach(p => { cabinetSun.forEach(p => {
// if (yearCollect.length) { if (yearCollect.length) {
// yearCollect[0].stations.forEach(f => { yearCollect[0].stations.forEach(f => {
// if (p.id == f.id) { if (p.id == f.id) {
// f.data.forEach(h => { f.data.forEach(h => {
// if (!h.changData) { if (!h.changData) {
// p.thisYear = p.thisYear + h.values.eQF_EQ p.thisYear = p.thisYear + h.values.eQF_EQ
// day365 += h.values.eQF_EQ day365 += h.values.eQF_EQ
// } }
// }) })
// } }
// }) })
// } }
// }) })
// } }
// } }
// sun.day1 = day1 sun.day1 = day1
// sun.day30 = day30 + day1 sun.day30 = day30 + day1
// sun.day365 = day365 + day1 sun.day365 = day365 + day1
// sun.daySun = daySun sun.daySun = daySun
// let capacityOne = { pump, cabinetSun, sun } let capacityOne = { pump, cabinetSun, sun }
// capacity['struc' + strucOne.id] = JSON.stringify(capacityOne) capacity['struc' + strucOne.id] = JSON.stringify(capacityOne)
// } }
// } }
// await app.redis.set("pumpStation_waterLevelAll", JSON.stringify(waterLevelData)) await app.redis.set("pumpStation_waterLevelAll", JSON.stringify(waterLevelData))
// await app.redis.hmset("pumpStation_waterLevelSix", waterLevelSix) await app.redis.hmset("pumpStation_waterLevelSix", waterLevelSix)
// await app.redis.set("pumpStation_waterPumpStateAll", JSON.stringify(waterPumpStateAll)) await app.redis.set("pumpStation_waterPumpStateAll", JSON.stringify(waterPumpStateAll))
// await app.redis.hmset("pumpStation_capacity", capacity) await app.redis.hmset("pumpStation_capacity", capacity)
// await app.redis.hmset("pumpStation_currentSix", currentSix) await app.redis.hmset("pumpStation_currentSix", currentSix)
// await app.redis.hmset("pumpStation_cabinet", cabinet) await app.redis.hmset("pumpStation_cabinet", cabinet)
// // await app.redis.hmset("pumpStation_threePhase", threePhase) await app.redis.hmset("pumpStation_threePhase", threePhase)
// } }
} catch (error) { } catch (error) {

2
web/client/src/sections/bigScreen/actions/index.js

@ -13,7 +13,7 @@ export function getPumpStation (query = {}) {
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
actionType: 'GET_PUMP_STATION', actionType: 'GET_PUMP_STATION',
url: 'pump1/station1', url: 'pump/station',
query, query,
msg: { error: '获取所有站点信息失败' } msg: { error: '获取所有站点信息失败' }
}); });

Loading…
Cancel
Save