From 095eb642b440c3c3b9ed2e553a666970ac1032ab Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 03 九月 2025 16:15:26 +0800
Subject: [PATCH] 用户消费金额与总订单数,按标签过滤会员,订单列表会员名称与导出
---
framework/src/main/java/cn/lili/modules/lmk/service/impl/NewsServiceImpl.java | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/NewsServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/NewsServiceImpl.java
index 92011fc..9088686 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/NewsServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/NewsServiceImpl.java
@@ -59,16 +59,24 @@
@Override
public Result remove(List<String> ids) {
+ for (String id : ids) {
+ if (isPublishNews(id)){
+ return Result.error("瀛樺湪鏂伴椈宸插彂甯冨垹闄ゅ墠璇蜂笅鏋惰鏂伴椈锛�");
+ }
+ }
+
baseMapper.deleteBatchIds(ids);
return Result.ok("鍒犻櫎鎴愬姛");
}
-
+ public Boolean isPublishNews(String id){
+ News entity = baseMapper.selectById(id);
+ return entity.getPublish();
+ }
@Override
public Result removeById(String id) {
//鍒ゆ柇鏄惁鍙戝竷鍙戝竷鍒欐彁绀哄厛涓嬫灦锛屽啀鍒犻櫎
- News entity = baseMapper.selectById(id);
- if(entity.getPublish()){
- throw new RuntimeException("璇ユ柊闂诲凡鍙戝竷");
+ if(isPublishNews(id)){
+ return Result.error("璇ユ柊闂诲凡鍙戝竷鍒犻櫎鍓嶈涓嬫灦璇ユ柊闂伙紒");
}
baseMapper.deleteById(id);
--
Gitblit v1.8.0