Browse Source

冲突解决

dev
wenlele 1 year ago
parent
commit
2f7c8439c2
  1. 38
      api/app/lib/controllers/report/index.js
  2. 27
      api/app/lib/models/road_spot_check_preview.js
  3. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/work.xlsx
  4. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/公交/车辆信息/四公司车辆信息(1).xls
  5. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx
  6. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/养护/南昌县农村公路各管养责任单位管养汇总表.xlsx
  7. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/桥梁.xls
  8. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/工程一览/道路.xls
  9. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/桥梁/桥第三方.xls
  10. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/治超/非现场处罚总台账更新至2022.7.5(最新).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/运政/车辆/危货/江西省通越运输有限公司危货车辆信息表.xlsx
  26. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/运政/车辆/危货/江西雨辰环保科技有限公司危货车辆信息表.xlsx
  27. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/道路/乡道第三方.xls
  28. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/道路/县道第三方.xls
  29. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/道路/村道第三方.xls
  30. BIN
      scripts/1.3.1/data/1_insert_report_data/data/work.xlsx
  31. 17
      scripts/1.4.1/data/1_insert_road_data/.vscode/launch.json
  32. 11
      scripts/1.4.1/data/1_insert_road_data/Dockerfile
  33. 7
      scripts/1.4.1/data/1_insert_road_data/Dockerfilenew
  34. BIN
      scripts/1.4.1/data/1_insert_road_data/data/sihao.xlsx
  35. 269
      scripts/1.4.1/data/1_insert_road_data/index.js
  36. 36
      scripts/1.4.1/data/1_insert_road_data/insert-towns.sql
  37. 17
      scripts/1.4.1/data/1_insert_road_data/package.json
  38. 11
      scripts/1.4.1/schema/1create_table.town.sql
  39. 8
      scripts/1.4.1/schema/2.alter_road.sql
  40. 45
      web/client/src/sections/fillion/components/adjustment.js
  41. 47
      web/client/src/sections/fillion/components/infor/details.js
  42. 201
      web/client/src/sections/fillion/components/transportationTable.js
  43. 118
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js
  44. 48
      web/client/src/sections/organization/components/depModal.js

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

