|
@@ -55,17 +55,29 @@ async function getClassByAreaID(data,compilation){
|
|
|
let newList = [];
|
|
|
let lib = await infoLibModel.findOne({compilationID:compilation._id,period:data.period})
|
|
|
if(lib){
|
|
|
- let infoClass = await infoClassModel.find({areaID:data.areaID,libID:lib.ID}).lean();
|
|
|
+ let tList =await getClassList(data.areaID,lib.ID);
|
|
|
+ newList.push(...tList);
|
|
|
+ if(data.commonInfoPriceID){
|
|
|
+ cList = await getClassList(data.commonInfoPriceID,lib.ID);
|
|
|
+ newList.push(...cList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ async function getClassList(areaID,libID){
|
|
|
+ let temList = [];
|
|
|
+ let infoClass = await infoClassModel.find({areaID:areaID,libID:libID}).lean();
|
|
|
let parentMap=_.groupBy(infoClass, 'ParentID');
|
|
|
for(let key in parentMap){
|
|
|
parentMap[key] = projectfacade.sortChildren(parentMap[key]);
|
|
|
}
|
|
|
|
|
|
if(parentMap && parentMap['-1']){
|
|
|
- getChildern(parentMap['-1'],newList,parentMap)
|
|
|
+ getChildern(parentMap['-1'],temList,parentMap)
|
|
|
}
|
|
|
+ return temList;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
function getChildern(children,list,pm){
|