diff --git a/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryController.kt b/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryController.kt index 55e8c04..143d339 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryController.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryController.kt @@ -4,10 +4,12 @@ import com.ffii.core.response.RecordsRes import com.ffii.fpsms.modules.stock.entity.projection.InventoryInfo import com.ffii.fpsms.modules.stock.service.InventoryService import com.ffii.fpsms.modules.stock.web.model.SearchInventoryRequest -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.ModelAttribute -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.core.io.ByteArrayResource +import org.springframework.core.io.Resource +import org.springframework.http.HttpHeaders +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.* +import java.time.LocalDate @RestController @RequestMapping("/inventory") @@ -23,4 +25,15 @@ class InventoryController( fun allInventoriesByPage(@ModelAttribute request: SearchInventoryRequest): RecordsRes { return inventoryService.allInventoriesByPage(request); } + + @PostMapping("/import-bom") + fun importInventory() { + val reportResult = inventoryService.importInventoryExcel() +// val filename = "bom_excel_issue_log_${LocalDate.now()}.xlsx" + +// return ResponseEntity.ok() +// .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"$filename\"") +// .header(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") +// .body(ByteArrayResource(reportResult)) + } } \ No newline at end of file