明树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
09e5f791
Commit
09e5f791
authored
Dec 06, 2024
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b355af71
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
5 deletions
+106
-5
agrMatController.js
controller/agrMatController.js
+19
-1
letianAgrMatApproval.js
db/models/letianAgrMatApproval.js
+6
-0
letianIndMarketDemand.js
db/models/letianIndMarketDemand.js
+74
-0
agrRouter.js
router/agrRouter.js
+7
-4
No files found.
controller/agrMatController.js
View file @
09e5f791
...
@@ -74,7 +74,7 @@ async function queryMatType(req, res, next) {
...
@@ -74,7 +74,7 @@ async function queryMatType(req, res, next) {
/**
/**
* 获取
审批
列表--入库、出库、归还
* 获取
记录
列表--入库、出库、归还
*/
*/
async
function
queryMatApprList
(
req
,
res
,
next
)
{
async
function
queryMatApprList
(
req
,
res
,
next
)
{
try
{
try
{
...
@@ -95,6 +95,23 @@ async function queryMatApprList(req, res, next) {
...
@@ -95,6 +95,23 @@ async function queryMatApprList(req, res, next) {
next
(
error
)
next
(
error
)
}
}
}
}
async
function
queryMatApprInfo
(
req
,
res
,
next
)
{
try
{
let
search
=
{
del
:
0
};
if
(
!
req
.
body
.
_id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
let
approval
=
await
DB
.
AgrMatApproval
.
findOne
({
_id
:
req
.
body
.
_id
}).
populate
({
path
:
'creator'
,
select
:
"mobile name"
}).
lean
().
exec
();
if
(
!
(
approval
&&
approval
.
_id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
let
inout
=
await
DB
.
AgrMatInOut
.
find
({
approval
:
req
.
body
.
_id
}).
sort
({
_id
:
1
}).
lean
().
exec
();
approval
.
materials
=
inout
||
[];
return
approval
;
}
catch
(
error
)
{
next
(
error
)
}
}
/**
/**
*创建审批--入库、出库、归还 ,保存 不发起流程
*创建审批--入库、出库、归还 ,保存 不发起流程
...
@@ -457,6 +474,7 @@ module.exports = {
...
@@ -457,6 +474,7 @@ module.exports = {
queryMatType
,
queryMatType
,
queryMatApprList
,
queryMatApprList
,
queryMatApprInfo
,
saveMatAppr
,
saveMatAppr
,
deleteMatAppr
,
deleteMatAppr
,
...
...
db/models/letianAgrMatApproval.js
View file @
09e5f791
...
@@ -21,6 +21,12 @@ const AgrMaterialApprovalSchema = new Schema({
...
@@ -21,6 +21,12 @@ const AgrMaterialApprovalSchema = new Schema({
type
:
String
,
type
:
String
,
comment
:
"单据名称"
comment
:
"单据名称"
},
},
time
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
comment
:
"操作时间"
},
// materials: {
// materials: {
// type: [mongoose.Types.ObjectId],
// type: [mongoose.Types.ObjectId],
// ref: 'AgrMatInOut',
// ref: 'AgrMatInOut',
...
...
db/models/letianIndMarketDemand.js
0 → 100644
View file @
09e5f791
const
mongoose
=
require
(
'mongoose'
);
const
Schema
=
mongoose
.
Schema
;
const
moment
=
require
(
'moment'
);
/**
* 工业大屏-市场需求趋势
*/
const
letianIndMarketDemandSchema
=
new
Schema
({
time
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
comment
:
"数据发布时间"
},
medicineFoodNum1
:
{
// 药食
type
:
Number
,
comment
:
""
},
medicineFoodNum2
:
{
// 药食
type
:
Number
,
comment
:
""
},
healthFoodNum1
:
{
// 健康食品
type
:
Number
,
comment
:
""
},
healthFoodNum2
:
{
// 健康食品
type
:
Number
,
comment
:
""
},
functionalFoodNum1
:
{
//保健食品
type
:
Number
,
comment
:
""
},
functionalFoodNum2
:
{
//保健食品
type
:
Number
,
comment
:
""
},
creator
:
{
type
:
mongoose
.
Types
.
ObjectId
,
ref
:
'User'
,
comment1
:
"创建人"
},
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
IndMarDem
=
mongoose
.
model
(
'letianIndMarketDemand'
,
letianIndMarketDemandSchema
,
'letianIndMarketDemand'
);
module
.
exports
=
IndMarDem
;
\ No newline at end of file
router/agrRouter.js
View file @
09e5f791
...
@@ -50,11 +50,14 @@ router.post('/mat/out', agrMatController.outMat);
...
@@ -50,11 +50,14 @@ router.post('/mat/out', agrMatController.outMat);
/**
/**
* 农资审批记录--- 202411 ---- 不要审批过程 废弃
* 农资审批记录--- 202411 ---- 不要审批过程
- 部分
废弃
*/
*/
router
.
post
(
'/mat/approval/list'
,
agrMatController
.
queryMatApprList
);
//获取农资审批记录列表
router
.
post
(
'/mat/approval/list'
,
agrMatController
.
queryMatApprList
);
//获取农资审批记录列表---保留记录列表
router
.
post
(
'/mat/approval/save'
,
agrMatController
.
saveMatAppr
);
//获取农资审批记录列表
router
.
post
(
'/mat/approval/info'
,
agrMatController
.
queryMatApprInfo
)
router
.
post
(
'/mat/approval/delete'
,
agrMatController
.
deleteMatAppr
);
//获取农资审批记录列表
//---废弃
router
.
post
(
'/mat/approval/save'
,
agrMatController
.
saveMatAppr
);
router
.
post
(
'/mat/approval/delete'
,
agrMatController
.
deleteMatAppr
);
...
...
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