From bfa320956f20988fe671b0c4d25aa82fe766a98d Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期一, 23 六月 2025 20:17:51 +0800
Subject: [PATCH] 验收报告添加信息

---
 src/main/java/com/whyc/controller/WorksheetMainController.java |   76 +++++++++++++++++++++++++++----------
 1 files changed, 55 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/whyc/controller/WorksheetMainController.java b/src/main/java/com/whyc/controller/WorksheetMainController.java
index 52a6e49..045f4a1 100644
--- a/src/main/java/com/whyc/controller/WorksheetMainController.java
+++ b/src/main/java/com/whyc/controller/WorksheetMainController.java
@@ -1,10 +1,12 @@
 package com.whyc.controller;
 
 import com.github.pagehelper.PageInfo;
+import com.whyc.config.EnumWorksheetType;
 import com.whyc.dto.Response;
 import com.whyc.dto.WorksheetMainDTO;
 import com.whyc.dto.WorksheetMainDTO2;
 import com.whyc.pojo.DocUser;
+import com.whyc.pojo.ProcedureDocApproving;
 import com.whyc.pojo.WorksheetMain;
 import com.whyc.service.WorksheetMainService;
 import com.whyc.util.ActionUtil;
@@ -12,10 +14,11 @@
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
-import javax.annotation.Resource;
+import javax.mail.MessagingException;
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.List;
 import java.util.Map;
 
 @RestController
@@ -28,7 +31,7 @@
 
     @PostMapping("submit")
     @ApiOperation("浜у搧鍥剧焊鍙奲om鎻愪氦")
