From b6dd47b05107fc36d8ff4f7f29a4446521f95503 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 02 一月 2025 18:44:28 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java
index 1091173..9b321ae 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java
@@ -9,6 +9,7 @@
 import com.ruoyi.common.enums.Education;
 import com.ruoyi.common.enums.NationalityEnum;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.project.domain.vo.RelativeConfirmationVO;
 import com.ruoyi.project.mapper.ServiceDonatebaseinfoMapper;
 import com.ruoyi.project.mapper.ServiceRelativesconfirmationMapper;
@@ -70,7 +71,7 @@
      * 鏌ヨ鎹愮尞浜插睘纭鍒楄〃
      */
     @ApiOperation("鑾峰彇浜插睘纭鍒楄〃")
-    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:list')")
+    //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:list')")
     @GetMapping("/list")
     public TableDataInfo list(ServiceRelativesconfirmation serviceRelativesconfirmation) {
         startPage();
@@ -90,7 +91,7 @@
      * 瀵煎嚭鎹愮尞浜插睘纭鍒楄〃
      */
     @ApiOperation("瀵煎嚭浜插睘纭鍒楄〃")
-    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:export')")
+    //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:export')")
     @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(ServiceRelativesconfirmation serviceRelativesconfirmation) {
@@ -103,7 +104,7 @@
      * 鑾峰彇鎹愮尞浜插睘纭璇︾粏淇℃伅
      */
     @ApiOperation("閫氳繃id鑾峰彇浜插睘纭淇℃伅")
-    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:query')")
+    //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(serviceRelativesconfirmationService.getById(id));
@@ -113,30 +114,34 @@
      * 鏂板鎹愮尞浜插睘纭
      */
     @ApiOperation("鏂板浜插睘纭")
-    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:add')")
+    //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:add')")
     @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.INSERT)
-    @PostMapping
+    @PostMapping("/add")
     @RepeatSubmit
     public AjaxResult add(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) {
-        return toAjax(serviceRelativesconfirmationService.save(serviceRelativesconfirmation));
+        boolean save = serviceRelativesconfirmationService.save(serviceRelativesconfirmation);
+        return AjaxResult.success(serviceRelativesconfirmation);
     }
 
     /**
      * 淇敼鎹愮尞浜插睘纭
      */
     @ApiOperation("淇敼浜插睘纭")
-    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:edit')")
+    //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:edit')")
     @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @RepeatSubmit
     public AjaxResult edit(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) {
-        ServiceRelativesconfirmation serviceRelativesconfirmation1 = new ServiceRelativesconfirmation();
-        serviceRelativesconfirmation1.setInfoid(serviceRelativesconfirmation.getInfoid());
-        List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation1);
-        if (CollectionUtils.isEmpty(list)) {
-            return error("鎹愮尞浜插睘纭鏁版嵁涓嶅瓨鍦�,璇锋鏌ュ悗鍐嶆淇敼");
+        if (serviceRelativesconfirmation.getInfoid() == null || serviceRelativesconfirmation.getId() == null) {
+            throw new BaseException("璇疯仈绯诲伐绋嬪笀妫�鏌D鏄惁涓虹┖");
         }
-        serviceRelativesconfirmation.setId(list.get(0).getId());
+//        ServiceRelativesconfirmation serviceRelativesconfirmation1 = new ServiceRelativesconfirmation();
+//        serviceRelativesconfirmation1.setInfoid(serviceRelativesconfirmation.getInfoid());
+//        List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation1);
+//        if (CollectionUtils.isEmpty(list)) {
+//            return error("鎹愮尞浜插睘纭鏁版嵁涓嶅瓨鍦�,璇锋鏌ュ悗鍐嶆淇敼");
+//        }
+//        serviceRelativesconfirmation.setId(list.get(0).getId());
         return toAjax(serviceRelativesconfirmationService.updateById(serviceRelativesconfirmation));
     }
 
@@ -144,7 +149,7 @@
      * 鍒犻櫎鎹愮尞浜插睘纭
      */
     @ApiOperation("鍒犻櫎浜插睘纭")
-    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:remove')")
+    //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:remove')")
     @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
@@ -184,17 +189,13 @@
 
         try {
             out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
-
-        } catch (FileNotFoundException e1) {
-            e1.printStackTrace();
-        }
-        try {
             t.process(dataMap, out);
         } catch (TemplateException e) {
             e.printStackTrace();
         }
         Map<String, Object> map = new HashMap<>();
         map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
+        map.put("downloadName", name + ".doc");
         return map;
     }
 

--
Gitblit v1.9.3