Commit 38a33cb6 by 孙香冬

no message

parent cd77655c
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<token>09a98bc555474e058ef90b6cc6e23638</token> <token>09a98bc555474e058ef90b6cc6e23638</token>
</mapView> </mapView>
<!-- 图片地址 这里填本机地址 --> <!-- 图片地址 这里填本机地址 -->
<imagePath>192.168.0.105</imagePath> <imagePath>192.168.0.47</imagePath>
<!-- 地图中心点 --> <!-- 地图中心点 -->
<mapCenter> <mapCenter>
<lng>121.183574</lng> <lng>121.183574</lng>
......
...@@ -97,8 +97,27 @@ export async function initControlSocketServer(port) { ...@@ -97,8 +97,27 @@ export async function initControlSocketServer(port) {
export async function controlGetCarList(req, res) { export async function controlGetCarList(req, res) {
let {enterpriseVehicleList} = await getInterfaceByInterfaceName(dataCenterInterfaceConfig.enterpriseVehicleList, {}); let {enterpriseVehicleList} = await getInterfaceByInterfaceName(dataCenterInterfaceConfig.enterpriseVehicleList, {});
//todo 最后加鉴权 //todo 最后加鉴权
let carList = controlGetOnlieCarList();//todo 改这里 // let carList = controlGetOnlieCarList();//todo 改这里
res.send({carList}); let carList = [];
enterpriseVehicleList.forEach(info => {
let vehicleList = info.vehicleList
vehicleList.forEach(list => {
let {vin, enterprise, online} = list;
let isOnline = "";
switch (online) {
case 0:
isOnline = "离线";
break;
case 1:
isOnline = "在线";
break;
}
carList.push({vin, enterprise, isOnline});
})
})
// res.send({carList});
res.send({carList});
} }
......
...@@ -199,7 +199,7 @@ export async function carInfo(req, res) { ...@@ -199,7 +199,7 @@ export async function carInfo(req, res) {
alertData.list.forEach((item, index) => { alertData.list.forEach((item, index) => {
if (index >= 10) return if (index >= 10) return
let { alertDuration, alertType, positionTime, velocity } = item; let { alertDuration, alertType, positionTime, velocity } = item;
let alertDurationStr = `${alertDuration}S`; let alertDurationStr = `${alertDuration}`;
let alertTypeStr = alertType == 1? '违规开启自动驾驶模式' : "手动模式"; let alertTypeStr = alertType == 1? '违规开启自动驾驶模式' : "手动模式";
车辆违规列表.push([positionTime, alertTypeStr, alertDurationStr, `${velocity}km/h`]); 车辆违规列表.push([positionTime, alertTypeStr, alertDurationStr, `${velocity}km/h`]);
}); });
...@@ -225,6 +225,7 @@ export async function carInfo(req, res) { ...@@ -225,6 +225,7 @@ export async function carInfo(req, res) {
let isNull = false let isNull = false
let 监控视频列表 = []; let 监控视频列表 = [];
if (testVideoData && videoPictureData) { if (testVideoData && videoPictureData) {
let map = {}; let map = {};
videoPictureData.vehiclePhotoList.forEach(info => { videoPictureData.vehiclePhotoList.forEach(info => {
let { photo, photoChannel } = info; let { photo, photoChannel } = info;
...@@ -251,3 +252,7 @@ export async function carInfo(req, res) { ...@@ -251,3 +252,7 @@ export async function carInfo(req, res) {
res.send(ret); res.send(ret);
} }
function isNull() {
}
\ No newline at end of file
...@@ -39,7 +39,7 @@ export async function getInterfaceByInterfaceName(url, body) { ...@@ -39,7 +39,7 @@ export async function getInterfaceByInterfaceName(url, body) {
export async function getCarVideo(url, body) { export async function getCarVideo(url, body) {
let {err, res, reqData}:any = await get(url, body, {}); let {err, res, reqData}:any = await get(url, body, {});
if (reqData.code == 500) { if (reqData.code == 500) {
return {}; return false;
} }
if (reqData.data || reqData.resultData) return reqData.data || reqData.resultData; if (reqData.data || reqData.resultData) return reqData.data || reqData.resultData;
// return reqData.data; // return reqData.data;
...@@ -48,7 +48,7 @@ export async function getCarVideo(url, body) { ...@@ -48,7 +48,7 @@ export async function getCarVideo(url, body) {
function get(url:string, query?, headers?, timeOut?) { function get(url:string, query?, headers?, timeOut?) {
timeOut = timeOut || 5000; timeOut = timeOut || 10000;
if (!url || (url.search(/http:/) && url.search(/https:/)) ) throw new BizError(!url ? "请求地址为空" : "请求地址错误"); if (!url || (url.search(/http:/) && url.search(/https:/)) ) throw new BizError(!url ? "请求地址为空" : "请求地址错误");
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
let paramater:any = { url, json:true, timeout:timeOut }; let paramater:any = { url, json:true, timeout:timeOut };
......
...@@ -9,9 +9,9 @@ import { getInterfaceByInterfaceName } from "../cronJob"; ...@@ -9,9 +9,9 @@ import { getInterfaceByInterfaceName } from "../cronJob";
//企业测试 //企业测试
export async function getQycs() { export async function getQycs() {
const interfaceName = "企业历史里程及时长统计信息接口"; const interfaceName = "企业历史里程及时长统计信息接口";
let startTime = moment().format("YYYY-MM") + "-01"; // let startTime = moment().format("YYYY-MM") + "-01";
let endTime = moment().format('YYYY-MM-DD'); // let endTime = moment().format('YYYY-MM-DD');
let data = await getInterfaceByInterfaceName( dataCenterInterfaceConfig.enterpriseTestStatus, { startTime, endTime } ); let data = await getInterfaceByInterfaceName( dataCenterInterfaceConfig.enterpriseTestStatus, {} );
let { enterpriseTestStatusList } = data; let { enterpriseTestStatusList } = data;
if ( !Array.isArray(enterpriseTestStatusList) ) throw new SysError(SYSTEMERRORENUM.未按接口协议返回, interfaceName, "enterpriseTestStatusList 不是数组", enterpriseTestStatusList); if ( !Array.isArray(enterpriseTestStatusList) ) throw new SysError(SYSTEMERRORENUM.未按接口协议返回, interfaceName, "enterpriseTestStatusList 不是数组", enterpriseTestStatusList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment