明树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
5e8b6921
Commit
5e8b6921
authored
Oct 25, 2024
by
zengfanpei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
752999d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
18 deletions
+33
-18
agrInputDetailController.js
controller/agrInputDetailController.js
+17
-13
agrInputEmployController.js
controller/agrInputEmployController.js
+8
-3
agrInputOtherController.js
controller/agrInputOtherController.js
+4
-1
agrInputRecordController.js
controller/agrInputRecordController.js
+4
-1
No files found.
controller/agrInputDetailController.js
View file @
5e8b6921
...
...
@@ -16,7 +16,7 @@ async function list(req, res, next) {
let
pageSize
=
req
.
body
.
pageSize
||
10
;
let
skip
=
(
page
-
1
)
*
pageSize
;
let
count
=
await
DB
.
AgrInputDetail
.
countDocuments
(
search
)
let
list
=
await
DB
.
AgrInputDetail
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
)
.
lean
().
exec
()
;
let
list
=
await
DB
.
AgrInputDetail
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
);
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
next
(
error
)
...
...
@@ -68,20 +68,24 @@ async function importExcel(req, res, next) {
let
obj
=
{
creator
:
req
.
user
.
_id
,
time
:
values
[
1
],
agrProName
:
values
[
2
],
name
:
values
[
3
],
type
:
values
[
4
],
total
:
values
[
5
],
unit
:
values
[
6
],
totalCost
:
values
[
7
],
dilutionRatio
:
values
[
8
],
waterConsumption
:
values
[
9
],
area
:
values
[
10
],
dosage
:
values
[
11
],
land
:
values
[
12
],
name
:
values
[
2
],
spec
:
values
[
3
],
proUnit
:
values
[
4
],
component
:
values
[
5
],
buyNum
:
Number
(
values
[
6
])
||
null
,
buyUnti
:
values
[
7
],
unitPrice
:
Number
(
values
[
8
])
||
null
,
totalAmount
:
Number
(
values
[
9
])
||
null
,
totalBuyNum
:
Number
(
values
[
10
])
||
null
,
totalBuyUnit
:
values
[
11
],
agent
:
values
[
12
],
notes
:
values
[
13
],
}
if
(
obj
.
time
&&
obj
.
agrProName
)
{
if
(
typeof
obj
.
time
==
'number'
)
{
obj
.
time
=
new
Date
(
1900
,
0
,
obj
.
time
-
1
,
0
,
0
,
0
);
}
if
(
obj
.
time
)
{
arr
.
push
(
obj
)
}
}
...
...
controller/agrInputEmployController.js
View file @
5e8b6921
...
...
@@ -5,6 +5,7 @@
const
ExcelJS
=
require
(
'exceljs'
);
const
_
=
require
(
'lodash'
);
const
fs
=
require
(
'fs'
);
const
moment
=
require
(
'moment'
);
...
...
@@ -16,7 +17,7 @@ async function list(req, res, next) {
let
pageSize
=
req
.
body
.
pageSize
||
10
;
let
skip
=
(
page
-
1
)
*
pageSize
;
let
count
=
await
DB
.
AgrInputEmploy
.
countDocuments
(
search
)
let
list
=
await
DB
.
AgrInputEmploy
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
)
.
lean
().
exec
()
;
let
list
=
await
DB
.
AgrInputEmploy
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
);
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
next
(
error
)
...
...
@@ -65,17 +66,21 @@ async function importExcel(req, res, next) {
let
arr
=
[];
for
(
let
index
=
2
;
index
<=
worksheet
.
actualRowCount
;
index
++
)
{
let
values
=
worksheet
.
getRow
(
index
).
values
;
console
.
log
(
values
)
let
obj
=
{
creator
:
req
.
user
.
_id
,
time
:
values
[
1
],
time2
:
new
Date
(
values
[
1
]),
agrProName
:
values
[
2
],
empDetails
:
values
[
3
],
peopleNum
:
Number
(
values
[
4
])
||
null
,
halfDayFee
:
Number
(
values
[
5
])
||
null
,
laborFee
:
Number
(
values
[
6
])
||
null
,
}
// console.log(typeof obj.time)
if
(
typeof
obj
.
time
==
'number'
)
{
obj
.
time
=
new
Date
(
1900
,
0
,
obj
.
time
-
1
,
0
,
0
,
0
);
}
if
(
obj
.
time
)
{
arr
.
push
(
obj
)
}
...
...
controller/agrInputOtherController.js
View file @
5e8b6921
...
...
@@ -16,7 +16,7 @@ async function list(req, res, next) {
let
pageSize
=
req
.
body
.
pageSize
||
10
;
let
skip
=
(
page
-
1
)
*
pageSize
;
let
count
=
await
DB
.
AgrInputOther
.
countDocuments
(
search
)
let
list
=
await
DB
.
AgrInputOther
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
)
.
lean
().
exec
()
;
let
list
=
await
DB
.
AgrInputOther
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
);
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
next
(
error
)
...
...
@@ -78,6 +78,9 @@ async function importExcel(req, res, next) {
agent
:
values
[
9
],
notes
:
values
[
10
],
}
if
(
typeof
obj
.
time
==
'number'
)
{
obj
.
time
=
new
Date
(
1900
,
0
,
obj
.
time
-
1
,
0
,
0
,
0
);
}
if
(
obj
.
time
)
{
arr
.
push
(
obj
)
}
...
...
controller/agrInputRecordController.js
View file @
5e8b6921
...
...
@@ -19,7 +19,7 @@ async function list(req, res, next) {
search
.
agrProName
=
req
.
body
.
agrProName
;
}
let
count
=
await
DB
.
AgrInputRecord
.
countDocuments
(
search
)
let
list
=
await
DB
.
AgrInputRecord
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
)
.
lean
().
exec
()
;
let
list
=
await
DB
.
AgrInputRecord
.
find
(
search
).
skip
(
skip
).
limit
(
pageSize
);
res
.
sendData
({
count
,
list
});
}
catch
(
error
)
{
next
(
error
)
...
...
@@ -85,6 +85,9 @@ async function importExcel(req, res, next) {
land
:
values
[
12
],
notes
:
values
[
13
],
}
if
(
typeof
obj
.
time
==
'number'
)
{
obj
.
time
=
new
Date
(
1900
,
0
,
obj
.
time
-
1
,
0
,
0
,
0
);
}
if
(
obj
.
time
&&
obj
.
agrProName
)
{
arr
.
push
(
obj
)
}
...
...
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