Browse Source

1.道路施工统计,近四年的道路分别统计每一年的修建、改建道路公里数

2.治超详情,点击某条记录,可获取到该记录的检测点名称,用于浮窗内展示。
dev
巴林闲侠 2 years ago
parent
commit
c7101083c6
  1. 11
      api/app/lib/controllers/overview/building.js
  2. 2
      api/app/lib/controllers/overview/management.js

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

@ -54,13 +54,20 @@ async function roadState (ctx) {
bridgeCount: bridgeRes.length, bridgeCount: bridgeRes.length,
// 涵洞数量 // 涵洞数量
culvertCount: 0, culvertCount: 0,
// 施工统计 // 施工统计 已建
construction: constructionYear.map(year => { construction: constructionYear.map(year => {
return { return {
year, year,
count: 0, count: 0,
} }
}), }),
// 施工统计 改建
constructionRebuild: constructionYear.map(year => {
return {
year,
count: 0,
}
}),
// 乡镇统计 // 乡镇统计
townRoad: { townRoad: {
@ -128,7 +135,7 @@ async function roadState (ctx) {
if (corBuildConstruction) { if (corBuildConstruction) {
corBuildConstruction.count += Number(r.chainageMileage) || 0 corBuildConstruction.count += Number(r.chainageMileage) || 0
} }
let corReBuildConstruction = roadState.construction.find(item => item.year === rebuildYear) let corReBuildConstruction = roadState.constructionRebuild.find(item => item.year === rebuildYear)
if (corReBuildConstruction) { if (corReBuildConstruction) {
corReBuildConstruction.count += Number(r.chainageMileage) || 0 corReBuildConstruction.count += Number(r.chainageMileage) || 0
} }

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

@ -7,7 +7,7 @@ async function overSpeedList (ctx) {
const { limit } = ctx.query; const { limit } = ctx.query;
const overSpeedRes = await models.Overspeed.findAll({ const overSpeedRes = await models.Overspeed.findAll({
attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime', 'testTime'], attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime', 'testTime', 'nameOfInspectionPoint'],
order: [['testTime', 'DESC']], order: [['testTime', 'DESC']],
limit: limit || 120, limit: limit || 120,
where: { where: {

Loading…
Cancel
Save