Browse Source

村抽查汇总修改

dev
wenlele 1 year ago
parent
commit
e0749430fb
  1. 4
      api/.vscode/launch.json
  2. 12
      api/app/lib/controllers/report/index.js

4
api/.vscode/launch.json

@ -16,8 +16,8 @@
"-p 13400", "-p 13400",
"-f http://localhost:13400", "-f http://localhost:13400",
// "-g postgres://FashionAdmin:123456@10.8.16.184:5432/sihaogonglu", // "-g postgres://FashionAdmin:123456@10.8.16.184:5432/sihaogonglu",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good", // "-g postgres://postgres:123@10.8.30.32:5432/highways4good",
// "-g postgres://postgres:123@10.8.30.32:5432/highwaytest", "-g postgres://postgres:123@10.8.30.32:5432/highway4test",
// "-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728", // "-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

12
api/app/lib/controllers/report/index.js

@ -810,18 +810,22 @@ async function roadSpotPrepare (ctx) {
} }
town.forEach(async d => { for (let index = 0; index < town.length; index++) {
let d = town[index]
if (allTownCodeResTown.find(c => c.code == d.code)) { if (allTownCodeResTown.find(c => c.code == d.code)) {
gather.push({ ...(allTownCodeResTown.find(c => c.code == d.code) || {}), name: d.name }) gather.push({ ...(allTownCodeResTown.find(c => c.code == d.code) || {}), name: d.name })
} else { } else {
let where = [`township_code='${d.code}'`]
let township = await getRoadTotalMileage('乡', where, false)
let village = await getRoadTotalMileage('村', where, false)
gather.push({ gather.push({
name: d.name, name: d.name,
township: await getRoadTotalMileage('乡', [`township_code='${d.code}'`], false), township: township,
village: await getRoadTotalMileage('村', [`township_code='${d.code}'`], false), village: village
}) })
} }
})
}
const previewRes = await models.RoadSpotCheckPreview.create({ const previewRes = await models.RoadSpotCheckPreview.create({

Loading…
Cancel
Save