|
|
@@ -92,6 +92,7 @@ const shareListModel = mongoose.model('share_list');
|
|
|
let welcomeModel = mongoose.model("welcome_setting");
|
|
|
let divideModel = mongoose.model("divide_setting");
|
|
|
let evaluateListModel = mongoose.model("evaluate_list");
|
|
|
+let bidListModel = mongoose.model("bid_evaluation_list");
|
|
|
|
|
|
let featureLibModel = mongoose.model("std_project_feature_lib");
|
|
|
let scMathUtil = require('../../../public/scMathUtil').getUtil();
|
|
|
@@ -583,7 +584,8 @@ async function copyProject(userID, compilationID, data, newProjectID = null, del
|
|
|
copyRationSubList(originalID,newProjectID,billMap.uuidMaping,rationMap.uuidMaping,projectGLJMap.IDMap,quantityDetailModel),
|
|
|
copyRationSubList(originalID,newProjectID,billMap.uuidMaping,rationMap.uuidMaping,projectGLJMap.IDMap,rationInstallationModel),
|
|
|
copyRationSubList(originalID,newProjectID,billMap.uuidMaping,rationMap.uuidMaping,projectGLJMap.IDMap,rationTemplateModel),
|
|
|
- copyMaterialList(originalID,newProjectID,projectGLJMap.IDMap,evaluateListModel)
|
|
|
+ copyMaterialList(originalID,newProjectID,projectGLJMap.IDMap,evaluateListModel),
|
|
|
+ copyMaterialList(originalID,newProjectID,projectGLJMap.IDMap,bidListModel),
|
|
|
];
|
|
|
if(originalProperty.calcProgramFile){
|
|
|
copyTasks.push(commonCopy(newProjectID,originalProperty.calcProgramFile.ID,calcProgramFileID,calcProgramsModel));
|
|
|
@@ -1637,7 +1639,7 @@ async function exportTenderData(data){
|
|
|
result.labourCoes = await labourCoesModel.findOne({projectID:data.projectID}).lean();
|
|
|
result.divide_setting = await divideModel.findOne({projectID:data.projectID}, '-_id').lean();
|
|
|
result.evaluateList = await evaluateListModel.find({projectID:data.projectID}, '-_id').lean();
|
|
|
-
|
|
|
+ result.bidList = await bidListModel.find({projectID:data.projectID}, '-_id').lean();
|
|
|
return cipher.aesEncrypt(JSON.stringify(result));
|
|
|
}
|
|
|
|
|
|
@@ -1791,9 +1793,9 @@ async function importProject(data,req,updateData) {
|
|
|
let [constructionProjectID,projectIDMap,labourCoeFileIDMap,calcProgramFileIDMap] = await handleMainProjectDatas(mainData,updateData,req.session.sessionUser.id);
|
|
|
result.constructionProjectID = constructionProjectID;
|
|
|
if(datas.length > 1 ){//生成后统一次插入 2020-05-29
|
|
|
- let newProjectSettings=[],bills=[],rations=[],projectGLJs=[],rationGLJs=[],rationCoes=[],quantityDetails=[],rationInstallations=[],rationTemplates=[],newCalcProgramsFiles=[],newLabourCoes=[],newDivides=[],evaluateList;
|
|
|
+ let newProjectSettings=[],bills=[],rations=[],projectGLJs=[],rationGLJs=[],rationCoes=[],quantityDetails=[],rationInstallations=[],rationTemplates=[],newCalcProgramsFiles=[],newLabourCoes=[],newDivides=[],evaluateList=[],bidList=[];
|
|
|
for(let i = 1;i<datas.length;i++){
|
|
|
- let [newProjectSetting,tbills,trations,tprojectGLJs,trationGLJs,trationCoes,tquantityDetails,trationInstallations,trationTemplates,newCalcProgramsFile,newLabourCoe,newDivide,tevaluateList] = await handleEachProject(datas[i],projectIDMap,labourCoeFileIDMap,calcProgramFileIDMap)
|
|
|
+ let [newProjectSetting,tbills,trations,tprojectGLJs,trationGLJs,trationCoes,tquantityDetails,trationInstallations,trationTemplates,newCalcProgramsFile,newLabourCoe,newDivide,tevaluateList,tbidList] = await handleEachProject(datas[i],projectIDMap,labourCoeFileIDMap,calcProgramFileIDMap)
|
|
|
if(newProjectSetting) newProjectSettings.push(newProjectSetting);
|
|
|
if(tbills.length > 0) bills = bills.concat(tbills);
|
|
|
if(trations.length > 0) rations = rations.concat(trations);
|
|
|
@@ -1807,6 +1809,7 @@ async function importProject(data,req,updateData) {
|
|
|
if(newLabourCoe) newLabourCoes.push(newLabourCoe);
|
|
|
if(newDivide) newDivides.push(newDivide);
|
|
|
if(tevaluateList.length > 0) evaluateList = evaluateList.concat(tevaluateList);
|
|
|
+ if(tbidList.length > 0) bidList = bidList.concat(tbidList);
|
|
|
}
|
|
|
|
|
|
if(newProjectSettings.length > 0) await insertMany(newProjectSettings,projectSettingModel);
|
|
|
@@ -1822,6 +1825,7 @@ async function importProject(data,req,updateData) {
|
|
|
if(newLabourCoes.length>0) await insertMany(newLabourCoes,labourCoesModel);
|
|
|
if(newDivides.length>0) await divideModel.insertMany(newDivides);
|
|
|
if(evaluateList.length > 0) await insertMany(evaluateList,evaluateListModel);
|
|
|
+ if(bidList.length > 0) await insertMany(bidList,bidListModel);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1830,7 +1834,7 @@ async function importProject(data,req,updateData) {
|
|
|
}
|
|
|
|
|
|
async function handleEachProject(data,projectIDMap,labourCoeFileIDMap,calcProgramFileIDMap){
|
|
|
- let bills = [],rations = [],projectGLJs = [],rationGLJs=[],rationCoes=[],quantityDetails=[],rationInstallations=[],rationTemplates=[],evaluateList=[];
|
|
|
+ let bills = [],rations = [],projectGLJs = [],rationGLJs=[],rationCoes=[],quantityDetails=[],rationInstallations=[],rationTemplates=[],evaluateList=[],bidList=[];
|
|
|
let newProjectSetting =null,newCalcProgramsFile = null,newLabourCoe = null,newDivide=null;
|
|
|
let billsIDMap = {},projectGLJIDMap={},rationIDMap = {};
|
|
|
let newProjectID = projectIDMap[data.projSetting.projectID];
|
|
|
@@ -1879,6 +1883,7 @@ async function handleEachProject(data,projectIDMap,labourCoeFileIDMap,calcProgra
|
|
|
if(data.rationInstallations && data.rationInstallations.length > 0) rationInstallations = setRationSubList(data.rationInstallations,newProjectID,billsIDMap,rationIDMap,projectGLJIDMap);
|
|
|
if(data.rationTemplates && data.rationTemplates.length > 0) rationTemplates = setRationSubList(data.rationTemplates,newProjectID,billsIDMap,rationIDMap,projectGLJIDMap);
|
|
|
if(data.evaluateList && data.evaluateList.length > 0) evaluateList = setMaterialList(data.evaluateList,newProjectID,projectGLJIDMap);
|
|
|
+ if(data.bidList && data.bidList.length > 0) bidList = setMaterialList(data.bidList,newProjectID,projectGLJIDMap);
|
|
|
|
|
|
//生成projectSetting 文件
|
|
|
if(data.projSetting){
|
|
|
@@ -1912,7 +1917,7 @@ async function handleEachProject(data,projectIDMap,labourCoeFileIDMap,calcProgra
|
|
|
delete newDivide._id;
|
|
|
}
|
|
|
|
|
|
- return [newProjectSetting,bills,rations,projectGLJs,rationGLJs,rationCoes,quantityDetails,rationInstallations,rationTemplates,newCalcProgramsFile,newLabourCoe,newDivide,evaluateList]
|
|
|
+ return [newProjectSetting,bills,rations,projectGLJs,rationGLJs,rationCoes,quantityDetails,rationInstallations,rationTemplates,newCalcProgramsFile,newLabourCoe,newDivide,evaluateList,bidList]
|
|
|
|
|
|
}
|
|
|
|