From e0749430fbc3152748dc0e5b50f05a27ae3f99a5 Mon Sep 17 00:00:00 2001 From: wenlele Date: Fri, 22 Dec 2023 17:12:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9D=91=E6=8A=BD=E6=9F=A5=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/.vscode/launch.json | 4 ++-- api/app/lib/controllers/report/index.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index fce97ad6..70665660 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -16,8 +16,8 @@ "-p 13400", "-f http://localhost:13400", // "-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/highwaytest", + // "-g postgres://postgres:123@10.8.30.32:5432/highways4good", + "-g postgres://postgres:123@10.8.30.32:5432/highway4test", // "-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index b668bc67..13018c7c 100644 --- a/api/app/lib/controllers/report/index.js +++ b/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)) { gather.push({ ...(allTownCodeResTown.find(c => c.code == d.code) || {}), name: d.name }) } else { + let where = [`township_code='${d.code}'`] + let township = await getRoadTotalMileage('乡', where, false) + let village = await getRoadTotalMileage('村', where, false) gather.push({ name: d.name, - township: await getRoadTotalMileage('乡', [`township_code='${d.code}'`], false), - village: await getRoadTotalMileage('村', [`township_code='${d.code}'`], false), + township: township, + village: village }) } - }) + } const previewRes = await models.RoadSpotCheckPreview.create({ From 3b810990b4227a6bc416f37f6b9540c041814db5 Mon Sep 17 00:00:00 2001 From: wenlele Date: Fri, 22 Dec 2023 17:48:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A1=AB=E5=85=85=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E5=8D=95=E5=85=83=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 13018c7c..49363ae7 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -820,8 +820,15 @@ async function roadSpotPrepare (ctx) { let village = await getRoadTotalMileage('村', where, false) gather.push({ name: d.name, + code: d.code, township: township, - village: village + townshipParticipate: 0, + townshipPresent: 0, + townshipDifferenceValue: 0, + village: village, + villageParticipate: 0, + villagePresent: 0, + villageDifferenceValue: 0 }) }