From 78ee837585bf67ca1b462db6adbdb8135de05fb8 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 19 十二月 2023 17:50:16 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateflowchartController.java | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateflowchartController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateflowchartController.java
index cf64e70..e86696a 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateflowchartController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateflowchartController.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -27,15 +28,14 @@
/**
* 鎹愮尞娴佺▼Controller
- *
+ *
* @author ruoyi
* @date 2021-11-15
*/
@Api("鎹愮尞娴佺▼绠$悊")
@RestController
@RequestMapping("/project/donateflowchart")
-public class ServiceDonateflowchartController extends BaseController
-{
+public class ServiceDonateflowchartController extends BaseController {
@Autowired
private IServiceDonateflowchartService serviceDonateflowchartService;
@@ -45,8 +45,7 @@
@ApiOperation("鏌ヨ鎹愮尞娴佺▼")
//@PreAuthorize("@ss.hasPermi('system:donateflowchart:list')")
@GetMapping("/list")
- public TableDataInfo list(ServiceDonateflowchart serviceDonateflowchart)
- {
+ public TableDataInfo list(ServiceDonateflowchart serviceDonateflowchart) {
startPage();
List<ServiceDonateflowchart> list = serviceDonateflowchartService.queryList(serviceDonateflowchart);
@@ -60,8 +59,7 @@
//@PreAuthorize("@ss.hasPermi('system:donateflowchart:export')")
@Log(title = "鎹愮尞娴佺▼", businessType = BusinessType.EXPORT)
@GetMapping("/export")
- public AjaxResult export(ServiceDonateflowchart serviceDonateflowchart)
- {
+ public AjaxResult export(ServiceDonateflowchart serviceDonateflowchart) {
List<ServiceDonateflowchart> list = serviceDonateflowchartService.queryList(serviceDonateflowchart);
ExcelUtil<ServiceDonateflowchart> util = new ExcelUtil<ServiceDonateflowchart>(ServiceDonateflowchart.class);
return util.exportExcel(list, "鎹愮尞娴佺▼鏁版嵁");
@@ -73,8 +71,7 @@
@ApiOperation("閫氳繃id鑾峰彇鎹愮尞娴佺▼")
//@PreAuthorize("@ss.hasPermi('system:donateflowchart:query')")
@GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(serviceDonateflowchartService.getById(id));
}
@@ -86,8 +83,7 @@
@Log(title = "鎹愮尞娴佺▼", businessType = BusinessType.INSERT)
@PostMapping
@RepeatSubmit
- public AjaxResult add(@RequestBody ServiceDonateflowchart serviceDonateflowchart)
- {
+ public AjaxResult add(@RequestBody ServiceDonateflowchart serviceDonateflowchart) {
return toAjax(serviceDonateflowchartService.save(serviceDonateflowchart));
}
@@ -98,9 +94,15 @@
//@PreAuthorize("@ss.hasPermi('system:donateflowchart:edit')")
@Log(title = "鎹愮尞娴佺▼", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
- @RepeatSubmit
- public AjaxResult edit(@RequestBody ServiceDonateflowchart serviceDonateflowchart)
- {
+ @RepeatSubmit
+ public AjaxResult edit(@RequestBody ServiceDonateflowchart serviceDonateflowchart) {
+ ServiceDonateflowchart serviceDonateflowchart1 = new ServiceDonateflowchart();
+ serviceDonateflowchart1.setInfoid(serviceDonateflowchart.getInfoid());
+ List<ServiceDonateflowchart> list = serviceDonateflowchartService.queryList(serviceDonateflowchart1);
+ if (CollectionUtils.isEmpty(list)) {
+ return error("浼︾悊瀹℃煡淇敼鏁版嵁涓嶅瓨鍦�,璇锋鏌ュ悗鍐嶆淇敼");
+ }
+ serviceDonateflowchart.setId(list.get(0).getId());
return toAjax(serviceDonateflowchartService.updateById(serviceDonateflowchart));
}
@@ -111,8 +113,7 @@
//@PreAuthorize("@ss.hasPermi('system:donateflowchart:remove')")
@Log(title = "鎹愮尞娴佺▼", businessType = BusinessType.DELETE)
@GetMapping("/remove/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
+ public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(serviceDonateflowchartService.removeByIds(Arrays.asList(ids)));
}
}
--
Gitblit v1.9.3