rt-sim-training-client/src/api/runplan.js
2020-12-14 11:29:26 +08:00

500 lines
12 KiB
JavaScript

import request from '@/utils/request';
/** 获取运行图的车站列表*/
export function getStationList(mapId) {
return request({
url: `/api/runPlan/draft/station/${mapId}`,
method: 'get'
});
}
// 运行图填充通用数据
export function populatingGenericData(planId, data) {
return request({
url: `/api/runPlan/draft/${planId}`,
method: 'post',
data: data
});
}
/** 查询运行图获取数据*/
export function queryRunPlan(planId) {
return request({
url: `/api/runPlan/draft/${planId}`,
method: 'get'
});
}
// 根据mapId查询发布运行图列表
export function queryRunPlanList(mapId) {
return request({
url: `/api/runPlan/template/${mapId}/list`,
method: 'get'
});
}
// 从发布运行图创建新运行图
export function postCreatePlan(data) {
return request({
url: `/api/runPlan/draft/createFrom/${data.templateId}`,
method: 'post',
data: data
});
}
// 删除运行图
export function deleteRunPlan(planId) {
return request({
url: `/api/runPlan/draft/${planId}`,
method: 'delete'
});
}
// 修改运行图内容
export function putRunPlanDetail(data) {
return request({
url: `/api/runPlan/draft/${data.planId}`,
method: 'put',
data: data
});
}
/**
* 发布运行图
*/
export function publishRunPlan(data) {
return request({
url: `/api/runPlan/draft/${data.planId}/publish`,
method: 'post',
data: data
});
}
/** 导入真实运行图*/
export function importRunPlan(data) {
return request({
url: `/api/runPlan/draft/${data.mapId}/prdPlan`,
method: 'post',
data: data.runPlanList
});
}
/** 运行图*/
export function getRpListByMapId(mapId) {
return request({
url: `/api/runPlan/draft/${mapId}/list`,
method: 'get'
});
}
/** 获取地图原始站间运行等级 */
export function getMapStationRun(mapId) {
return request({
url: `/api/runPlan/draft/${mapId}/stationRunLevel`,
method: 'get'
});
}
/** 分页获取用户站间运行等级 */
export function getMapStationRunUser(mapId) {
return request({
url: `/api/runPlan/userData/${mapId}/runlevel/page?pageNum=1&pageSize=999`,
method: 'get'
});
}
/** 设置站间运行时间*/
export function setStationRunning(mapId, data) {
return request({
// url: `/api/runPlan/draft/${mapId}/stationRunning`,
url: `/api/runPlan/userData/${mapId}/runlevel`,
method: 'put',
data: data
});
}
/** 获取用户轨道停车时间*/
export function getStationStopTime(mapId) {
return request({
url: `/api/runPlan/userData/${mapId}/parktime/page?pageNum=1&pageSize=999`,
method: 'get'
});
}
/** 更新用户轨道停车时间*/
export function setStationStopTime(mapId, data) {
return request({
url: `/api/runPlan/userData/${mapId}/parktime`,
method: 'put',
data
});
}
/** 创建运行图*/
export function createEmptyPlan(data) {
return request({
url: `/api/runPlan/draft`,
method: 'post',
data: data
});
}
/** 查询运行图服务号是否存在*/
export function checkServiceNumberExist({ planId, serviceNumber }) {
return request({
url: `/api/runPlan/draft/${planId}/${serviceNumber}/service`,
method: 'get'
});
}
// /** 查询交路列表*/
// export function getRoutingList(planId) {
// return request({
// url: `/api/runPlan/draft/${planId}/routingList`,
// method: 'get'
// });
// }
/** 查询用户交路数据 (新版)*/
export function listUserRoutingData(mapId) {
return request({
// url: `/api/mapBuild/${mapId}/routingData`,
url: `/api/runPlan/userData/${mapId}/routing`,
method: 'get'
});
}
/** 根据交路查询交路区段列表*/
export function querySectionListByRouting({ planId, routingCode }) {
return request({
url: `/api/runPlan/draft/${planId}/${routingCode}/routingSectionList`,
method: 'get'
});
}
/** 有效性检查*/
export function planEffectiveCheck(planId) {
return request({
url: `/api/runPlan/draft/${planId}/check`,
method: 'get'
});
}
/** 增加计划*/
export function addPlanService(data) {
return request({
url: `/api/runPlan/draft/${data.planId}/service`,
method: 'post',
data: data
});
}
/** 修改计划*/
export function updatePlanService(planId, serviceNumber, data) {
return request({
url: `/api/runPlan/draft/${planId}/service/${serviceNumber}`,
method: 'put',
data: data
});
}
/** 删除计划*/
export function deletePlanService(data) {
return request({
url: `/api/runPlan/draft/${data.planId}/service/${data.serviceNumber}`,
method: 'delete'
});
}
/** 复制计划*/
export function duplicateService(data) {
return request({
url: `/api/runPlan/draft/${data.planId}/service/${data.serviceNumber}`,
method: 'post',
data: data
});
}
/** 增加任务*/
export function addPlanTrip(data) {
return request({
url: `/api/runPlan/draft/${data.planId}/${data.serviceNumber}/trip`,
method: 'post',
data: data
});
}
/** 删除任务*/
export function deletePlanTrip(params) {
return request({
url: `/api/runPlan/draft/${params.planId}/trip/${params.SDTNumber}`,
method: 'delete',
params: { deleteBefore: params.deleteBefore }
});
}
/** 修改任务*/
export function updatePlanTrip(data) {
return request({
url: `/api/runPlan/draft/${data.planId}/trip/${data.SDTNumber}`,
method: 'put',
data: data
});
}
/** 根据车次号查询交路 */
export function getRoutingBySDTNumber(params) {
// 旧版
// return request({
// url: `/api/runPlan/draft/${params.planId}/routing`,
// method: 'get',
// params: {
// SDTNumber: params.SDTNumber
// }
// });
// 新版
return request({
url: `/api/runPlan/draft/${params.planId}/userRouting`,
method: 'get',
params: {
SDTNumber: params.SDTNumber
}
});
}
/** 修改计划号*/
export function updateServiceNumber(planId, serviceNumber, newServiceNumber) {
return request({
url: `/api/runPlan/draft/${planId}/service/${serviceNumber}/serviceNumber?newServiceNumber=${newServiceNumber}`,
method: 'put'
});
}
/** 生成计划(新版)*/
export function generatePlanTrain(planId, data) {
return request({
url: `/api/runPlan/draft/${planId}/service/generate`,
method: 'post',
data
});
}
/** 修改任务车次号*/
export function updateTripNumber(planId, SDTNumber, tripNumber) {
return request({
url: `/api/runPlan/draft/${planId}/trip/${SDTNumber}/tripNumber?tripNumber=${tripNumber}`,
method: 'put'
});
}
/** 运行图仿真测试*/
export function runPlanNotify({ planId }) {
return request({
url: `/api/runPlan/draft/${planId}/simulation`,
method: 'get'
});
}
/** 获取运行计划模板列表*/
export function runPlanTemplateList(params) {
return request({
url: '/api/runPlan/template',
method: 'get',
params: params
});
}
/** 删除运行图模板*/
export function deleteRunPlanTemplate(planId) {
return request({
url: `/api/runPlan/template/${planId}`,
method: 'delete'
});
}
/** 生成通用每日运行图*/
export function generateCommonRunPlanEveryDay(planId, params) {
return request({
url: `/api/runPlan/template/generate/${planId}`,
method: 'post',
params
});
}
/** 获取运行计划每日列表*/
export function runPlanEveryDayList(params) {
return request({
url: '/api/runPlan/daily',
method: 'get',
params: params
});
}
/** 删除运行图每日计划*/
export function deleteRunPlanEveryDay(planId) {
return request({
url: `/api/runPlan/daily/${planId}`,
method: 'delete'
});
}
/** 分页查询加载计划*/
export function getRunPlanLoadList(params) {
return request({
url: `/api/runPlan/daily/runPlanLoad`,
method: 'get',
params: params
});
}
/** 创建加载计划*/
export function createRunPlanLoad(data) {
return request({
url: `/api/runPlan/daily/runPlanLoad`,
method: 'post',
data: data
});
}
/** 管理创建通用加载计划*/
export function createRunPlanCommon(data) {
return request({
url: `/api/runPlan/daily/runPlanLoad/common`,
method: 'post',
data: data
});
}
/** 删除加载计划*/
export function deleteRunPlanLoad(planId) {
return request({
url: `/api/runPlan/daily/runPlanLoad/${planId}`,
method: 'delete'
});
}
/** 查询模板运行图数据*/
export function queryRunPlanTemplate(planId) {
return request({
url: `/api/runPlan/template/${planId}`,
method: 'get'
});
}
/** 查询当日运行图数据*/
export function queryRunPlanDaily(planId) {
return request({
url: `/api/runPlan/daily/${planId}`,
method: 'get'
});
}
/** 获取模板运行图列表*/
export function listAllTempLateRunPlan() {
return request({
url: `/api/runPlan/template/all`,
method: 'get'
});
}
// 删除加载计划
export function deleteDailyRunPlanLoad(id) {
return request({
url: `/api/runPlan/daily/runPlanLoad/${id}`,
method: 'DELETE'
});
}
// 从加载计划创建每日计划
export function postDailyRunPlanLoadGenerate(id) {
return request({
url: `/api/runPlan/daily/runPlanLoad/${id}/generate`,
method: 'post'
});
}
// 复制地图运行图到其他地图
export function postRunPlanCopyToMaps(id, data) {
return request({
url: `/api/runPlan/daily/${id}/copyToMaps`,
method: 'post',
data: data
});
}
// 加载通用排班计划
export function postSchedulingCommonGenerate(mapId) {
return request({
url: `/api/v1/scheduling/generate/common?mapId=${mapId}`,
method: 'post'
});
}
// 从加载计划创建每日计划
export function postRunPlanTemplate(data) {
return request({
url: `/api/runPlan/template/${data.id}/copyAs/${data.mapId}?name=${data.name}`,
method: 'post'
});
}
// 根据地图起始-终点车站站台区段生成站间运行等级
export function postGenerateLevel(data) {
return request({
url: `/api/draftMap/runLevel/generate`,
method: 'post',
data
});
}
/** 根据地图交路一键生成生成所有站间运行等级 (新版)*/
export function generateAllStationRunData(mapId) {
return request({
url: `/api/draftMap/runLevel/generate/routing?mapId=${mapId}`,
method: 'post'
});
}
// 新建站间运行等级
export function postSaveLevel(data) {
return request({
url: `/api/draftMap/runLevel`,
method: 'post',
data
});
}
// 更新站间运行等级数据
export function putUploadLevel(id, data) {
return request({
url: `/api/draftMap/runLevel/${id}`,
method: 'put',
data
});
}
// 删除站间运行等级
export function deleteRunLevel(id) {
return request({
url: `/api/draftMap/runLevel/${id}`,
method: 'delete'
});
}
// 查询站间运行等级列表
export function getRunLevelList(mapId, params) {
return request({
url: `/api/draftMap/runLevel/${mapId}/listAll`,
method: 'get',
params
});
}
// 查询站间运行等级明细
export function getRunLevelDetail(id) {
return request({
url: `/api/draftMap/runLevel/${id}`,
method: 'get'
});
}