From 04d13e3a41ef798e07c25c1d3ad2002270a9cb76 Mon Sep 17 00:00:00 2001
From: whycxzp <perryhsu@163.com>
Date: 星期一, 17 十月 2022 13:53:56 +0800
Subject: [PATCH] 邮件发送

---
 src/main/java/com/whyc/controller/WorksheetMainController.java |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/whyc/controller/WorksheetMainController.java b/src/main/java/com/whyc/controller/WorksheetMainController.java
index 52a6e49..a248063 100644
--- a/src/main/java/com/whyc/controller/WorksheetMainController.java
+++ b/src/main/java/com/whyc/controller/WorksheetMainController.java
@@ -12,10 +12,9 @@
 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 java.io.IOException;
-import java.util.List;
 import java.util.Map;
 
 @RestController
@@ -28,7 +27,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 +37,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 +49,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 +63,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 +81,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")

--
Gitblit v1.9.1