|
@@ -141,7 +141,7 @@ function get_lib_glj_info(ration_glj) {
|
|
ration_glj.repositoryId = glj.repositoryId;
|
|
ration_glj.repositoryId = glj.repositoryId;
|
|
ration_glj.adjCoe = glj.adjCoe;
|
|
ration_glj.adjCoe = glj.adjCoe;
|
|
getInfoFromProjectGLJ(ration_glj).then(function (info) {
|
|
getInfoFromProjectGLJ(ration_glj).then(function (info) {
|
|
- if (info) {
|
|
|
|
|
|
+ if (info &&info.length>0) {
|
|
let tem = {};
|
|
let tem = {};
|
|
tem.newRecode = createNewRecord(info[0]);
|
|
tem.newRecode = createNewRecord(info[0]);
|
|
tem.showData = info[0];
|
|
tem.showData = info[0];
|
|
@@ -635,13 +635,14 @@ async function prepareExtData(projectID,compilation) {
|
|
|
|
|
|
async function addGLJ(rgList,compilation) {
|
|
async function addGLJ(rgList,compilation) {
|
|
if (rgList.length <= 0) return {};
|
|
if (rgList.length <= 0) return {};
|
|
- let newRecodes = await insertAddTypeGLJ(rgList,compilation);
|
|
|
|
|
|
+ let [newRecodes,projectGLJList] = await insertAddTypeGLJ(rgList,compilation);
|
|
let stateResult = await glj_calculate_facade.calculateQuantity({
|
|
let stateResult = await glj_calculate_facade.calculateQuantity({
|
|
projectID: rgList[0].projectID,
|
|
projectID: rgList[0].projectID,
|
|
rationID: rgList[0].rationID
|
|
rationID: rgList[0].rationID
|
|
});
|
|
});
|
|
let result = {
|
|
let result = {
|
|
newRecodes: newRecodes,
|
|
newRecodes: newRecodes,
|
|
|
|
+ projectGLJList:projectGLJList,
|
|
showData: rgList,
|
|
showData: rgList,
|
|
adjustState: stateResult.adjustState
|
|
adjustState: stateResult.adjustState
|
|
};
|
|
};
|
|
@@ -650,6 +651,7 @@ async function addGLJ(rgList,compilation) {
|
|
|
|
|
|
async function insertAddTypeGLJ(rgList,compilation) {
|
|
async function insertAddTypeGLJ(rgList,compilation) {
|
|
let newRecodes = [];
|
|
let newRecodes = [];
|
|
|
|
+ let projectGLJList = [];
|
|
let [unitFileId,ext] = await prepareExtData(rgList[0].projectID,compilation);
|
|
let [unitFileId,ext] = await prepareExtData(rgList[0].projectID,compilation);
|
|
for (let g of rgList) {
|
|
for (let g of rgList) {
|
|
let projectGljModel = new GLJListModel();
|
|
let projectGljModel = new GLJListModel();
|
|
@@ -668,9 +670,10 @@ async function insertAddTypeGLJ(rgList,compilation) {
|
|
g.subList = getMixRatioShowDatas(result.subList);
|
|
g.subList = getMixRatioShowDatas(result.subList);
|
|
}
|
|
}
|
|
newRecodes.push(createNewRecord(g));
|
|
newRecodes.push(createNewRecord(g));
|
|
|
|
+ projectGLJList.push(result);
|
|
}
|
|
}
|
|
await ration_glj.insertMany(newRecodes);
|
|
await ration_glj.insertMany(newRecodes);
|
|
- return newRecodes;
|
|
|
|
|
|
+ return [newRecodes,projectGLJList];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -693,20 +696,21 @@ async function replaceGLJByData(data,compilation) {
|
|
if (result.hasOwnProperty('subList') && result.subList.length > 0) {
|
|
if (result.hasOwnProperty('subList') && result.subList.length > 0) {
|
|
data.subList = getMixRatioShowDatas(result.subList);
|
|
data.subList = getMixRatioShowDatas(result.subList);
|
|
}
|
|
}
|
|
- return data;
|
|
|
|
|
|
+ return [data,result];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
async function replaceGLJ(data,compilation) {
|
|
async function replaceGLJ(data,compilation) {
|
|
let rdata = {};
|
|
let rdata = {};
|
|
- data = await replaceGLJByData(data,compilation);
|
|
|
|
|
|
+ let [tdata,projectGLJ] = await replaceGLJByData(data,compilation);
|
|
let stateResult = await glj_calculate_facade.calculateQuantity({
|
|
let stateResult = await glj_calculate_facade.calculateQuantity({
|
|
- projectID: data.projectID,
|
|
|
|
- rationID: data.rationID
|
|
|
|
|
|
+ projectID: tdata.projectID,
|
|
|
|
+ rationID: tdata.rationID
|
|
}, true,true);
|
|
}, true,true);
|
|
- rdata.data = data;
|
|
|
|
|
|
+ rdata.data = tdata;
|
|
rdata.adjustState = stateResult.adjustState;
|
|
rdata.adjustState = stateResult.adjustState;
|
|
rdata.name = stateResult.rationName;
|
|
rdata.name = stateResult.rationName;
|
|
|
|
+ rdata.projectGLJ = projectGLJ;
|
|
return rdata;
|
|
return rdata;
|
|
}
|
|
}
|
|
async function mReplaceGLJ(data,compilation) {
|
|
async function mReplaceGLJ(data,compilation) {
|
|
@@ -739,6 +743,7 @@ async function mReplaceGLJ(data,compilation) {
|
|
data.doc = newDoc;
|
|
data.doc = newDoc;
|
|
mresult.data = data;
|
|
mresult.data = data;
|
|
mresult.stateList = stateList;
|
|
mresult.stateList = stateList;
|
|
|
|
+ mresult.projectGLJ = result;
|
|
return mresult
|
|
return mresult
|
|
}
|
|
}
|
|
|
|
|