|
@@ -90,7 +90,8 @@ async function calcInstallationFee(data) {
|
|
|
if(data.ration.add.length>0){//新增的安装子目要增加对应的工料机
|
|
|
for(let nr of data.ration.add){
|
|
|
for(let tkey in nr.glj){
|
|
|
- newGljList.push(await addInstallationGLJ(nr.glj[tkey]));
|
|
|
+ let [newRecode,projectGLJ] = await createRationGLJData(nr.glj[tkey])
|
|
|
+ newGljList.push(newRecode);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -102,14 +103,17 @@ async function calcInstallationFee(data) {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-async function addInstallationGLJ(glj) {
|
|
|
+async function createRationGLJData(glj) {
|
|
|
glj.ID = uuidV1();
|
|
|
- let info = await ration_glj_facade.getInfoFromProjectGLJ(glj);
|
|
|
+ let [info,projectGLJ ] = await ration_glj_facade.getInfoFromProjectGLJ(glj);
|
|
|
let newRecode = ration_glj_facade.createNewRecord(info);
|
|
|
- return newRecode;
|
|
|
+ return [newRecode,projectGLJ];
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
function generateTasks(data,userID) {
|
|
|
let tasks=[];
|
|
|
let deleteInfo={deleted: true, deleteDateTime: new Date(), deleteBy: userID};
|
|
@@ -218,7 +222,7 @@ async function calcOverHeightFee(data) {
|
|
|
let completeRationGLJList = [];
|
|
|
if (rationGLJ.length) {
|
|
|
// 定额人材机需要新增项目人材机、单价文件、且返回完整的定额人材机数据
|
|
|
- const rationGLJTasks = rationGLJ.map(glj => addInstallationGLJ(glj));
|
|
|
+ const rationGLJTasks = rationGLJ.map(glj => createRationGLJData(glj));
|
|
|
completeRationGLJList = await Promise.all(rationGLJTasks);
|
|
|
// 新增定额人材机
|
|
|
tasks.push(ration_glj_model.insertMany(completeRationGLJList));
|