|
@@ -25,6 +25,7 @@ const rationInstallationModel = mongoose.model('ration_installation');
|
|
|
const quantityDetailModel = mongoose.model('quantity_detail');
|
|
|
const unitPriceFileModel = mongoose.model('unit_price_file');
|
|
|
const unitPriceModel = mongoose.model('unit_price');
|
|
|
+const mixRatioModel = mongoose.model('mix_ratio');
|
|
|
const feeRateFileModel = mongoose.model('fee_rate_file');
|
|
|
const feeRateModel = mongoose.model('fee_rates');
|
|
|
|
|
@@ -94,7 +95,7 @@ async function clearJunkData(callback){
|
|
|
unitPriceModel.remove({unit_price_file_id: {$in: junkUFIds}}, cb);
|
|
|
});
|
|
|
functions.push(function(cb){
|
|
|
- unitPriceFileModel.remove({id: {$in: junkUFIds}}, cb);
|
|
|
+ mixRatioModel.remove({unit_price_file_id: {$in: junkUFIds}}, cb);
|
|
|
});
|
|
|
}
|
|
|
//彻底删除了的费率文件
|
|
@@ -107,9 +108,6 @@ async function clearJunkData(callback){
|
|
|
functions.push(function(cb){
|
|
|
feeRateModel.remove({ID: {$in: junkFFIds}}, cb);
|
|
|
});
|
|
|
- functions.push(function(cb){
|
|
|
- feeRateFileModel.remove({feeRateID: {$in: junkFFIds}}, cb);
|
|
|
- });
|
|
|
}
|
|
|
//清除
|
|
|
if(functions.length > 0){
|
|
@@ -117,6 +115,10 @@ async function clearJunkData(callback){
|
|
|
if(!err){
|
|
|
//清除项目
|
|
|
await projectModel.remove({ID: {$in: junkProjIds}});
|
|
|
+ //清除单价文件
|
|
|
+ await unitPriceFileModel.remove({id: {$in: junkUFIds}});
|
|
|
+ //清除费率文件
|
|
|
+ await feeRateFileModel.remove({feeRateID: {$in: junkFFIds}});
|
|
|
}
|
|
|
if(callback){
|
|
|
callback(err);
|