| @@ -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.entity.projection.InventoryInfo | ||||
| import com.ffii.fpsms.modules.stock.service.InventoryService | import com.ffii.fpsms.modules.stock.service.InventoryService | ||||
| import com.ffii.fpsms.modules.stock.web.model.SearchInventoryRequest | 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 | @RestController | ||||
| @RequestMapping("/inventory") | @RequestMapping("/inventory") | ||||
| @@ -23,4 +25,15 @@ class InventoryController( | |||||
| fun allInventoriesByPage(@ModelAttribute request: SearchInventoryRequest): RecordsRes<InventoryInfo> { | fun allInventoriesByPage(@ModelAttribute request: SearchInventoryRequest): RecordsRes<InventoryInfo> { | ||||
| return inventoryService.allInventoriesByPage(request); | 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)) | |||||
| } | |||||
| } | } | ||||