|
@@ -2402,10 +2402,19 @@ async function importProjects(data,req,updateData) {
|
|
|
|
|
|
|
|
|
async function handleEachProject(data,projectIDMap,labourCoeFileIDMap,calcProgramFileIDMap){
|
|
|
- let bills = [],rations = [],projectGLJs = [],rationGLJs=[],rationCoes=[],quantityDetails=[],rationInstallations=[],rationTemplates=[],evaluateList=[],bidList=[],contractorList=[];
|
|
|
+ let bills = [],rations = [],projectGLJs = [],installationFees=[],rationGLJs=[],rationCoes=[],quantityDetails=[],rationInstallations=[],rationTemplates=[],evaluateList=[],bidList=[],contractorList=[];
|
|
|
let newProjectSetting =null,newCalcProgramsFile = null,newLabourCoe = null;
|
|
|
let billsIDMap = {},projectGLJIDMap={},rationIDMap = {};
|
|
|
let newProjectID = projectIDMap[data.projSetting.projectID];
|
|
|
+ //生成安装增加费设置
|
|
|
+ if(data.installationFees && data.installationFees.length > 0){
|
|
|
+ for(let ins of data.installationFees){
|
|
|
+ delete ins._id;
|
|
|
+ ins.ID = uuidV1();
|
|
|
+ ins.projectID = newProjectID;
|
|
|
+ installationFees.push(ins);
|
|
|
+ }
|
|
|
+ }
|
|
|
//生成新的清单;
|
|
|
if(data.bills && data.bills.length > 0){
|
|
|
for(let b of data.bills){
|
|
@@ -2479,6 +2488,7 @@ async function handleEachProject(data,projectIDMap,labourCoeFileIDMap,calcProgra
|
|
|
if(newProjectSetting) await projectSettingModel.create(newProjectSetting);
|
|
|
if(bills.length > 0) await insertMany(bills,billsModel);
|
|
|
if(rations.length > 0) await insertMany(rations,rationModel);
|
|
|
+ if(installationFees.length > 0) await insertMany(installationFees,installationFeeModel);
|
|
|
if(projectGLJs.length > 0) await insertMany(projectGLJs,gljListModel);
|
|
|
if(rationGLJs.length > 0) await insertMany(rationGLJs,rationGLJModel);
|
|
|
if(rationCoes.length > 0) await insertMany(rationCoes,rationCoeModel);
|