|
@@ -785,17 +785,17 @@ rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function(data) {
|
|
|
let sectionId = parseInt(tmp[0]);
|
|
|
sectionId = isNaN(sectionId) || sectionId <= 0 ? 0 : sectionId;
|
|
|
// 取费专业
|
|
|
- let feeType = parseInt(tmp[1]);
|
|
|
+ let feeType = tmp[1] ? parseInt(tmp[1]) : null;
|
|
|
feeType = isNaN(feeType) || feeType <= 0 ? 0 : feeType;
|
|
|
let name = tmp[4];
|
|
|
name = name ? name : '';
|
|
|
- if (sectionId <= 0 || rationId <= 0 || feeType <= 0) {
|
|
|
+ if (sectionId <= 0 || rationId <= 0) {
|
|
|
continue;
|
|
|
}
|
|
|
bulkOprs.push({updateOne: {filter: {ID: rationId}, update: {$set: {sectionId: sectionId, feeType: feeType, name: name}}}});
|
|
|
}
|
|
|
if(bulkOprs.length <= 0){
|
|
|
- throw '无有效数据(树ID、取费专业、定额ID不为空、且为数值)';
|
|
|
+ throw '无有效数据(树ID、定额ID不为空、且为数值)';
|
|
|
}
|
|
|
await rationItemModel.bulkWrite(bulkOprs);
|
|
|
};
|