明树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
211b9a24
Commit
211b9a24
authored
Mar 12, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
64602711
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
143 additions
and
12 deletions
+143
-12
agrInputDetailController.js
controller/agrInputDetailController.js
+30
-2
agrInputEmployController.js
controller/agrInputEmployController.js
+30
-2
agrInputOtherController.js
controller/agrInputOtherController.js
+30
-2
agrInputRecordController.js
controller/agrInputRecordController.js
+44
-2
letianAgrInputDetail.js
db/models/letianAgrInputDetail.js
+1
-1
letianAgrInputEmploy.js
db/models/letianAgrInputEmploy.js
+1
-1
letianAgrInputOther.js
db/models/letianAgrInputOther.js
+1
-1
letianAgrInputRecord.js
db/models/letianAgrInputRecord.js
+1
-1
letianHeavyMetal.js
db/models/letianHeavyMetal.js
+1
-0
fileRouter.js
router/fileRouter.js
+4
-0
No files found.
controller/agrInputDetailController.js
View file @
211b9a24
...
...
@@ -111,7 +111,34 @@ async function importExcel(req, res, next) {
async
function
exportExcel
(
req
,
res
,
next
)
{
try
{
let
search
=
{
del
:
0
};
if
(
req
.
body
.
agrProName
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
agrProName
};
}
if
(
req
.
body
.
name
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
name
};
}
if
(
req
.
body
.
startTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$gte
=
req
.
body
.
startTime
;
}
if
(
req
.
body
.
endTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$lte
=
req
.
body
.
endTime
}
let
ret
=
await
DB
.
ExcelRecord
.
create
({
creator
:
req
.
user
.
_id
,
type
:
2
,
modleName
:
'AgrInputDetail'
,
search
,
})
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
...
...
@@ -126,5 +153,6 @@ module.exports = {
create
,
importExcel
,
deleteOne
,
updateOne
updateOne
,
exportExcel
,
}
\ No newline at end of file
controller/agrInputEmployController.js
View file @
211b9a24
...
...
@@ -106,7 +106,34 @@ async function importExcel(req, res, next) {
}
async
function
exportExcel
(
req
,
res
,
next
)
{
try
{
let
search
=
{
del
:
0
};
if
(
req
.
body
.
agrProName
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
agrProName
};
}
if
(
req
.
body
.
name
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
name
};
}
if
(
req
.
body
.
startTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$gte
=
req
.
body
.
startTime
;
}
if
(
req
.
body
.
endTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$lte
=
req
.
body
.
endTime
}
let
ret
=
await
DB
.
ExcelRecord
.
create
({
creator
:
req
.
user
.
_id
,
type
:
2
,
modleName
:
'AgrInputEmploy'
,
search
,
})
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
...
...
@@ -122,5 +149,6 @@ module.exports = {
create
,
importExcel
,
deleteOne
,
updateOne
updateOne
,
exportExcel
,
}
\ No newline at end of file
controller/agrInputOtherController.js
View file @
211b9a24
...
...
@@ -106,7 +106,34 @@ async function importExcel(req, res, next) {
}
async
function
exportExcel
(
req
,
res
,
next
)
{
try
{
let
search
=
{
del
:
0
};
if
(
req
.
body
.
agrProName
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
agrProName
};
}
if
(
req
.
body
.
name
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
name
};
}
if
(
req
.
body
.
startTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$gte
=
req
.
body
.
startTime
;
}
if
(
req
.
body
.
endTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$lte
=
req
.
body
.
endTime
}
let
ret
=
await
DB
.
ExcelRecord
.
create
({
creator
:
req
.
user
.
_id
,
type
:
2
,
modleName
:
'AgrInputOther'
,
search
,
})
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
...
...
@@ -122,5 +149,6 @@ module.exports = {
create
,
importExcel
,
deleteOne
,
updateOne
updateOne
,
exportExcel
,
}
\ No newline at end of file
controller/agrInputRecordController.js
View file @
211b9a24
...
...
@@ -16,7 +16,18 @@ async function listFroDP(req, res, next) {
let
pageSize
=
req
.
body
.
pageSize
||
10
;
let
skip
=
(
page
-
1
)
*
pageSize
;
if
(
req
.
body
.
agrProName
)
{
search
.
agrProName
=
req
.
body
.
agrProName
;
search
.
agrProName
=
{
$regex
:
req
.
body
.
agrProName
};
}
if
(
req
.
body
.
name
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
name
};
}
if
(
req
.
body
.
startTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$gte
=
req
.
body
.
startTime
;
}
if
(
req
.
body
.
endTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$lte
=
req
.
body
.
endTime
}
let
count
=
await
DB
.
AgrInputRecord
.
countDocuments
(
search
)
let
list
=
await
DB
.
AgrInputRecord
.
find
(
search
).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
1000
);
//甲方要求整体循环,暂时调整
...
...
@@ -129,6 +140,36 @@ async function importExcel(req, res, next) {
}
async
function
exportExcel
(
req
,
res
,
next
)
{
try
{
let
search
=
{
del
:
0
};
if
(
req
.
body
.
agrProName
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
agrProName
};
}
if
(
req
.
body
.
name
)
{
search
.
agrProName
=
{
$regex
:
req
.
body
.
name
};
}
if
(
req
.
body
.
startTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$gte
=
req
.
body
.
startTime
;
}
if
(
req
.
body
.
endTime
)
{
search
.
time
=
search
.
time
||
{};
search
.
time
.
$lte
=
req
.
body
.
endTime
}
let
ret
=
await
DB
.
ExcelRecord
.
create
({
creator
:
req
.
user
.
_id
,
type
:
2
,
modleName
:
'AgrInputRecord'
,
search
,
})
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
...
...
@@ -146,5 +187,6 @@ module.exports = {
importExcel
,
deleteOne
,
updateOne
,
listFroDP
listFroDP
,
exportExcel
,
}
\ No newline at end of file
db/models/letianAgrInputDetail.js
View file @
211b9a24
...
...
@@ -92,5 +92,5 @@ const letianAgrInputDetailSchema = new Schema({
});
const
AgrInputDetail
=
mongoose
.
model
(
'
letian
AgrInputDetail'
,
letianAgrInputDetailSchema
,
'letianAgrInputDetail'
);
const
AgrInputDetail
=
mongoose
.
model
(
'AgrInputDetail'
,
letianAgrInputDetailSchema
,
'letianAgrInputDetail'
);
module
.
exports
=
AgrInputDetail
;
\ No newline at end of file
db/models/letianAgrInputEmploy.js
View file @
211b9a24
...
...
@@ -64,5 +64,5 @@ const letianAgrInputEmploySchema = new Schema({
});
const
AgrInputEmploy
=
mongoose
.
model
(
'
letian
AgrInputEmploy'
,
letianAgrInputEmploySchema
,
'letianAgrInputEmploy'
);
const
AgrInputEmploy
=
mongoose
.
model
(
'AgrInputEmploy'
,
letianAgrInputEmploySchema
,
'letianAgrInputEmploy'
);
module
.
exports
=
AgrInputEmploy
;
\ No newline at end of file
db/models/letianAgrInputOther.js
View file @
211b9a24
...
...
@@ -80,5 +80,5 @@ const letianAgrInputOtherSchema = new Schema({
});
const
AgrInputOther
=
mongoose
.
model
(
'
letian
AgrInputOther'
,
letianAgrInputOtherSchema
,
'letianAgrInputOther'
);
const
AgrInputOther
=
mongoose
.
model
(
'AgrInputOther'
,
letianAgrInputOtherSchema
,
'letianAgrInputOther'
);
module
.
exports
=
AgrInputOther
;
\ No newline at end of file
db/models/letianAgrInputRecord.js
View file @
211b9a24
...
...
@@ -94,5 +94,5 @@ const letianAgrInputRecordSchema = new Schema({
});
const
AgrInputRecord
=
mongoose
.
model
(
'
letian
AgrInputRecord'
,
letianAgrInputRecordSchema
,
'letianAgrInputRecord'
);
const
AgrInputRecord
=
mongoose
.
model
(
'AgrInputRecord'
,
letianAgrInputRecordSchema
,
'letianAgrInputRecord'
);
module
.
exports
=
AgrInputRecord
;
\ No newline at end of file
db/models/letianHeavyMetal.js
View file @
211b9a24
...
...
@@ -24,6 +24,7 @@ const letianHeavyMetalSchema = new Schema({
},
time
:
{
type
:
Date
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
data
:
{
//因对接过程 不清楚对方的数据 此处弄一个json对象让对方所传数据都放置在这里面
...
...
router/fileRouter.js
View file @
211b9a24
...
...
@@ -73,6 +73,10 @@ router.post('/:modelName/exportExcel', async (req, res, next) => {
'IPS'
:
"collectIPSController"
,
'SMC'
:
"collectSMCController"
,
'WS'
:
"collectWSController"
,
'agrInputRecord'
:
"agrInputRecordController"
,
'agrInputOther'
:
"agrInputOtherController"
,
'agrInputDetail'
:
"agrInputDetailController"
,
'agrInputEmploy'
:
"agrInputEmployController"
,
}
console
.
log
(
modelMap
[
modelName
]);
let
controller
=
require
(
`../controller/
${
modelMap
[
modelName
]}
`
);
...
...
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