Browse Source

获取所有用户接口

release_0.0.1
巴林闲侠 3 years ago
parent
commit
fd2faa9401
  1. 23
      api/app/lib/controllers/organization/user.js
  2. 2
      api/app/lib/routes/organization/index.js
  3. 485
      scripts/0.0.1/data/工具脚本(无需执行)/桥梁_数据字段对应.json

23
api/app/lib/controllers/organization/user.js

@ -26,6 +26,28 @@ async function getUser (ctx, next) {
} }
} }
async function getUserAll (ctx, next) {
try {
const models = ctx.fs.dc.models;
const userRes = await models.User.findAll({
where: {
delete: false
},
attributes: { exclude: ['password', 'delete'] },
order: [['id', 'asc']],
})
ctx.status = 200;
ctx.body = userRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "获取所有用户信息失败"
}
}
}
async function creatUser (ctx, next) { async function creatUser (ctx, next) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -190,6 +212,7 @@ async function setPassword (ctx, next) {
module.exports = { module.exports = {
getUser, getUser,
getUserAll,
creatUser, creatUser,
updateUser, updateUser,
deleteUser, deleteUser,

2
api/app/lib/routes/organization/index.js

@ -13,6 +13,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['DEL/department/:depId'] = { content: '删除部门信息', visible: false }; app.fs.api.logAttr['DEL/department/:depId'] = { content: '删除部门信息', visible: false };
router.del('/department/:depId', Department.delDep); router.del('/department/:depId', Department.delDep);
app.fs.api.logAttr['GET/user'] = { content: '获取所有用户信息', visible: false };
router.get('/user', user.getUserAll);
app.fs.api.logAttr['GET/department/:depId/user'] = { content: '获取部门下用户信息', visible: false }; app.fs.api.logAttr['GET/department/:depId/user'] = { content: '获取部门下用户信息', visible: false };
router.get('/department/:depId/user', user.getUser); router.get('/department/:depId/user', user.getUser);

485
scripts/0.0.1/data/工具脚本(无需执行)/桥梁_数据字段对应.json

@ -1,390 +1,99 @@
{ {
"bridgeCode": { "bridgeCode": "桥梁代码",
"type": "string", "bridgeName": "桥梁名称",
"description": "桥梁代码" "centralStation": "中心桩号",
}, "crossingFigureType": "跨越地物类型",
"bridgeName": { "crossingFigureName": "跨越地物名称",
"type": "string", "natureOfCharges": "收费性质",
"description": "桥梁名称" "rampCode": "匝道编码",
}, "sectionType": "路段类型",
"centralStation": { "crossingFigureType1": "跨越地物类型1",
"type": "string", "crossingFigureName1": "跨越地物名称1",
"description": "中心桩号" "originalBridgeCode": "原桥梁代码",
}, "whetherWideRoadAndNarrowBridge": "是否宽路窄桥",
"crossingFigureType": { "isItInTheDirectoryOfLongAndLongBridges": "是否在长大桥梁目录中",
"type": "string", "whetherItIsACrossProvincialBridge": "是否跨省桥梁",
"description": "跨越地物类型" "interworkingType": "互通类型",
}, "interworkingForm": "互通形式",
"crossingFigureName": { "interworkingAndCrossoverMode": "互通交叉方式",
"type": "string", "bridgeClassification": "桥梁分类",
"description": "跨越地物名称" "totalLengthOfBridge": "桥梁全长",
}, "totalSpanLength": "跨径总长",
"natureOfCharges": { "mainSpanOfMainBridge": "主桥主跨",
"type": "string", "numberOfMainBridgeHoles": "主桥孔数",
"description": "收费性质" "spanCombination": "跨径组合",
}, "bridgeProperties": "桥梁性质",
"rampCode": { "designLoadClass": "设计荷载等级",
"type": "string", "superstructure": "上部结构",
"description": "匝道编码" "superstructureMaterials": "上部结构材料",
}, "bridgeDeckPavementType": "桥面铺装类型",
"sectionType": { "bridgeDeckWidth": "桥面宽",
"type": "string", "clearWidthOfBridgeDeck": "桥面净宽",
"description": "路段类型" "clearanceUnderBridge": "桥下净空",
}, "seismicGrade": "抗震等级",
"crossingFigureType1": { "navigationClass": "通航等级",
"type": "string", "abutmentType": "桥台类型",
"description": "跨越地物类型1" "pierType": "桥墩类型",
}, "typesOfPierAndAbutmentAntiCollisionFacilities": "墩台防撞设施类型",
"crossingFigureName1": { "expansionJointType": "伸缩缝类型",
"type": "string", "supportType": "支座类型",
"description": "跨越地物名称1" "characteristicsOfCurvedSlope": "弯坡斜特征",
}, "bridgeHeight": "桥梁高度",
"originalBridgeCode": { "sidewalkWidth": "人行道宽度",
"type": "string", "constructionUnit": "建设单位",
"description": "原桥梁代码" "completionTime": "建成时间",
}, "openingDate": "通车日期",
"whetherWideRoadAndNarrowBridge": { "reconstructionTime": "改建时间",
"type": "string", "totalCost": "总造价",
"description": "是否宽路窄桥" "nameOfDesignUnit": "设计单位名称",
}, "nameOfConstructionUnit": "施工单位名称",
"isItInTheDirectoryOfLongAndLongBridges": { "nameOfSupervisionUnit": "监理单位名称",
"type": "string", "natureOfConstruction": "建设性质",
"description": "是否在长大桥梁目录中" "evaluationDate": "评定日期",
}, "technicalConditionEvaluation": "技术状况评定",
"whetherItIsACrossProvincialBridge": { "assessmentUnit": "评定单位",
"type": "string", "locationOfMajorDiseases": "主要病害位置",
"description": "是否跨省桥梁" "diseaseDescription": "病害描述",
}, "takeControlMeasures": "采取管制措施",
"interworkingType": { "dateOfLastPeriodicInspection": "最近定期检查日期",
"type": "string", "natureOfManagementAndMaintenanceUnit": "管养单位性质",
"description": "互通类型" "managementAndMaintenanceUnit": "管养单位",
}, "supervisionUnit": "监管单位",
"interworkingForm": { "reconstructionConstructionUnit": "改造施工单位",
"type": "string", "whetherItIsASubsidyProjectOfTheMinistry": "是否部补助项目",
"description": "互通形式" "engineeringProperties": "工程性质",
}, "reconstructionPart": "改造部位",
"interworkingAndCrossoverMode": { "modificationCompletionDate": "改造完工日期",
"type": "string", "year1": "年份1",
"description": "互通交叉方式" "spanCombination1": "跨径组合1",
}, "investment1": "投资1",
"bridgeClassification": { "year2": "年份2",
"type": "string", "spanCombination2": "跨径组合2",
"description": "桥梁分类" "investment2": "投资2",
}, "year3": "年份3",
"totalLengthOfBridge": { "spanCombination3": "跨径组合3",
"type": "string", "investment3": "投资3",
"description": "桥梁全长" "year4": "年份4",
}, "spanCombination4": "跨径组合4",
"totalSpanLength": { "investment4": "投资4",
"type": "string", "year5": "年份5",
"description": "跨径总长" "spanCombination5": "跨径组合5",
}, "investment5": "投资5",
"mainSpanOfMainBridge": { "plannedFundCategory": "计划资金类别",
"type": "string", "plannedYear": "计划年度",
"description": "主桥主跨" "planDocumentNo": "计划文号",
}, "planItemUniqueCode": "计划项目唯一编码",
"numberOfMainBridgeHoles": { "plannedProjectType": "计划项目类型",
"type": "string", "planProjectName": "计划项目名称",
"description": "主桥孔数" "completionStatus": "完工情况",
}, "yearOfCompletion": "完工年度",
"spanCombination": { "reasonForChange": "变更原因",
"type": "string", "changeTime": "变更时间",
"description": "跨径组合" "reportingUnit": "填报单位",
}, "remarks": "备注",
"bridgeProperties": { "whetherOverpassBridge": "是否跨线桥",
"type": "string", "offLineBridgeOrNot": "是否线外桥",
"description": "桥梁性质" "whetherDangerousBridgeReconstruction": "是否危桥改造",
}, "districtcounty": "所在区县",
"designLoadClass": { "locationCity": "所在地市"
"type": "string",
"description": "设计荷载等级"
},
"superstructure": {
"type": "string",
"description": "上部结构"
},
"superstructureMaterials": {
"type": "string",
"description": "上部结构材料"
},
"bridgeDeckPavementType": {
"type": "string",
"description": "桥面铺装类型"
},
"bridgeDeckWidth": {
"type": "string",
"description": "桥面宽"
},
"clearWidthOfBridgeDeck": {
"type": "string",
"description": "桥面净宽"
},
"clearanceUnderBridge": {
"type": "string",
"description": "桥下净空"
},
"seismicGrade": {
"type": "string",
"description": "抗震等级"
},
"navigationClass": {
"type": "string",
"description": "通航等级"
},
"abutmentType": {
"type": "string",
"description": "桥台类型"
},
"pierType": {
"type": "string",
"description": "桥墩类型"
},
"typesOfPierAndAbutmentAntiCollisionFacilities": {
"type": "string",
"description": "墩台防撞设施类型"
},
"expansionJointType": {
"type": "string",
"description": "伸缩缝类型"
},
"supportType": {
"type": "string",
"description": "支座类型"
},
"characteristicsOfCurvedSlope": {
"type": "string",
"description": "弯坡斜特征"
},
"bridgeHeight": {
"type": "string",
"description": "桥梁高度"
},
"sidewalkWidth": {
"type": "string",
"description": "人行道宽度"
},
"constructionUnit": {
"type": "string",
"description": "建设单位"
},
"completionTime": {
"type": "string",
"description": "建成时间"
},
"openingDate": {
"type": "string",
"description": "通车日期"
},
"reconstructionTime": {
"type": "string",
"description": "改建时间"
},
"totalCost": {
"type": "string",
"description": "总造价"
},
"nameOfDesignUnit": {
"type": "string",
"description": "设计单位名称"
},
"nameOfConstructionUnit": {
"type": "string",
"description": "施工单位名称"
},
"nameOfSupervisionUnit": {
"type": "string",
"description": "监理单位名称"
},
"natureOfConstruction": {
"type": "string",
"description": "建设性质"
},
"evaluationDate": {
"type": "string",
"description": "评定日期"
},
"technicalConditionEvaluation": {
"type": "string",
"description": "技术状况评定"
},
"assessmentUnit": {
"type": "string",
"description": "评定单位"
},
"locationOfMajorDiseases": {
"type": "string",
"description": "主要病害位置"
},
"diseaseDescription": {
"type": "string",
"description": "病害描述"
},
"takeControlMeasures": {
"type": "string",
"description": "采取管制措施"
},
"dateOfLastPeriodicInspection": {
"type": "string",
"description": "最近定期检查日期"
},
"natureOfManagementAndMaintenanceUnit": {
"type": "string",
"description": "管养单位性质"
},
"managementAndMaintenanceUnit": {
"type": "string",
"description": "管养单位"
},
"supervisionUnit": {
"type": "string",
"description": "监管单位"
},
"reconstructionConstructionUnit": {
"type": "string",
"description": "改造施工单位"
},
"whetherItIsASubsidyProjectOfTheMinistry": {
"type": "string",
"description": "是否部补助项目"
},
"engineeringProperties": {
"type": "string",
"description": "工程性质"
},
"reconstructionPart": {
"type": "string",
"description": "改造部位"
},
"modificationCompletionDate": {
"type": "string",
"description": "改造完工日期"
},
"year1": {
"type": "string",
"description": "年份1"
},
"spanCombination1": {
"type": "string",
"description": "跨径组合1"
},
"investment1": {
"type": "string",
"description": "投资1"
},
"year2": {
"type": "string",
"description": "年份2"
},
"spanCombination2": {
"type": "string",
"description": "跨径组合2"
},
"investment2": {
"type": "string",
"description": "投资2"
},
"year3": {
"type": "string",
"description": "年份3"
},
"spanCombination3": {
"type": "string",
"description": "跨径组合3"
},
"investment3": {
"type": "string",
"description": "投资3"
},
"year4": {
"type": "string",
"description": "年份4"
},
"spanCombination4": {
"type": "string",
"description": "跨径组合4"
},
"investment4": {
"type": "string",
"description": "投资4"
},
"year5": {
"type": "string",
"description": "年份5"
},
"spanCombination5": {
"type": "string",
"description": "跨径组合5"
},
"investment5": {
"type": "string",
"description": "投资5"
},
"plannedFundCategory": {
"type": "string",
"description": "计划资金类别"
},
"plannedYear": {
"type": "string",
"description": "计划年度"
},
"planDocumentNo": {
"type": "string",
"description": "计划文号"
},
"planItemUniqueCode": {
"type": "string",
"description": "计划项目唯一编码"
},
"plannedProjectType": {
"type": "string",
"description": "计划项目类型"
},
"planProjectName": {
"type": "string",
"description": "计划项目名称"
},
"completionStatus": {
"type": "string",
"description": "完工情况"
},
"yearOfCompletion": {
"type": "string",
"description": "完工年度"
},
"reasonForChange": {
"type": "string",
"description": "变更原因"
},
"changeTime": {
"type": "string",
"description": "变更时间"
},
"reportingUnit": {
"type": "string",
"description": "填报单位"
},
"remarks": {
"type": "string",
"description": "备注"
},
"whetherOverpassBridge": {
"type": "string",
"description": "是否跨线桥"
},
"offLineBridgeOrNot": {
"type": "string",
"description": "是否线外桥"
},
"whetherDangerousBridgeReconstruction": {
"type": "string",
"description": "是否危桥改造"
},
"districtcounty": {
"type": "string",
"description": "所在区县"
},
"locationCity": {
"type": "string",
"description": "所在地市"
}
} }
Loading…
Cancel
Save