Browse Source

公交路线

release_0.0.1
巴林闲侠 2 years ago
parent
commit
648e74178a
  1. 16
      api/app/lib/controllers/organization/department.js
  2. 2
      api/app/lib/routes/data/index.js
  3. 3
      api/log/development.log
  4. BIN
      scripts/0.0.1/data/工具脚本(无需执行)/data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx
  5. 5
      scripts/0.0.1/data/工具脚本(无需执行)/dataIn.js
  6. 6
      scripts/0.0.1/data/工具脚本(无需执行)/index.js
  7. 25
      scripts/0.0.1/data/工具脚本(无需执行)/公交线路_字段对应.json
  8. 25
      scripts/0.0.1/data/工具脚本(无需执行)/公交线路_数据字段对应.json
  9. 25
      scripts/0.0.1/data/工具脚本(无需执行)/公交线路_数据库表对应.json
  10. 29
      scripts/0.0.1/data/工具脚本(无需执行)/公交线路_数据脚本对应.sql

16
api/app/lib/controllers/organization/department.js

@ -121,6 +121,18 @@ async function delDep (ctx) {
getDep(d.dataValues)
}
const undeleteUserCount = await models.User.count({
where: {
departmentId: {
$in: depIds
},
delete: false
}
})
if (undeleteUserCount) {
throw '该部门下有用户,不能删除'
}
await models.Department.update({
delete: true,
}, {
@ -144,7 +156,9 @@ async function delDep (ctx) {
await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {}
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}

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

@ -45,7 +45,7 @@ module.exports = function (app, router, opts) {
router.post('/road/import', road.importIn);
app.fs.api.logAttr['GET/road'] = { content: '获取道路数据', visible: true };
router.post('/road', road.get);
router.get('/road', road.get);
app.fs.api.logAttr['put/road'] = { content: '编辑道路数据', visible: true };
router.put('/road', road.edit);

3
api/log/development.log

@ -7155,3 +7155,6 @@
2022-07-22 15:22:09.565 - info: [FS-AUTH] Inject auth and api mv into router.
2022-07-22 15:22:12.241 - error: path: /overspeed, error: ReferenceError: startTime is not defined
2022-07-22 15:22:51.819 - error: path: /overspeed, error: ReferenceError: startTime is not defined
2022-07-22 15:58:39.491 - debug: [FS-LOGGER] Init.
2022-07-22 15:58:39.611 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-22 15:58:39.611 - info: [FS-AUTH] Inject auth and api mv into router.

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

Binary file not shown.

5
scripts/0.0.1/data/工具脚本(无需执行)/dataIn.js

@ -122,6 +122,11 @@ try {
// n: '治超',
// tableName: 'overspeed',
// },
{
path: ['./data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx'],
n: '公交线路',
tableName: 'bus_line',
},
]
for (let f of fileList) {

6
scripts/0.0.1/data/工具脚本(无需执行)/index.js

@ -43,6 +43,7 @@ try {
let upperCaseRslt = rslt[0].dst
.replace(/\//g, ' ')
.replace(/'/g, '')
.replace(/:/g,'')
.trim()
.replace(/\s{2,}/g, '')
.replace(/-/g, ' ');
@ -91,6 +92,11 @@ try {
// n: '治超',
// tableName: 'overspeed'
// },
{
path: './data/公交/运营线路/(四公司)南昌公交运营线路基础信息表2022年6月(总表).xlsx',
n: '公交线路',
tableName: 'bus_line'
},
]
for (let f of fileList) {

25
scripts/0.0.1/data/工具脚本(无需执行)/公交线路_字段对应.json

@ -0,0 +1,25 @@
{
"公司": "company",
"车队": "fleet",
"车队长": "carCaptain",
"副车队长": "assistantCarCaptain",
"办公地点": "officeLocation",
"线路名称": "lineName",
"线路类型": "lineType",
"线路划分": "lineDivision",
"GPS编号": "gPSNumber",
"起点终点": "startingPointEndPoint",
"车辆数": "numberOfVehicles",
"全程公里数": "totalKilometers",
"票价": "ticketPrice",
"开通时间": "openingTime",
"运行时间": "runningTime",
"开班时间夏令": "openingTimeSummer",
"收班时间夏令": "shiftClosingTimeSummer",
"开班时间冬令": "openingTimeWinter",
"收班时间冬令": "shiftClosingTimeWinter",
"沿途站点上行": "uplinkOfStationsAlongTheWay",
"沿途站点下行": "downlinkOfStationsAlongTheWay",
"所属区域": "area",
"备注": "remarks"
}

25
scripts/0.0.1/data/工具脚本(无需执行)/公交线路_数据字段对应.json

@ -0,0 +1,25 @@
{
"company": "公司",
"fleet": "车队",
"carCaptain": "车队长",
"assistantCarCaptain": "副车队长",
"officeLocation": "办公地点",
"lineName": "线路名称",
"lineType": "线路类型",
"lineDivision": "线路划分",
"gPSNumber": "GPS编号",
"startingPointEndPoint": "起点终点",
"numberOfVehicles": "车辆数",
"totalKilometers": "全程公里数",
"ticketPrice": "票价",
"openingTime": "开通时间",
"runningTime": "运行时间",
"openingTimeSummer": "开班时间夏令",
"shiftClosingTimeSummer": "收班时间夏令",
"openingTimeWinter": "开班时间冬令",
"shiftClosingTimeWinter": "收班时间冬令",
"uplinkOfStationsAlongTheWay": "沿途站点上行",
"downlinkOfStationsAlongTheWay": "沿途站点下行",
"area": "所属区域",
"remarks": "备注"
}

25
scripts/0.0.1/data/工具脚本(无需执行)/公交线路_数据库表对应.json

@ -0,0 +1,25 @@
{
"公司": "company",
"车队": "fleet",
"车队长": "car_Captain",
"副车队长": "assistant_car_Captain",
"办公地点": "office_location",
"线路名称": "line_name",
"线路类型": "line_type",
"线路划分": "line_division",
"GPS编号": "gPS_number",
"起点终点": "starting_point_end_point",
"车辆数": "number_of_vehicles",
"全程公里数": "total_kilometers",
"票价": "ticket_Price",
"开通时间": "opening_time",
"运行时间": "running_time",
"开班时间夏令": "opening_time_summer",
"收班时间夏令": "shift_closing_time_summer",
"开班时间冬令": "opening_time_Winter",
"收班时间冬令": "shift_closing_time_winter",
"沿途站点上行": "uplink_of_stations_along_the_way",
"沿途站点下行": "downlink_of_stations_along_the_way",
"所属区域": "area",
"备注": "remarks"
}

29
scripts/0.0.1/data/工具脚本(无需执行)/公交线路_数据脚本对应.sql

@ -0,0 +1,29 @@
-- 公交线路
CREATE TABLE if not exists "bus_line" ( id serial not null );
CREATE unique index if not exists bus_line_id_uindex
ON bus_line (id); alter TABLE bus_line add constraint bus_line_pk primary key (id); alter TABLE bus_line add Company varchar(1024); comment
ON column bus_line.Company is '公司'; alter TABLE bus_line add Fleet varchar(1024); comment
ON column bus_line.Fleet is '车队'; alter TABLE bus_line add Car_Captain varchar(1024); comment
ON column bus_line.Car_Captain is '车队长'; alter TABLE bus_line add Assistant_Car_Captain varchar(1024); comment
ON column bus_line.Assistant_Car_Captain is '副车队长'; alter TABLE bus_line add Office_Location varchar(1024); comment
ON column bus_line.Office_Location is '办公地点'; alter TABLE bus_line add Line_Name varchar(1024); comment
ON column bus_line.Line_Name is '线路名称'; alter TABLE bus_line add Line_Type varchar(1024); comment
ON column bus_line.Line_Type is '线路类型'; alter TABLE bus_line add Line_Division varchar(1024); comment
ON column bus_line.Line_Division is '线路划分'; alter TABLE bus_line add GPS_Number varchar(1024); comment
ON column bus_line.GPS_Number is 'GPS编号'; alter TABLE bus_line add Starting_Point_End_Point varchar(1024); comment
ON column bus_line.Starting_Point_End_Point is '起点终点'; alter TABLE bus_line add Number_Of_Vehicles varchar(1024); comment
ON column bus_line.Number_Of_Vehicles is '车辆数'; alter TABLE bus_line add Total_Kilometers varchar(1024); comment
ON column bus_line.Total_Kilometers is '全程公里数'; alter TABLE bus_line add Ticket_Price varchar(1024); comment
ON column bus_line.Ticket_Price is '票价'; alter TABLE bus_line add Opening_Time varchar(1024); comment
ON column bus_line.Opening_Time is '开通时间'; alter TABLE bus_line add Running_Time varchar(1024); comment
ON column bus_line.Running_Time is '运行时间'; alter TABLE bus_line add Opening_Time_Summer varchar(1024); comment
ON column bus_line.Opening_Time_Summer is '开班时间夏令'; alter TABLE bus_line add Shift_Closing_Time_Summer varchar(1024); comment
ON column bus_line.Shift_Closing_Time_Summer is '收班时间夏令'; alter TABLE bus_line add Opening_Time_Winter varchar(1024); comment
ON column bus_line.Opening_Time_Winter is '开班时间冬令'; alter TABLE bus_line add Shift_Closing_Time_Winter varchar(1024); comment
ON column bus_line.Shift_Closing_Time_Winter is '收班时间冬令'; alter TABLE bus_line add Uplink_Of_Stations_Along_The_Way varchar(1024); comment
ON column bus_line.Uplink_Of_Stations_Along_The_Way is '沿途站点上行'; alter TABLE bus_line add Downlink_Of_Stations_Along_The_Way varchar(1024); comment
ON column bus_line.Downlink_Of_Stations_Along_The_Way is '沿途站点下行'; alter TABLE bus_line add Area varchar(1024); comment
ON column bus_line.Area is '所属区域'; alter TABLE bus_line add Remarks varchar(1024); comment
ON column bus_line.Remarks is '备注';
Loading…
Cancel
Save