| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SopDto; |
| | | import com.whyc.pojo.SOP; |
| | | import com.whyc.service.SOPService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @RequestMapping("sop") |
| | | @RestController |
| | |
| | | if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){ |
| | | response.set(1,false,"文件解析错误:上传格式非excel格式"); |
| | | }else{ |
| | | response = service.excelParse(multipartFile.getInputStream()); |
| | | response = service.excelParse(multipartFile); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | @ApiOperation("确定sop") |
| | | @PostMapping("confirm") |
| | | public Response add(@RequestBody SOP sop) { |
| | | public Response add(@RequestBody SOP sop) throws IOException { |
| | | return service.add(sop); |
| | | } |
| | | |
| | | @ApiOperation("查询sop信息") |
| | | @PostMapping("getSopInfo") |
| | | public Response getSopInfo(@RequestBody(required = false) List<SopDto> list, @RequestParam(required = false) String code, @RequestParam(required = false) String model) { |
| | | return service.getSopInfo(list,code,model); |
| | | } |
| | | } |