明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
letian_backend
Project
Project
Details
Activity
Releases
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
zengfanpei
letian_backend
Commits
ee75da1e
Commit
ee75da1e
authored
Mar 19, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
66c1d6bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
statisticsController.js
controller/statisticsController.js
+25
-0
statisticsRouter.js
router/statisticsRouter.js
+2
-0
No files found.
controller/statisticsController.js
View file @
ee75da1e
...
@@ -492,6 +492,30 @@ async function getQualityInfoTrend(req, res, next) {
...
@@ -492,6 +492,30 @@ async function getQualityInfoTrend(req, res, next) {
next
(
error
);
next
(
error
);
}
}
}
}
async
function
getQualityInfoCount
(
req
,
res
,
next
)
{
try
{
let
search
=
{
time
:
{
$exists
:
true
}
};
if
((
req
.
body
.
startTime
&&
req
.
body
.
endTime
))
{
let
endTime
=
new
Date
(
req
.
body
.
endTime
);
endTime
.
setHours
(
23
);
endTime
.
setMinutes
(
59
);
endTime
.
setSeconds
(
59
);
let
startTime
=
new
Date
(
req
.
body
.
startTime
);
startTime
.
setHours
(
0
);
startTime
.
setMinutes
(
0
);
startTime
.
setSeconds
(
0
);
search
.
time
=
{
$gt
:
startTime
,
$lte
:
endTime
}
}
let
ret
=
await
DB
.
HeavyMetal
.
countDocuments
(
search
);
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
...
@@ -508,5 +532,6 @@ module.exports = {
...
@@ -508,5 +532,6 @@ module.exports = {
getIndustryDeviceCount
,
getIndustryDeviceCount
,
getEnvironmentalTrend
,
getEnvironmentalTrend
,
getQualityInfoTrend
,
getQualityInfoTrend
,
getQualityInfoCount
,
}
}
\ No newline at end of file
router/statisticsRouter.js
View file @
ee75da1e
...
@@ -26,6 +26,8 @@ router.post('/getIndustryDeviceCount', statisticsController.getIndustryDeviceCou
...
@@ -26,6 +26,8 @@ router.post('/getIndustryDeviceCount', statisticsController.getIndustryDeviceCou
router
.
post
(
'/getEnvironmentalTrend'
,
statisticsController
.
getEnvironmentalTrend
);
router
.
post
(
'/getEnvironmentalTrend'
,
statisticsController
.
getEnvironmentalTrend
);
// 工业大屏-产品质量信息-近七日变化
// 工业大屏-产品质量信息-近七日变化
router
.
post
(
'/getQualityInfoTrend'
,
statisticsController
.
getQualityInfoTrend
);
router
.
post
(
'/getQualityInfoTrend'
,
statisticsController
.
getQualityInfoTrend
);
// 工业大屏-产品质量信息-总量
router
.
post
(
'/getQualityInfoCount'
,
statisticsController
.
getQualityInfoCount
);
module
.
exports
=
router
;
module
.
exports
=
router
;
\ No newline at end of file
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