From 34a716e48e49743083953113bfc2e8011d52444f Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 15 九月 2025 19:08:05 +0800
Subject: [PATCH] 日志修改
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java | 65 ++++++++++++++++++++++----------
1 files changed, 45 insertions(+), 20 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java
index bbef2d5..ef5f73b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java
@@ -7,8 +7,10 @@
import com.ruoyi.common.core.domain.AjaxResult;
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.ServiceDonatecomporgan;
import com.ruoyi.project.domain.ServiceDonateorgan;
import com.ruoyi.project.domain.ServiceDonateorganVO;
import com.ruoyi.project.domain.ServiceOrganallocation;
@@ -18,6 +20,7 @@
import com.ruoyi.project.service.IServiceOrganallocationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -31,6 +34,7 @@
* @author ruoyi
* @date 2021-11-10
*/
+@Slf4j
@Api("鎹愮尞鍣ㄥ畼绠$悊")
@RestController
@RequestMapping("/project/donateorgan")
@@ -46,22 +50,23 @@
* 鏌ヨ鎹愮尞鍣ㄥ畼绠$悊鍒楄〃
*/
@ApiOperation("鎹愮尞鍣ㄥ畼鍒楄〃")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:list')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:list')")
@GetMapping("/list")
public TableDataInfo list(ServiceDonateorgan serviceDonateorgan) {
startPage();
List<ServiceDonateorgan> list = serviceDonateorganService.queryList(serviceDonateorgan);
- if (!CollectionUtils.isEmpty(list)) {
- List<ServiceDonateorganVO> serviceDonateorganVOS = DtoConversionUtils.sourceToTarget(list, ServiceDonateorganVO.class);
-// for (ServiceDonateorganVO serviceDonateorganVO : serviceDonateorganVOS) {
-// ServiceOrganallocation serviceOrganallocation = new ServiceOrganallocation();
-// serviceOrganallocation.setOrganid(serviceDonateorganVO.getId());
-// List<ServiceOrganallocation> serviceOrganallocations = serviceOrganallocationService.selectServiceOrganallocationList(serviceOrganallocation);
-// serviceDonateorganVO.setServiceOrganallocations(serviceOrganallocations);
-// }
- return getDataTable(serviceDonateorganVOS);
- }
+ return getDataTable(list);
+ }
+
+ /**
+ * 鍣ㄥ畼鍒嗛厤绱
+ */
+ @ApiOperation("鍣ㄥ畼鍒嗛厤绱")
+ @GetMapping("/countList")
+ public TableDataInfo countList(ServiceDonateorgan serviceDonateorgan) {
+ startPage();
+ List<ServiceDonateorgan> list = serviceDonateorganService.countList(serviceDonateorgan);
return getDataTable(list);
}
@@ -77,7 +82,7 @@
* 瀵煎嚭鎹愮尞鍣ㄥ畼绠$悊鍒楄〃
*/
@ApiOperation("瀵煎嚭鎹愮尞鍣ㄥ畼鍒楄〃")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:export')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:export')")
@Log(title = "鎹愮尞鍣ㄥ畼绠$悊", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ServiceDonateorgan serviceDonateorgan) {
@@ -90,7 +95,7 @@
* 鑾峰彇鎹愮尞鍣ㄥ畼绠$悊璇︾粏淇℃伅
*/
@ApiOperation("閫氳繃id鑾峰緱鎹愮尞鍣ㄥ畼淇℃伅")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:query')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(serviceDonateorganService.getById(id));
@@ -100,9 +105,9 @@
* 鏂板鎹愮尞鍣ㄥ畼绠$悊
*/
@ApiOperation("鏂板鎹愮尞鍣ㄥ畼淇℃伅")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
@Log(title = "鎹愮尞鍣ㄥ畼绠$悊", businessType = BusinessType.INSERT)
- @PostMapping
+ @PostMapping("/add")
@RepeatSubmit
public AjaxResult add(@RequestBody ServiceDonateorgan serviceDonateorgan) {
String organNumber = serviceDonateorgan.getDonorno() + "." + serviceDonateorgan.getOrganno();
@@ -117,7 +122,8 @@
}
}
serviceDonateorgan.setOrgannumber(organNumber);
- return toAjax(serviceDonateorganService.save(serviceDonateorgan));
+ boolean save = serviceDonateorganService.save(serviceDonateorgan);
+ return AjaxResult.success(serviceDonateorgan);
}
@@ -125,7 +131,7 @@
* 鏂板鎹愮尞鍣ㄥ畼绠$悊
*/
@ApiOperation("鏂板鎹愮尞鍣ㄥ畼淇℃伅")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
@Log(title = "鎹愮尞鍣ㄥ畼绠$悊", businessType = BusinessType.INSERT)
@PostMapping("/addData")
@RepeatSubmit
@@ -139,7 +145,7 @@
* 淇敼鍣ㄥ畼鍒嗛厤
*/
@ApiOperation("淇敼鍣ㄥ畼鍒嗛厤淇℃伅")
- //@PreAuthorize("@ss.hasPermi('project:organallocation:edit')")
+ //// @PreAuthorize("@ss.hasPermi('project:organallocation:edit')")
@Log(title = "鍣ㄥ畼鍒嗛厤", businessType = BusinessType.UPDATE)
@PostMapping("/editarraydata")
@RepeatSubmit
@@ -151,7 +157,7 @@
* 淇敼鎹愮尞鍣ㄥ畼绠$悊
*/
@ApiOperation("淇敼鎹愮尞鍣ㄥ畼淇℃伅")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:edit')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:edit')")
@Log(title = "鎹愮尞鍣ㄥ畼绠$悊", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@RepeatSubmit
@@ -163,7 +169,7 @@
* 鍒犻櫎鎹愮尞鍣ㄥ畼绠$悊
*/
@ApiOperation("鍒犻櫎鎹愮尞鍣ㄥ畼淇℃伅")
- //@PreAuthorize("@ss.hasPermi('project:donateorgan:remove')")
+ //// @PreAuthorize("@ss.hasPermi('project:donateorgan:remove')")
@Log(title = "鎹愮尞鍣ㄥ畼绠$悊", businessType = BusinessType.DELETE)
@GetMapping("/remove/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
@@ -280,5 +286,24 @@
return AjaxResult.success(serviceDonateorganService.getOrganCount(timeVO));
}
+ @RepeatSubmit
+ @ApiOperation("鏂板鎴栦慨鏀规崘鐚櫒瀹樼鐞�")
+ @Log(title = "鎹愮尞瀹屾垚", businessType = BusinessType.UPDATE)
+ @PostMapping("/saveOrUpdateDonateorgan")
+ public AjaxResult saveOrUpdateDonateorgan(@RequestBody List<ServiceDonateorgan> serviceDonateorganList) {
+ if (CollectionUtils.isEmpty(serviceDonateorganList)) {
+ throw new BaseException("璇锋鏌ラ渶瑕佹柊澧炴垨淇敼鐨勬崘鐚櫒瀹樼鐞嗗弬鏁版槸鍚﹀畬鏁�");
+ }
+ Boolean i = null;
+ for (ServiceDonateorgan serviceDonateorgan : serviceDonateorganList) {
+ log.info("鎹愮尞鍣ㄥ畼绉绘id鏄惁涓虹┖ : {},鍩虹琛ㄧ殑id涓� : {}", serviceDonateorgan.getId(), serviceDonateorgan.getInfoid());
+ if (serviceDonateorgan.getId() == null) {
+ i = serviceDonateorganService.save(serviceDonateorgan);
+ } else {
+ i = serviceDonateorganService.updateById(serviceDonateorgan);
+ }
+ }
+ return toAjax(i);
+ }
}
--
Gitblit v1.9.3