Merge branch 'master' of http://118.89.139.230:10101/r/~whyclxw/CadDrawManager
| | |
| | | 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; |
| | |
| | | public Response getMaterialById(@RequestParam int materialId){ |
| | | return service.getMaterialById(materialId); |
| | | } |
| | | |
| | | /**物料id-物料编码-物料型号*/ |
| | | @ApiOperation(value = "追加附件",notes = "materialStr为json字符串,包含id,subCode,subModel") |
| | | @PostMapping("attachment") |
| | | public Response addAttachment(@RequestParam MultipartFile multipartFile,@RequestParam String materialStr){ |
| | | Material material = ActionUtil.getGson().fromJson(materialStr, Material.class); |
| | | return service.addAttachment(multipartFile,material); |
| | | } |
| | | } |
| | |
| | | } |
| | | return new Response().setIII(1,material!=null,material,list,"物料历史版本数据返回"); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param multipartFile 被追加的附件 |
| | | * @param material |
| | | * @return 返回被追加文件的文件夹路径 |
| | | */ |
| | | public Response addAttachment(MultipartFile multipartFile, Material material) { |
| | | String dirPath = "doc_file" + File.separator + "material" + File.separator + material.getId() + material.getSubCode() + material.getSubModel(); |
| | | //TODO |
| | | return new Response().setII(1,"上传完成"); |
| | | } |
| | | } |