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("侧重要素添加成功"); } /**