MSI\derek преди 1 седмица
родител
ревизия
2a899e2d7b
променени са 1 файла, в които са добавени 17 реда и са изтрити 4 реда
  1. +17
    -4
      src/main/java/com/ffii/fpsms/modules/stock/web/InventoryController.kt

+ 17
- 4
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<InventoryInfo> {
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))
}
}

Зареждане…
Отказ
Запис