|
@@ -83,7 +83,7 @@ function combineQuantity(results) {
|
|
|
|
|
|
|
|
|
function get_lib_glj_info(ration_glj) {
|
|
|
- return function (cb) {
|
|
|
+ return function (result,cb) {
|
|
|
std_glj_lib_gljList_model.findOne({'ID':ration_glj.GLJID},(err,glj)=>{
|
|
|
if(err){
|
|
|
cb(err,'')
|
|
@@ -96,8 +96,9 @@ function get_lib_glj_info(ration_glj) {
|
|
|
ration_glj.shortName = glj.shortName;
|
|
|
ration_glj.type = glj.gljType;
|
|
|
ration_glj.repositoryId = glj.ration_glj
|
|
|
- getInfoFromProjectGLJ(ration_glj).then(function (result) {
|
|
|
- if(result){
|
|
|
+ getInfoFromProjectGLJ(ration_glj).then(function (info) {
|
|
|
+ if(info){
|
|
|
+ result.datas.push(info);
|
|
|
cb(null,result);
|
|
|
}else {
|
|
|
cb(new Error('get project glj error'),null);
|
|
@@ -144,16 +145,17 @@ function create_ration_glj(user_id,datas) {
|
|
|
return function (callback) {
|
|
|
let ration_glj_list=datas.ration_glj_list;
|
|
|
var tasks=[];
|
|
|
+ tasks.push(startingTask("get glj info"))
|
|
|
for(let i =0;i<ration_glj_list.length;i++){
|
|
|
ration_glj_list[i].ID = uuidV1();
|
|
|
tasks.push(get_lib_glj_info(ration_glj_list[i]))
|
|
|
}
|
|
|
- async_n.parallel(tasks,(err,results)=>{
|
|
|
+ async_n.waterfall(tasks,(err,results)=>{
|
|
|
if(err){
|
|
|
callback(err,results)
|
|
|
}else {
|
|
|
let newRecords =[];
|
|
|
- for (let r of results){
|
|
|
+ for (let r of results.datas){
|
|
|
if(r){
|
|
|
newRecords.push(r)
|
|
|
}
|
|
@@ -397,7 +399,8 @@ function deleteByID(datas,callback){
|
|
|
function startingTask(processName){
|
|
|
return function(asyncCallBack){
|
|
|
var result = {
|
|
|
- processName : processName
|
|
|
+ processName : processName,
|
|
|
+ datas:[]
|
|
|
};
|
|
|
asyncCallBack(null, result);
|
|
|
};
|