| @@ -26,7 +26,8 @@ open class WarehouseSetup { | |||||
| val area: String, | val area: String, | ||||
| val slot: String, | val slot: String, | ||||
| val order: String?, | val order: String?, | ||||
| val stockTakeSection: String? | |||||
| val stockTakeSection: String?, | |||||
| val stockTakeSectionDescription: String? | |||||
| ) | ) | ||||
| @Transactional(rollbackFor = [Exception::class]) | @Transactional(rollbackFor = [Exception::class]) | ||||
| @@ -50,6 +51,7 @@ open class WarehouseSetup { | |||||
| val COLUMN_SLOT_INDEX = 4 // Column E | val COLUMN_SLOT_INDEX = 4 // Column E | ||||
| val COLUMN_ORDER_INDEX = 5 // Column F | val COLUMN_ORDER_INDEX = 5 // Column F | ||||
| val COLUMN_STOCK_TAKE_SECTION_INDEX = 6 // Column G | val COLUMN_STOCK_TAKE_SECTION_INDEX = 6 // Column G | ||||
| val COLUMN_STOCK_TAKE_SECTION_DESCRIPTION_INDEX = 7 // Column H | |||||
| val START_ROW_INDEX = 8 // Start from Excel row 9 (0-based: index 8) | val START_ROW_INDEX = 8 // Start from Excel row 9 (0-based: index 8) | ||||
| @@ -73,6 +75,7 @@ open class WarehouseSetup { | |||||
| val order = ExcelUtils.getStringValue(row.getCell(COLUMN_ORDER_INDEX))?.trim() | val order = ExcelUtils.getStringValue(row.getCell(COLUMN_ORDER_INDEX))?.trim() | ||||
| val stockTakeSection = ExcelUtils.getStringValue(row.getCell(COLUMN_STOCK_TAKE_SECTION_INDEX))?.trim() | val stockTakeSection = ExcelUtils.getStringValue(row.getCell(COLUMN_STOCK_TAKE_SECTION_INDEX))?.trim() | ||||
| val stockTakeSectionDescription = ExcelUtils.getStringValue(row.getCell(COLUMN_STOCK_TAKE_SECTION_DESCRIPTION_INDEX))?.trim() | |||||
| println("=== Processing row ${rowIndex + 1} (store_id: $store_id, warehouse: $warehouse, area: $area, slot: $slot) ===") | println("=== Processing row ${rowIndex + 1} (store_id: $store_id, warehouse: $warehouse, area: $area, slot: $slot) ===") | ||||
| @@ -83,7 +86,8 @@ open class WarehouseSetup { | |||||
| area = area, | area = area, | ||||
| slot = slot, | slot = slot, | ||||
| order = order, | order = order, | ||||
| stockTakeSection = stockTakeSection | |||||
| stockTakeSection = stockTakeSection, | |||||
| stockTakeSectionDescription = stockTakeSectionDescription | |||||
| ) | ) | ||||
| ) | ) | ||||
| } | } | ||||
| @@ -126,6 +130,9 @@ open class WarehouseSetup { | |||||
| if (data.stockTakeSection != null) { | if (data.stockTakeSection != null) { | ||||
| this.stockTakeSection = data.stockTakeSection | this.stockTakeSection = data.stockTakeSection | ||||
| } | } | ||||
| if (data.stockTakeSectionDescription != null) { | |||||
| this.stockTakeSectionDescription = data.stockTakeSectionDescription | |||||
| } | |||||
| } | } | ||||
| warehouseRepository.save(existingWarehouse) | warehouseRepository.save(existingWarehouse) | ||||
| updatedCount++ | updatedCount++ | ||||
| @@ -145,6 +152,9 @@ open class WarehouseSetup { | |||||
| if (data.stockTakeSection != null) { | if (data.stockTakeSection != null) { | ||||
| this.stockTakeSection = data.stockTakeSection | this.stockTakeSection = data.stockTakeSection | ||||
| } | } | ||||
| if (data.stockTakeSectionDescription != null) { | |||||
| this.stockTakeSectionDescription = data.stockTakeSectionDescription | |||||
| } | |||||
| } | } | ||||
| warehouseRepository.save(newWarehouse) | warehouseRepository.save(newWarehouse) | ||||
| createdCount++ | createdCount++ | ||||