明树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
f5fc6f34
Commit
f5fc6f34
authored
Jan 08, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
!
parent
d752f549
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
43 deletions
+43
-43
productDeepController.js
controller/productDeepController.js
+9
-9
productDirPlantController.js
controller/productDirPlantController.js
+8
-8
productPreController.js
controller/productPreController.js
+8
-8
productTracController.js
controller/productTracController.js
+9
-9
productltController.js
controller/productltController.js
+9
-9
No files found.
controller/productDeepController.js
View file @
f5fc6f34
...
@@ -27,15 +27,15 @@ async function listDeepPlant(req, res, next) {
...
@@ -27,15 +27,15 @@ async function listDeepPlant(req, res, next) {
}
}
const
count
=
await
DB
.
ProductDeep
.
countDocuments
(
search
);
const
count
=
await
DB
.
ProductDeep
.
countDocuments
(
search
);
let
list
=
await
DB
.
ProductDeep
.
find
(
search
).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
list
=
await
DB
.
ProductDeep
.
find
(
search
).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
namemap
=
await
getSccjMap
();
//
let namemap = await getSccjMap();
let
ret
=
[];
//
let ret = [];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
//
for (let index = 0; index < list.length; index++) {
const
element
=
list
[
index
];
//
const element = list[index];
element
.
agrPlantBase
=
namemap
[
element
.
agrPlantBase
];
//
element.agrPlantBase = namemap[element.agrPlantBase];
element
.
workshop
=
namemap
[
element
.
workshop
];
//
element.workshop = namemap[element.workshop];
ret
.
push
(
element
);
//
ret.push(element);
}
//
}
res
.
sendData
({
count
,
list
:
ret
});
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
...
controller/productDirPlantController.js
View file @
f5fc6f34
...
@@ -30,14 +30,14 @@ async function listDirectPlant(req, res, next) {
...
@@ -30,14 +30,14 @@ async function listDirectPlant(req, res, next) {
const
count
=
await
DB
.
ProductPlant
.
countDocuments
(
search
);
const
count
=
await
DB
.
ProductPlant
.
countDocuments
(
search
);
let
list
=
await
DB
.
ProductPlant
.
find
(
search
).
populate
({
path
:
"plantPlan"
}).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
list
=
await
DB
.
ProductPlant
.
find
(
search
).
populate
({
path
:
"plantPlan"
}).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
namemap
=
await
getSccjMap
();
//
let namemap = await getSccjMap();
let
ret
=
[];
//
let ret = [];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
//
for (let index = 0; index < list.length; index++) {
const
element
=
list
[
index
];
//
const element = list[index];
element
.
agrPlantBase
=
namemap
[
element
.
agrPlantBase
];
//
element.agrPlantBase = namemap[element.agrPlantBase];
ret
.
push
(
element
);
//
ret.push(element);
}
//
}
res
.
sendData
({
count
,
list
:
ret
});
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
...
controller/productPreController.js
View file @
f5fc6f34
...
@@ -28,14 +28,14 @@ async function listPrePlant(req, res, next) {
...
@@ -28,14 +28,14 @@ async function listPrePlant(req, res, next) {
}
}
const
count
=
await
DB
.
ProductPre
.
countDocuments
(
search
);
const
count
=
await
DB
.
ProductPre
.
countDocuments
(
search
);
let
list
=
await
DB
.
ProductPre
.
find
(
search
).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"sourcePlantProduct"
}).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
list
=
await
DB
.
ProductPre
.
find
(
search
).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"sourcePlantProduct"
}).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
namemap
=
await
getSccjMap
();
//
let namemap = await getSccjMap();
let
ret
=
[];
//
let ret = [];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
//
for (let index = 0; index < list.length; index++) {
const
element
=
list
[
index
];
//
const element = list[index];
element
.
agrPlantBase
=
namemap
[
element
.
agrPlantBase
];
//
element.agrPlantBase = namemap[element.agrPlantBase];
ret
.
push
(
element
);
//
ret.push(element);
}
//
}
res
.
sendData
({
count
,
list
:
ret
});
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
...
controller/productTracController.js
View file @
f5fc6f34
...
@@ -37,7 +37,7 @@ async function listTraceCode(req, res, next) {
...
@@ -37,7 +37,7 @@ async function listTraceCode(req, res, next) {
}
}
const
count
=
await
DB
.
ProTraceCode
.
countDocuments
(
search
);
const
count
=
await
DB
.
ProTraceCode
.
countDocuments
(
search
);
let
list
=
await
DB
.
ProTraceCode
.
find
(
search
).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
populate
({
path
:
"rawMatCul.proSteps.img"
}).
populate
({
path
:
"proProcess.proSteps.img"
}).
populate
({
path
:
"cjVideo"
}).
populate
({
path
:
"qualityInsReportImgs"
}).
populate
({
path
:
"flourMerchantImgs"
}).
populate
({
path
:
"pesticidetImgs"
}).
lean
();
let
list
=
await
DB
.
ProTraceCode
.
find
(
search
).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
populate
({
path
:
"rawMatCul.proSteps.img"
}).
populate
({
path
:
"proProcess.proSteps.img"
}).
populate
({
path
:
"cjVideo"
}).
populate
({
path
:
"qualityInsReportImgs"
}).
populate
({
path
:
"flourMerchantImgs"
}).
populate
({
path
:
"pesticidetImgs"
}).
lean
();
let
namemap
=
await
getSccjMap
();
//
let namemap = await getSccjMap();
let
ret
=
[];
let
ret
=
[];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
const
element
=
list
[
index
];
const
element
=
list
[
index
];
...
@@ -50,15 +50,15 @@ async function listTraceCode(req, res, next) {
...
@@ -50,15 +50,15 @@ async function listTraceCode(req, res, next) {
}
else
if
(
element
.
source
&&
element
.
type
==
4
)
{
}
else
if
(
element
.
source
&&
element
.
type
==
4
)
{
element
.
source
=
await
DB
.
ProductLt
.
findOne
({
_id
:
element
.
source
}).
lean
();
element
.
source
=
await
DB
.
ProductLt
.
findOne
({
_id
:
element
.
source
}).
lean
();
}
}
element
.
workshop
=
namemap
[
element
.
workshop
];
//
element.workshop = namemap[element.workshop];
element
.
agrPlantBase
=
namemap
[
element
.
agrPlantBase
];
//
element.agrPlantBase = namemap[element.agrPlantBase];
if
(
element
.
rawMatCul
&&
element
.
rawMatCul
.
proAdr
)
{
//
if (element.rawMatCul && element.rawMatCul.proAdr) {
element
.
rawMatCul
.
proAdr
=
namemap
[
element
.
rawMatCul
.
proAdr
]
//
element.rawMatCul.proAdr = namemap[element.rawMatCul.proAdr]
}
//
}
if
(
element
.
proProcess
&&
element
.
proProcess
.
proAdr
)
{
//
if (element.proProcess && element.proProcess.proAdr) {
element
.
proProcess
.
proAdr
=
namemap
[
element
.
proProcess
.
proAdr
]
//
element.proProcess.proAdr = namemap[element.proProcess.proAdr]
}
//
}
ret
.
push
(
element
);
ret
.
push
(
element
);
}
}
res
.
sendData
({
count
,
list
:
ret
});
res
.
sendData
({
count
,
list
:
ret
});
...
...
controller/productltController.js
View file @
f5fc6f34
...
@@ -28,15 +28,15 @@ async function listlt(req, res, next) {
...
@@ -28,15 +28,15 @@ async function listlt(req, res, next) {
const
count
=
await
DB
.
ProductLt
.
countDocuments
(
search
);
const
count
=
await
DB
.
ProductLt
.
countDocuments
(
search
);
let
list
=
await
DB
.
ProductLt
.
find
(
search
).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
list
=
await
DB
.
ProductLt
.
find
(
search
).
populate
({
path
:
"homepageCarouselImgs"
}).
populate
({
path
:
"productPhotos2"
}).
populate
({
path
:
"monitorInfo.device"
}).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
).
lean
().
exec
();
let
namemap
=
await
getSccjMap
();
//
let namemap = await getSccjMap();
let
ret
=
[];
//
let ret = [];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
//
for (let index = 0; index < list.length; index++) {
const
element
=
list
[
index
];
//
const element = list[index];
element
.
agrPlantBase
=
namemap
[
element
.
agrPlantBase
];
// //
element.agrPlantBase = namemap[element.agrPlantBase];
element
.
workshop
=
namemap
[
element
.
workshop
];
// //
element.workshop = namemap[element.workshop];
ret
.
push
(
element
);
//
ret.push(element);
}
//
}
res
.
sendData
({
count
,
list
:
ret
});
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
...
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