Browse Source

定额导入内部数据,取费类别可为空

zhongzewei 7 years ago
parent
commit
1cfc5fb28e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      modules/ration_repository/models/ration_item.js

+ 3 - 3
modules/ration_repository/models/ration_item.js

@@ -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);
 };