-    public Response submit(@RequestBody WorksheetMain main){
+    public Response submit(@RequestBody WorksheetMain main) throws IOException {
         DocUser user = ActionUtil.getUser();
         boolean res = service.submit(main,user);
         if(res) {
@@ -38,11 +41,11 @@
         }
     }
 
-    @PostMapping("componentRelatedSubmit")
-    @ApiOperation(value="鏁h浠�-浜у搧瀹℃壒鎻愪氦")
-    public Response componentProductSubmit(@RequestBody WorksheetMainDTO mainDTO){
+    @PostMapping("materialRelatedSubmit")
+    @ApiOperation(value="鐗╂枡-浜у搧瀹℃壒鎻愪氦")
+    public Response materialProductSubmit(@RequestBody WorksheetMainDTO mainDTO){
         DocUser user = ActionUtil.getUser();
-        boolean res = service.componentProductSubmit(mainDTO,user);
+        boolean res = service.MaterialProductSubmit(mainDTO,user);
         if(res) {
             return new Response().set(1,true, "鎻愪氦瀹屾垚");
         }else{
@@ -50,12 +53,13 @@
         }
     }
 
-    @PostMapping("componentSubmit")
-    @ApiOperation(value="鏁h浠跺鎵规彁浜�")
-    public Response componentSubmit(@RequestBody WorksheetMain main){
+    /**鍓嶇鏈紶閫掕繃鏉ョ墿鏂欐枃浠舵墍鍦ㄨ矾寰�,瀛樺湪闂 TODO*/
+    @PostMapping("materialSubmit")
+    @ApiOperation(value="鐗╂枡瀹℃壒鎻愪氦")
+    public Response materialSubmit(@RequestBody WorksheetMain main){
         Response<Object> response = new Response<>();
         DocUser user = ActionUtil.getUser();
-        Response res = service.componentSubmit(main,user);
+        Response res = service.materialSubmit(main,user);
         if(res.getCode()==1) {
             response.set(1,true, "鎻愪氦瀹屾垚");
         }else if(res.getCode()==3){
@@ -63,17 +67,17 @@
         }else{
             //閲嶅鎻愪氦
             Object existCAList = res.getData();
-            Object existComponentList = res.getData2();
+            Object existMaterialList = res.getData2();
             response.setCode(1);
             response.setData(false);
             response.setData2(existCAList);
-            response.setData3(existComponentList);
+            response.setData3(existMaterialList);
             if(res.getCode()==21){
-                response.setMsg("閲嶅鎻愪氦:鐜版湁鏁h浠跺強姝e湪杩涜瀹℃壒鐨勬暎瑁呬欢涓�,瀛樺湪褰撳墠鎻愪氦涓婁紶鐨勬暎瑁呬欢");
+                response.setMsg("閲嶅鎻愪氦:鐜版湁鐗╂枡鍙婃鍦ㄨ繘琛屽鎵圭殑鐗╂枡涓�,瀛樺湪褰撳墠鎻愪氦涓婁紶鐨勬暎瑁呬欢");
             }else if(res.getCode()==22){
-                response.setMsg("閲嶅鎻愪氦:姝e湪杩涜瀹℃壒鐨勬暎瑁呬欢涓�,瀛樺湪褰撳墠鎻愪氦涓婁紶鐨勬暎瑁呬欢");
+                response.setMsg("閲嶅鎻愪氦:姝e湪杩涜瀹℃壒鐨勭墿鏂欎腑,瀛樺湪褰撳墠鎻愪氦涓婁紶鐨勭墿鏂�");
             }else{
-                response.setMsg("閲嶅鎻愪氦:鐜版湁鏁h浠朵腑,瀛樺湪褰撳墠鎻愪氦涓婁紶鐨勬暎瑁呬欢");
+                response.setMsg("閲嶅鎻愪氦:鐜版湁鐗╂枡涓�,瀛樺湪褰撳墠鎻愪氦涓婁紶鐨勭墿鏂�");
             }
         }
         return response;
@@ -81,9 +85,10 @@
 
     @PostMapping("productSoftwareSubmit")
     @ApiOperation(value="浜у搧杞欢瀹℃壒鎻愪氦")
-    public Response productSoftwareSubmit(@RequestBody WorksheetMainDTO2 mainDTO) throws IOException {
+    public Response productSoftwareSubmit(@RequestParam MultipartFile multipartFile,@RequestParam String mainDTOString) throws IOException {
         DocUser user = ActionUtil.getUser();
-        return service.productSoftwareSubmit(mainDTO,user);
+        WorksheetMainDTO2 mainDTO = ActionUtil.getGson().fromJson(mainDTOString, WorksheetMainDTO2.class);
+        return service.productSoftwareSubmit(multipartFile,mainDTO,user);
     }
 
     @GetMapping("statusStatistic")
@@ -123,14 +128,14 @@
     }
 
     @GetMapping("handlingListPage")
-    @ApiOperation("鏌ョ湅鍒嗛〉-寰呭鐞�")
+    @ApiOperation(tags = "娴佺▼鍗″拰SOP",value = "鏌ョ湅鍒嗛〉-寰呭鐞�")
     public Response<PageInfo<WorksheetMain>> getHandlingListPage(@RequestParam int pageNum, @RequestParam int pageSize){
         DocUser user = ActionUtil.getUser();
         return service.getHandlingListPage(user,pageNum,pageSize);
     }
 
     @GetMapping("handledListPage")
-    @ApiOperation("鏌ョ湅鍒嗛〉-宸插鐞�")
+    @ApiOperation(tags = "娴佺▼鍗″拰SOP",value = "鏌ョ湅鍒嗛〉-宸插鐞�")
     public Response<PageInfo<WorksheetMain>> getHandledListPage(@RequestParam int pageNum, @RequestParam int pageSize){
         DocUser user = ActionUtil.getUser();
         return service.getHandledListPage(user,pageNum,pageSize);
@@ -151,10 +156,39 @@
     }
 
     @GetMapping("myListPage")
-    @ApiOperation("鎴戠殑宸ュ崟")
+    @ApiOperation(tags = "娴佺▼鍗″拰SOP",value = "鎴戠殑宸ュ崟")
     public Response<PageInfo<WorksheetMain>> getMyList(@RequestParam int pageNum,@RequestParam int pageSize){
         DocUser user = ActionUtil.getUser();
         return service.getMyList(pageNum,pageSize,user);
     }
 
+    /**
+     * {@link EnumWorksheetType#getType()}
+     * @param approving
+     * @return
+     * @throws IOException
+     * @throws MessagingException
+     */
+    @PostMapping("productProcedureAndSOP")
+    @ApiOperation(tags = "娴佺▼鍗″拰SOP",value = "纭杩囩▼-浜у搧娴佺▼鍗″強SOP鎻愪氦",notes = "type:1-娴佺▼鍗�,2-SOP")
+    public Response addProductProcedureAndSOP(@RequestBody ProcedureDocApproving approving) throws IOException, MessagingException {
+        DocUser user = ActionUtil.getUser();
+        return service.addProductProcedureAndSOP(approving,user);
+    }
+
+    @GetMapping("procedurePreview")
+    @ApiOperation(tags = "娴佺▼鍗″拰SOP",value = "纭杩囩▼-棰勮pdf",notes = "")
+    public Response procedurePreview(HttpServletResponse response,@RequestParam int mainId) throws IOException {
+        return service.procedurePreview(response,mainId);
+    }
+
+    /**
+     * 璇㈡墍鏈夌殑宸ュ崟,鎵�鏈変汉鍙
+     */
+    @PostMapping("getAllPage")
+    @ApiOperation(value = "璇㈡墍鏈夌殑宸ュ崟,鎵�鏈変汉鍙")
+    public Response getAllPage(@RequestBody WorksheetMain param) {
+        return service.getAllPage(param);
+    }
+
 }

--
Gitblit v1.9.1