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
aeae7865
Commit
aeae7865
authored
Aug 10, 2022
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
16dcf959
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
8 deletions
+35
-8
data.ts
src/biz/jgfwnl/data.ts
+12
-4
serverConfig.ts
src/config/serverConfig.ts
+1
-1
interfaceService.ts
src/data/interface/interfaceService.ts
+22
-3
No files found.
src/biz/jgfwnl/data.ts
View file @
aeae7865
...
...
@@ -77,12 +77,14 @@ export async function getCSFX(req, res) {
let
ret
:
any
=
{};
let
月度测试里程分布测试
data
=
[
{
key
:
"2020.8"
,
value
:
"546km"
},
{
key
:
"2020.9"
,
value
:
"124km"
},
{
key
:
"2020.10"
,
value
:
"791km"
},
{
key
:
"2020.11"
,
value
:
"135km"
},
{
key
:
"2020.12"
,
value
:
"264km"
},
{
key
:
"2021.1"
,
value
:
"546km"
},
{
key
:
"2021.2"
,
value
:
"124km"
},
{
key
:
"2021.3"
,
value
:
"791km"
},
{
key
:
"2021.4"
,
value
:
"135km"
},
{
key
:
"2021.5"
,
value
:
"264km"
},
{
key
:
"2021.6"
,
value
:
"485km"
},
{
key
:
"2021.7"
,
value
:
"362km"
},
{
key
:
"2021.8"
,
value
:
"132km"
},
{
key
:
"2021.9"
,
value
:
"783km"
},
{
key
:
"2021.10"
,
value
:
"459km"
},
{
key
:
"2021.11"
,
value
:
"631km"
},
{
key
:
"2021.12"
,
value
:
"587km"
},
{
key
:
"2022.1"
,
value
:
"486km"
},
{
key
:
"2022.2"
,
value
:
"898km"
},
{
key
:
"2022.3"
,
value
:
"213km"
},
{
key
:
"2022.4"
,
value
:
"765km"
},
{
key
:
"2022.5"
,
value
:
"456km"
},
{
key
:
"2022.6"
,
value
:
"913km"
},
{
key
:
"2022.7"
,
value
:
"566km"
},
{
key
:
"2022.8"
,
value
:
"311km"
}
];
let
月度测试里程分布功能测试
data
=
[
{
key
:
"2020.8"
,
value
:
"546km"
},
{
key
:
"2020.9"
,
value
:
"124km"
},
{
key
:
"2020.10"
,
value
:
"791km"
},
{
key
:
"2020.11"
,
value
:
"135km"
},
{
key
:
"2020.12"
,
value
:
"264km"
},
{
key
:
"2021.1"
,
value
:
"460km"
},
{
key
:
"2021.2"
,
value
:
"240km"
},
{
key
:
"2021.3"
,
value
:
"901km"
},
{
key
:
"2021.4"
,
value
:
"350km"
},
{
key
:
"2021.5"
,
value
:
"640km"
},
{
key
:
"2021.6"
,
value
:
"850km"
},
{
key
:
"2021.7"
,
value
:
"602km"
},
{
key
:
"2021.8"
,
value
:
"320km"
},
{
key
:
"2021.9"
,
value
:
"830km"
},
{
key
:
"2021.10"
,
value
:
"509km"
},
{
key
:
"2021.11"
,
value
:
"310km"
},
{
key
:
"2021.12"
,
value
:
"870km"
},
{
key
:
"2022.1"
,
value
:
"860km"
},
{
key
:
"2022.2"
,
value
:
"980km"
},
{
key
:
"2022.3"
,
value
:
"103km"
},
...
...
@@ -93,12 +95,14 @@ export async function getCSFX(req, res) {
let
月度测试时长分布测试
data
=
[
{
key
:
"2020.8"
,
value
:
"546h"
},
{
key
:
"2020.9"
,
value
:
"124h"
},
{
key
:
"2020.10"
,
value
:
"791h"
},
{
key
:
"2020.11"
,
value
:
"135h"
},
{
key
:
"2020.12"
,
value
:
"264h"
},
{
key
:
"2021.1"
,
value
:
"546h"
},
{
key
:
"2021.2"
,
value
:
"124h"
},
{
key
:
"2021.3"
,
value
:
"791h"
},
{
key
:
"2021.4"
,
value
:
"135h"
},
{
key
:
"2021.5"
,
value
:
"264h"
},
{
key
:
"2021.6"
,
value
:
"485h"
},
{
key
:
"2021.7"
,
value
:
"362h"
},
{
key
:
"2021.8"
,
value
:
"132h"
},
{
key
:
"2021.9"
,
value
:
"783h"
},
{
key
:
"2021.10"
,
value
:
"459h"
},
{
key
:
"2021.11"
,
value
:
"631h"
},
{
key
:
"2021.12"
,
value
:
"587h"
},
{
key
:
"2022.1"
,
value
:
"486h"
},
{
key
:
"2022.2"
,
value
:
"898h"
},
{
key
:
"2022.3"
,
value
:
"213h"
},
{
key
:
"2022.4"
,
value
:
"765h"
},
{
key
:
"2022.5"
,
value
:
"456h"
},
{
key
:
"2022.6"
,
value
:
"913h"
},
{
key
:
"2022.7"
,
value
:
"566h"
},
{
key
:
"2022.8"
,
value
:
"311h"
}
];
let
月度测试时长分布功能测试
data
=
[
{
key
:
"2020.8"
,
value
:
"546h"
},
{
key
:
"2020.9"
,
value
:
"124h"
},
{
key
:
"2020.10"
,
value
:
"791h"
},
{
key
:
"2020.11"
,
value
:
"135h"
},
{
key
:
"2020.12"
,
value
:
"264h"
},
{
key
:
"2021.1"
,
value
:
"460h"
},
{
key
:
"2021.2"
,
value
:
"240h"
},
{
key
:
"2021.3"
,
value
:
"901h"
},
{
key
:
"2021.4"
,
value
:
"350h"
},
{
key
:
"2021.5"
,
value
:
"640h"
},
{
key
:
"2021.6"
,
value
:
"850h"
},
{
key
:
"2021.7"
,
value
:
"602h"
},
{
key
:
"2021.8"
,
value
:
"320h"
},
{
key
:
"2021.9"
,
value
:
"830h"
},
{
key
:
"2021.10"
,
value
:
"509h"
},
{
key
:
"2021.11"
,
value
:
"310h"
},
{
key
:
"2021.12"
,
value
:
"870h"
},
{
key
:
"2022.1"
,
value
:
"860h"
},
{
key
:
"2022.2"
,
value
:
"980h"
},
{
key
:
"2022.3"
,
value
:
"103h"
},
...
...
@@ -110,11 +114,13 @@ export async function getCSFX(req, res) {
let
企业测试里程测试分布
data
=
[
{
key
:
"百度"
,
value
:
"46km"
},
{
key
:
"滴滴"
,
value
:
"59km"
},
{
key
:
"阿里"
,
value
:
"86km"
},
{
key
:
"丰田"
,
value
:
"71km"
},
{
key
:
"大众"
,
value
:
"59km"
},
{
key
:
"商汤"
,
value
:
"56km"
},
{
key
:
"AutoX"
,
value
:
"43km"
},
{
key
:
"小马易车"
,
value
:
"36km"
},
{
key
:
"上汽红岩"
,
value
:
"67km"
}
{
key
:
"AutoX"
,
value
:
"43km"
},
{
key
:
"小马易车"
,
value
:
"36km"
},
{
key
:
"上汽红岩"
,
value
:
"67km"
},
{
key
:
"阿利昂斯"
,
value
:
"17km"
},
{
key
:
"宝马"
,
value
:
"42km"
},
{
key
:
"吉利汽车"
,
value
:
"11km"
},
{
key
:
"上汽通用"
,
value
:
"67km"
},
{
key
:
"图森未来"
,
value
:
"53km"
}
];
let
企业测试里程功能测试分布
data
=
[
{
key
:
"百度"
,
value
:
"39km"
},
{
key
:
"滴滴"
,
value
:
"43km"
},
{
key
:
"阿里"
,
value
:
"71km"
},
{
key
:
"丰田"
,
value
:
"51km"
},
{
key
:
"大众"
,
value
:
"53km"
},
{
key
:
"商汤"
,
value
:
"46km"
},
{
key
:
"AutoX"
,
value
:
"33km"
},
{
key
:
"小马易车"
,
value
:
"26km"
},
{
key
:
"上汽红岩"
,
value
:
"47km"
}
{
key
:
"AutoX"
,
value
:
"33km"
},
{
key
:
"小马易车"
,
value
:
"26km"
},
{
key
:
"上汽红岩"
,
value
:
"47km"
},
{
key
:
"阿利昂斯"
,
value
:
"27km"
},
{
key
:
"宝马"
,
value
:
"70km"
},
{
key
:
"吉利汽车"
,
value
:
"75km"
},
{
key
:
"上汽通用"
,
value
:
"67km"
},
{
key
:
"图森未来"
,
value
:
"72km"
}
];
let
企业测试里程分布
data
=
{
测试
:
{
unit
:
'km'
,
dataInfo
:
企业测试里程测试分布
data
},
功能测试
:
{
unit
:
'km'
,
dataInfo
:
企业测试里程功能测试分布
data
}};
ret
[
"api3"
]
=
getChartOutData
(
"企业测试里程分布"
,
企业测试里程分布
data
);
...
...
@@ -122,11 +128,13 @@ export async function getCSFX(req, res) {
let
企业测试时长测试分布
data
=
[
{
key
:
"百度"
,
value
:
"61h"
},
{
key
:
"滴滴"
,
value
:
"48h"
},
{
key
:
"阿里"
,
value
:
"78h"
},
{
key
:
"丰田"
,
value
:
"71h"
},
{
key
:
"大众"
,
value
:
"59h"
},
{
key
:
"商汤"
,
value
:
"56h"
},
{
key
:
"AutoX"
,
value
:
"53h"
},
{
key
:
"小马易车"
,
value
:
"37h"
},
{
key
:
"上汽红岩"
,
value
:
"67h"
}
{
key
:
"AutoX"
,
value
:
"53h"
},
{
key
:
"小马易车"
,
value
:
"37h"
},
{
key
:
"上汽红岩"
,
value
:
"67h"
},
{
key
:
"阿利昂斯"
,
value
:
"17km"
},
{
key
:
"宝马"
,
value
:
"42km"
},
{
key
:
"吉利汽车"
,
value
:
"11km"
},
{
key
:
"上汽通用"
,
value
:
"67km"
},
{
key
:
"图森未来"
,
value
:
"53km"
}
];
let
企业测试时长功能测试分布
data
=
[
{
key
:
"百度"
,
value
:
"66h"
},
{
key
:
"滴滴"
,
value
:
"43h"
},
{
key
:
"阿里"
,
value
:
"63h"
},
{
key
:
"丰田"
,
value
:
"51h"
},
{
key
:
"大众"
,
value
:
"53h"
},
{
key
:
"商汤"
,
value
:
"46h"
},
{
key
:
"AutoX"
,
value
:
"63h"
},
{
key
:
"小马易车"
,
value
:
"26h"
},
{
key
:
"上汽红岩"
,
value
:
"47h"
}
{
key
:
"AutoX"
,
value
:
"63h"
},
{
key
:
"小马易车"
,
value
:
"26h"
},
{
key
:
"上汽红岩"
,
value
:
"47h"
},
{
key
:
"阿利昂斯"
,
value
:
"27km"
},
{
key
:
"宝马"
,
value
:
"70km"
},
{
key
:
"吉利汽车"
,
value
:
"75km"
},
{
key
:
"上汽通用"
,
value
:
"67km"
},
{
key
:
"图森未来"
,
value
:
"72km"
}
];
let
企业测试时长分布
data
=
{
测试
:
{
unit
:
'h'
,
dataInfo
:
企业测试时长测试分布
data
},
功能测试
:
{
unit
:
'h'
,
dataInfo
:
企业测试时长功能测试分布
data
}};
ret
[
"api4"
]
=
getChartOutData
(
"企业测试时长分布"
,
企业测试时长分布
data
);
...
...
src/config/serverConfig.ts
View file @
aeae7865
...
...
@@ -9,7 +9,7 @@ export let port = Number(process.env.PORT) || Number(process.argv[3]) || 30001;
export
let
dbConfig
;
export
let
appConfig
;
export
let
mongoServerConstVal
;
export
let
systemLogPath
;
export
let
systemLogPath
;
export
let
mySqlConfig
;
const
ConfigName
=
"serverConfig.xml"
;
...
...
src/data/interface/interfaceService.ts
View file @
aeae7865
import
moment
=
require
(
"moment"
)
import
{
get
}
from
"../../util/request"
;
let
月里程数据
:
any
=
[{
key
:
"2021.01"
,
count
:
"31km"
,
autoCount
:
"45km"
}];
//格式 [{key:"日期 格式是 2021.1", count:"测试里程", autoCount:"功能测试里程"}]
let
月里程数据
:
any
=
[{
key
:
"2021.01"
,
count
:
"31km"
,
autoCount
:
"45km"
}
,
{
key
:
"2021.02"
,
count
:
"42km"
,
autoCount
:
"75km"
},
{
key
:
"2020.02"
,
count
:
"42km"
,
autoCount
:
"75km"
},
{
key
:
"2022.08"
,
count
:
"42km"
,
autoCount
:
"75km"
}
];
//格式 [{key:"日期 格式是 2021.1", count:"测试里程", autoCount:"功能测试里程"}]
let
企业日里程数据
=
{};
//格式 {"企业名称":{count:"测试里程", autoCount:"功能测试里程"} }
let
lastMonths
=
""
;
//数据库源数据接口
export
async
function
getTestAnalysis
()
{
//在月里程数据集合中 从后往前拿20个月份的数据,动态的拿本月的数据 拼接好返回 不要改变源数据
let
{
newDateArr
,
whereDateArr
}
=
getPreMonthDay
(
20
);
let
monthMileage
=
[];
let
testMileage
=
[];
let
functionTestMileage
=
[];
let
testMileage
=
[];
//测试里程
let
functionTestMileage
=
[];
//功能测试里程
for
(
let
i
=
0
;
i
<
newDateArr
.
length
;
i
++
)
{
let
months
=
newDateArr
[
i
];
月里程数据
.
forEach
(
item
=>
{
...
...
@@ -22,6 +23,24 @@ export async function getTestAnalysis() {
}
})
}
let
months
=
moment
().
format
(
'YYYY.MM'
);
let
startTime
=
moment
().
format
(
"YYMM"
)
+
"01"
;
let
endTime
=
moment
().
format
(
"YYMM"
)
+
"31"
;
let
testList
=
await
getInterfaceData
(
startTime
,
endTime
,
1
);
let
testCount
=
0
;
testList
.
forEach
(
info
=>
{
let
{
time_day
,
enterprise
,
total_mileage
}
=
info
;
testCount
+=
total_mileage
;
});
let
functionList
=
await
getInterfaceData
(
startTime
,
endTime
,
2
);
let
functionCount
=
0
;
functionList
.
forEach
(
info
=>
{
let
{
time_day
,
enterprise
,
auto_mileage
}
=
info
;
functionCount
+=
auto_mileage
;
});
testMileage
.
push
({
key
:
months
,
value
:
testCount
});
functionTestMileage
.
push
({
key
:
months
,
value
:
functionCount
});
}
...
...
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