Browse Source

(*) 更新道路脚本提交 web道路管理 乡镇编码改为所属乡镇

dev
peng.peng 1 year ago
parent
commit
a5d90174a5
  1. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx
  2. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls
  3. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx
  4. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx
  5. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls
  6. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls
  7. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls
  8. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).xlsx
  9. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/出租车/事业发展中心巡游出租业户信息表.xlsx
  10. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌南化物流有限责任公司危货业户信息表.xlsx
  11. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌宁昌物流运输有限公司危货业户信息表.xlsx
  12. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌市万利特种气体有限公司危货业户信息表.xlsx
  13. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌江竹实业有限公司危货业户信息表.xlsx
  14. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西昌海运输有限公司危货业户信息表.xlsx
  15. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西省通越运输有限公司危货业户信息表.xlsx
  16. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西雨辰环保科技有限公司危货业户信息表.xlsx
  17. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/出租车/运输事业发展中心巡游出租车辆信息表.xlsx
  18. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌南化物流有限责任公司危货车辆信息表.xlsx
  19. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌宁昌物流运输有限公司危货车辆信息表.xlsx
  20. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌市万利特种气体有限公司危货车辆信息表.xlsx
  21. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌江竹实业有限公司危货车辆信息表.xlsx
  22. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西昌海运输有限公司危货车辆信息表.xlsx
  23. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx
  24. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx
  25. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls
  26. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls
  27. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls
  28. BIN
      scripts/1.3.1/data/1_insert_report_data/data/work.xlsx
  29. 17
      scripts/1.4.1/data/1_insert_road_data/.vscode/launch.json
  30. 11
      scripts/1.4.1/data/1_insert_road_data/Dockerfile
  31. 7
      scripts/1.4.1/data/1_insert_road_data/Dockerfilenew
  32. BIN
      scripts/1.4.1/data/1_insert_road_data/data/sihao.xlsx
  33. 269
      scripts/1.4.1/data/1_insert_road_data/index.js
  34. 36
      scripts/1.4.1/data/1_insert_road_data/insert-towns.sql
  35. 17
      scripts/1.4.1/data/1_insert_road_data/package.json
  36. 11
      scripts/1.4.1/schema/1create_table.town.sql
  37. 8
      scripts/1.4.1/schema/2.alter_road.sql
  38. 60
      web/client/src/sections/fillion/components/infor/details.js

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/出租车/事业发展中心巡游出租业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌南化物流有限责任公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌宁昌物流运输有限公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌市万利特种气体有限公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/南昌江竹实业有限公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西昌海运输有限公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西省通越运输有限公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/业户/危货/江西雨辰环保科技有限公司危货业户信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/出租车/运输事业发展中心巡游出租车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌南化物流有限责任公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌宁昌物流运输有限公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌市万利特种气体有限公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/南昌江竹实业有限公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西昌海运输有限公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls

Binary file not shown.

BIN
scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls

Binary file not shown.

BIN
scripts/1.3.1/data/1_insert_report_data/data/work.xlsx

Binary file not shown.

17
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": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\index.js"
}
]
}

11
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"]

7
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"]

BIN
scripts/1.4.1/data/1_insert_road_data/data/sihao.xlsx

Binary file not shown.

269
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)
}

36
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);

17
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"
}
}

11
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);

8
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;

60
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
}
<ProFormText
name={newlys?.[0]?.type}
width="md"
@ -317,10 +318,19 @@ const UserModal = (props) => {
/> : null
}
{newlysay?.map((item, index) => {
return <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称"
key={index}
/>
return item.type == 'townshipCode' ?
<ProFormSelect
width="md"
options={townCode || []}
placeholder="请选择所属乡镇"
showSearch={true}
name='townshipCode'
label='所属乡镇'
/> : <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称"
key={index}
/>
})}
</ProForm.Group>
@ -371,11 +381,18 @@ const UserModal = (props) => {
}
{newlysay?.map((item, index) => {
return <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index}
/>
return item.type == 'townshipCode' ?
<ProFormSelect
width="md"
options={townCode || []}
placeholder="请选择所属乡镇"
showSearch={true}
name='townshipCode'
label='所属乡镇'
/> :
<ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index}
/>
})}
</ProForm.Group>}
@ -386,7 +403,7 @@ const UserModal = (props) => {
</Spin>
)
}
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);
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" },
]
Loading…
Cancel
Save