diff --git a/scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx b/scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx index 2fd86c39..50aa3837 100644 Binary files a/scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx and b/scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls index f297808d..80fb3a09 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx index fd996b51..68d9cecc 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx index 779bf870..f4c015ce 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls index aa73ae7c..95c8a2ed 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls index 1f938dea..64193237 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls index d979c98a..29539e84 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).xlsx index 6623858e..9936796a 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/出租车/事业发展中心巡游出租业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/出租车/事业发展中心巡游出租业户信息表.xlsx index 58c13780..c5ef398d 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/出租车/事业发展中心巡游出租业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/出租车/事业发展中心巡游出租业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌南化物流有限责任公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌南化物流有限责任公司危货业户信息表.xlsx index ef14062f..cda4a4c9 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌南化物流有限责任公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌南化物流有限责任公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌宁昌物流运输有限公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌宁昌物流运输有限公司危货业户信息表.xlsx index 48dbf0a0..dad63a6a 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌宁昌物流运输有限公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌宁昌物流运输有限公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌市万利特种气体有限公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌市万利特种气体有限公司危货业户信息表.xlsx index 7c3b8507..d2941318 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌市万利特种气体有限公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌市万利特种气体有限公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌江竹实业有限公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌江竹实业有限公司危货业户信息表.xlsx index 7578dc21..0166ff83 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌江竹实业有限公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌江竹实业有限公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西昌海运输有限公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西昌海运输有限公司危货业户信息表.xlsx index 5c2244d7..ac200f14 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西昌海运输有限公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西昌海运输有限公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西省通越运输有限公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西省通越运输有限公司危货业户信息表.xlsx index 5e8340f1..8c9694ca 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西省通越运输有限公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西省通越运输有限公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西雨辰环保科技有限公司危货业户信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西雨辰环保科技有限公司危货业户信息表.xlsx index 9f50171a..410ccbc6 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西雨辰环保科技有限公司危货业户信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西雨辰环保科技有限公司危货业户信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/出租车/运输事业发展中心巡游出租车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/出租车/运输事业发展中心巡游出租车辆信息表.xlsx index e080922d..f4d63688 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/出租车/运输事业发展中心巡游出租车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/出租车/运输事业发展中心巡游出租车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌南化物流有限责任公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌南化物流有限责任公司危货车辆信息表.xlsx index c2a43d00..22034c38 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌南化物流有限责任公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌南化物流有限责任公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌宁昌物流运输有限公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌宁昌物流运输有限公司危货车辆信息表.xlsx index 6e74a426..fa606929 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌宁昌物流运输有限公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌宁昌物流运输有限公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌市万利特种气体有限公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌市万利特种气体有限公司危货车辆信息表.xlsx index d82a2964..ac666063 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌市万利特种气体有限公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌市万利特种气体有限公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌江竹实业有限公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌江竹实业有限公司危货车辆信息表.xlsx index 52fd914f..58d1a927 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌江竹实业有限公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌江竹实业有限公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西昌海运输有限公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西昌海运输有限公司危货车辆信息表.xlsx index a10d3aac..3049d882 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西昌海运输有限公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西昌海运输有限公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx index 7f5d21c6..7a0017c1 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx index aa96a6f3..aff239bc 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx and b/scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls index cf53b8d6..7d1a6bbc 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls index 4d61104b..2ea57141 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls differ diff --git a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls index d23427d4..2048e856 100644 Binary files a/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls and b/scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls differ diff --git a/scripts/1.3.1/data/1_insert_report_data/data/work.xlsx b/scripts/1.3.1/data/1_insert_report_data/data/work.xlsx index 104dd2c4..a56af238 100644 Binary files a/scripts/1.3.1/data/1_insert_report_data/data/work.xlsx and b/scripts/1.3.1/data/1_insert_report_data/data/work.xlsx differ diff --git a/scripts/1.4.1/data/1_insert_road_data/.vscode/launch.json b/scripts/1.4.1/data/1_insert_road_data/.vscode/launch.json new file mode 100644 index 00000000..3a3fcba2 --- /dev/null +++ b/scripts/1.4.1/data/1_insert_road_data/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "启动程序", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\index.js" + } + ] +} \ No newline at end of file diff --git a/scripts/1.4.1/data/1_insert_road_data/Dockerfile b/scripts/1.4.1/data/1_insert_road_data/Dockerfile new file mode 100644 index 00000000..d0293a8f --- /dev/null +++ b/scripts/1.4.1/data/1_insert_road_data/Dockerfile @@ -0,0 +1,11 @@ +FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 + +COPY . /var/app + +WORKDIR /var/app + +RUN npm cache clean -f +RUN rm -rf package-lock.json +RUN npm install --registry http://10.8.30.22:7000 + +CMD ["node", "index.js"] \ No newline at end of file diff --git a/scripts/1.4.1/data/1_insert_road_data/Dockerfilenew b/scripts/1.4.1/data/1_insert_road_data/Dockerfilenew new file mode 100644 index 00000000..dba16607 --- /dev/null +++ b/scripts/1.4.1/data/1_insert_road_data/Dockerfilenew @@ -0,0 +1,7 @@ +FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 +COPY ./scripts/1.3.1/data/1_insert_report_data /var/app +WORKDIR /var/app +RUN npm cache clean -f +RUN rm -rf package-lock.json +RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ +CMD ["node", "index.js"] \ No newline at end of file diff --git a/scripts/1.4.1/data/1_insert_road_data/data/sihao.xlsx b/scripts/1.4.1/data/1_insert_road_data/data/sihao.xlsx new file mode 100644 index 00000000..183e8be8 Binary files /dev/null and b/scripts/1.4.1/data/1_insert_road_data/data/sihao.xlsx differ diff --git a/scripts/1.4.1/data/1_insert_road_data/index.js b/scripts/1.4.1/data/1_insert_road_data/index.js new file mode 100644 index 00000000..ca9f9561 --- /dev/null +++ b/scripts/1.4.1/data/1_insert_road_data/index.js @@ -0,0 +1,269 @@ +try { + const { Pool, Client } = require('pg') + const XLSX = require('xlsx') + const path = require('path') + const fs = require("fs"); + + //开发 + const pool = new Pool({ + user: 'postgres', + host: '10.8.30.32', + database: 'highways4good', + password: '123', + port: 5432, + }) + + // 测试环境 + // const pool = new Pool({ + // user: 'highwayadmin', + // host: '10.8.40.223', + // database: 'highway4good', + // password: 'highway123', + // port: 5432, + // }) + + // 商用环境 + // const pool = new Pool({ + // user: 'highwayadmin', + // host: '10.8.40.223', + // database: 'highway4good', + // password: 'highway123', + // port: 5432, + // }) + // const userId = '' + + const fun = async () => { + const client = await pool.connect() + try { + await client.query('BEGIN') + console.log(`开始`); + + let allVillageRes = (await client.query(`SELECT * FROM village`)).rows + let allRoads = (await client.query(`SELECT * FROM road`)).rows + let towns = (await client.query(`SELECT * FROM town`)).rows + + // 读取数据文件 + let workbook = XLSX.readFile(path.join(__dirname, './data/sihao.xlsx')); + let firstSheetName = workbook.SheetNames[0]; + let worksheet = workbook.Sheets[firstSheetName]; + let res = XLSX.utils.sheet_to_json(worksheet, { + defval: '' + }); + + let villageSql = '' + let noExistVillage = '' + let noExistVillageObj = {} + let delSql = '' + allRoads.forEach(r => { + let isExit = res.find(s => s.route_code == r.route_code && s.section_no == r.section_no && s.route_name == r.route_name) + if (!isExit) { + delSql += `UPDATE road SET del = true WHERE id = ${r.id};\n` + } + }) + if (delSql) fs.writeFileSync('delete_road.sql', delSql, 'utf-8'); + + for (let r of [...res]) { + console.log(r); + // if (r.id == 3259) { + // console.log(r); + // } + let villageId = null + if (r['所属行政村']) { + let v = r['所属行政村'] + v = v.split(' ')[0] + v = v.trim() + if (v) { + let noExist = false + let corV = allVillageRes.find(village => village.name === v) + if (corV) { + villageId = corV.id + } else { + + if (!v.endsWith('村')) { + v += '村' + let corV = allVillageRes.find(village => village.name === v) + if (corV) { + villageId = corV.id + } else { + noExist = true + } + } else { + noExist = true + } + } + + if (noExist) { + if (!noExistVillageObj[v]) { + noExistVillage += `${v}\n` + noExistVillageObj[v] = true + } + + } + } + } + let del = false + let spot = false + + let isDel = r['isdelete'] + + if (isDel) { + isDel = isDel.toString() + isDel = isDel.trim() + if (isDel) { + if (isDel == 1) { + del = true + } + } + } + + let mark = r['mark'] + if (mark) { + spot = true + } else { + spot = false + } + + let rId = r.id + if (rId) { + rId = rId.toString() + rId = rId.trim() + if (rId) { + r.id = rId + } + } + + let town = towns.find(x => x.name == r['乡镇定稿']) + let township_code = town ? town.code : '' + const arr = [] + Object.keys(r).forEach(key => { + arr.push(key) + }) + console.log(arr) + let isExit = allRoads.find(s => s.route_code == r.route_code && s.section_no == r.section_no && s.route_name == r.route_name) + if (isExit) { + villageSql += `UPDATE road SET village_id = ${villageId}, "del" = ${del}, spot = ${spot}, "township_code" = ${township_code ? township_code : `null`} WHERE id = ${r.id};\n` + } else { + const { + route_name = `null`, route_code = `null`, section_no = `null`, township_code = `null`, starting_place_name = `null`, + start_station = `null`, category_of_starting_point_and_dividing_point = `null`, stop_place_name = `null`, + category_of_dead_center_and_dividing_point = `null`, stop_station = `null`, section_type = `null`, + route_code_before_road_network_adjustment = `null`, serial_number_of_original_section = `null`, + starting_stake_number_of_the_original_road_section = `null`, ending_point_stake_no_of_the_original_road_section = `null`, + route_level = `null`, nature_of_road_section = `null`, completion_time = `null`, reconstruction_time = `null`, nature_of_construction = `null`, + gbm_and_civilized_model_road = `null`, landforms = `null`, nature_of_charges = `null`, toll_station = `null`, number_of_culverts = `null`, + technical_level = `null`, pavement_type = `null`, pavement_width = `null`, subgrade_width = `null`, lane_characteristics = `null`, + whether_it_is_open_to_traffic_in_sunny_or_rainy_days = `null`, design_speed_per_hour = `null`, urban_management_section_or_not = `null`, + management_and_maintenance_unit = `null`, road_administration_unit = `null`, alimentation = `null`, source_of_listed_maintenance_funds = `null`, + curing_time = `null`, greening_mileage = `null`, greening_mileaged = `null`, type_of_repeated_road_section = `null`, + serial_number_of_repeated_section = `null`, repeated_section_route_code = `null`, planned_fund_category = `null`, + planned_year = `null`, plan_document_no = `null`, plan_item_unique_code = `null`, planned_project_route_code = `null`, + plan_project_name = `null`, planned_project_type = `null`, completion_status = `null`, year_of_completion = `null`, planned_fund_category__one = `null`, + planned_year__one = `null`, plan_document_no__one = `null`, plan_item_unique_code__one = `null`, plan_project_name__one = `null`, + completion_status__one = `null`, year_of_completion__one = `null`, station_range = `null`, reporting_unit = `null`, reason_for_change = `null`, + change_time = `null`, last_repair_and_maintenance_year = `null`, whether_maintenance_managed_highway = `null`, remarks = `null`, + route_code_of_last_year = `null`, route_name_of_last_year = `null`, starting_station_of_last_year = `null`, + last_years_ending_point_stake_number = `null`, graphic_mileage = `null`, chainage_mileage = `null`, districtcounty = `null`, + location_city = `null`, level = `null`, surface_thickness = `null`, + } = r; + villageSql += ` + INSERT INTO road ( + village_id, + "del", + spot, + route_name, route_code, section_no, township_code, starting_place_name, + start_station, category_of_starting_point_and_dividing_point, stop_place_name, + category_of_dead_center_and_dividing_point, stop_station, section_type, + route_code_before_road_network_adjustment, serial_number_of_original_section, + starting_stake_number_of_the_original_road_section, ending_point_stake_no_of_the_original_road_section, + route_level, nature_of_road_section, completion_time, reconstruction_time, nature_of_construction, + gbm_and_civilized_model_road, landforms, nature_of_charges, toll_station, number_of_culverts, + technical_level, pavement_type, pavement_width, subgrade_width, lane_characteristics, + whether_it_is_open_to_traffic_in_sunny_or_rainy_days, design_speed_per_hour, urban_management_section_or_not, + management_and_maintenance_unit, road_administration_unit, alimentation, source_of_listed_maintenance_funds, + curing_time, greening_mileage, greening_mileaged, type_of_repeated_road_section, + serial_number_of_repeated_section, repeated_section_route_code, planned_fund_category, + planned_year, plan_document_no, plan_item_unique_code, planned_project_route_code, + plan_project_name, planned_project_type, completion_status, year_of_completion, planned_fund_category__one, + planned_year__one, plan_document_no__one, plan_item_unique_code__one, plan_project_name__one, + completion_status__one, year_of_completion__one, station_range, reporting_unit, reason_for_change, + change_time, last_repair_and_maintenance_year, whether_maintenance_managed_highway, remarks, + route_code_of_last_year, route_name_of_last_year, starting_station_of_last_year, + last_years_ending_point_stake_number, graphic_mileage, chainage_mileage, districtcounty, + location_city, level, surface_thickness + ) VALUES ( + ${villageId || `null`}, + ${del}, + ${spot}, + ${route_name ? `'${r.route_name}'` : `null`}, ${route_code ? `'${r.route_code}'` : `null`}, + ${section_no ? `'${r.section_no}'` : `null`}, ${township_code ? `'${r.township_code}'` : `null`}, + ${starting_place_name ? `'${r.starting_place_name}'` : `null`}, + ${start_station ? `'${r.start_station}'` : `null`}, ${category_of_starting_point_and_dividing_point ? `'${r.category_of_starting_point_and_dividing_point}'` : `null`}, + ${stop_place_name ? `'${r.stop_place_name}'` : `null`}, + ${category_of_dead_center_and_dividing_point ? `'${r.category_of_dead_center_and_dividing_point}'` : `null`}, ${stop_station ? `'${r.stop_station}'` : `null`}, + ${section_type ? `'${r.section_type}'` : `null`}, + ${route_code_before_road_network_adjustment ? `'${r.route_code_before_road_network_adjustment}'` : `null`}, ${serial_number_of_original_section ? `'${r.serial_number_of_original_section}'` : `null`}, + ${starting_stake_number_of_the_original_road_section ? `'${r.starting_stake_number_of_the_original_road_section}'` : `null`}, + ${ending_point_stake_no_of_the_original_road_section ? `'${r.ending_point_stake_no_of_the_original_road_section}'` : `null`}, + ${route_level ? `'${r.route_level}'` : `null`}, ${nature_of_road_section ? `'${r.nature_of_road_section}'` : `null`}, + ${completion_time ? `'${r.completion_time}'` : `null`}, + ${reconstruction_time ? `'${r.reconstruction_time}'` : `null`}, ${nature_of_construction ? `'${r.nature_of_construction}'` : `null`}, + ${gbm_and_civilized_model_road ? `'${r.gbm_and_civilized_model_road}'` : `null`}, ${landforms ? `'${r.landforms}'` : `null`}, + ${nature_of_charges ? `'${r.nature_of_charges}'` : `null`}, + ${toll_station ? `'${r.toll_station}'` : `null`}, ${number_of_culverts ? `'${r.number_of_culverts}'` : `null`}, + ${technical_level ? `'${r.technical_level}'` : `null`}, ${pavement_type ? `'${r.pavement_type}'` : `null`}, + ${pavement_width ? `'${r.pavement_width}'` : `null`}, + ${subgrade_width ? `'${r.subgrade_width}'` : `null`}, ${lane_characteristics ? `'${r.lane_characteristics}'` : `null`}, + ${whether_it_is_open_to_traffic_in_sunny_or_rainy_days ? `'${r.whether_it_is_open_to_traffic_in_sunny_or_rainy_days}'` : `null`}, + ${design_speed_per_hour ? `'${r.design_speed_per_hour}'` : `null`}, ${urban_management_section_or_not ? `'${r.urban_management_section_or_not}'` : `null`}, + ${management_and_maintenance_unit ? `'${r.management_and_maintenance_unit}'` : `null`}, ${road_administration_unit ? `'${r.road_administration_unit}'` : `null`}, + ${alimentation ? `'${r.alimentation}'` : `null`}, ${source_of_listed_maintenance_funds ? `'${r.source_of_listed_maintenance_funds}'` : `null`}, + ${curing_time ? `'${r.curing_time}'` : `null`}, ${greening_mileage ? `'${r.greening_mileage}'` : `null`}, + ${greening_mileaged ? `'${r.greening_mileaged}'` : `null`}, + ${type_of_repeated_road_section ? `'${r.type_of_repeated_road_section}'` : `null`}, + ${serial_number_of_repeated_section ? `'${r.serial_number_of_repeated_section}'` : `null`}, + ${repeated_section_route_code ? `'${r.repeated_section_route_code}'` : `null`}, + ${planned_fund_category ? `'${r.planned_fund_category}'` : `null`}, + ${planned_year ? `'${r.planned_year}'` : `null`}, ${plan_document_no ? `'${r.plan_document_no}'` : `null`}, + ${plan_item_unique_code ? `'${r.plan_item_unique_code}'` : `null`}, + ${planned_project_route_code ? `'${r.planned_project_route_code}'` : `null`}, + ${plan_project_name ? `'${r.plan_project_name}'` : `null`}, ${planned_project_type ? `'${r.planned_project_type}'` : `null`}, + ${completion_status ? `'${r.completion_status}'` : `null`}, + ${year_of_completion ? `'${r.year_of_completion}'` : `null`}, ${planned_fund_category__one ? `'${r.planned_fund_category__one}'` : `null`}, + ${planned_year__one ? `'${r.planned_year__one}'` : `null`}, ${plan_document_no__one ? `'${r.plan_document_no__one}'` : `null`}, + ${plan_item_unique_code__one ? `'${r.plan_item_unique_code__one}'` : `null`}, + ${plan_project_name__one ? `'${r.plan_project_name__one}'` : `null`}, + ${completion_status__one ? `'${r.completion_status__one}'` : `null`}, ${year_of_completion__one ? `'${r.year_of_completion__one}'` : `null`}, + ${station_range ? `'${r.station_range}'` : `null`}, ${reporting_unit ? `'${r.reporting_unit}'` : `null`}, + ${reason_for_change ? `'${r.reason_for_change}'` : `null`}, + ${change_time ? `'${r.change_time}'` : `null`}, ${last_repair_and_maintenance_year ? `'${r.last_repair_and_maintenance_year}'` : `null`}, + ${whether_maintenance_managed_highway ? `'${r.whether_maintenance_managed_highway}'` : `null`}, ${remarks ? `'${r.remarks}'` : `null`}, + ${route_code_of_last_year ? `'${r.route_code_of_last_year}'` : `null`}, ${route_name_of_last_year ? `'${r.route_name_of_last_year}'` : `null`}, + ${starting_station_of_last_year ? `'${r.starting_station_of_last_year}'` : `null`}, + ${last_years_ending_point_stake_number ? `'${r.last_years_ending_point_stake_number}'` : `null`}, ${graphic_mileage ? `'${r.graphic_mileage}'` : `null`}, + ${chainage_mileage ? `'${r.chainage_mileage}'` : `null`}, ${districtcounty ? `'${r.districtcounty}'` : `null`}, + ${location_city ? `'${r.location_city}'` : `null`}, ${level ? `'${r.level}'` : `null`}, + ${surface_thickness ? `'${r.surface_thickness}'` : `null`} + );\n` + } + } + + + fs.writeFileSync('road_update.sql', villageSql, 'utf-8'); + // fs.writeFileSync('no_exist_village.txt', noExistVillage, 'utf-8'); + + // await client.query('ROLLBACK') + await client.query('COMMIT') + console.log('执行完毕~') + } catch (e) { + await client.query('ROLLBACK') + console.log('执行错误~' + JSON.stringify(e)) + throw e + } finally { + client.release(); + } + } + + fun() +} catch (error) { + console.error(error) +} diff --git a/scripts/1.4.1/data/1_insert_road_data/insert-towns.sql b/scripts/1.4.1/data/1_insert_road_data/insert-towns.sql new file mode 100644 index 00000000..3e3cea6d --- /dev/null +++ b/scripts/1.4.1/data/1_insert_road_data/insert-towns.sql @@ -0,0 +1,36 @@ + + INSERT INTO town(name,code) VALUES ('八一乡', 360121206000); + + INSERT INTO town(name,code) VALUES ('东新乡', 360121205000); + + INSERT INTO town(name,code) VALUES ('富山乡', 360121204000); + + INSERT INTO town(name,code) VALUES ('冈上镇', 360121107000); + + INSERT INTO town(name,code) VALUES ('广福镇', 360121108000); + + INSERT INTO town(name,code) VALUES ('黄马乡', 360121203000); + + INSERT INTO town(name,code) VALUES ('蒋巷镇', 360121105000); + + INSERT INTO town(name,code) VALUES ('金湖管理处', 330052); + + INSERT INTO town(name,code) VALUES ('泾口乡', 360121200000); + + INSERT INTO town(name,code) VALUES ('莲塘镇', 360121100000); + + INSERT INTO town(name,code) VALUES ('南新乡', 360121201000); + + INSERT INTO town(name,code) VALUES ('三江镇', 360121102000); + + INSERT INTO town(name,code) VALUES ('塔城乡', 360121202000); + + INSERT INTO town(name,code) VALUES ('塘南镇', 360121103000); + + INSERT INTO town(name,code) VALUES ('武阳镇', 360121106000); + + INSERT INTO town(name,code) VALUES ('向塘镇', 360121101000); + + INSERT INTO town(name,code) VALUES ('银三角管委会', 360121471000); + + INSERT INTO town(name,code) VALUES ('幽兰镇', 360121104000); diff --git a/scripts/1.4.1/data/1_insert_road_data/package.json b/scripts/1.4.1/data/1_insert_road_data/package.json new file mode 100644 index 00000000..7da06c06 --- /dev/null +++ b/scripts/1.4.1/data/1_insert_road_data/package.json @@ -0,0 +1,17 @@ +{ + "name": "appkey-generator", + "version": "1.0.0", + "description": "tool", + "main": "index.js", + "scripts": { + "test": "mocha", + "start": "set NODE_ENV=development&&node index" + }, + "author": "liu", + "license": "ISC", + "dependencies": { + "crypto-js": "^4.1.1", + "pg": "^7.18.2", + "xlsx": "^0.17.1" + } +} diff --git a/scripts/1.4.1/schema/1create_table.town.sql b/scripts/1.4.1/schema/1create_table.town.sql new file mode 100644 index 00000000..ab40fb58 --- /dev/null +++ b/scripts/1.4.1/schema/1create_table.town.sql @@ -0,0 +1,11 @@ +create table town +( + id serial + constraint table_name_pk + primary key, + name varchar, + code varchar +); + +create unique index town_id_uindex + on town (id); \ No newline at end of file diff --git a/scripts/1.4.1/schema/2.alter_road.sql b/scripts/1.4.1/schema/2.alter_road.sql new file mode 100644 index 00000000..4fa36b3c --- /dev/null +++ b/scripts/1.4.1/schema/2.alter_road.sql @@ -0,0 +1,8 @@ +alter table road_spot_check_preview + add village_mil float; + +alter table road_spot_check_preview + add town_mil float; + +alter table road_spot_check_preview + add country_mil float; diff --git a/web/client/src/sections/fillion/components/infor/details.js b/web/client/src/sections/fillion/components/infor/details.js index 361c3f85..9a15a4e0 100644 --- a/web/client/src/sections/fillion/components/infor/details.js +++ b/web/client/src/sections/fillion/components/infor/details.js @@ -13,7 +13,7 @@ const UserModal = (props) => { const [recordsay, setRecordsay] = useState()//必填数据 // const [success, setSuccess] = useState() //状态 // const [establishment, setEstablishment] = useState() //业户类型 - + useEffect(() => { const array = [] if (rewkeys === 'transportation') { @@ -283,6 +283,7 @@ const UserModal = (props) => { label='所属行政村' /> : null } + { /> : null } {newlysay?.map((item, index) => { - return + + return item.type == 'townshipCode' ? + : })} @@ -371,11 +381,18 @@ const UserModal = (props) => { } {newlysay?.map((item, index) => { - return + return item.type == 'townshipCode' ? + : + })} } @@ -386,7 +403,7 @@ const UserModal = (props) => { ) } -function mapStateToProps (state) { +function mapStateToProps(state) { const { depMessage } = state; const pakData = (dep) => { return dep.map((d) => { @@ -403,4 +420,23 @@ function mapStateToProps (state) { depData, }; } -export default connect(mapStateToProps)(UserModal); \ No newline at end of file +export default connect(mapStateToProps)(UserModal); + +export const townCode = [ + { label: "莲塘镇", value: "360121100000" }, + { label: "向塘镇", value: "360121101000" }, + { label: "三江镇", value: "360121102000" }, + { label: "塘南镇", value: "360121103000" }, + { label: "幽兰镇", value: "360121104000" }, + { label: "蒋巷镇", value: "360121105000" }, + { label: "武阳镇", value: "360121106000" }, + { label: "冈上镇", value: "360121107000" }, + { label: "广福镇", value: "360121108000" }, + { label: "泾口乡", value: "360121200000" }, + { label: "南新乡", value: "360121201000" }, + { label: "塔城乡", value: "360121202000" }, + { label: "黄马乡", value: "360121203000" }, + { label: "富山乡", value: "360121204000" }, + { label: "八一乡", value: "360121206000" }, + { label: "银三角管理委员会", value: "360121471000" }, +] \ No newline at end of file