明树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
141f898b
Commit
141f898b
authored
Oct 22, 2024
by
zengfanpei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c2df2c74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
collectIPSController.js
controller/collectIPSController.js
+8
-1
collectIPSResult.js
db/models/collectIPSResult.js
+4
-0
No files found.
controller/collectIPSController.js
View file @
141f898b
...
@@ -37,7 +37,14 @@ async function list(req, res, next) {
...
@@ -37,7 +37,14 @@ async function list(req, res, next) {
let
skip
=
(
page
-
1
)
*
pageSize
;
let
skip
=
(
page
-
1
)
*
pageSize
;
let
count
=
await
collectIPSModule
.
count
(
search
);
let
count
=
await
collectIPSModule
.
count
(
search
);
let
data
=
await
collectIPSModule
.
findList
(
search
,
{
skip
,
limit
:
pageSize
});
let
data
=
await
collectIPSModule
.
findList
(
search
,
{
skip
,
limit
:
pageSize
});
res
.
sendData
({
list
:
data
,
count
});
let
list
=
[];
for
(
let
index
=
0
;
index
<
data
.
length
;
index
++
)
{
let
element
=
data
[
index
].
toJSON
();
let
collectIPSResults
=
await
DB
.
CollectIPSResult
.
find
({
data
:
element
.
_id
}).
select
(
'deviceNumber name count time _id'
).
populate
({
path
:
"plan"
,
select
:
'name controlPlan'
});
element
.
collectIPSResults
=
collectIPSResults
;
list
.
push
(
element
)
}
res
.
sendData
({
list
,
count
});
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
...
db/models/collectIPSResult.js
View file @
141f898b
...
@@ -45,14 +45,18 @@ const collectIPSResultSchema = new Schema({
...
@@ -45,14 +45,18 @@ const collectIPSResultSchema = new Schema({
type
:
mongoose
.
Types
.
ObjectId
,
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
"CollectIPSType"
,
ref
:
"CollectIPSType"
,
comment
:
"虫子种类表id"
,
comment
:
"虫子种类表id"
,
ref
:
"CollectIPSType"
},
},
plan
:
{
plan
:
{
type
:
mongoose
.
Types
.
ObjectId
,
type
:
mongoose
.
Types
.
ObjectId
,
comment
:
"防治建议表id"
,
comment
:
"防治建议表id"
,
ref
:
"CollectIPSPlan"
},
},
data
:
{
data
:
{
type
:
mongoose
.
Types
.
ObjectId
,
type
:
mongoose
.
Types
.
ObjectId
,
comment
:
"硬件采集数据的id"
,
comment
:
"硬件采集数据的id"
,
ref
:
"CollectIPS"
},
},
...
...
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