From 6bed83e92f67954cd2135071133329f2205efe4f Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 02 四月 2024 16:58:41 +0800
Subject: [PATCH] notify错误修改
---
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifySystemServiceImpl.java | 184 +++++++++-------------------------------------
1 files changed, 36 insertions(+), 148 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifySystemServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifySystemServiceImpl.java
index 42f94fc..4b3465f 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifySystemServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifySystemServiceImpl.java
@@ -1,24 +1,24 @@
package com.qianwen.smartman.modules.notify.service.impl;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import java.lang.invoke.SerializedLambda;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-import com.qianwen.smartman.common.cache.RegionCache;
-import com.qianwen.smartman.common.constant.DictConstant;
-import com.qianwen.smartman.common.utils.ExtraLambdaQueryWrapper;
-import com.qianwen.smartman.common.utils.Lambda;
-import com.qianwen.smartman.common.utils.MessageUtils;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qianwen.core.log.exception.ServiceException;
import com.qianwen.core.mp.base.BaseServiceImpl;
import com.qianwen.core.secure.utils.AuthUtil;
import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.common.constant.DictConstant;
+import com.qianwen.smartman.common.utils.Lambda;
+import com.qianwen.smartman.common.utils.MessageUtils;
import com.qianwen.smartman.modules.notify.convert.NotifySystemConvert;
import com.qianwen.smartman.modules.notify.entity.Notice;
import com.qianwen.smartman.modules.notify.entity.NotifySystem;
@@ -30,9 +30,6 @@
import com.qianwen.smartman.modules.notify.vo.NotifySystemVO;
import com.qianwen.smartman.modules.system.entity.Dict;
import com.qianwen.smartman.modules.system.service.IDictService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotifySystemServiceImpl.class */
@@ -43,139 +40,20 @@
@Autowired
private IDictService dictService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1601031533:
- if (implMethodName.equals("getDictKey")) {
- z = false;
- break;
- }
- break;
- case -1462679124:
- if (implMethodName.equals("getNotifyTime")) {
- z = true;
- break;
- }
- break;
- case -1462663655:
- if (implMethodName.equals("getNotifyType")) {
- z = true;
- break;
- }
- break;
- case -1462639958:
- if (implMethodName.equals("getNotifyUser")) {
- z = true;
- break;
- }
- break;
- case -982980443:
- if (implMethodName.equals("getDictValue")) {
- z = true;
- break;
- }
- break;
- case -75622813:
- if (implMethodName.equals("getCode")) {
- z = true;
- break;
- }
- break;
- }
- switch (z) {
- case false:
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictKey();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictKey();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictKey();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictKey();
- };
- }
- break;
- case true:
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/notify/entity/NotifySystem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getNotifyType();
- };
- }
- break;
- case true:
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/notify/entity/NotifySystem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getNotifyUser();
- };
- }
- break;
- case true:
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictValue();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictValue();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getDictValue();
- };
- }
- break;
- case true:
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getCode();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getCode();
- };
- }
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getCode();
- };
- }
- break;
- case RegionCache.VILLAGE_LEVEL /* 5 */:
- if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/notify/entity/NotifySystem") && lambda.getImplMethodSignature().equals("()Ljava/util/Date;")) {
- return (v0) -> {
- return v0.getNotifyTime();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
-
@Override // org.springblade.modules.notify.service.INotifySystemService
public NotifySystemUnreadVO getUnreadList() {
+
+ List<Dict> dicts = this.dictService.list(Wrappers.<Dict>lambdaQuery().select(Dict::getDictKey, Dict::getDictValue).eq(Dict::getCode, DictConstant.NOTICE_CODE));
+
+ /*
List<Dict> dicts = this.dictService.list((Wrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> {
return v0.getDictKey();
}, (v0) -> {
return v0.getDictValue();
}}).eq((v0) -> {
return v0.getCode();
- }, DictConstant.NOTICE_CODE));
- Map<String, String> noticeDict = (Map) dicts.stream().collect(Collectors.toMap((v0) -> {
+ }, DictConstant.NOTICE_CODE));*/
+ Map<String, String> noticeDict = dicts.stream().collect(Collectors.toMap((v0) -> {
return v0.getDictKey();
}, (v0) -> {
return v0.getDictValue();
@@ -185,14 +63,14 @@
return new NotifySystemUnreadVO();
}
if (Func.isNotEmpty(noticeDict)) {
- notifySystems = (List) notifySystems.stream().peek(o -> {
+ notifySystems = notifySystems.stream().peek(o -> {
o.setCategoryName((String) noticeDict.get(String.valueOf(o.getCategory())));
}).collect(Collectors.toList());
}
- List<NotifySystemVO> internalList = (List) notifySystems.stream().filter(o2 -> {
+ List<NotifySystemVO> internalList = notifySystems.stream().filter(o2 -> {
return o2.getNotifyType().equals(1);
}).collect(Collectors.toList());
- List<NotifySystemVO> noticeList = (List) notifySystems.stream().filter(o3 -> {
+ List<NotifySystemVO> noticeList = notifySystems.stream().filter(o3 -> {
return o3.getNotifyType().equals(2);
}).collect(Collectors.toList());
NotifySystemUnreadVO notifySystemUnreadVO = NotifySystemUnreadVO.builder().totalList(notifySystems).internalList(internalList).noticeList(noticeList).build();
@@ -205,25 +83,30 @@
Integer notifyType = selectVO.getNotifyType();
selectVO.setUserId(Func.toStr(userId));
if (Func.equals(1, notifyType)) {
+ Wrapper<NotifySystem> wrapper = Wrappers.<NotifySystem>lambdaQuery()
+ .eq(NotifySystem::getNotifyType, 1).eq(NotifySystem::getNotifyUser, userId).orderByDesc(NotifySystem::getNotifyTime);
+ /*
Wrapper<NotifySystem> wrapper = (Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getNotifyType();
}, 1)).eq((v0) -> {
return v0.getNotifyUser();
}, userId)).orderByDesc((v0) -> {
return v0.getNotifyTime();
- });
+ });*/
return NotifySystemConvert.INSTANCE.convert(page(page, wrapper));
} else if (Func.equals(2, notifyType)) {
IPage<NotifySystemVO> voPage = ((NotifySystemMapper) this.baseMapper).pageNotifySystem(selectVO, page);
List<NotifySystemVO> records = voPage.getRecords();
+ List<Dict> dicts = this.dictService.list(Wrappers.<Dict>lambdaQuery().select(Dict::getDictKey, Dict::getDictValue).eq(Dict::getCode, DictConstant.NOTICE_CODE));
+ /*
List<Dict> dicts = this.dictService.list((Wrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> {
return v0.getDictKey();
}, (v0) -> {
return v0.getDictValue();
}}).eq((v0) -> {
return v0.getCode();
- }, DictConstant.NOTICE_CODE));
- Map<String, String> noticeDict = (Map) dicts.stream().collect(Collectors.toMap((v0) -> {
+ }, DictConstant.NOTICE_CODE));*/
+ Map<String, String> noticeDict = dicts.stream().collect(Collectors.toMap((v0) -> {
return v0.getDictKey();
}, (v0) -> {
return v0.getDictValue();
@@ -233,7 +116,7 @@
});
return voPage;
} else {
- return new Page();
+ return new Page<>();
}
}
@@ -253,6 +136,11 @@
}
Integer category = notice.getCategory();
String content = notice.getContent();
+ Dict dict = this.dictService.getOne(Lambda.<Dict>create()
+ .select(Dict::getDictKey, Dict::getDictValue).eq(Dict::getCode, DictConstant.NOTICE_CODE)
+ .eq(Dict::getDictKey, category.toString())
+ .limit());
+ /*
Dict dict = (Dict) this.dictService.getOne(((ExtraLambdaQueryWrapper) ((ExtraLambdaQueryWrapper) Lambda.create().select((v0) -> {
return v0.getDictKey();
}, (v0) -> {
@@ -261,7 +149,7 @@
return v0.getCode();
}, DictConstant.NOTICE_CODE)).eq((v0) -> {
return v0.getDictKey();
- }, category.toString())).limit());
+ }, category.toString())).limit());*/
if (Func.isNotEmpty(dict)) {
String dictValue = dict.getDictValue();
systemVO.setCategoryName(dictValue);
--
Gitblit v1.9.3