|
@@ -660,14 +660,18 @@ rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function(data) {
|
|
|
// 批量执行update
|
|
|
const bulk = rationItemModel.collection.initializeOrderedBulkOp();
|
|
|
for (const tmp of data) {
|
|
|
- let rationId = parseInt(tmp[1]);
|
|
|
+ let rationId = parseInt(tmp[2]);
|
|
|
rationId = isNaN(rationId) || rationId <= 0 ? 0 : rationId;
|
|
|
let sectionId = parseInt(tmp[0]);
|
|
|
sectionId = isNaN(sectionId) || sectionId <= 0 ? 0 : sectionId;
|
|
|
- if (sectionId <= 0 || rationId <= 0) {
|
|
|
+ // 取费专业
|
|
|
+ let feeType = parseInt(tmp[1]);
|
|
|
+ feeType = isNaN(feeType) || feeType <= 0 ? 0 : feeType;
|
|
|
+ if (sectionId <= 0 || rationId <= 0 || feeType <= 0) {
|
|
|
continue;
|
|
|
}
|
|
|
- bulk.find({"ID": rationId}).update({$set: { sectionId: sectionId }});
|
|
|
+
|
|
|
+ bulk.find({"ID": rationId}).update({$set: { sectionId: sectionId, feeType: feeType }});
|
|
|
}
|
|
|
|
|
|
const result = await bulk.execute();
|