@ -3,8 +3,6 @@ const { QueryTypes } = require('sequelize');
const moment = require('moment'); const moment = require('moment');
const xlsxDownload = require('../../../../utils/xlsxDownload.js'); const xlsxDownload = require('../../../../utils/xlsxDownload.js');
const fs = require('fs'); const fs = require('fs');
const XLSX = require('xlsx')
const path = require('path')
async function reportList(ctx) { async function reportList(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -304,7 +302,6 @@ async function deleteReport (ctx) {
} }
// TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回 // TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回
async function spotPrepare(ctx) { async function spotPrepare(ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
@ -540,7 +537,6 @@ async function roadSpotPrepare (ctx) {
}) })
let lastCountyPercentage = 0 // 最后一次的县道百分比 let lastCountyPercentage = 0 // 最后一次的县道百分比
let lastCountyRoadIds = [] // 上次查得的县道id let lastCountyRoadIds = [] // 上次查得的县道id
let lastTownRoadIds = [] // 上次查得的乡镇道id let lastTownRoadIds = [] // 上次查得的乡镇道id
let lastVillageRoadRoadIds = [] // 上次查得的村道id let lastVillageRoadRoadIds = [] // 上次查得的村道id
@ -590,7 +586,6 @@ async function roadSpotPrepare (ctx) {
} }
// 先查上次没查的范围内的 然后比较百分比 如果重叠 再查上次查过的 // 先查上次没查的范围内的 然后比较百分比 如果重叠 再查上次查过的
let keyMap = { let keyMap = {
'县': `route_code LIKE 'X%'`, '县': `route_code LIKE 'X%'`,
'乡': `route_code LIKE 'Y%'`, '乡': `route_code LIKE 'Y%'`,
@ -659,6 +654,7 @@ async function roadSpotPrepare (ctx) {
spotRoadIds.push(r.id) spotRoadIds.push(r.id)
accumulationMileage += parseFloat(r.chainage_mileage) accumulationMileage += parseFloat(r.chainage_mileage)
if (accumulationMileage >= targetMileage) { if (accumulationMileage >= targetMileage) {
break; break;
} }
} }
@ -686,13 +682,17 @@ async function roadSpotPrepare (ctx) {
await filterRoad(otherWhere, true) await filterRoad(otherWhere, true)
} }
return spotRoadIds return [spotRoadIds, accumulationMileage]
} }
let villageMil = 0, townMil = 0, countryMil = 0;
// 抽县 // 抽县
const countryRoadTotalMileage = await getRoadTotalMileage('县') const countryRoadTotalMileage = await getRoadTotalMileage('县')
const countryRoadNeedMileage = countryRoadTotalMileage * countyPercentage / 100 const countryRoadNeedMileage = countryRoadTotalMileage * countyPercentage / 100
let spotCountyRoadIds = await spotRoadId('县', lastCountyRoadIds, countryRoadNeedMileage, []) let spotCountyRoadIdsArr = await spotRoadId('县', lastCountyRoadIds, countryRoadNeedMileage, [])
let spotCountyRoadIds = spotCountyRoadIdsArr[0]
let countryMil_ = spotCountyRoadIdsArr[1]
if (countryMil_) countryMil += countryMil_;
// 抽乡 // 抽乡
const allTownCodeRes = await sequelize.query(` const allTownCodeRes = await sequelize.query(`
@ -707,15 +707,18 @@ async function roadSpotPrepare (ctx) {
let spotTownRoadIds = [] let spotTownRoadIds = []
let spotVillageRoadIds = [] let spotVillageRoadIds = []
let spotVillageIds = [] let spotVillageIds = []
for await (let t of allTownCodeRes) { for await (let t of allTownCodeRes) {
// 遍历每个乡镇并抽取 // 遍历每个乡镇并抽取
let otherWhere = [`township_code='${t.township_code}'`] let otherWhere = [`township_code='${t.township_code}'`]
const townRoadTotalMileage = await getRoadTotalMileage('乡', otherWhere) const townRoadTotalMileage = await getRoadTotalMileage('乡', otherWhere)
const townRoadNeedMileage = townRoadTotalMileage * 25 / 100 const townRoadNeedMileage = townRoadTotalMileage * 25 / 100
let spotTownRoadIds_ = await spotRoadId('乡', lastTownRoadIds, townRoadNeedMileage, otherWhere) let spotTownRoadIdsArr = await spotRoadId('乡', lastTownRoadIds, townRoadNeedMileage, otherWhere)
let spotTownRoadIds_ = spotTownRoadIdsArr[0]
let townMil_ = spotTownRoadIdsArr[1]
spotTownRoadIds = spotTownRoadIds.concat(spotTownRoadIds_) spotTownRoadIds = spotTownRoadIds.concat(spotTownRoadIds_)
if (townMil_) townMil += townMil_
// 抽村 // 抽村
const villageRoadTotalMileage = await getRoadTotalMileage('村', otherWhere) const villageRoadTotalMileage = await getRoadTotalMileage('村', otherWhere)
const villageRoadNeedMileage = villageRoadTotalMileage * 10 / 100 const villageRoadNeedMileage = villageRoadTotalMileage * 10 / 100
@ -757,8 +760,11 @@ async function roadSpotPrepare (ctx) {
villageCheckIdList.unshift(spotFirstVillageId) villageCheckIdList.unshift(spotFirstVillageId)
villageCheckIdList = [...(new Set(villageCheckIdList))] villageCheckIdList = [...(new Set(villageCheckIdList))]
let spotVillageRoadIds_ = await spotRoadId('村', lastVillageRoadRoadIds, villageRoadNeedMileage, otherWhere, villageCheckIdList) let spotVillageRoadIdsArr = await spotRoadId('村', lastVillageRoadRoadIds, villageRoadNeedMileage, otherWhere, villageCheckIdList)
let spotVillageRoadIds_ = spotVillageRoadIdsArr[0]
let villageMil_ = spotVillageRoadIdsArr[1]
spotVillageRoadIds = spotVillageRoadIds.concat(spotVillageRoadIds_) spotVillageRoadIds = spotVillageRoadIds.concat(spotVillageRoadIds_)
if (villageMil_) villageMil += villageMil_
} }
const previewRes = await models.RoadSpotCheckPreview.create({ const previewRes = await models.RoadSpotCheckPreview.create({
@ -768,7 +774,10 @@ async function roadSpotPrepare (ctx) {
townshipRoadId: spotTownRoadIds, townshipRoadId: spotTownRoadIds,
villageRoadId: spotVillageRoadIds, villageRoadId: spotVillageRoadIds,
villageId: spotVillageIds, villageId: spotVillageIds,
checked: false checked: false,
villageMil,
townMil,
countryMil
}) })
ctx.status = 200; ctx.status = 200;
@ -777,6 +786,10 @@ async function roadSpotPrepare (ctx) {
spotCountyRoadCount: spotCountyRoadIds.length, spotCountyRoadCount: spotCountyRoadIds.length,
spotTownRoadCount: spotTownRoadIds.length, spotTownRoadCount: spotTownRoadIds.length,
spotVillageRoadCount: spotVillageRoadIds.length, spotVillageRoadCount: spotVillageRoadIds.length,
villageMil,
townMil,
countryMil
} }
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
@ -887,6 +900,9 @@ async function roadSpotList (ctx) {
countyRoadId: item.countyRoadId, countyRoadId: item.countyRoadId,
townshipRoadId: item.townshipRoadId, townshipRoadId: item.townshipRoadId,
villageRoadId: item.villageRoadId, villageRoadId: item.villageRoadId,
villageMil: item.villageMil,
townMil: item.townMil,
countryMil: item.countryMil
} }
}) })
} catch (error) { } catch (error) {

27
api/app/lib/models/road_spot_check_preview.js

@ -77,6 +77,33 @@ module.exports = dc => {
primaryKey: false, primaryKey: false,
field: "village_id", field: "village_id",
autoIncrement: false autoIncrement: false
},
villageMil: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "village_mil",
autoIncrement: false
},
townMil: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "town_mil",
autoIncrement: false
},
countryMil: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "country_mil",
autoIncrement: false
} }
}, { }, {
tableName: "road_spot_check_preview", tableName: "road_spot_check_preview",

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;

45
web/client/src/sections/fillion/components/adjustment.js

@ -1,7 +1,7 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react'
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd' import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd'
import { roadSpotChange } from '../actions/spotCheck'; import { roadSpotChange } from '../actions/spotCheck'
import { getRoadway } from "../actions/infor" import { getRoadway } from "../actions/infor"
import moment from 'moment' import moment from 'moment'
@ -21,14 +21,14 @@ const Adjustment = (props) => {
const [reportData, setReportData] = useState([]) const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([]) const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]); const [dateRange, setDateRange] = useState([])
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
const [nameList, setNameList] = useState([]); const [nameList, setNameList] = useState([])
const [codeList, setCodeList] = useState([]); const [codeList, setCodeList] = useState([])
const [indexList, setIndexList] = useState([]); const [indexList, setIndexList] = useState([])
const [roadFind, setRoadFind] = useState({}); const [roadFind, setRoadFind] = useState({})
const [routeCodeDisabled, setRouteCodeDisabled] = useState(true); const [routeCodeDisabled, setRouteCodeDisabled] = useState(true)
const [sectionNoDisabled, setSectionNoDisabled] = useState(true); const [sectionNoDisabled, setSectionNoDisabled] = useState(true)
@ -52,7 +52,7 @@ const Adjustment = (props) => {
if (v.sectionNo && !index.includes(v.sectionNo)) { if (v.sectionNo && !index.includes(v.sectionNo)) {
index.push(v.sectionNo) index.push(v.sectionNo)
} }
}); })
setNameList(name) setNameList(name)
setCodeList(code) setCodeList(code)
setIndexList(index) setIndexList(index)
@ -80,10 +80,11 @@ const Adjustment = (props) => {
changeRoadId: data?.id changeRoadId: data?.id
})).then(res => { })).then(res => {
if (res.success) { if (res.success) {
console.log(res)
onCancel() onCancel()
onOk() onOk()
} }
}); })
}) })
@ -100,7 +101,7 @@ const Adjustment = (props) => {
if (v.routeName && !name.includes(v.routeName)) { if (v.routeName && !name.includes(v.routeName)) {
name.push(v.routeName) name.push(v.routeName)
} }
}); })
for (let d in changedValues) { for (let d in changedValues) {
if (d == 'routeName') { if (d == 'routeName') {
form.setFieldsValue({ form.setFieldsValue({
@ -111,7 +112,7 @@ const Adjustment = (props) => {
if (allValues?.routeName && allValues?.routeName == v.routeName && v.routeCode && !code.includes(v.routeCode)) { if (allValues?.routeName && allValues?.routeName == v.routeName && v.routeCode && !code.includes(v.routeCode)) {
code.push(v.routeCode) code.push(v.routeCode)
} }
}); })
setCodeList(code) setCodeList(code)
} }
@ -129,7 +130,7 @@ const Adjustment = (props) => {
if (!allValues?.routeCode && v.routeCode && !code.includes(v.routeCode)) { if (!allValues?.routeCode && v.routeCode && !code.includes(v.routeCode)) {
code.push(v.routeCode) code.push(v.routeCode)
} }
}); })
if (!allValues?.routeCode) { if (!allValues?.routeCode) {
setCodeList(code) setCodeList(code)
} }
@ -158,13 +159,13 @@ const Adjustment = (props) => {
if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) { if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) {
let find = road?.find(s => allValues?.routeName == s.routeName && allValues?.routeCode == s.routeCode && allValues?.sectionNo == s.sectionNo) let find = road?.find(s => allValues?.routeName == s.routeName && allValues?.routeCode == s.routeCode && allValues?.sectionNo == s.sectionNo)
form.setFieldsValue({ form.setFieldsValue({
'startingPlaceName': find?.startingPlaceName, 'startStation': find?.startStation,
'stopPlaceName': find?.stopPlaceName 'stopStation': find?.stopStation
}) })
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
'startingPlaceName': null, 'startStation': null,
'stopPlaceName': null 'stopStation': null
}) })
} }
@ -194,10 +195,10 @@ const Adjustment = (props) => {
<Select style={{}} allowClear showSearch={true} disabled={sectionNoDisabled} placeholder="请选择路段序号" options={indexList?.map(v => ({ value: v, label: v })) || []} /> <Select style={{}} allowClear showSearch={true} disabled={sectionNoDisabled} placeholder="请选择路段序号" options={indexList?.map(v => ({ value: v, label: v })) || []} />
</Form.Item> </Form.Item>
<Form.Item label='起点地名' name='startingPlaceName'> <Form.Item label='起点桩号' name='startStation'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
<Form.Item label='止点地名' name='stopPlaceName'> <Form.Item label='止点桩号' name='stopStation'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
</Form> </Form>
@ -218,4 +219,4 @@ function mapStateToProps (state) {
road: road?.data || [], road: road?.data || [],
} }
} }
export default connect(mapStateToProps)(Adjustment); export default connect(mapStateToProps)(Adjustment)

