From c40d7f65624a6f158ec734d2007d7bf8d3b744f4 Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期三, 07 九月 2022 11:32:54 +0800 Subject: [PATCH] 软件excel解析 --- src/main/java/com/whyc/controller/MaterialController.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/controller/MaterialController.java b/src/main/java/com/whyc/controller/MaterialController.java index 15a93ba..60f87cb 100644 --- a/src/main/java/com/whyc/controller/MaterialController.java +++ b/src/main/java/com/whyc/controller/MaterialController.java @@ -3,6 +3,7 @@ import com.whyc.dto.Response; import com.whyc.pojo.Material; import com.whyc.service.MaterialService; +import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; @@ -65,4 +66,18 @@ public Response getMaterialVersion(@RequestParam String subModel){ return service.getMaterialVersion(subModel); } + + @ApiOperation(value = "鏍规嵁鐗╂枡id鏌ヨ鐗╂枡淇℃伅",notes = "9.3淇敼鍚庝娇鐢�") + @GetMapping("getMaterialById") + public Response getMaterialById(@RequestParam int materialId){ + return service.getMaterialById(materialId); + } + + /**鐗╂枡id-鐗╂枡缂栫爜-鐗╂枡鍨嬪彿*/ + @ApiOperation(value = "杩藉姞闄勪欢",notes = "materialStr涓簀son瀛楃涓�,鍖呭惈id,subCode,subModel") + @PostMapping("attachment") + public Response addAttachment(@RequestParam MultipartFile multipartFile,@RequestParam String materialStr) throws IOException { + Material material = ActionUtil.getGson().fromJson(materialStr, Material.class); + return service.addAttachment(multipartFile,material); + } } -- Gitblit v1.9.1