公交调度系统BS版 0.1
目录
字典表
字典操作全部由前端负责,主要有2种。
1、转换字典代码。
当pjax的pjax:success事件被触发(片段加载完成)
扫描容器内所有有 $(".nt-dictionary") 元素进行字典转换
--dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码
<span class="nt-dictionary" data-group="ScheduleType">out</span>
--to
<span>出场</span>
<!- dom标签为input时,如下 data-code为要转换的代码 -->
<input class="nt-dictionary" data-group="ScheduleType" data-code="out">
--to
<input value="出场">
<!- dom标签为select时 如下 data-code为要选中的项 -->
<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select>
--to
<select>
<option value="normal">正常班次</option>
<option value="out" selected>出场</option>
<option value="in">进场</option>
<option value="oil">加油</option>
<option value="temp">临加</option>
<option value="region">区间</option>
<option value="venting">放空</option>
<option value="major">放大站</option>
</select>
原标签的class 除nt-dictionary 外,其余均会被保留
2、dictionary.js提供如下方法自行使用 | 方法名 | 参数|返回| | ---- | ---- | ---- | ---- | | groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} | | getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}| | transformCode (转换字典代码)| (group, code) | 上行 |
动态jpa查询实现
参考调度系统枚举com.bsth.entity.search.SearchOperator
gps
实时gps接口
所有在线GPS: http://192.168.168.192:8080/transport_server/rtgps 根据设备号查询:http://192.168.168.192:8080/transport_server/rtgps/05B01901
Response:
{
"data":[
{
"companyCode":5,
"lineId":10329,
"deviceId":"05B01901",
"carparkNo":"00000000",
"stopNo":"7C890002",
"lon":121.549866,
"lat":31.238798,
"timestamp":1397104499000,
"speed":42.0,
"direction":245.9,
"state":0,
"upDown":0
}]
}
| -- | -- | -- |
|---|---|---|
| companyCode | int | 公司代码 |
| lineId | int | 线路编码 |
| deviceId | String | 设备编号 |
| carparkNo | String | 停车场编码 |
| stopNo | String | 站点编码 |
| lon | float | 经度 |
| lat | float | 纬度 |
| timestamp | long | 时间戳 |
| speed | float | 速度 |
| direction | float | 方向(角度) |
| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
进站数据
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| deviceId | String | 设备号 |
| lineId | int | 线路编码 |
| stopNo | long | 站点编码 |
| timestamp | long | 时间戳 |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
| createDate | Date | 创建时间 |
异常警报
大间隔
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| line | int | 线路编码 |
| station | String | 站点编码 |
| cVehicle | String | 当前车辆编码 |
| lastVehicle | String | 上一个车辆编码 |
| interval | long | 间隔时间(秒) |
| timestamp | long | 时间戳 |
| createDate | Date | 创建时间 |
超速
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| vehicle | String | 车辆编码 |
| line | int | 线路编码 |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
| lon | float | 经度 |
| lat | float | 纬度 |
| speed | float | 速度 |
| timestamp | long | 时间戳 |
| createDate | Date | 时间 |
越界
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| vehicle | String | 车辆编码 |
| line | int | 线路编码 |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
| lon | float | 经度 |
| lat | float | 纬度 |
| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值 |
| timestamp | long | 时间戳 |
| createDate | Date | 时间 |
越站
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| line | int | 线路编码 |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
| station | String | 站点编码 |
| vehicle | String | 车辆编码 |
| inData | Date | 进站时间 |
| outDate | Date | 出站时间 |
聚集
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| line | int | 线路编码 |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
| stations | String | 站点(多个用 , 号分隔。应该是连续站点) |
| vehicles | String | 车辆编码(多个用 , 号分隔) |
| timestamp | long | 时间戳 |
| createDate | Date | 时间 |
掉线
表名:
| .. | .. | .. |
|---|---|---|
| id | int | 主键 |
| line | int | 线路编码 |
| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
| vehicle | String | 车辆编码 |
| lon | float | 经度 |
| lat | float | 纬度 |
| timestamp | long | 时间戳 |
| createDate | Date | 时间 |
调度消息下发接口
http://192.168.168.192:8080/transport_server/message
Request:
{
"deviceId":12345,
"timestamp":44324,
"operCode":0x60,
"data":{
"companyCode":22,
"deviceId":"029L2222",
"timestamp":134326,
"instructType":00,
"dispatchInstruct":0x00,
"msgId":12345,
"alarmTime":201606012000,
"serviceState":00000000,
"txtContent":"你好"
}
}
| .. | .. | .. |
|---|---|---|
| deviceId | string | 设备编号 |
| timestamp | long | 时间戳(ms) |
| operCode | short | 一级协议 |
| data.companyCode | short | 公司代码 |
| data.deviceId | string | 设备编号 |
| data.timestamp | long | 时间戳 |
| data.instructType | short | 保留 默认0 |
| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。 |
| data.msgId | long | 同上 |
| data.alarmTime | long | 闹钟 MMddhhmm |
| data.serviceState | long | 多状态字节 先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。 |
| data.txtContent | string | 下发的消息文本 |
{
"deviceId":12345,
"timestamp":44324,
"operCode":0x64,
"data":{
"cityCode":22,
"deviceId":"029L2222",
"lineId":"134326"
}
}
| .. | .. | .. |
|---|---|---|
| deviceId | string | 设备编号 |
| timestamp | long | 时间戳(ms) |
| operCode | short | 一级协议 |
| data.cityCode | short | 城市区号 |
| data.deviceId | string | 设备编号 |
| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 |
{
"deviceId":12345,
"timestamp":44324,
"operCode":0xC0,
"data":{
"operCode":0x86,
"requestAck":0x06
}
}
| .. | .. | .. |
|---|---|---|
| deviceId | string | 设备编号 |
| timestamp | long | 时间戳(ms) |
| operCode | short | 一级协议 |
| data.operCode | short | 二级协议 |
| data.requestAck | short | 请求应答字 0x06同意 0x15不同意 |
Response:
{
"errCode":0
}
调度消息上传接口
上行POST地址:http://192.168.168.120:9088/control/upstream Request:
{
"deviceId":12345,
"timestamp":44324,
"status":0,
"operCode":0x80,
"data":{
"operCode":0x26,
"requestCode":22
}
}
| .. | .. | .. |
|---|---|---|
| deviceId | string | 设备编号 |
| timestamp | long | 时间戳(ms) |
| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 |
| operCode | short | 一级协议 消息确认将无数据 |
| data.operCode | short | 二级协议 |
| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 |
Response:
{
"errCode":0
}