From 7e971f7dd0a8931082f9216601f491815225018b Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Wed, 24 Apr 2024 16:37:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=BE=A7=E9=87=8D=E8=A6=81?= =?UTF-8?q?=E7=B4=A0=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventImportantController.java | 2 +- .../business/service/IDcEventImportantService.java | 4 +++- .../service/impl/DcEventImportantServiceImpl.java | 12 +++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventImportantController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventImportantController.java index e010ebc7..23eaadde 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventImportantController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventImportantController.java @@ -92,7 +92,7 @@ public class DcEventImportantController extends BaseController @ApiOperation("修改事件侧重要素") public AjaxResult edit(@RequestBody DcEventImportant dcEventImportant) { - return toAjax(dcEventImportantService.updateDcEventImportant(dcEventImportant)); + return dcEventImportantService.updateDcEventImportant(dcEventImportant); } /** diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventImportantService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventImportantService.java index 04a27946..6dafcd4e 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventImportantService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventImportantService.java @@ -1,6 +1,8 @@ package com.zc.business.service; import java.util.List; + +import com.ruoyi.common.core.domain.AjaxResult; import com.zc.business.domain.DcEventImportant; /** @@ -41,7 +43,7 @@ public interface IDcEventImportantService * @param dcEventImportant 事件侧重要素 * @return 结果 */ - int updateDcEventImportant(DcEventImportant dcEventImportant); + AjaxResult updateDcEventImportant(DcEventImportant dcEventImportant); /** * 批量删除事件侧重要素 diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java index 0c951f7d..b0bc219e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantServiceImpl.java @@ -1,6 +1,9 @@ package com.zc.business.service.impl; import java.util.List; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.zc.business.mapper.DcEventImportantMapper; @@ -62,13 +65,16 @@ public class DcEventImportantServiceImpl implements IDcEventImportantService * @return 结果 */ @Override - public int updateDcEventImportant(DcEventImportant dcEventImportant) + public AjaxResult updateDcEventImportant(DcEventImportant dcEventImportant) { + if (StringUtils.isEmpty(dcEventImportant.getEventId())){ + return AjaxResult.error("事件id不能为空"); + } int i = dcEventImportantMapper.updateDcEventImportant(dcEventImportant); if (i < 1){ - i = dcEventImportantMapper.insertDcEventImportant(dcEventImportant); + dcEventImportantMapper.insertDcEventImportant(dcEventImportant); } - return i; + return AjaxResult.success("侧重要素添加成功"); } /**