Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
motorCity
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
motorCity
Commits
38a33cb6
Commit
38a33cb6
authored
Dec 15, 2022
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
cd77655c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
9 deletions
+34
-9
serverConfig.xml
serverConfig.xml
+1
-1
control.ts
src/biz/control.ts
+21
-2
data.ts
src/biz/jgfwnl/data.ts
+7
-1
cronJob.ts
src/data/cronJob.ts
+2
-2
csfxData.ts
src/data/dataCenterInterface/csfxData.ts
+3
-3
No files found.
serverConfig.xml
View file @
38a33cb6
...
@@ -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>
...
...
src/biz/control.ts
View file @
38a33cb6
...
@@ -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
});
}
}
...
...
src/biz/jgfwnl/data.ts
View file @
38a33cb6
...
@@ -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
src/data/cronJob.ts
View file @
38a33cb6
...
@@ -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
||
5
000
;
timeOut
=
timeOut
||
10
000
;
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
};
...
...
src/data/dataCenterInterface/csfxData.ts
View file @
38a33cb6
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment