wenlele
1 year ago
25 changed files with 1039 additions and 797 deletions
@ -0,0 +1,45 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const Video = sequelize.define("video", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: true, |
||||
|
unique: "video_id_uindex" |
||||
|
}, |
||||
|
videoUrl: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: false, |
||||
|
field: "video_url", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
strucId: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "", |
||||
|
primaryKey: false, |
||||
|
field: "struc_id", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
|
||||
|
}, { |
||||
|
tableName: "video", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
|
||||
|
dc.models.Video = Video; |
||||
|
return Video; |
||||
|
}; |
@ -0,0 +1,458 @@ |
|||||
|
const moment = require('moment') |
||||
|
|
||||
|
// let isDev = false
|
||||
|
let isDev = true |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
module.exports = function (app, opts) { |
||||
|
const workorderStatistics = app.fs.scheduleInit( |
||||
|
{ |
||||
|
interval: '24 0 */5 * * *', |
||||
|
immediate: isDev, |
||||
|
proRun: !isDev, |
||||
|
// disabled: true,
|
||||
|
}, |
||||
|
|
||||
|
async () => { |
||||
|
try { |
||||
|
const { models, ORM: sequelize } = app.fs.dc |
||||
|
const { parseProcessData } = app.fs.utils |
||||
|
|
||||
|
let data = await getAnxinyunToken(app) |
||||
|
//获取所有泵站
|
||||
|
let structureList = await app.fs.anxinyun.get(`/organizations/${data.orgId}/structures?token=${data.token}`) || [] |
||||
|
await app.redis.set("structure", JSON.stringify(structureList)) |
||||
|
if (structureList.length) { |
||||
|
|
||||
|
|
||||
|
let waterLevelData = [] //七天内每个泵站的集水池液位
|
||||
|
let waterLevelSix = {} //泵站最新6h的集水池液位
|
||||
|
let waterPumpStateAll = [] //所有水泵的状态
|
||||
|
let capacity = {} //能耗监测
|
||||
|
let currentSix = {} //水泵六小时数据
|
||||
|
let cabinet = {} //进线柜
|
||||
|
let threePhase = {} //三相电流
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
for (let index = 0; index < structureList.length; index++) { |
||||
|
const strucOne = structureList[index]; |
||||
|
//单个泵站
|
||||
|
let pumpOne = await app.fs.anxinyun.get(`structures/${strucOne.id}/factors?token=${data.token}`) || [] |
||||
|
if (pumpOne.length) { |
||||
|
|
||||
|
let pump = [] //能耗监测--水泵
|
||||
|
let cabinetSun = [] //能耗监测--进线柜
|
||||
|
let sun = {} |
||||
|
let day1 = 0 |
||||
|
let day30 = 0 |
||||
|
let day365 = 0 |
||||
|
let daySun = 0 |
||||
|
|
||||
|
//泵站信息
|
||||
|
let informationId = pumpOne.find(v => v.name == '泵站信息').id |
||||
|
if (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) { |
||||
|
//七天内该泵站最新的集水池液位
|
||||
|
let waterLevel = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: pumpInformation[0].groups[0].stations[0].id, |
||||
|
startTime: moment().startOf('week').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
endTime: moment().endOf('week').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
limit: 1 |
||||
|
} |
||||
|
}) || {} |
||||
|
|
||||
|
let findOne = waterLevel.stations[0].data[0] || {} |
||||
|
sun.sHumidity = findOne.sHumidity |
||||
|
sun.sTEMP = findOne.sTEMP |
||||
|
sun.sGrille_level = findOne.sGrille_level |
||||
|
|
||||
|
|
||||
|
|
||||
|
waterLevelData.push({ |
||||
|
strucId: strucOne.id, name: strucOne.name, level: findOne.sLiquid_level || 0 |
||||
|
}) |
||||
|
|
||||
|
//该泵站最新6h的集水池液位
|
||||
|
let waterLevel6 = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: pumpInformation[0].groups[0].stations[0].id, |
||||
|
startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
endTime: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||
|
limit: 1440 |
||||
|
} |
||||
|
}) || {} |
||||
|
|
||||
|
waterLevelSix['struc' + strucOne.id] = waterLevel6.stations[0] && JSON.stringify(waterLevel6.stations[0].data) |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
//水泵信息
|
||||
|
let waterId = pumpOne.find(v => v.name == '泵站水泵').id |
||||
|
if (waterId) { |
||||
|
let waterpPmpInformation = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: waterId } }) || [] |
||||
|
|
||||
|
let dataId = [] |
||||
|
waterpPmpInformation.forEach(v => { |
||||
|
v.groups.forEach(s => { |
||||
|
s.stations.forEach(f => { |
||||
|
dataId.push(f.id) |
||||
|
}) |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
if (dataId.length) { |
||||
|
|
||||
|
|
||||
|
|
||||
|
// 当前时间
|
||||
|
let todayOne = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
limit: 1 |
||||
|
} |
||||
|
}) || [] |
||||
|
|
||||
|
waterPumpStateAll.push({ strucId: strucOne.id, name: strucOne.name, data: todayOne.stations }) |
||||
|
pump = todayOne.stations || [] |
||||
|
|
||||
|
todayOne.stations && todayOne.stations.forEach(d => { |
||||
|
daySun += d.data[0] && d.data[0].eMotor_EQ || 0 |
||||
|
}) |
||||
|
|
||||
|
// 今天
|
||||
|
let dayCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
begin: moment().startOf('day').format('x'), |
||||
|
end: moment().endOf('day').format('x'), |
||||
|
aggtype: "h", |
||||
|
method: 'diff' |
||||
|
} |
||||
|
}) || [] |
||||
|
|
||||
|
if (dayCollect.length) { |
||||
|
dayCollect[0].stations.forEach(f => { |
||||
|
f.data.forEach(h => { |
||||
|
if (!h.changData) { |
||||
|
day1 += h.values.eMotor_EQ |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 本月
|
||||
|
let monthCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
begin: moment().startOf('month').format('x'), |
||||
|
end: moment().endOf('month').format('x'), |
||||
|
aggtype: "d", |
||||
|
method: 'diff' |
||||
|
} |
||||
|
}) || [] |
||||
|
if (monthCollect.length) { |
||||
|
monthCollect[0].stations.forEach(f => { |
||||
|
f.data.forEach(h => { |
||||
|
if (!h.changData) { |
||||
|
day30 += h.values.eMotor_EQ |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 今年
|
||||
|
let yearCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
begin: moment().startOf('year').format('x'), |
||||
|
end: moment().endOf('year').format('x'), |
||||
|
aggtype: "d", |
||||
|
method: 'diff' |
||||
|
} |
||||
|
}) || [] |
||||
|
|
||||
|
if (yearCollect.length) { |
||||
|
yearCollect[0].stations.map(f => { |
||||
|
f.data.forEach(h => { |
||||
|
if (!h.changData) { |
||||
|
day365 += h.values.eMotor_EQ |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
let current = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
endTime: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||
|
limit: 1440 |
||||
|
} |
||||
|
}) || {} |
||||
|
|
||||
|
currentSix['struc' + strucOne.id] = JSON.stringify(current.stations) |
||||
|
|
||||
|
|
||||
|
let threedata = [] |
||||
|
let timeSet = new Set() |
||||
|
if (current.stations && current.stations.length) { |
||||
|
current.stations.map(p => { |
||||
|
p.data.map(s => { |
||||
|
timeSet.add(moment(s.time).format('YYYY-MM-DD HH:mm:ss')) |
||||
|
}) |
||||
|
}) |
||||
|
let time = [...timeSet].sort((a, b) => moment(a).isBefore(b) ? -1 : 1) |
||||
|
|
||||
|
time.map(x => { |
||||
|
let A = [] |
||||
|
let B = [] |
||||
|
let C = [] |
||||
|
current.stations.map((s, index) => { |
||||
|
let abcData = s.data.find(f => moment(f.time).format('YYYY-MM-DD HH:mm:ss') == x) || {} |
||||
|
let a = abcData.eMotor_A_A |
||||
|
let b = abcData.eMotor_B_A |
||||
|
let c = abcData.eMotor_C_A |
||||
|
if (a) A.push(a) |
||||
|
if (b) B.push(b) |
||||
|
if (c) C.push(c) |
||||
|
}) |
||||
|
const sum = (arr) => { |
||||
|
let sum = 0 |
||||
|
arr.map(h => { |
||||
|
sum += h |
||||
|
}) |
||||
|
return sum |
||||
|
} |
||||
|
threedata.push({ |
||||
|
A: A.length && (sum(A) / A.length) || null, |
||||
|
B: B.length && (sum(B) / B.length) || null, |
||||
|
C: C.length && (sum(C) / C.length) || null, |
||||
|
time: x |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
threePhase['struc' + strucOne.id] = JSON.stringify(threedata) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
//进线柜
|
||||
|
let wireCabinetId = pumpOne.find(v => v.name == '泵站进线柜').id |
||||
|
if (wireCabinetId) { |
||||
|
let dataList = await app.fs.anxinyun.get(`structures/${strucOne.id}/stations?token=${data.token}`, { query: { factorId: wireCabinetId } }) || [] |
||||
|
let dataId = [] |
||||
|
dataList.map(v => { |
||||
|
v.groups.map(s => { |
||||
|
s.stations.map(f => { |
||||
|
dataId.push(f.id) |
||||
|
}) |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
if (dataId.length) { |
||||
|
// 当前时间
|
||||
|
let todayOne = await app.fs.anxinyun.get(`stations/theme/data?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
limit: 1 |
||||
|
} |
||||
|
}) || {} |
||||
|
|
||||
|
let cabinetOne = todayOne.stations && todayOne.stations || [] |
||||
|
|
||||
|
cabinet['struc' + strucOne.id] = JSON.stringify(cabinetOne) |
||||
|
|
||||
|
cabinetOne.forEach(d => { |
||||
|
let todayFindOne = d.data[0] || {} |
||||
|
daySun += todayFindOne.eQF_EQ || 0 |
||||
|
cabinetSun.push({ |
||||
|
today: 0, |
||||
|
sameMonth: 0, |
||||
|
thisYear: 0, |
||||
|
eQF_EQ: todayFindOne.eQF_EQ || 0, |
||||
|
id: d.id, |
||||
|
name: d.name, |
||||
|
sQF_CLOSING: todayFindOne.sQF_CLOSING |
||||
|
}) |
||||
|
}) |
||||
|
// 今天
|
||||
|
let dayCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
begin: moment().startOf('day').format('x'), |
||||
|
end: moment().endOf('day').format('x'), |
||||
|
aggtype: "h", |
||||
|
method: 'diff' |
||||
|
} |
||||
|
}) || [] |
||||
|
|
||||
|
cabinetSun.forEach(p => { |
||||
|
if (dayCollect.length) { |
||||
|
dayCollect[0].stations.forEach(f => { |
||||
|
if (p.id == f.id) { |
||||
|
f.data.forEach(h => { |
||||
|
if (!h.changData) { |
||||
|
p.today = p.today + h.values.eQF_EQ |
||||
|
p.sameMonth = p.sameMonth + h.values.eQF_EQ |
||||
|
p.thisYear = p.thisYear + h.values.eQF_EQ |
||||
|
day1 += h.values.eQF_EQ |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
// 本月
|
||||
|
let monthCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
begin: moment().startOf('month').format('x'), |
||||
|
end: moment().endOf('month').format('x'), |
||||
|
aggtype: "d", |
||||
|
method: 'diff' |
||||
|
} |
||||
|
}) || [] |
||||
|
|
||||
|
cabinetSun.forEach(p => { |
||||
|
if (monthCollect.length) { |
||||
|
monthCollect[0].stations.forEach(f => { |
||||
|
if (p.id == f.id) { |
||||
|
f.data.forEach(h => { |
||||
|
if (!h.changData) { |
||||
|
p.sameMonth = p.sameMonth + h.values.eQF_EQ |
||||
|
day30 += h.values.eQF_EQ |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
// 今年
|
||||
|
let yearCollect = await app.fs.anxinyun.get(`stations/data/theme?token=${data.token}`, { |
||||
|
query: { |
||||
|
stations: dataId.join(), |
||||
|
begin: moment().startOf('year').format('x'), |
||||
|
end: moment().endOf('year').format('x'), |
||||
|
aggtype: "d", |
||||
|
method: 'diff' |
||||
|
} |
||||
|
}) || [] |
||||
|
|
||||
|
cabinetSun.forEach(p => { |
||||
|
if (yearCollect.length) { |
||||
|
yearCollect[0].stations.forEach(f => { |
||||
|
if (p.id == f.id) { |
||||
|
f.data.forEach(h => { |
||||
|
if (!h.changData) { |
||||
|
p.thisYear = p.thisYear + h.values.eQF_EQ |
||||
|
day365 += h.values.eQF_EQ |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
sun.day1 = day1 |
||||
|
sun.day30 = day30 + day1 |
||||
|
sun.day365 = day365 + day1 |
||||
|
sun.daySun = daySun |
||||
|
|
||||
|
let capacityOne = { pump, cabinetSun, sun } |
||||
|
|
||||
|
capacity['struc' + strucOne.id] = JSON.stringify(capacityOne) |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
await app.redis.set("waterLevelAll", JSON.stringify(waterLevelData)) |
||||
|
await app.redis.hmset("waterLevelSix", waterLevelSix) |
||||
|
await app.redis.set("waterPumpStateAll", JSON.stringify(waterPumpStateAll)) |
||||
|
await app.redis.hmset("capacity", capacity) |
||||
|
await app.redis.hmset("currentSix", currentSix) |
||||
|
await app.redis.hmset("cabinet", cabinet) |
||||
|
await app.redis.hmset("threePhase", threePhase) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} catch (error) { |
||||
|
console.error(error); |
||||
|
} |
||||
|
} |
||||
|
) |
||||
|
|
||||
|
return { |
||||
|
workorderStatistics, |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
let axyTokenCache = { |
||||
|
token: null, |
||||
|
orgId: null, |
||||
|
expireTime: null //过期时间
|
||||
|
} |
||||
|
|
||||
|
const getAnxinyunToken = async function (app) { |
||||
|
try { |
||||
|
|
||||
|
if (!axyTokenCache.token || moment() > moment(axyTokenCache.expireTime)) { |
||||
|
if (app.fs.opts.axyProject.split('/').length === 3) { |
||||
|
const dataToAxy = { |
||||
|
p: app.fs.opts.axyProject.split('/')[0], |
||||
|
username: app.fs.opts.axyProject.split('/')[1], |
||||
|
password: app.fs.opts.axyProject.split('/')[2], |
||||
|
} |
||||
|
const axyResponse = await app.fs.anxinyun.post('project/login', { data: dataToAxy }) |
||||
|
if (axyResponse.authorized) { |
||||
|
axyTokenCache.token = axyResponse.token //放进缓存
|
||||
|
axyTokenCache.orgId = axyResponse.orgId //放进缓存
|
||||
|
axyTokenCache.expireTime = moment().add(20, 'hour').format('YYYY-MM-DD HH:mm:ss') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return axyTokenCache |
||||
|
} catch (error) { |
||||
|
app.fs.logger.error(`sechedule: laborAttendance, error: ${error}`); |
||||
|
} |
||||
|
} |
@ -1,25 +1,55 @@ |
|||||
|
--八月湖二站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3569, '东新乡', 840,'1000ZLB—4轴流泵','JSL12—14','S91000KVA','排灌结合',4,'1974年','2009年'); |
3569, '东新乡', 1050,'1000ZLB—4轴流泵','JSL12—14','S9800KVA2','纯排',5,'1985年','2009年'); |
||||
|
--东山电排站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3592, '富山乡', 2010,'28、36','6台180、6台155','1250、1650','排涝',12,'1983年','2008年'); |
||||
|
--杨家湾站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3594, '东新乡', 60 ,'ZLB28—70轴流泵','Y—200T—4','80KVA箱式变压器','纯排',2,'2013年','--'); |
||||
|
--汇仁大道补水站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3595, '东新乡',260,'20ZLB—70轴流泵','Y67—130kw','315KVA箱式变压器','纯排',2,'2014年','--'); |
||||
|
--利用站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3593, '东新乡',240, 'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',3,'1974年','1992年'); |
||||
|
--石岐电排站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3598, '东新乡', 340,'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',3,'1974年','1988年'); |
||||
|
--石岐补水站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3597, '东新乡',260,'20ZLB—70轴流泵','Y67—130kw','S9_315KVA变压器','灌溉',2,'2014年','--'); |
||||
|
--三山电排站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3592, '富山乡', 2010,'空','6台180、6台155','1250、1650','排涝',12,'1983年','2008年'); |
3599, '富山乡',390, '28','130','--','排涝',3,'1973年','2008年'); |
||||
|
|
||||
|
|
||||
|
|
||||
|
-- 象湖站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3594, '东新乡', 60 ,'ZLB28—70轴流泵','Y—200T—4','80KVA箱式变压器','纯排',2,'2013年','空'); |
3652, '象湖站',1050, '1200ZLB—160轴流泵','JsL10—12(210KW)','s9—M500KVA、s9—M800KVA','排涝',5,'2008年','--'); |
||||
|
|
||||
|
-- 沥山电排站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3595, '东新乡',260,'20ZLB—70轴流泵','Y67—130kw','315KVA箱式变压器','纯排',2,'2014年','空'); |
3642, '象湖站',1680, '1200ZLB—160轴流泵','JsL10—12(210KW)','s9—M1000KVA/2','排涝',8,'2004年','--'); |
||||
|
|
||||
|
-- 张坊电排站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3593, '东新乡',240, 'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',3,'1974年','1992年'); |
3590, '象湖站',2500, '1400ZLB-5立式半调节轴流泵','YL630-16/1430(500KW)','SCB11-160/10/0.4','排涝',5,'2020年','--'); |
||||
|
|
||||
|
-- 河下电排站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3598, '东新乡', 340,'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',3,'1974年','1988年'); |
3596, '东新乡',320, 'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',4,'1972年','1987年'); |
||||
|
|
||||
|
-- 万寿湖电排站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3597, '东新乡',260,'20ZLB—70轴流泵','Y67—130kw','S9_315KVA变压器','灌溉',2,'2014年','空'); |
3600, '象湖站',660, '1000ZLB-5立式半调节轴流泵','JsL14—12(220KW)','SCB11-1000/10/0.4、SCB11-80/10/0.4','排涝',3,'2020年','--'); |
||||
|
|
||||
|
-- 河外电排站 |
||||
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
3599, '富山乡',390, '空','空','空','排涝',3,'1973年','2008年'); |
3601, '富山乡',90, '--','45','--','排涝',2,'1984年','2021年'); |
||||
|
|
||||
|
-- 雄溪泵站 |
||||
|
INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT, |
||||
|
3653, '象湖站',630, '1200ZLB—160轴流泵','JsL10—12(210KW)','s9—M315KVA、s9—M500KVA','排涝',3,'2003年','--'); |
||||
|
|
||||
|
@ -0,0 +1,18 @@ |
|||||
|
create table video |
||||
|
( |
||||
|
id serial not null, |
||||
|
video_url varchar(255) not null, |
||||
|
struc_id int |
||||
|
); |
||||
|
|
||||
|
comment on column video.video_url is '泵站摄像头嵌入链接'; |
||||
|
|
||||
|
comment on column video.struc_id is '泵站id,不填就是全部'; |
||||
|
|
||||
|
create unique index video_id_uindex |
||||
|
on video (id); |
||||
|
|
||||
|
alter table video |
||||
|
add constraint video_pk |
||||
|
primary key (id); |
||||
|
|
Before Width: | Height: | Size: 785 KiB After Width: | Height: | Size: 805 KiB |
@ -1,8 +1,27 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
import { basicAction } from '@peace/utils' |
||||
|
import { ApiTable } from '$utils' |
||||
|
|
||||
|
|
||||
import * as bigScreen from './bigScreen' |
import * as bigScreen from './bigScreen' |
||||
|
import * as video from './video' |
||||
|
|
||||
|
|
||||
|
|
||||
|
export function getPumpStation (query = {}) { |
||||
|
return dispatch => basicAction({ |
||||
|
type: 'get', |
||||
|
dispatch: dispatch, |
||||
|
actionType: 'GET_PUMP_STATION', |
||||
|
url: '/pump/station', |
||||
|
query, |
||||
|
msg: { error: '获取所有站点信息失败' } |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
export default { |
export default { |
||||
...bigScreen |
...bigScreen, |
||||
|
...video, |
||||
|
getPumpStation, |
||||
} |
} |
@ -0,0 +1,21 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import { basicAction } from '@peace/utils' |
||||
|
import { ApiTable } from '$utils' |
||||
|
|
||||
|
|
||||
|
export function getVideoUrl (query = {}) { |
||||
|
return dispatch => basicAction({ |
||||
|
type: 'get', |
||||
|
dispatch: dispatch, |
||||
|
actionType: 'GET_VIDEO_URL', |
||||
|
url: `${ApiTable.videoUrl}`, |
||||
|
query, |
||||
|
msg: { error: '获取泵站视频监控失败' }, |
||||
|
reducer: { name: 'videoUrl' } |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
getVideoUrl, |
||||
|
} |
Loading…
Reference in new issue