47
web/client/src/sections/fillion/components/infor/details.js

@ -283,6 +283,7 @@ const UserModal = (props) => {
label='所属行政村' label='所属行政村'
/> : null /> : null
} }
<ProFormText <ProFormText
name={newlys?.[0]?.type} name={newlys?.[0]?.type}
width="md" width="md"
@ -317,7 +318,16 @@ const UserModal = (props) => {
/> : null /> : null
} }
{newlysay?.map((item, index) => { {newlysay?.map((item, index) => {
return <ProFormText width="md"
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="请输入名称" name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称"
key={index} key={index}
/> />
@ -371,10 +381,17 @@ const UserModal = (props) => {
} }
{newlysay?.map((item, index) => { {newlysay?.map((item, index) => {
return <ProFormText width="md" 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} name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index}
/> />
})} })}
</ProForm.Group>} </ProForm.Group>}
@ -404,3 +421,25 @@ function mapStateToProps (state) {
}; };
} }
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" },
{ label: "东新乡", value: "360121205000" },
{ label: "金湖管理处", value: "330052" },
]

201
web/client/src/sections/fillion/components/transportationTable.js

@ -1,23 +1,23 @@
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react'
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import { Spin, Button, Popconfirm } from 'antd'; import { Spin, Button, Popconfirm } from 'antd'
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table'
import './protable.less' import './protable.less'
import moment from 'moment'; import moment from 'moment'
import { getRoadway, getProject, delRoadway, delProject, getVillageList } from "../actions/infor" import { getRoadway, getProject, delRoadway, delProject, getVillageList } from "../actions/infor"
import UserModal from './infor/details'; import UserModal from './infor/details'
import ProjectModal from './project/project'; import ProjectModal from './project/project'
const TransporTationTable = (props) => { const TransporTationTable = (props) => {
const { dispatch, user, depData, depMessage, depLoading, villageList } = props const { dispatch, user, depData, depMessage, depLoading, villageList } = props
const [rowSelected, setRowSelected] = useState([]) const [rowSelected, setRowSelected] = useState([])
const [sitename, setSitename] = useState()//名称 const [sitename, setSitename] = useState()//名称
const [counts, setCounts] = useState()//shuju const [counts, setCounts] = useState()//shuju
const [modalVisible, setModalVisible] = useState(false); const [modalVisible, setModalVisible] = useState(false)
const [modalVisibleyilan, setModalVisibleyilan] = useState(false); const [modalVisibleyilan, setModalVisibleyilan] = useState(false)
const [modalRecord, setModalRecord] = useState(); const [modalRecord, setModalRecord] = useState()
const [typecard, setTypecard] = useState(); const [typecard, setTypecard] = useState()
const [activeKey, setActiveKey] = useState('tab1'); const [activeKey, setActiveKey] = useState('tab1')
const [recortd, setRecortd] = useState() const [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('县') const [whichofits, setWhichofits] = useState('县')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
@ -30,12 +30,12 @@ const TransporTationTable = (props) => {
useEffect(() => { ref.current.reload() }, [whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
//打开弹窗 //打开弹窗
const openModal = (type, record) => { const openModal = (type, record) => {
setModalVisible(true); setModalVisible(true)
// setModalType(type); // setModalType(type);
if (type == 'edit') { if (type == 'edit') {
setModalRecord(record); setModalRecord(record)
} else { } else {
setModalRecord(null); setModalRecord(null)
} }
} }
useEffect(() => { useEffect(() => {
@ -50,12 +50,12 @@ const TransporTationTable = (props) => {
// console.log('11111', depMessage) // console.log('11111', depMessage)
// }, [depMessage]) // }, [depMessage])
const yilanModal = (type, record) => { const yilanModal = (type, record) => {
setModalVisibleyilan(true); setModalVisibleyilan(true)
// setModalType(type); // setModalType(type);
if (type == 'edit') { if (type == 'edit') {
setModalRecord(record); setModalRecord(record)
} else { } else {
setModalRecord(null); setModalRecord(null)
} }
} }
//删除daolu //删除daolu
@ -78,6 +78,28 @@ const TransporTationTable = (props) => {
} }
const roadCode = [
{ title: "八一乡", value: "360121206000" },
{ title: "东新乡", value: "360121205000" },
{ title: "富山乡", value: "360121204000" },
{ title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" },
{ title: "黄马乡", value: "360121203000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "向塘镇", value: "360121101000" },
{ title: "银三角管委会", value: "360121471000" },
{ title: "幽兰镇", value: "360121104000" },
]
useEffect(async () => { useEffect(async () => {
dispatch(getVillageList({})) dispatch(getVillageList({}))
@ -94,7 +116,7 @@ const TransporTationTable = (props) => {
query.level = '村' query.level = '村'
} }
const res = await dispatch(getRoadway(query)) const res = await dispatch(getRoadway(query))
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]; const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]
setRoadData(uniqueArray) setRoadData(uniqueArray)
}, [whichofits]) }, [whichofits])
@ -150,13 +172,22 @@ const TransporTationTable = (props) => {
} }
}, },
{ {
title: '乡镇编码', title: '所属乡镇',
search: false, search: false,
dataIndex: 'time3', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
width: 120,
width: 140,
render: (dom, record) => { render: (dom, record) => {
return record.townshipCode const targetValue = record.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}, },
fieldProps: { fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -1203,6 +1234,45 @@ const TransporTationTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, },
{
title: '所属行政村',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
return record.villageId
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '是否隐藏字段',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
console.log(record.spot)
if (record.spot) {
return "是"
} else {
return "否"
}
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{ {
title: '操作', title: '操作',
dataIndex: 'creatTime', dataIndex: 'creatTime',
@ -1258,7 +1328,7 @@ const TransporTationTable = (props) => {
导入 导入
</Button> */} </Button> */}
</div> </div>
); )
}, },
}, },
], tab2: [ ], tab2: [
@ -1310,13 +1380,22 @@ const TransporTationTable = (props) => {
} }
}, },
{ {
title: '乡镇编码', title: '所属乡镇',
search: false, search: false,
dataIndex: 'time3', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
width: 120,
width: 140,
render: (dom, record) => { render: (dom, record) => {
return record.townshipCode const targetValue = record.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}, },
fieldProps: { fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -2363,6 +2442,22 @@ const TransporTationTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, },
{
title: '所属行政村',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
return record.villageId
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{ {
title: '操作', title: '操作',
dataIndex: 'creatTime', dataIndex: 'creatTime',
@ -2417,7 +2512,7 @@ const TransporTationTable = (props) => {
</div> </div>
); )
}, },
}, },
], tab3: [ ], tab3: [
@ -2483,16 +2578,25 @@ const TransporTationTable = (props) => {
} }
}, },
{ {
title: '乡镇编码', title: '所属乡镇',
search: false, search: false,
dataIndex: 'time3', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
width: 120,
width: 140,
render: (dom, record) => { render: (dom, record) => {
return record.townshipCode const targetValue = record.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}, },
fieldProps: { fieldProps: {
getPopupContainer: (c) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, { }, {
title: '起点地名', title: '起点地名',
@ -3536,6 +3640,7 @@ const TransporTationTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'creatTime', dataIndex: 'creatTime',
@ -3592,7 +3697,7 @@ const TransporTationTable = (props) => {
</div> </div>
); )
}, },
}, },
], tab4: [ ], tab4: [
@ -3778,7 +3883,7 @@ const TransporTationTable = (props) => {
</div> </div>
); )
}, },
}, },
] ]
@ -3836,7 +3941,7 @@ const TransporTationTable = (props) => {
}} }}
scroll={{ x: 800 }} scroll={{ x: 800 }}
options={false} options={false}
ref={c => { finishedProductTable = c; }} ref={c => { finishedProductTable = c }}
style={{ width: "100% ", overflow: "auto", height: '760px' }} style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id' rowKey='id'
onReset={(v) => { onReset={(v) => {
@ -3845,7 +3950,7 @@ const TransporTationTable = (props) => {
rowSelection={{ rowSelection={{
selectedRowKeys: rowSelected, selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => { onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys); setRowSelected(selectedRowKeys)
}, },
}} }}
columns={columns[activeKey]} columns={columns[activeKey]}
@ -3859,8 +3964,8 @@ const TransporTationTable = (props) => {
level: '县', level: '县',
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query))
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
@ -3875,8 +3980,8 @@ const TransporTationTable = (props) => {
level: '乡', level: '乡',
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query))
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data) }) : res.payload.data)
@ -3889,7 +3994,7 @@ const TransporTationTable = (props) => {
level: '村', level: '村',
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getRoadway(query)) const res = await dispatch(getRoadway(query))
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
@ -3904,7 +4009,7 @@ const TransporTationTable = (props) => {
type: 'road', type: 'road',
entryName: sitename entryName: sitename
} }
setRowSelected([]); setRowSelected([])
const res = await dispatch(getProject(query)) const res = await dispatch(getProject(query))
console.log('56666666', res) console.log('56666666', res)
return { return {
@ -3964,7 +4069,7 @@ const data = [
{ name: "路线名称", type: 'routeName' }, { name: "路线名称", type: 'routeName' },
{ name: "路线代码", type: 'routeCode' }, { name: "路线代码", type: 'routeCode' },
{ name: "路段序号", type: 'sectionNo' }, { name: "路段序号", type: 'sectionNo' },
{ name: "乡镇编码", type: 'townshipCode' }, { name: "所属乡镇", type: 'townshipCode' },
{ name: "起点地名", type: 'startingPlaceName' }, { name: "起点地名", type: 'startingPlaceName' },
{ name: "起点桩号", type: 'startStation' }, { name: "起点桩号", type: 'startStation' },
{ name: "起点分界点类别", type: 'categoryOfStartingPointAndDividingPoint' }, { name: "起点分界点类别", type: 'categoryOfStartingPointAndDividingPoint' },
@ -4038,7 +4143,7 @@ const data = [
{ name: "面层厚度", type: 'surfaceThickness' }, { name: "面层厚度", type: 'surfaceThickness' },
] ]
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, depMessage, villageList } = state; const { auth, depMessage, villageList } = state
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -4056,6 +4161,6 @@ function mapStateToProps (state) {
depLoading: depMessage.isRequesting, depLoading: depMessage.isRequesting,
depData, depData,
villageList: villageList?.data || [] villageList: villageList?.data || []
};
} }
export default connect(mapStateToProps)(TransporTationTable); }
export default connect(mapStateToProps)(TransporTationTable)

