Browse Source

api

release_0.0.1
巴林闲侠 3 years ago
parent
commit
bb27f44219
  1. 12
      api/app/lib/controllers/overview/building.js
  2. 10
      api/app/lib/controllers/overview/management.js
  3. 3
      api/log/development.log

12
api/app/lib/controllers/overview/building.js

@ -170,11 +170,13 @@ async function roadState (ctx) {
} }
} }
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '') if (p.buildUnit) {
if (roadState.townProject[townName]) { let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '')
roadState.townProject[townName] += 1 if (roadState.townProject[townName]) {
} else { roadState.townProject[townName] += 1
roadState.townProject[townName] = 1 } else {
roadState.townProject[townName] = 1
}
} }
} }

10
api/app/lib/controllers/overview/management.js

@ -4,15 +4,23 @@ async function overSpeedList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { userId } = ctx.fs.api; const { userId } = ctx.fs.api;
const { limit } = ctx.query;
const overSpeedRes = await models.Overspeed.findAll({ const overSpeedRes = await models.Overspeed.findAll({
attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime'], attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime'],
order: [['testTime', 'DESC']], order: [['testTime', 'DESC']],
limit: limit || 120,
})
const overSpeedProcessedCount = await models.Overspeed.count({
where: {
processingTime: { $ne: null }
}
}) })
ctx.status = 200 ctx.status = 200
ctx.body = { ctx.body = {
processed: overSpeedRes.filter(s => s.processingTime).length, processed: overSpeedProcessedCount,
overSpeedList: overSpeedRes, overSpeedList: overSpeedRes,
} }
} catch (error) { } catch (error) {

3
api/log/development.log

@ -8534,3 +8534,6 @@
original: { '$ref': '$["parent"]' }, original: { '$ref': '$["parent"]' },
__stackCleaned__: true __stackCleaned__: true
} }
2022-07-26 09:52:19.623 - debug: [FS-LOGGER] Init.
2022-07-26 09:52:19.753 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-26 09:52:19.753 - info: [FS-AUTH] Inject auth and api mv into router.

Loading…
Cancel
Save