明树Git Lab

Commit f5fc6f34 authored by zfp1's avatar zfp1

!

parent d752f549
......@@ -27,15 +27,15 @@ async function listDeepPlant(req, res, next) {
}
const count = await DB.ProductDeep.countDocuments(search);
let list = await DB.ProductDeep.find(search).populate({path: "productPhotos2"}).populate({path: "homepageCarouselImgs"}).populate({path: "monitorInfo.device"}).sort({_id: -1}).skip(skip).limit(pageSize).lean().exec();
let namemap = await getSccjMap();
let ret = [];
for (let index = 0; index < list.length; index++) {
const element = list[index];
element.agrPlantBase = namemap[element.agrPlantBase];
element.workshop = namemap[element.workshop];
ret.push(element);
}
res.sendData({ count, list: ret });
// let namemap = await getSccjMap();
// let ret = [];
// for (let index = 0; index < list.length; index++) {
// const element = list[index];
// element.agrPlantBase = namemap[element.agrPlantBase];
// element.workshop = namemap[element.workshop];
// ret.push(element);
// }
res.sendData({ count, list });
} catch (error) {
next(error);
}
......
......@@ -30,14 +30,14 @@ async function listDirectPlant(req, res, next) {
const count = await DB.ProductPlant.countDocuments(search);
let list = await DB.ProductPlant.find(search).populate({path: "plantPlan"}).populate({path: "homepageCarouselImgs"}).populate({path: "productPhotos2"}).populate({path: "monitorInfo.device"}).sort({_id: -1}).skip(skip).limit(pageSize).lean().exec();
let namemap = await getSccjMap();
let ret = [];
for (let index = 0; index < list.length; index++) {
const element = list[index];
element.agrPlantBase = namemap[element.agrPlantBase];
ret.push(element);
}
res.sendData({ count, list: ret });
// let namemap = await getSccjMap();
// let ret = [];
// for (let index = 0; index < list.length; index++) {
// const element = list[index];
// element.agrPlantBase = namemap[element.agrPlantBase];
// ret.push(element);
// }
res.sendData({ count, list });
} catch (error) {
next(error);
}
......
......@@ -28,14 +28,14 @@ async function listPrePlant(req, res, next) {
}
const count = await DB.ProductPre.countDocuments(search);
let list = await DB.ProductPre.find(search).populate({path: "productPhotos2"}).populate({path: "sourcePlantProduct"}).populate({path: "homepageCarouselImgs"}).populate({path: "monitorInfo.device"}).sort({_id: -1}).skip(skip).limit(pageSize).lean().exec();
let namemap = await getSccjMap();
let ret = [];
for (let index = 0; index < list.length; index++) {
const element = list[index];
element.agrPlantBase = namemap[element.agrPlantBase];
ret.push(element);
}
res.sendData({ count, list: ret });
// let namemap = await getSccjMap();
// let ret = [];
// for (let index = 0; index < list.length; index++) {
// const element = list[index];
// element.agrPlantBase = namemap[element.agrPlantBase];
// ret.push(element);
// }
res.sendData({ count, list });
} catch (error) {
next(error);
}
......
......@@ -37,7 +37,7 @@ async function listTraceCode(req, res, next) {
}
const count = await DB.ProTraceCode.countDocuments(search);
let list = await DB.ProTraceCode.find(search).sort({ _id: -1 }).skip(skip).limit(pageSize).populate({ path: "rawMatCul.proSteps.img" }).populate({ path: "proProcess.proSteps.img" }).populate({ path: "cjVideo" }).populate({ path: "qualityInsReportImgs" }).populate({ path: "flourMerchantImgs" }).populate({ path: "pesticidetImgs" }).lean();
let namemap = await getSccjMap();
// let namemap = await getSccjMap();
let ret = [];
for (let index = 0; index < list.length; index++) {
const element = list[index];
......@@ -50,15 +50,15 @@ async function listTraceCode(req, res, next) {
} else if (element.source && element.type == 4) {
element.source = await DB.ProductLt.findOne({ _id: element.source }).lean();
}
element.workshop = namemap[element.workshop];
element.agrPlantBase = namemap[element.agrPlantBase];
if (element.rawMatCul && element.rawMatCul.proAdr) {
element.rawMatCul.proAdr = namemap[element.rawMatCul.proAdr]
// element.workshop = namemap[element.workshop];
// element.agrPlantBase = namemap[element.agrPlantBase];
// if (element.rawMatCul && element.rawMatCul.proAdr) {
// element.rawMatCul.proAdr = namemap[element.rawMatCul.proAdr]
}
if (element.proProcess && element.proProcess.proAdr) {
element.proProcess.proAdr = namemap[element.proProcess.proAdr]
}
// }
// if (element.proProcess && element.proProcess.proAdr) {
// element.proProcess.proAdr = namemap[element.proProcess.proAdr]
// }
ret.push(element);
}
res.sendData({ count, list: ret });
......
......@@ -28,15 +28,15 @@ async function listlt(req, res, next) {
const count = await DB.ProductLt.countDocuments(search);
let list = await DB.ProductLt.find(search).populate({path: "homepageCarouselImgs"}).populate({path: "productPhotos2"}).populate({path: "monitorInfo.device"}).sort({_id: -1}).skip(skip).limit(pageSize).lean().exec();
let namemap = await getSccjMap();
let ret = [];
for (let index = 0; index < list.length; index++) {
const element = list[index];
element.agrPlantBase = namemap[element.agrPlantBase];
element.workshop = namemap[element.workshop];
ret.push(element);
}
res.sendData({ count, list: ret });
// let namemap = await getSccjMap();
// let ret = [];
// for (let index = 0; index < list.length; index++) {
// const element = list[index];
// // element.agrPlantBase = namemap[element.agrPlantBase];
// // element.workshop = namemap[element.workshop];
// ret.push(element);
// }
res.sendData({ count, list });
} catch (error) {
next(error);
}
......
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