118
web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

@ -1,8 +1,9 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react'
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Tooltip, Table } from 'antd' import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Tooltip, Table } from 'antd'
import { ExclamationCircleOutlined } from '@ant-design/icons'; import { ExclamationCircleOutlined } from '@ant-design/icons'
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck'; import { getVillageList } from "../actions/infor"
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck'
import moment from 'moment' import moment from 'moment'
import Adjustment from '../components/adjustment' import Adjustment from '../components/adjustment'
import '../components/maintenanceTable.less' import '../components/maintenanceTable.less'
@ -22,17 +23,53 @@ const MaintenanceSpotCheck = (props) => {
const [reportData, setReportData] = useState([]) const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([]) const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]); const [dateRange, setDateRange] = useState([])
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
const [expandedRowKeys, setExpandedRowKeys] = useState([]); const [expandedRowKeys, setExpandedRowKeys] = useState([])
const [isAdjustment, setIsAdjustment] = useState(false); const [isAdjustment, setIsAdjustment] = useState(false)
const [editData, setEditData] = useState({}); const [editData, setEditData] = useState({})
const [keyword, setKeyword] = useState(""); const [keyword, setKeyword] = useState("")
const roadCode = [
{ title: "八一乡", value: "360121206000" },
{ title: "东新乡", value: "360121205000" },
{ title: "富山乡", value: "360121204000" },
{ title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" },
{ title: "黄马乡", value: "360121203000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "向塘镇", value: "360121101000" },
{ title: "银三角管委会", value: "360121471000" },
{ title: "幽兰镇", value: "360121104000" },
]
const [village, setVillage] = useState()
useEffect(() => {
const fetchData = async () => {
try {
const res = await dispatch(getVillageList({}))
let data = res.payload.data
console.log(data)
data.map(s => {
setVillage(s)
})
} catch (error) {
console.error(error)
}
}
fetchData()
//里层列名 }, [dispatch])
// console.log(village)
const columns = [ const columns = [
{ {
title: '抽查日期', title: '抽查日期',
@ -46,19 +83,19 @@ const MaintenanceSpotCheck = (props) => {
dataIndex: 'countyPercentage', dataIndex: 'countyPercentage',
}, },
{ {
title: '抽查县道', title: '抽查县道(公里)',
key: 'spotCountyRoadCount', key: 'countryMil',
dataIndex: 'spotCountyRoadCount', dataIndex: 'countryMil',
}, },
{ {
title: '抽查乡道', title: '抽查乡道(公里)',
key: 'spotTownRoadCount', key: 'townMil',
dataIndex: 'spotTownRoadCount', dataIndex: 'townMil',
}, },
{ {
title: '抽查村道', title: '抽查村道(公里)',
key: 'spotVillageRoadCount', key: 'villageMil',
dataIndex: 'spotVillageRoadCount', dataIndex: 'villageMil',
}, },
{ {
title: '操作', title: '操作',
@ -103,9 +140,9 @@ const MaintenanceSpotCheck = (props) => {
const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue })) const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue }))
setPreviewId(res?.payload.data?.previewId) setPreviewId(res?.payload.data?.previewId)
form.setFieldsValue({ form.setFieldsValue({
'spotCountyRoadCount': res?.payload.data?.spotCountyRoadCount, 'countryMil': res?.payload.data?.countryMil,
'spotTownRoadCount': res?.payload.data?.spotTownRoadCount, 'townMil': res?.payload.data?.townMil,
'spotVillageRoadCount': res?.payload.data?.spotVillageRoadCount, 'villageMil': res?.payload.data?.villageMil,
}) })
} }
}) })
@ -186,14 +223,27 @@ const MaintenanceSpotCheck = (props) => {
columns={ columns={
[ [
{ {
title: '道路类型', key: 'level', dataIndex: 'level', render: (_, r) => r?.road?.level ? (r?.road?.level + '道') : '--' title: '所属乡镇', key: 'townshipCode', dataIndex: 'townshipCode', render: (_, r) => {
const targetValue = r?.road?.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue)
if (foundItem) {
return foundItem.title
} else {
return "--"
}
}
}, },
{ title: '所属行政村', key: 'villageId', dataIndex: 'villageId', render: (_, r) => r.road?.villageId === village.id ? village.name : '--' },
{ title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' }, { title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' },
{ title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' }, { title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' },
{ title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' }, // { title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' },
{ title: '起点地名', key: 'startingPlaceName', dataIndex: 'startingPlaceName', render: (_, r) => r.road?.startingPlaceName || '--' }, { title: '起点桩号', key: 'startStation', dataIndex: 'startStation', render: (_, r) => r.road?.startStation || '--' },
{ title: '止点地名', key: 'stopPlaceName', dataIndex: 'stopPlaceName', render: (_, r) => r.road?.stopPlaceName || '--' }, { title: '止点桩号', key: 'stopStation', dataIndex: 'stopStation', render: (_, r) => r.road?.stopStation || '--' },
{ title: '里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' }, { title: '技术等级', key: 'technicalLevel', dataIndex: 'technicalLevel', render: (_, r) => r.road?.technicalLevel || '--' },
{ title: '路面类型', key: 'pavementType', dataIndex: 'pavementType', render: (_, r) => r.road?.pavementType || '--' },
{ title: '路面宽度', key: 'pavementWidth', dataIndex: 'pavementWidth', render: (_, r) => r.road?.pavementWidth || '--' },
{ title: '路基宽度', key: 'subgradeWidth', dataIndex: 'subgradeWidth', render: (_, r) => r.road?.subgradeWidth || '--' },
{ title: '桩号里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' },
{ title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' }, { title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' },
{ {
title: '操作', title: '操作',
@ -243,7 +293,7 @@ const MaintenanceSpotCheck = (props) => {
form.resetFields() form.resetFields()
setVis(false) setVis(false)
} }
}); })
}) })
}}> }}>
<Form form={form}> <Form form={form}>
@ -269,13 +319,13 @@ const MaintenanceSpotCheck = (props) => {
}}> }}>
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button> <Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item> </Form.Item>
<Form.Item label='抽查县道(条)' name='spotCountyRoadCount'> <Form.Item label='抽查县道(公里)' name='countryMil'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
<Form.Item label='抽查乡道(条)' name='spotTownRoadCount'> <Form.Item label='抽查乡道(公里)' name='townMil'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
<Form.Item label='抽查村道(条)' name='spotVillageRoadCount'> <Form.Item label='抽查村道(公里)' name='villageMil'>
<Input disabled /> <Input disabled />
</Form.Item> </Form.Item>
</Form> </Form>
@ -313,4 +363,4 @@ function mapStateToProps (state) {
} }
} }
export default connect(mapStateToProps)(MaintenanceSpotCheck); export default connect(mapStateToProps)(MaintenanceSpotCheck)

