瀏覽代碼

update

master
MSI\derek 2 週之前
父節點
當前提交
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))
}
}

Loading…
取消
儲存