whycxzp
2023-06-25 7951879338b046e000d39ebb6fbcfae16ff47324
src/main/java/com/whyc/controller/SOPController.java
@@ -1,6 +1,7 @@
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;
@@ -12,6 +13,7 @@
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
@RequestMapping("sop")
@RestController
@@ -30,14 +32,20 @@
        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);
    }
}