明树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
d6b88127
Commit
d6b88127
authored
Sep 11, 2024
by
zengfanpei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a90fdc1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
78 deletions
+84
-78
README.md
README.md
+6
-0
letianPurchase.js
db/models/letianPurchase.js
+78
-78
No files found.
README.md
View file @
d6b88127
...
@@ -12,6 +12,12 @@
...
@@ -12,6 +12,12 @@
| router | 路由 |
| router | 路由 |
| utils | 工具方法 |
| utils | 工具方法 |
# 命名
| 简称 | 解释 |
| --- | --- |
| IPS | 虫情 |
| SMC | 土壤墒情 |
| WS | 气象 |
# 记录
# 记录
...
...
db/models/letianPurchase.js
View file @
d6b88127
const
mongoose
=
require
(
'mongoose'
);
//
const mongoose = require('mongoose');
const
Schema
=
mongoose
.
Schema
;
//
const Schema = mongoose.Schema;
const
moment
=
require
(
'moment'
);
//
const moment = require('moment');
/**
/
/ /
**
* 乐田 农业投入品 采购
//
* 乐田 农业投入品 采购
*/
//
*/
const
letianAgrInRecordSchema
=
new
Schema
({
//
const letianAgrInRecordSchema = new Schema({
purchaseDate
:
{
//
purchaseDate: {
type
:
Date
,
//
type: Date,
// default: Date.now,
//
// default: Date.now,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
//
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
comment
:
"购买日期"
//
comment: "购买日期"
},
//
},
name
:
{
//
name: {
type
:
String
,
//
type: String,
required
:
true
,
//
required: true,
commnet
:
"产品名称"
,
//
commnet: "产品名称",
},
//
},
specifications
:
{
//
specifications: {
type
:
String
,
//
type: String,
comment
:
"规格"
//
comment: "规格"
},
//
},
ingredients
:
{
//
ingredients: {
type
:
String
,
//
type: String,
comment
:
"成分"
//
comment: "成分"
},
//
},
shipmentQuantity
:
{
//
shipmentQuantity: {
type
:
Number
,
//
type: Number,
default
:
0
,
//
default: 0,
comment
:
"出货数量"
//
comment: "出货数量"
},
//
},
unit
:
{
//
unit: {
type
:
String
,
//
type: String,
comment
:
"单位"
//
comment: "单位"
},
//
},
shippingPrice
:
{
//
shippingPrice: {
type
:
String
,
//
type: String,
comment
:
"出货价格(元)"
//
comment: "出货价格(元)"
},
//
},
totalAmount
:
{
//
totalAmount : {
type
:
String
,
//
type: String,
comment
:
"合计金额(元)"
//
comment: "合计金额(元)"
},
//
},
consumption
:
{
//
consumption : {
type
:
String
,
//
type: String,
comment
:
"用量"
//
comment: "用量"
},
//
},
agent
:
{
//
agent : {
type
:
String
,
//
type: String,
comment
:
"代理商"
//
comment: "代理商"
},
//
},
remarks
:
{
//
remarks : {
type
:
String
,
//
type: String,
comment
:
"备注"
//
comment: "备注"
},
//
},
createdAt
:
{
//
createdAt: {
type
:
Date
,
//
type: Date,
default
:
Date
.
now
,
//
default: Date.now,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
//
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
//
},
updatedAt
:
{
//
updatedAt: {
type
:
Date
,
//
type: Date,
default
:
Date
.
now
,
//
default: Date.now,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
//
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
//
},
del
:
{
//
del: {
type
:
Number
,
//
type: Number,
default
:
0
,
//
default: 0,
comment
:
'默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
//
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
//
}
},
{
//
}, {
id
:
false
,
//
id: false,
toJSON
:
{
//
toJSON: {
getters
:
true
,
//
getters: true,
}
//
}
});
//
});
const
AgrInRecord
=
mongoose
.
model
(
'AgrInRecord'
,
letianAgrInRecordSchema
,
'letianAgrInRecord'
);
// const AgrInRecord = mongoose.model('AgrInRecord', letianAgrInRecordSchema, 'letianAgrInRecord');
module
.
exports
=
AgrInRecord
;
// module.exports = AgrInRecord;
\ No newline at end of file
\ No newline at end of file
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