明树Git Lab

Commit 09e5f791 authored by zfp1's avatar zfp1

update

parent b355af71
...@@ -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,
......
...@@ -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',
......
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
...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment