From cf9a5039e6db9d1d5963e3fe1a37d00169ec2ef7 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期三, 25 六月 2025 11:18:22 +0800 Subject: [PATCH] 验收报告修改 --- src/main/java/com/whyc/controller/SOPController.java | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/whyc/controller/SOPController.java b/src/main/java/com/whyc/controller/SOPController.java index 74d4396..13c8792 100644 --- a/src/main/java/com/whyc/controller/SOPController.java +++ b/src/main/java/com/whyc/controller/SOPController.java @@ -1,19 +1,21 @@ package com.whyc.controller; import com.whyc.dto.Response; +import com.whyc.dto.SopDto; +import com.whyc.pojo.SOP; +import com.whyc.pojo.SOPLockLog; import com.whyc.service.SOPService; +import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.text.ParseException; +import java.util.List; @RequestMapping("sop") @RestController @@ -32,8 +34,43 @@ if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){ response.set(1,false,"鏂囦欢瑙f瀽閿欒:涓婁紶鏍煎紡闈瀍xcel鏍煎紡"); }else{ - response = service.excelParse(multipartFile.getInputStream()); + response = service.excelParse(multipartFile); } return response; } + + @ApiOperation("纭畾sop") + @PostMapping("confirm") + public Response add(@RequestParam MultipartFile multipartFile,@RequestParam String sopStr) throws IOException { + SOP sop=ActionUtil.getGson().fromJson(sopStr,SOP.class); + return service.add(sop,multipartFile); + } + + @ApiOperation("鏌ヨsop淇℃伅") + @PostMapping("getSopInfo") + public Response getSopInfo(@RequestBody(required = false) List<SopDto> list + , @RequestParam(required = false) String code, @RequestParam(required = false) String model + , @RequestParam(required = false) Integer status, @RequestParam(required = false) String fileName + , @RequestParam int pageCurr, @RequestParam int pageSize) { + return service.getSopInfo(list,code,model,status,fileName,pageCurr,pageSize); + } + + @ApiOperation("鏌ヨsop鍘嗗彶") + @GetMapping("getSopHis") + public Response getSopHis(@RequestParam(required = false) String fileName) { + return service.getSopHis(fileName); + } + + @ApiOperation("鏇存柊sop璇存槑锛堜笉鍚攣淇℃伅锛�") + @PostMapping("updateSop") + public Response updateSop(@RequestBody SOP sop) { + return service.updateSop(sop); + } + + @ApiOperation("璁剧疆sop鏈夋晥鐘舵��") + @PutMapping("updateStatusById") + public Response updateStatusById(@RequestBody SOPLockLog lockLog) { + return service.updateStatusById(lockLog); + } + } -- Gitblit v1.9.1