48
web/client/src/sections/organization/components/depModal.js

@ -1,35 +1,31 @@
import React, { useRef, useState, useEffect } from 'react'; import React, { useRef, useState, useEffect } from 'react'
import { connect } from 'react-redux'; import { connect } from 'react-redux'
import { Spin, Card, Modal, TreeSelect } from 'antd'; import { Spin, Card, Modal, TreeSelect } from 'antd'
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'
const DepModal = (props) => { const DepModal = (props) => {
const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props
console.log('data', data) console.log('data', data)
const formRef = useRef(); const formRef = useRef()
const roadCode = [ const roadCode = [
{ title: "莲塘镇", value: "360121100000" }, { title: "八一乡", value: "360121206000" },
{ title: "向塘镇", value: "360121101000" }, { title: "东新乡", value: "360121205000" },
{ title: "三江镇", value: "360121102000" }, { title: "富山乡", value: "360121204000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "幽兰镇", value: "360121104000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "冈上镇", value: "360121107000" }, { title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" }, { title: "广福镇", value: "360121108000" },
//{ title: "昌东镇", value: "360121191000" }, { title: "黄马乡", value: "360121203000" },
//{ title: "麻丘镇", value: "360121192000" }, { title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" }, { title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" }, { title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" }, { title: "塔城乡", value: "360121202000" },
{ title: "黄马乡", value: "360121203000" }, { title: "塘南镇", value: "360121103000" },
{ title: "富山乡", value: "360121204000" }, { title: "武阳镇", value: "360121106000" },
//{ title: "东新乡", value: "360121205000" }, { title: "向塘镇", value: "360121101000" },
{ title: "八一乡", value: "360121206000" }, { title: "银三角管委会", value: "360121471000" },
//{ title: "小蓝经济开发区", value: "360121403000" }, { title: "幽兰镇", value: "360121104000" },
{ title: "银三角管理委员会", value: "360121471000" },
// { title: "五星垦殖场", value: "360121501000" },
// { title: "良种繁殖场", value: "360121572000" },
] ]
useEffect(() => { useEffect(() => {
//console.log('depData', depData) //console.log('depData', depData)
@ -46,7 +42,7 @@ const DepModal = (props) => {
} }
onConfirm(value) onConfirm(value)
} else { } else {
onConfirm(values); onConfirm(values)
} }
} }
@ -113,7 +109,7 @@ const DepModal = (props) => {
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { depMessage } = state; const { depMessage } = state
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
@ -134,7 +130,7 @@ function mapStateToProps(state) {
return { return {
loading: depMessage.isRequesting, loading: depMessage.isRequesting,
depData, depData,
}; }
} }
export default connect(mapStateToProps)(DepModal); export default connect(mapStateToProps)(DepModal)
Loading…
Cancel
Save