|
@ -810,18 +810,29 @@ 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), |
|
|
code: d.code, |
|
|
village: await getRoadTotalMileage('村', [`township_code='${d.code}'`], false), |
|
|
township: township, |
|
|
|
|
|
townshipParticipate: 0, |
|
|
|
|
|
townshipPresent: 0, |
|
|
|
|
|
townshipDifferenceValue: 0, |
|
|
|
|
|
village: village, |
|
|
|
|
|
villageParticipate: 0, |
|
|
|
|
|
villagePresent: 0, |
|
|
|
|
|
villageDifferenceValue: 0 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const previewRes = await models.RoadSpotCheckPreview.create({ |
|
|
const previewRes = await models.RoadSpotCheckPreview.create({ |
|
|