From 0c5e744bd9b52147c7fc273ec8fe7bd7afea0ebb Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 05 三月 2024 15:42:21 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java
index f14aba7..45dee61 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java
@@ -1,5 +1,6 @@
 package com.ruoyi.web.controller.project;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
@@ -7,8 +8,10 @@
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.bean.DtoConversionUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.project.domain.ServiceDonorchargeorgan;
+import com.ruoyi.project.domain.ServiceDonorchargeorganVO;
 import com.ruoyi.project.service.IServiceDonorchargeorganService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -18,6 +21,7 @@
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -78,7 +82,11 @@
     @Log(title = "鎹愮尞鍣ㄥ畼", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @RepeatSubmit
-    public AjaxResult add(@RequestBody ServiceDonorchargeorgan serviceDonorchargeorgan) {
+    public AjaxResult add(@RequestBody ServiceDonorchargeorganVO serviceDonorchargeorganvo) {
+        if (!CollectionUtils.isEmpty(serviceDonorchargeorganvo.getAnnexFilesList())) {
+            serviceDonorchargeorganvo.setAnnexFiles(JSON.toJSONString(serviceDonorchargeorganvo.getAnnexFilesList()));
+        }
+        ServiceDonorchargeorgan serviceDonorchargeorgan = DtoConversionUtils.sourceToTarget(serviceDonorchargeorganvo, ServiceDonorchargeorgan.class);
         boolean save = serviceDonorchargeorganService.save(serviceDonorchargeorgan);
         return AjaxResult.success(serviceDonorchargeorgan);
     }
@@ -91,7 +99,11 @@
     @Log(title = "鎹愮尞鍣ㄥ畼", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @RepeatSubmit
-    public AjaxResult edit(@RequestBody ServiceDonorchargeorgan serviceDonorchargeorgan) {
+    public AjaxResult edit(@RequestBody ServiceDonorchargeorganVO serviceDonorchargeorganVO) {
+        if (!CollectionUtils.isEmpty(serviceDonorchargeorganVO.getAnnexFilesList())) {
+            serviceDonorchargeorganVO.setAnnexFiles(JSON.toJSONString(serviceDonorchargeorganVO.getAnnexFilesList()));
+        }
+        ServiceDonorchargeorgan serviceDonorchargeorgan = DtoConversionUtils.sourceToTarget(serviceDonorchargeorganVO, ServiceDonorchargeorgan.class);
         return toAjax(serviceDonorchargeorganService.updateById(serviceDonorchargeorgan));
     }
 

--
Gitblit v1.9.3