|
|
@ -3,6 +3,7 @@ const { QueryTypes } = require('sequelize'); |
|
|
|
const moment = require('moment'); |
|
|
|
const xlsxDownload = require('../../../../utils/xlsxDownload.js'); |
|
|
|
const fs = require('fs'); |
|
|
|
const data = require('../../routes/data/index.js'); |
|
|
|
async function reportList(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
@ -1074,6 +1075,24 @@ async function roadSpotChange (ctx) { |
|
|
|
let content = '' |
|
|
|
let curOriginRoad = roadRes.find(item => item.id == originRoadId) |
|
|
|
let curChangeRoad = roadRes.find(item => item.id == changeRoadId) |
|
|
|
const level = curChangeRoad.level; |
|
|
|
let milData = {} |
|
|
|
if (level == '县') { |
|
|
|
milData = { countryMil: previewRes.countryMil + parseFloat(curChangeRoad.chainageMileage) - parseFloat(curOriginRoad.chainageMileage) } |
|
|
|
} else if (level == '乡') { |
|
|
|
milData = { townMil: previewRes.townMil + parseFloat(curChangeRoad.chainageMileage) - parseFloat(curOriginRoad.chainageMileage) } |
|
|
|
} else if (level == '村') { |
|
|
|
milData = { villageMil: previewRes.villageMil + parseFloat(curChangeRoad.chainageMileage) - parseFloat(curOriginRoad.chainageMileage) } |
|
|
|
} |
|
|
|
|
|
|
|
await models.RoadSpotCheckPreview.update({ |
|
|
|
...milData |
|
|
|
}, { |
|
|
|
where: { |
|
|
|
id: previewId |
|
|
|
}, |
|
|
|
transaction |
|
|
|
}) |
|
|
|
|
|
|
|
content = `将${curOriginRoad.routeName}从${curOriginRoad.startingPlaceName}到${curOriginRoad.stopPlaceName}改为${curChangeRoad.routeName}从${curChangeRoad.startingPlaceName}到${curChangeRoad.stopPlaceName}` |
|
|
|
|
|
|
|