明树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
5d6ffe40
Commit
5d6ffe40
authored
Sep 13, 2024
by
zengfanpei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ac2363f0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
228 additions
and
2 deletions
+228
-2
userController.js
controller/userController.js
+1
-1
letian
db/models/letian
+0
-0
letianAgrTask.js
db/models/letianAgrTask.js
+57
-0
letianPlantCycle.js
db/models/letianPlantCycle.js
+47
-0
letianPlantPlan.js
db/models/letianPlantPlan.js
+70
-0
letianPlantVariety.js
db/models/letianPlantVariety.js
+50
-0
systemMenu.js
db/models/systemMenu.js
+3
-1
No files found.
controller/userController.js
View file @
5d6ffe40
...
...
@@ -321,7 +321,7 @@ async function updateRole(req, res, next) {
let
objButtons
=
dbMenus
.
map
(
o
=>
{
return
o
&&
o
.
_id
});
obj
.
menus
=
menus
;
obj
.
buttons
=
objButtons
;
let
ret
=
await
roleModu
le
.
findOneAndUpdate
({
_id
:
req
.
body
.
_id
},
obj
);
let
ret
=
await
DB
.
Ro
le
.
findOneAndUpdate
({
_id
:
req
.
body
.
_id
},
obj
);
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
...
...
db/models/letian
deleted
100644 → 0
View file @
ac2363f0
db/models/letianAgrTask.js
0 → 100644
View file @
5d6ffe40
const
mongoose
=
require
(
'mongoose'
);
const
Schema
=
mongoose
.
Schema
;
const
moment
=
require
(
'moment'
);
/**
* 地块 --- 园区 ---- 乡镇(这个等级暂时不做)
*/
const
AgrTaskSchema
=
new
Schema
({
name
:
{
type
:
"任务名称"
,
},
agrType
:
{
type
:
Number
,
comment
:
"农事类型"
,
},
startTime
:
{
type
:
Date
,
omment
:
"任务开始日期"
,
},
endTime
:
{
type
:
Date
,
omment
:
"任务结束日期"
,
},
leader
:
{
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'User'
,
comment
:
"负责人--从分配负责人开始,任务就开启"
},
createdAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
updatedAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
del
:
{
type
:
Number
,
default
:
0
,
comment
:
'默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
},
{
toJSON
:
{
getters
:
true
}
});
const
AgrTask
=
mongoose
.
model
(
'AgrTask'
,
AgrTaskSchema
,
'letianAgrTask'
);
module
.
exports
=
AgrTask
;
\ No newline at end of file
db/models/letianPlantCycle.js
0 → 100644
View file @
5d6ffe40
const
mongoose
=
require
(
'mongoose'
);
const
Schema
=
mongoose
.
Schema
;
const
moment
=
require
(
'moment'
);
/**
* 种植周期
*/
const
PlantCycleSchema
=
new
Schema
({
name
:
{
type
:
String
,
comment
:
"种植周期名称"
,
},
startTime
:
{
type
:
Date
,
},
endTime
:
{
type
:
Date
,
},
createdAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
updatedAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
del
:
{
type
:
Number
,
default
:
0
,
comment
:
'默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
},
{
toJSON
:
{
getters
:
true
}
});
const
PlantCycle
=
mongoose
.
model
(
'PlantCycle'
,
PlantCycleSchema
,
'letianPlantCycle'
);
module
.
exports
=
PlantCycle
;
\ No newline at end of file
db/models/letianPlantPlan.js
0 → 100644
View file @
5d6ffe40
const
mongoose
=
require
(
'mongoose'
);
const
Schema
=
mongoose
.
Schema
;
const
moment
=
require
(
'moment'
);
/**
* 种植计划
*/
const
PlantPlanSchema
=
new
Schema
({
plantVariety
:
{
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'PlantVariety'
,
comment
:
"作物种类"
},
planNum
:
{
type
:
String
,
unique
:
true
,
comment
:
"种植计划编号"
},
// zone: {
// type: mongoose.Types.ObjectId,
// ref: 'Zone',
// comment: "所属基地"
// },
land
:
{
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'Land'
,
comment
:
"地块"
},
plantArea
:
{
type
:
Number
,
comment
:
"种植面积"
},
plantStatus
:
{
type
:
String
,
comment
:
"种植状态 采收、结束种植"
,
},
plantiCycle
:
{
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
"PlantCycle"
,
comment
:
"种植周期"
,
},
createdAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
updatedAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
del
:
{
type
:
Number
,
default
:
0
,
comment
:
'默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
},
{
toJSON
:
{
getters
:
true
}
});
const
PlantPlan
=
mongoose
.
model
(
'PlantPlan'
,
PlantPlanSchema
,
'letianPlantPlan'
);
module
.
exports
=
PlantPlan
;
\ No newline at end of file
db/models/letianPlantVariety.js
0 → 100644
View file @
5d6ffe40
const
mongoose
=
require
(
'mongoose'
);
const
Schema
=
mongoose
.
Schema
;
const
moment
=
require
(
'moment'
);
/**
* 作物种类
*/
const
PlantVarietySchema
=
new
Schema
({
name
:
{
type
:
String
,
comment
:
"作物品种名称"
},
description
:
{
type
:
String
,
comment
:
"作物介绍信息"
},
img
:
{
type
:
String
,
comment
:
"作物图片"
},
createdAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
updatedAt
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
},
del
:
{
type
:
Number
,
default
:
0
,
comment
:
'默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
},
{
toJSON
:
{
getters
:
true
}
});
const
PlantVariety
=
mongoose
.
model
(
'PlantVariety'
,
PlantVarietySchema
,
'letianPlantVariety'
);
module
.
exports
=
PlantVariety
;
\ No newline at end of file
db/models/systemMenu.js
View file @
5d6ffe40
...
...
@@ -13,11 +13,13 @@ const menuSchema = new Schema({
// level: Number,
url
:
{
type
:
String
,
unique
:
true
,
comment
:
"菜单唯一标识"
},
key
:
{
type
:
String
,
comment
:
"按钮唯一标识"
comment
:
"按钮唯一标识"
,
unique
:
true
,
},
order
:
{
type
:
Number
,
...
...
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