Browse Source

治超筛查

dev
巴林闲侠 2 years ago
parent
commit
08ce145b11
  1. 4
      api/.vscode/launch.json
  2. 11
      api/app/lib/controllers/data/overspeed.js

4
api/.vscode/launch.json

@ -13,8 +13,8 @@
"NODE_ENV": "development" "NODE_ENV": "development"
}, },
"args": [ "args": [
"-p 4000", "-p 14000",
"-f http://localhost:4000", "-f http://localhost:14000",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good", "-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

11
api/app/lib/controllers/data/overspeed.js

@ -34,6 +34,14 @@ async function overspeedGet (ctx) {
if (numberOfAxles) { if (numberOfAxles) {
findOption.where.numberOfAxles = numberOfAxles findOption.where.numberOfAxles = numberOfAxles
} }
if (overrunRateUpper && overrunRateFloor) {
findOption.where['$and'] = []
findOption.where['$and'].push
({ overrunRate: { $lte: overrunRateUpper } })
findOption.where['$and'].push
({ overrunRate: { $gte: overrunRateFloor } })
} else {
if (overrunRateUpper) { if (overrunRateUpper) {
findOption.where.overrunRate = { findOption.where.overrunRate = {
$lte: overrunRateUpper $lte: overrunRateUpper
@ -44,6 +52,9 @@ async function overspeedGet (ctx) {
$gte: overrunRateFloor $gte: overrunRateFloor
} }
} }
}
if (testTime) { if (testTime) {
findOption.where.testTime = { findOption.where.testTime = {
$between: [moment(testTime).startOf('day').format(), moment(testTime).endOf('day').format()] $between: [moment(testTime).startOf('day').format(), moment(testTime).endOf('day').format()]

Loading…
Cancel
Save