Browse Source

萤石状态查询

release_0.0.2
巴林闲侠 3 years ago
parent
commit
eb5bbc2758
  1. 19
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  2. 57
      code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiState.js

19
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -43,15 +43,15 @@ async function getCameraProject (ctx, next) {
findOption.offset = page * limit findOption.offset = page * limit
} }
if (keyword) { if (keyword) {
findOption.where.name = { $like: `%${keyword}%` } // findOption.where.name = { $like: `%${keyword}%` }
// findOption.where.$or = [ findOption.where.$or = [
// { {
// name: { $like: `%${keyword}%` } name: { $like: `%${keyword}%` }
// }, },
// // { // {
// // serialNo: { $like: `%${keyword}%` } // serialNo: { $like: `%${keyword}%` }
// // } // }
// ] ]
} }
if (type) { if (type) {
findOption.where.type = type findOption.where.type = type
@ -70,6 +70,7 @@ async function getCameraProject (ctx, next) {
findOption.include.push(abilityFind) findOption.include.push(abilityFind)
const cameraRes = await models.Camera.findAll(findOption) const cameraRes = await models.Camera.findAll(findOption)
// const cameraRes = await models.Camera.findAndCountAll(findOption)
delete findOption.order delete findOption.order
delete findOption.limit delete findOption.limit

57
code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiState.js

@ -6,34 +6,35 @@ module.exports = function (app, opts) {
// '* * 4 * * *', // '* * 4 * * *',
'*/8 * * * * *', '*/8 * * * * *',
async () => { async () => {
try { try {
// const { models } = app.fs.dc const { models } = app.fs.dc
// const { varifyYingshiBelongSecretBySerialNo, token4yingshi } = app.fs.utils const { varifyYingshiBelongSecretBySerialNo, token4yingshi } = app.fs.utils
// const secretRes = await models.SecretYingshi.findAll() const secretRes = await models.SecretYingshi.findAll()
// for (let s of secretRes) { for (let s of secretRes) {
// const tokenYingshi = await token4yingshi(s.dataValues) const tokenYingshi = await token4yingshi(s.dataValues)
// // 查询所有设备 // 查询所有设备
// let pageStart = 0 let pageStart = 0
// let deviceList = [] let deviceList = []
// while (pageStart >= 0) { while (pageStart >= 0) {
// const deviceRes = await app.fs.yingshiRequest.post('lapp/device/list', { const deviceRes = await app.fs.yingshiRequest.post('lapp/device/list', {
// query: { query: {
// accessToken: tokenYingshi, accessToken: tokenYingshi,
// pageStart, pageStart,
// pageSize: 50 pageSize: 50
// } }
// }) })
// if (deviceRes.code == 200) { if (deviceRes.code == 200) {
// if (deviceRes.data.length) { if (deviceRes.data.length) {
// deviceList = deviceList.concat.apply(deviceList, deviceRes.data) deviceList = deviceList.concat.apply(deviceList, deviceRes.data)
// pageStart++ pageStart++
// } else { } else {
// pageStart = -1 pageStart = -1
// } }
// } }
// } }
// console.log(deviceList); console.log(deviceList);
// } }
// const await models.UserToken.destroy({ // const await models.UserToken.destroy({
// where: { // where: {
@ -47,6 +48,6 @@ module.exports = function (app, opts) {
}); });
return { return {
// freshYingshiState freshYingshiState
} }
} }
Loading…
Cancel
Save