明树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
8e50bb6f
Commit
8e50bb6f
authored
May 23, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2e09eec3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
companyInfoController.js
controller/companyInfoController.js
+1
-1
productTracController.js
controller/productTracController.js
+5
-3
letianCompanyInfo.js
db/models/letianCompanyInfo.js
+8
-0
letianProTraceCode.js
db/models/letianProTraceCode.js
+0
-8
No files found.
controller/companyInfoController.js
View file @
8e50bb6f
...
...
@@ -5,7 +5,7 @@
async
function
findCompInfo
(
req
,
res
,
next
)
{
try
{
let
ret
=
await
DB
.
CompanyInfo
.
findOne
({}).
populate
({
path
:
"companyInfoImgs"
}).
populate
({
path
:
"qualiCertiImgs"
}).
populate
({
path
:
"addressInfo.img"
}).
lean
().
exec
();
let
ret
=
await
DB
.
CompanyInfo
.
findOne
({}).
populate
({
path
:
"companyInfoImgs"
}).
populate
({
path
:
"qualiCertiImgs"
}).
populate
({
path
:
"addressInfo.img"
}).
populate
({
path
:
"gcImg"
}).
populate
({
path
:
"jdImg"
}).
lean
().
exec
();
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
...
...
controller/productTracController.js
View file @
8e50bb6f
...
...
@@ -47,7 +47,7 @@ async function listTraceCode(req, res, next) {
search
.
batchNumber
=
{
$regex
:
req
.
body
.
batchNumber
}
}
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
:
"jdImg"
}).
populate
({
path
:
"gcImg"
}).
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"
}).
lean
();
let
ret
=
[];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
const
element
=
list
[
index
];
...
...
@@ -189,7 +189,7 @@ async function getJiankong(req, res, next) {
if
(
!
req
.
body
.
_id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
let
traccode
=
await
DB
.
ProTraceCode
.
findOne
({
_id
:
req
.
body
.
_id
},
{
type
:
1
,
source
:
1
,
_id
:
1
,
jdImg
:
1
,
gcImg
:
1
,
agrOnOff
:
1
,
indEnvOnOff
:
1
}).
populate
({
path
:
"gcImg"
}).
populate
({
path
:
"jdImg"
}).
lean
();
let
traccode
=
await
DB
.
ProTraceCode
.
findOne
({
_id
:
req
.
body
.
_id
},
{
type
:
1
,
source
:
1
,
_id
:
1
,
agrOnOff
:
1
,
indEnvOnOff
:
1
}).
lean
();
if
(
!
(
traccode
&&
traccode
.
_id
&&
traccode
.
source
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
...
...
@@ -220,7 +220,9 @@ async function getJiankong(req, res, next) {
// 工业环境
}
let
companyInfo
=
await
DB
.
CompanyInfo
.
findOne
({},
{
gcImg
:
1
,
jdImg
:
1
}).
populate
({
path
:
"gcImg"
}).
populate
({
path
:
"jdImg"
});
traccode
.
gcImg
=
companyInfo
.
gcImg
;
traccode
.
jdImg
=
companyInfo
.
jdImg
;
traccode
.
source
=
source
;
res
.
sendData
(
traccode
);
}
catch
(
error
)
{
...
...
db/models/letianCompanyInfo.js
View file @
8e50bb6f
...
...
@@ -16,6 +16,14 @@ const letianCompanyInfoSchema = new Schema({
type
:
String
,
comment
:
"简介"
},
jdImg
:
{
// 基地总览图片
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'File'
,
},
gcImg
:
{
//工厂总览图
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'File'
,
},
companyInfoImgs
:
[
{
type
:
mongoose
.
Types
.
ObjectId
,
...
...
db/models/letianProTraceCode.js
View file @
8e50bb6f
...
...
@@ -11,14 +11,6 @@ const letianProTraceCodeSchema = new Schema({
// comment: "产品名称"
// },
tcode
:
String
,
// 溯源码
jdImg
:
{
// 基地总览图片
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'File'
,
},
gcImg
:
{
//工厂总览图
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'File'
,
},
type
:
{
type
:
Number
,
comment
:
"1 种植农产品 2 轻加工 3 深加工"
...
...
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