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/BusinessNotifyStateServiceImpl.java | 115 --
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/manager/NotifyBusinessManager.java | 40
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/websocket/InternalMessageDataJsonMessageHandler.java | 55 -
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/api/DingTalkApi.java | 56 -
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotificationController.java | 120 +--
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTaskServiceImpl.java | 123 +--
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/jobHandler/BusinessNotifyJob.java | 165 +---
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotificationServiceImpl.java | 47 -
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifySystemServiceImpl.java | 184 +----
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyDefaultPersonServiceImpl.java | 83 --
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyServiceImpl.java | 218 +----
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierConfigController.java | 129 ---
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NoticeServiceImpl.java | 107 --
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyConfigServiceImpl.java | 194 +----
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifySystemController.java | 110 --
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierTemplateController.java | 183 +----
smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTemplateServiceImpl.java | 45
17 files changed, 481 insertions(+), 1,493 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/api/DingTalkApi.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/api/DingTalkApi.java
index fc5fa5e..b2fc957 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/api/DingTalkApi.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/api/DingTalkApi.java
@@ -1,7 +1,11 @@
package com.qianwen.smartman.modules.notify.api;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.request.OapiGettokenRequest;
@@ -10,16 +14,11 @@
import com.dingtalk.api.response.OapiGettokenResponse;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
-import com.taobao.api.ApiException;
-import java.lang.invoke.SerializedLambda;
-import java.util.Map;
import com.qianwen.core.notify.DefaultNotifyType;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.smartman.modules.notify.entity.NotifyConfigEntity;
import com.qianwen.smartman.modules.notify.service.INotifyConfigService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Component;
+import com.taobao.api.ApiException;
@Component
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/api/DingTalkApi.class */
@@ -28,41 +27,6 @@
@Lazy
private INotifyConfigService notifyConfigService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -75106384:
- if (implMethodName.equals("getType")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/notify/entity/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public String getToken() {
DingTalkConfig dingTalkDTO = getDingTalkConfig();
@@ -98,11 +62,15 @@
}
private DingTalkConfig getDingTalkConfig() {
+ NotifyConfigEntity config = this.notifyConfigService.getOne(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .eq(NotifyConfigEntity::getType, DefaultNotifyType.dingTalk.name())
+ .eq(NotifyConfigEntity::getStatus, 1));
+ /*
NotifyConfigEntity config = (NotifyConfigEntity) this.notifyConfigService.getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getType();
}, DefaultNotifyType.dingTalk.name())).eq((v0) -> {
return v0.getStatus();
- }, 1));
+ }, 1));*/
Map<String, Object> configuration = config.getConfiguration();
Object appKey = configuration.get("appKey");
Object appSecret = configuration.get("appSecret");
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotificationController.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotificationController.java
index 54640aa..dd29ecf 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotificationController.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotificationController.java
@@ -1,16 +1,15 @@
package com.qianwen.smartman.modules.notify.controller;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import java.util.List;
+
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import java.lang.invoke.SerializedLambda;
-import java.util.List;
-import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.mp.support.Condition;
import com.qianwen.core.mp.support.Query;
@@ -21,6 +20,7 @@
import com.qianwen.core.scanner.modular.stereotype.ApiResource;
import com.qianwen.core.secure.BladeUser;
import com.qianwen.core.tool.api.R;
+import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.smartman.modules.notify.convert.NotificationConvert;
import com.qianwen.smartman.modules.notify.convert.NotifySubscriberConvert;
import com.qianwen.smartman.modules.notify.dto.Notification;
@@ -29,9 +29,9 @@
import com.qianwen.smartman.modules.notify.entity.NotifySubscriberEntity;
import com.qianwen.smartman.modules.notify.service.INotificationService;
import com.qianwen.smartman.modules.notify.service.INotifySubscriberService;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
@ApiResource({"blade-notify/notifications"})
@Api(value = "绯荤粺閫氱煡绠$悊", tags = {"绯荤粺閫氱煡绠$悊"})
@@ -41,79 +41,6 @@
private final INotificationService notificationService;
private final INotifySubscriberService subscriberService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1517517730:
- if (implMethodName.equals("getSubscriber")) {
- z = false;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/notify/entity/NotifySubscriberEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getSubscriber();
- };
- }
- 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/NotifySubscriberEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getSubscriber();
- };
- }
- 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/NotificationEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getSubscriber();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotificationController(final INotificationService notificationService, final INotifySubscriberService subscriberService) {
this.notificationService = notificationService;
@@ -124,9 +51,13 @@
@GetResource({"/subscriptions/query"})
@ApiOperation(value = "鏌ヨ褰撳墠鐢ㄦ埛璁㈤槄淇℃伅", notes = "鏌ヨ褰撳墠鐢ㄦ埛璁㈤槄淇℃伅")
public R<IPage<NotifySubscriberDTO>> querySubscription(Query query, BladeUser bladeUser) {
+ IPage<NotifySubscriberEntity> pages = this.subscriberService.page(Condition.getPage(query),
+ Wrappers.<NotifySubscriberEntity>query().lambda()
+ .eq(NotifySubscriberEntity::getSubscriber, bladeUser.getUserId()));
+ /*
IPage<NotifySubscriberEntity> pages = this.subscriberService.page(Condition.getPage(query), (Wrapper) Wrappers.query().lambda().eq((v0) -> {
return v0.getSubscriber();
- }, bladeUser.getUserId()));
+ }, bladeUser.getUserId()));*/
return R.data(NotifySubscriberConvert.INSTANCE.convertToPage(pages));
}
@@ -134,22 +65,32 @@
@PutResource({"/subscription/{id}/{state}"})
@ApiOperation(value = "淇敼閫氱煡璁㈤槄鐘舵��", notes = "淇敼閫氱煡璁㈤槄鐘舵��")
public R<String> changeSubscribeState(@PathVariable("id") String id, @PathVariable("state") Integer state) {
+ LambdaUpdateWrapper<NotifySubscriberEntity> updateWrapper = Wrappers.<NotifySubscriberEntity>update().lambda()
+ .set(NotifySubscriberEntity::getStatus, state).eq(NotifySubscriberEntity::getId, id);
+
+ return R.status(this.subscriberService.update(updateWrapper));
+ /*
return R.status(this.subscriberService.update((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.update().lambda().set((v0) -> {
return v0.getStatus();
}, state)).eq((v0) -> {
return v0.getId();
- }, id)));
+ }, id)));*/
}
@ApiOperationSupport(order = 3)
@DeleteResource({"/subscription/{id}"})
@ApiOperation(value = "鍒犻櫎璁㈤槄", notes = "鍒犻櫎璁㈤槄")
public R<String> deleteSubscription(@PathVariable("id") String id, BladeUser bladeUser) {
+ return R.status(this.subscriberService
+ .remove(Wrappers.<NotifySubscriberEntity>lambdaQuery()
+ .eq(NotifySubscriberEntity::getId, id)
+ .eq(NotifySubscriberEntity::getSubscriber, bladeUser.getUserId())));
+ /*
return R.status(this.subscriberService.remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getId();
}, id)).eq((v0) -> {
return v0.getSubscriber();
- }, bladeUser.getUserId())));
+ }, bladeUser.getUserId())));*/
}
@ApiOperationSupport(order = 4)
@@ -178,12 +119,17 @@
@PostResource({"/{state}"})
@ApiOperation("淇敼閫氱煡鐘舵�� 1宸茶")
public R<String> changeNotificationState(@RequestBody List<String> idList, @PathVariable("state") Integer state, BladeUser bladeUser) {
+ LambdaUpdateWrapper<NotificationEntity> updateWrapper = Wrappers.<NotificationEntity>update().lambda()
+ .set(NotificationEntity::getStatus, state).eq(NotificationEntity::getSubscriber, bladeUser.getUserId()).in(NotificationEntity::getId, idList);
+ return R.status(this.notificationService.update(updateWrapper));
+
+ /*
return R.status(this.notificationService.update((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.update().lambda().set((v0) -> {
return v0.getStatus();
}, state)).eq((v0) -> {
return v0.getSubscriber();
}, bladeUser.getUserId())).in((v0) -> {
return v0.getId();
- }, idList)));
+ }, idList)));*/
}
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierConfigController.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierConfigController.java
index 59f3368..dc1ccfc 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierConfigController.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierConfigController.java
@@ -1,20 +1,20 @@
package com.qianwen.smartman.modules.notify.controller;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
+
import javax.validation.Valid;
-import com.qianwen.smartman.common.cache.RegionCache;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.cache.utils.CacheUtil;
import com.qianwen.core.notify.notifier.NotifierProvider;
@@ -25,17 +25,17 @@
import com.qianwen.core.secure.BladeUser;
import com.qianwen.core.tool.api.R;
import com.qianwen.core.tool.metadata.ConfigMetadata;
+import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.smartman.modules.notify.convert.NotifyConfigConvert;
import com.qianwen.smartman.modules.notify.dto.NotifyConfigDTO;
import com.qianwen.smartman.modules.notify.dto.NotifyTypeInfo;
import com.qianwen.smartman.modules.notify.dto.ProviderInfo;
import com.qianwen.smartman.modules.notify.entity.NotifyConfigEntity;
import com.qianwen.smartman.modules.notify.service.INotifyConfigService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
@ApiResource({"blade-notify/notifier/config"})
@Api(value = "閫氱煡閰嶇疆绠$悊", tags = {"閫氱煡閰嶇疆绠$悊"})
@@ -44,91 +44,6 @@
public class NotifierConfigController extends BladeController {
private final INotifyConfigService notifyConfigService;
private final List<NotifierProvider> providers;
-
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -75308287:
- if (implMethodName.equals("getName")) {
- z = false;
- break;
- }
- break;
- case -75106384:
- if (implMethodName.equals("getType")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 771206363:
- if (implMethodName.equals("getTenantId")) {
- z = true;
- break;
- }
- break;
- case 1090405223:
- if (implMethodName.equals("getProvider")) {
- 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/notify/entity/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getName();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getProvider();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getTenantId();
- };
- }
- 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/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getTenantId();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotifierConfigController(final INotifyConfigService notifyConfigService, final List<NotifierProvider> providers) {
this.notifyConfigService = notifyConfigService;
@@ -171,11 +86,15 @@
public R<String> remove(@PathVariable("id") @ApiParam(value = "涓婚敭", required = true) String id, BladeUser bladeUser) {
CacheUtil.evict("blade:notify", "notifier:id:", id, false);
this.notifyConfigService.checkUsedByBusinessNotify(id);
+
+ return R.status(this.notifyConfigService.remove(Wrappers.<NotifyConfigEntity>query().lambda()
+ .eq(NotifyConfigEntity::getId, id).eq(NotifyConfigEntity::getTenantId, bladeUser.getTenantId())));
+ /*
return R.status(this.notifyConfigService.remove((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> {
return v0.getId();
}, id)).eq((v0) -> {
return v0.getTenantId();
- }, bladeUser.getTenantId())));
+ }, bladeUser.getTenantId())));*/
}
@ApiOperationSupport(order = 7)
@@ -183,6 +102,12 @@
@ApiOperation(value = "涓氬姟閫氱煡鍙�夌殑閫氱煡閰嶇疆", notes = "浼犲叆閫氱煡绫诲瀷")
public R<List<NotifyConfigDTO>> getAvailableNotifyConfig(@RequestParam String notifyType, BladeUser bladeUser) {
List<String> tenantIds = new ArrayList<>(Arrays.asList(bladeUser.getTenantId()));
+
+ List<NotifyConfigEntity> result = this.notifyConfigService.list(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .in(NotifyConfigEntity::getTenantId, tenantIds)
+ .eq(NotifyConfigEntity::getType, notifyType)
+ .select(NotifyConfigEntity::getId, NotifyConfigEntity::getName, NotifyConfigEntity::getProvider));
+ /*
List<NotifyConfigEntity> result = this.notifyConfigService.list(((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getTenantId();
}, tenantIds)).eq((v0) -> {
@@ -193,7 +118,7 @@
return v0.getName();
}, (v0) -> {
return v0.getProvider();
- }}));
+ }}));*/
return R.data(NotifyConfigConvert.INSTANCE.convertToDTOList(result));
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierTemplateController.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierTemplateController.java
index 4b8a083..0f37334 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierTemplateController.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifierTemplateController.java
@@ -1,21 +1,21 @@
package com.qianwen.smartman.modules.notify.controller;
-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.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
+
import javax.validation.Valid;
-import com.qianwen.smartman.common.cache.RegionCache;
+
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.cache.utils.CacheUtil;
import com.qianwen.core.mp.support.Condition;
@@ -30,6 +30,7 @@
import com.qianwen.core.tool.metadata.ConfigMetadata;
import com.qianwen.core.tool.tuple.NameValue;
import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.smartman.modules.notify.convert.NotifyTemplateConvert;
import com.qianwen.smartman.modules.notify.dto.NotifyTemplateDTO;
import com.qianwen.smartman.modules.notify.dto.NotifyTemplateQueryDTO;
@@ -39,10 +40,10 @@
import com.qianwen.smartman.modules.notify.service.INotifyConfigService;
import com.qianwen.smartman.modules.notify.service.INotifyTemplateService;
import com.qianwen.smartman.modules.notify.wrapper.NotifyTemplateWrapper;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
@ApiResource({"blade-notify/notifier/template"})
@Api(value = "娑堟伅閫氱煡妯$増", tags = {"娑堟伅閫氱煡妯$増"})
@@ -53,128 +54,6 @@
private final INotifyConfigService notifyConfigService;
private final List<TemplateProvider> providers;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -75308287:
- if (implMethodName.equals("getName")) {
- z = false;
- break;
- }
- break;
- case -75106384:
- if (implMethodName.equals("getType")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 771206363:
- if (implMethodName.equals("getTenantId")) {
- z = true;
- break;
- }
- break;
- case 931069238:
- if (implMethodName.equals("getBusiness")) {
- z = true;
- break;
- }
- break;
- case 1090405223:
- if (implMethodName.equals("getProvider")) {
- 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/notify/entity/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getName();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getName();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusiness();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusiness();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getProvider();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getProvider();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getTenantId();
- };
- }
- 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/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getTenantId();
- };
- }
- 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/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getTenantId();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotifierTemplateController(final INotifyTemplateService templateService, final INotifyConfigService notifyConfigService, final List<TemplateProvider> providers) {
this.templateService = templateService;
@@ -207,21 +86,33 @@
public R<String> remove(@PathVariable("id") @ApiParam(value = "涓婚敭", required = true) String id, BladeUser bladeUser) {
CacheUtil.evict("blade:notify", "template:id:", id, false);
this.templateService.checkUsedByBusinessNotify(id);
+ return R.status(this.templateService
+ .remove(Wrappers.<NotifyTemplateEntity>query().lambda()
+ .eq(NotifyTemplateEntity::getId, id).eq(NotifyTemplateEntity::getTenantId, bladeUser.getTenantId())));
+ /*
return R.status(this.templateService.remove((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> {
return v0.getId();
}, id)).eq((v0) -> {
return v0.getTenantId();
- }, bladeUser.getTenantId())));
+ }, bladeUser.getTenantId())));*/
}
@ApiOperationSupport(order = 4)
@GetResource({"/list"})
@ApiOperation(value = "閫氱煡妯℃澘鍒楄〃", notes = "浼犲叆妯℃澘")
public R<IPage<NotifyTemplateResponseDTO>> configPageList(NotifyTemplateQueryDTO notifyTemplateQueryDTO, Query query, BladeUser bladeUser) {
+ LambdaQueryWrapper<NotifyTemplateEntity> lambdaQueryWrapper = Wrappers.<NotifyTemplateEntity>lambdaQuery()
+ .eq(NotifyTemplateEntity::getTenantId, bladeUser.getTenantId());
+ /*
Wrapper wrapper = (LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getTenantId();
- }, bladeUser.getTenantId());
+ }, bladeUser.getTenantId());*/
if (Func.isNotEmpty(notifyTemplateQueryDTO)) {
+ lambdaQueryWrapper.like(Func.isNotEmpty(notifyTemplateQueryDTO.getName()), NotifyTemplateEntity::getName, notifyTemplateQueryDTO.getName())
+ .in(Func.isNotEmpty(notifyTemplateQueryDTO.getType()), NotifyTemplateEntity::getType, Arrays.asList(notifyTemplateQueryDTO.getType().split(",")))
+ .eq(Func.isNotEmpty(notifyTemplateQueryDTO.getBusinessKey()), NotifyTemplateEntity::getBusiness, notifyTemplateQueryDTO.getBusinessKey())
+ .eq(Func.isNotEmpty(notifyTemplateQueryDTO.getProvider()), NotifyTemplateEntity::getProvider, notifyTemplateQueryDTO.getProvider());
+ /*
wrapper.like(Func.isNotEmpty(notifyTemplateQueryDTO.getName()), (v0) -> {
return v0.getName();
}, notifyTemplateQueryDTO.getName()).in(Func.isNotEmpty(notifyTemplateQueryDTO.getType()), (v0) -> {
@@ -230,9 +121,9 @@
return v0.getBusiness();
}, notifyTemplateQueryDTO.getBusinessKey()).eq(Func.isNotEmpty(notifyTemplateQueryDTO.getProvider()), (v0) -> {
return v0.getProvider();
- }, notifyTemplateQueryDTO.getProvider());
+ }, notifyTemplateQueryDTO.getProvider());*/
}
- IPage<NotifyTemplateEntity> list = this.templateService.page(Condition.getPage(query), wrapper);
+ IPage<NotifyTemplateEntity> list = this.templateService.page(Condition.getPage(query), lambdaQueryWrapper);
return R.data(NotifyTemplateWrapper.build().pageVO(NotifyTemplateConvert.INSTANCE.convertToPage(list)));
}
@@ -251,6 +142,14 @@
List<NameValue<String>> result = new ArrayList<>();
NotifyConfigEntity notifyConfigEntity = (NotifyConfigEntity) this.notifyConfigService.getById(notifyId);
if (Func.isNotEmpty(notifyConfigEntity)) {
+ result = this.templateService.list(Wrappers.<NotifyTemplateEntity>lambdaQuery()
+ .in(NotifyTemplateEntity::getTenantId, Arrays.asList(new String[] { bladeUser.getTenantId(), "000000" }))
+ .eq(NotifyTemplateEntity::getType, notifyConfigEntity.getType())
+ .eq(NotifyTemplateEntity::getBusiness, businessKey)
+ .eq(NotifyTemplateEntity::getProvider, notifyConfigEntity.getProvider())
+ .select(NotifyTemplateEntity::getId, NotifyTemplateEntity::getName ))
+ .stream().map(x -> new NameValue<String>(x.getName(), x.getId().toString())).collect(Collectors.toList());
+ /*
result = (List) this.templateService.list(((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getTenantId();
}, Arrays.asList(bladeUser.getTenantId(), "000000"))).eq((v0) -> {
@@ -265,7 +164,7 @@
return v0.getName();
}})).stream().map(x -> {
return new NameValue(x.getName(), x.getId().toString());
- }).collect(Collectors.toList());
+ }).collect(Collectors.toList());*/
}
return R.data(result);
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifySystemController.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifySystemController.java
index 97c2452..9d34008 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifySystemController.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/controller/NotifySystemController.java
@@ -1,20 +1,24 @@
package com.qianwen.smartman.modules.notify.controller;
-import cn.hutool.json.JSONUtil;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.validation.Valid;
+
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import java.lang.invoke.SerializedLambda;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import javax.validation.Valid;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.mp.support.Condition;
import com.qianwen.core.mp.support.Query;
@@ -31,14 +35,11 @@
import com.qianwen.smartman.modules.notify.vo.NotifySystemUnreadVO;
import com.qianwen.smartman.modules.notify.vo.NotifySystemVO;
import com.qianwen.smartman.modules.notify.websocket.InternalMessageResponseJsonWebSocketMessage;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+
+import cn.hutool.json.JSONUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
import springfox.documentation.annotations.ApiIgnore;
@Api(value = "閫氱煡鍏憡琛ㄧ鐞�", tags = {"閫氱煡鍏憡琛ㄧ鐞�"})
@@ -49,64 +50,6 @@
private INotifySystemService notifySystemService;
private RedisMessageDistributor messageDistributor;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1462639958:
- if (implMethodName.equals("getNotifyUser")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotifySystemController(final INotifySystemService notifySystemService, final RedisMessageDistributor messageDistributor) {
this.notifySystemService = notifySystemService;
@@ -166,19 +109,28 @@
@PostResource({"/{state}"})
@ApiOperation("淇敼閫氱煡鐘舵��")
public R<String> changeState(@RequestBody List<String> idList, @PathVariable("state") Integer state, BladeUser bladeUser) {
+ LambdaUpdateWrapper<NotifySystem> updateWrapper = Wrappers.<NotifySystem>update().lambda()
+ .set(NotifySystem::getStatus, state)
+ .eq(NotifySystem::getNotifyUser, bladeUser.getUserId()).in(NotifySystem::getId, idList);
+ boolean flag = this.notifySystemService.update(updateWrapper);
+ /*
boolean flag = this.notifySystemService.update((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.update().lambda().set((v0) -> {
return v0.getStatus();
}, state)).eq((v0) -> {
return v0.getNotifyUser();
}, bladeUser.getUserId())).in((v0) -> {
return v0.getId();
- }, idList));
+ }, idList));*/
InternalMessageResponseJsonWebSocketMessage internalMessageResponseJsonWebSocketMessage = new InternalMessageResponseJsonWebSocketMessage();
+ long unNotificationCount = this.notifySystemService.count(Wrappers.<NotifySystem>lambdaQuery()
+ .ne(NotifySystem::getStatus, 1)
+ .eq(NotifySystem::getNotifyUser, AuthUtil.getUserId()));
+ /*
long unNotificationCount = this.notifySystemService.count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne((v0) -> {
return v0.getStatus();
}, 1)).eq((v0) -> {
return v0.getNotifyUser();
- }, AuthUtil.getUserId()));
+ }, AuthUtil.getUserId()));*/
internalMessageResponseJsonWebSocketMessage.setHaveUnread(unNotificationCount > 0);
MessageDO messageDO = new MessageDO();
messageDO.setNeedBroadcast(Boolean.FALSE);
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/jobHandler/BusinessNotifyJob.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/jobHandler/BusinessNotifyJob.java
index 90fbd61..0c2c4c9 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/jobHandler/BusinessNotifyJob.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/jobHandler/BusinessNotifyJob.java
@@ -1,22 +1,18 @@
package com.qianwen.smartman.modules.notify.jobHandler;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
-import com.xxl.job.core.biz.model.ReturnT;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import com.xxl.job.core.log.XxlJobLogger;
-import java.lang.invoke.SerializedLambda;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
+
import org.assertj.core.util.Lists;
-import com.qianwen.smartman.common.constant.NotifyConstant;
+import org.springframework.stereotype.Component;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.common.constant.NotifyConstant;
import com.qianwen.smartman.modules.cps.entity.MaintainProject;
import com.qianwen.smartman.modules.cps.service.IMaintainProjectService;
import com.qianwen.smartman.modules.notify.business.BusinessSend;
@@ -29,7 +25,9 @@
import com.qianwen.smartman.modules.tpm.enums.MaintainGenerateEnum;
import com.qianwen.smartman.modules.tpm.enums.MaintainPlanStatusEnum;
import com.qianwen.smartman.modules.tpm.service.IMaintainPlanService;
-import org.springframework.stereotype.Component;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
@Component
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/jobHandler/BusinessNotifyJob.class */
@@ -39,92 +37,6 @@
private final IBusinessNotifyStateService businessNotifyStateService;
private final IMaintainProjectService maintainProjectService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -798691761:
- if (implMethodName.equals("getMaintainDate")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 112409713:
- if (implMethodName.equals("getPlanStatus")) {
- z = false;
- break;
- }
- break;
- case 1404342513:
- if (implMethodName.equals("getBusinessId")) {
- 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/tpm/entity/MaintainPlan") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getPlanStatus();
- };
- }
- 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/tpm/entity/MaintainPlan") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getPlanStatus();
- };
- }
- 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/tpm/entity/MaintainPlan") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getPlanStatus();
- };
- }
- 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/BusinessNotifyState") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getBusinessId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/tpm/entity/MaintainPlan") && lambda.getImplMethodSignature().equals("()Ljava/time/LocalDateTime;")) {
- return (v0) -> {
- return v0.getMaintainDate();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public BusinessNotifyJob(final IMaintainPlanService maintainPlanService, final BusinessSendFactory businessSendFactory, final IBusinessNotifyStateService businessNotifyStateService, final IMaintainProjectService maintainProjectService) {
this.maintainPlanService = maintainPlanService;
@@ -139,7 +51,7 @@
LocalDateTime now = LocalDateTime.now();
BusinessSend businessSend = this.businessSendFactory.getBusinessSend(NotifyConstant.MAINTAIN_OVERDUE);
List<BusinessNotifyState> businessNotifyStates = this.businessNotifyStateService.listByBusinessKey(NotifyConstant.MAINTAIN_OVERDUE);
- Map<Long, List<BusinessNotifyState>> mapByBusinessId = (Map) businessNotifyStates.stream().collect(Collectors.groupingBy((v0) -> {
+ Map<Long, List<BusinessNotifyState>> mapByBusinessId = businessNotifyStates.stream().collect(Collectors.groupingBy((v0) -> {
return v0.getBusinessId();
}));
Set<Long> businessIds = mapByBusinessId.keySet();
@@ -147,35 +59,41 @@
return ReturnT.SUCCESS;
}
List<Long> expireIds = deleteExpireState(businessIds);
+ expireIds.forEach(businessIds::remove);
+ /*
businessIds.getClass();
expireIds.forEach((v1) -> {
r1.remove(v1);
- });
+ });*/
+ List<MaintainPlan> list = this.maintainPlanService.list(Wrappers.<MaintainPlan>lambdaQuery()
+ .lt(true, MaintainPlan::getMaintainDate, now)
+ .in(MaintainPlan::getPlanStatus, Lists.list(new Integer[] {MaintainPlanStatusEnum.T1.getType(), MaintainPlanStatusEnum.T2.getType() } )).in(MaintainPlan::getId, businessIds));
+ /*
List<MaintainPlan> list = this.maintainPlanService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().lt(true, (v0) -> {
return v0.getMaintainDate();
}, now).in((v0) -> {
return v0.getPlanStatus();
}, Lists.list(new Integer[]{Integer.valueOf(MaintainPlanStatusEnum.T1.getType()), Integer.valueOf(MaintainPlanStatusEnum.T2.getType())}))).in((v0) -> {
return v0.getId();
- }, businessIds));
+ }, businessIds));*/
if (Func.isEmpty(list)) {
return ReturnT.SUCCESS;
}
for (MaintainPlan maintainPlan : list) {
Long id = maintainPlan.getId();
List<BusinessNotifyState> states = mapByBusinessId.get(id);
- List<Long> empIds = (List) states.stream().filter(item -> {
+ List<Long> empIds = states.stream().filter(item -> {
return Func.equals(item.getPersonType(), Integer.valueOf(ObjectTypeEnum.EMP.getCode()));
}).map((v0) -> {
return v0.getPersonId();
}).collect(Collectors.toList());
- List<Long> empIds2 = (List) empIds.stream().distinct().collect(Collectors.toList());
- List<Long> orgIds = (List) states.stream().filter(item2 -> {
+ List<Long> empIds2 = empIds.stream().distinct().collect(Collectors.toList());
+ List<Long> orgIds = states.stream().filter(item2 -> {
return Func.equals(item2.getPersonType(), Integer.valueOf(ObjectTypeEnum.ORG.getCode()));
}).map((v0) -> {
return v0.getPersonId();
}).collect(Collectors.toList());
- businessSend.sendMessage(maintainPlan, NotifyBusinessSendDTO.builder().empIds(empIds2).orgIds((List) orgIds.stream().distinct().collect(Collectors.toList())).build());
+ businessSend.sendMessage(maintainPlan, NotifyBusinessSendDTO.builder().empIds(empIds2).orgIds(orgIds.stream().distinct().collect(Collectors.toList())).build());
}
XxlJobLogger.log("瀹氭椂鍙戦�佹垚鍔燂紝:{}", new Object[]{now});
return ReturnT.SUCCESS;
@@ -183,24 +101,33 @@
private List<Long> deleteExpireState(Set<Long> businessIds) {
if (Func.isEmpty(businessIds)) {
- return new ArrayList();
+ return new ArrayList<>();
}
+ List<MaintainPlan> deleteStatePlans = this.maintainPlanService.list(Wrappers.<MaintainPlan>lambdaQuery()
+ .select( MaintainPlan::getId).in(MaintainPlan::getPlanStatus, Lists.list(new Integer[] { Integer.valueOf(MaintainPlanStatusEnum.T3.getType()),MaintainPlanStatusEnum.T4.getType(), MaintainPlanStatusEnum.T5.getType() }))
+ .in(MaintainPlan::getId, businessIds));
+ /*
List<MaintainPlan> deleteStatePlans = this.maintainPlanService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> {
return v0.getId();
}}).in((v0) -> {
return v0.getPlanStatus();
}, Lists.list(new Integer[]{Integer.valueOf(MaintainPlanStatusEnum.T3.getType()), Integer.valueOf(MaintainPlanStatusEnum.T4.getType()), Integer.valueOf(MaintainPlanStatusEnum.T5.getType())}))).in((v0) -> {
return v0.getId();
- }, businessIds));
+ }, businessIds));*/
if (Func.isEmpty(deleteStatePlans)) {
- return new ArrayList();
+ return new ArrayList<>();
}
+ List<Long> waitDeleteBusinessIds = deleteStatePlans.stream().map(MaintainPlan::getId).collect(Collectors.toList());
+ /*
List<Long> waitDeleteBusinessIds = (List) deleteStatePlans.stream().map((v0) -> {
return v0.getId();
- }).collect(Collectors.toList());
+ }).collect(Collectors.toList());*/
+
+ this.businessNotifyStateService.remove(Wrappers.<BusinessNotifyState>lambdaQuery().in(BusinessNotifyState::getBusinessId, waitDeleteBusinessIds));
+ /*
this.businessNotifyStateService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getBusinessId();
- }, waitDeleteBusinessIds));
+ }, waitDeleteBusinessIds));*/
return waitDeleteBusinessIds;
}
@@ -211,7 +138,7 @@
LocalDateTime now = LocalDateTime.now();
BusinessSend businessSend = this.businessSendFactory.getBusinessSend(NotifyConstant.MAINTENANCE_WARNING);
List<BusinessNotifyState> businessNotifyStates = this.businessNotifyStateService.listByBusinessKey(NotifyConstant.MAINTENANCE_WARNING);
- Map<Long, List<BusinessNotifyState>> businessStateMap = (Map) businessNotifyStates.stream().collect(Collectors.groupingBy((v0) -> {
+ Map<Long, List<BusinessNotifyState>> businessStateMap = businessNotifyStates.stream().collect(Collectors.groupingBy((v0) -> {
return v0.getBusinessId();
}));
Set<Long> businessIds = businessStateMap.keySet();
@@ -219,19 +146,25 @@
return ReturnT.SUCCESS;
}
List<Long> expireIds = deleteExpireState(businessIds);
+ expireIds.forEach(businessIds::remove);
+ /*
businessIds.getClass();
expireIds.forEach((v1) -> {
r1.remove(v1);
- });
+ });*/
+ List<MaintainPlan> list = this.maintainPlanService.list(Wrappers.<MaintainPlan>lambdaQuery()
+ .in(MaintainPlan::getPlanStatus, Lists.list(new Integer[] {MaintainPlanStatusEnum.T1.getType(), MaintainPlanStatusEnum.T2.getType() }))
+ .in(MaintainPlan::getId, businessIds));
+ /*
List<MaintainPlan> list = this.maintainPlanService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getPlanStatus();
}, Lists.list(new Integer[]{Integer.valueOf(MaintainPlanStatusEnum.T1.getType()), Integer.valueOf(MaintainPlanStatusEnum.T2.getType())}))).in((v0) -> {
return v0.getId();
- }, businessIds));
+ }, businessIds));*/
if (Func.isEmpty(list)) {
return ReturnT.SUCCESS;
}
- Map<Integer, List<MaintainPlan>> planMap = (Map) list.stream().collect(Collectors.groupingBy((v0) -> {
+ Map<Integer, List<MaintainPlan>> planMap =list.stream().collect(Collectors.groupingBy((v0) -> {
return v0.getIsAuto();
}));
if (planMap.containsKey(Integer.valueOf(MaintainGenerateEnum.T0.getType()))) {
@@ -246,13 +179,13 @@
}
if (planMap.containsKey(Integer.valueOf(MaintainGenerateEnum.T1.getType()))) {
List<MaintainPlan> maintainPlans = planMap.get(Integer.valueOf(MaintainGenerateEnum.T1.getType()));
- List<Long> projectIds = (List) maintainPlans.stream().map((v0) -> {
+ List<Long> projectIds = maintainPlans.stream().map((v0) -> {
return v0.getProjectId();
}).filter((v0) -> {
return Func.isNotEmpty(v0);
}).collect(Collectors.toList());
List<MaintainProject> maintainProjects = this.maintainProjectService.listByIds(projectIds);
- Map<Long, MaintainProject> projectMap = (Map) maintainProjects.stream().collect(Collectors.toMap((v0) -> {
+ Map<Long, MaintainProject> projectMap = maintainProjects.stream().collect(Collectors.toMap((v0) -> {
return v0.getId();
}, item -> {
return item;
@@ -273,12 +206,12 @@
for (MaintainPlan maintainPlan : waitSends) {
Long id = maintainPlan.getId();
List<BusinessNotifyState> states = businessStateMap.get(id);
- List<Long> empIds = (List) states.stream().filter(item2 -> {
+ List<Long> empIds = states.stream().filter(item2 -> {
return Func.equals(item2.getPersonType(), Integer.valueOf(ObjectTypeEnum.EMP.getCode()));
}).map((v0) -> {
return v0.getPersonId();
}).collect(Collectors.toList());
- List<Long> orgIds = (List) states.stream().filter(item3 -> {
+ List<Long> orgIds = states.stream().filter(item3 -> {
return Func.equals(item3.getPersonType(), Integer.valueOf(ObjectTypeEnum.ORG.getCode()));
}).map((v0) -> {
return v0.getPersonId();
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/manager/NotifyBusinessManager.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/manager/NotifyBusinessManager.java
index 9eb57de..c25ca50 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/manager/NotifyBusinessManager.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/manager/NotifyBusinessManager.java
@@ -1,15 +1,16 @@
package com.qianwen.smartman.modules.notify.manager;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.log.exception.ServiceException;
import com.qianwen.core.log.utils.LogTraceUtil;
import com.qianwen.core.notify.DefaultNotifyType;
@@ -23,7 +24,6 @@
import com.qianwen.smartman.modules.notify.api.DingTalkApi;
import com.qianwen.smartman.modules.notify.dto.NotifySendMethodDTO;
import com.qianwen.smartman.modules.system.service.IUserOauthService;
-import org.springframework.stereotype.Component;
@Component
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/manager/NotifyBusinessManager.class */
@@ -34,28 +34,6 @@
private final IEmployeeService employeeService;
private final IUserOauthService userOauthService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = false;
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotifyBusinessManager(final NotifierManager notifierManager, final DingTalkApi dingTalkApi, final IEmployeeService employeeService, final IUserOauthService userOauthService) {
this.notifierManager = notifierManager;
@@ -84,18 +62,20 @@
}
private List<String> getProviderName(String providerName, List<Long> empIds) {
+ List<Employee> employees = this.employeeService.list(Wrappers.<Employee>lambdaQuery().in(Employee::getId, empIds));
+ /*
List<Employee> employees = this.employeeService.list((Wrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getId();
- }, empIds));
+ }, empIds));*/
if (Func.isEmpty(employees)) {
return null;
}
- List<String> tels = (List) employees.stream().map((v0) -> {
+ List<String> tels = employees.stream().map((v0) -> {
return v0.getTel();
}).filter((v0) -> {
return Func.isNotEmpty(v0);
}).collect(Collectors.toList());
- List<String> ids = (List) employees.stream().map((v0) -> {
+ List<String> ids = employees.stream().map((v0) -> {
return v0.getUserId();
}).filter((v0) -> {
return Func.isNotEmpty(v0);
@@ -106,7 +86,7 @@
notifiedParty = ids;
}
} else if (Func.equals(DefaultNotifyType.email.name(), providerName)) {
- notifiedParty = (List) employees.stream().map((v0) -> {
+ notifiedParty = employees.stream().map((v0) -> {
return v0.getEmail();
}).collect(Collectors.toList());
} else if (Func.equals(DefaultNotifyType.dingTalk.name(), providerName)) {
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyServiceImpl.java
index 0c334bb..1fbac63 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyServiceImpl.java
@@ -1,11 +1,5 @@
package com.qianwen.smartman.modules.notify.service.impl;
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
@@ -13,18 +7,23 @@
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
-import java.util.stream.Stream;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.qianwen.smartman.common.cache.RegionCache;
-import com.qianwen.smartman.common.constant.NotifyConstant;
-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 org.springframework.transaction.annotation.Transactional;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.cache.utils.CacheUtil;
import com.qianwen.core.log.exception.ServiceException;
import com.qianwen.core.mp.base.BaseEntity;
import com.qianwen.core.mp.base.BaseServiceImpl;
import com.qianwen.core.tool.node.ForestNodeMerger;
import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.common.constant.NotifyConstant;
+import com.qianwen.smartman.common.utils.MessageUtils;
import com.qianwen.smartman.modules.cps.entity.Employee;
import com.qianwen.smartman.modules.cps.service.IEmployeeService;
import com.qianwen.smartman.modules.notify.convert.BusinessNotifyConvert;
@@ -47,10 +46,9 @@
import com.qianwen.smartman.modules.notify.vo.NotifyBusinessTreeVO;
import com.qianwen.smartman.modules.notify.vo.NotifyDefaultObjectVO;
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;
-import org.springframework.transaction.annotation.Transactional;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
@Transactional(rollbackFor = {Exception.class})
@Service
@@ -68,136 +66,6 @@
@Lazy
private NotifyBusinessManager notifyBusinessManager;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1462663655:
- if (implMethodName.equals("getNotifyType")) {
- z = true;
- break;
- }
- break;
- case -330190124:
- if (implMethodName.equals("getNotifyTemplateId")) {
- z = true;
- break;
- }
- break;
- case -75106384:
- if (implMethodName.equals("getType")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 584947017:
- if (implMethodName.equals("getBusinessKey")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- z = true;
- break;
- }
- break;
- case 931069238:
- if (implMethodName.equals("getBusiness")) {
- 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/notify/entity/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getNotifyTemplateId();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getNotifyType();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- 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/NotifyTemplateEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusiness();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public BusinessNotifyServiceImpl(final NotifyConfigServiceImpl notifyConfigService, final INotifyTemplateService notifyTemplateService, final BusinessNotifyMapper businessNotifyMapper, final IDictService dictService, final IEmployeeService employeeService, final INotifyDefaultPersonService notifyDefaultPersonService, final NotifyBusinessManager notifyBusinessManager) {
this.notifyConfigService = notifyConfigService;
@@ -221,13 +89,15 @@
@Override // org.springblade.modules.notify.service.IBusinessNotifyService
public List<BusinessNotifyDTO> list(String businessKey) {
Map<String, NotifyTypeInfo> typeInfoMap = this.notifyConfigService.getNotifyInfo();
+ Map<String, BusinessNotifyDTO> businessMap = this.businessNotifyMapper.businessList(businessKey).stream().collect(Collectors.toMap(BusinessNotifyDTO::getNotifyType, notifyBusiness -> notifyBusiness));
+ /*
Map<String, BusinessNotifyDTO> businessMap = (Map) this.businessNotifyMapper.businessList(businessKey).stream().collect(Collectors.toMap((v0) -> {
return v0.getNotifyType();
}, notifyBusiness -> {
return notifyBusiness;
- }));
+ }));*/
Map<String, NotifyConfigEntity> configMap = this.notifyConfigService.getConfigs(CollectionUtil.list(Boolean.FALSE.booleanValue(), typeInfoMap.keySet()));
- configMap.forEach(typeId, config -> {
+ configMap.forEach((typeId, config) -> {
BusinessNotifyDTO businessNotify = (BusinessNotifyDTO) businessMap.get(typeId);
boolean isExit = ObjectUtil.isNull(businessNotify);
BusinessNotifyDTO businessNotify2 = isExit ? new BusinessNotifyDTO() : businessNotify;
@@ -244,6 +114,12 @@
businessMap.put(typeId, businessNotify2);
});
List<BusinessNotifyDTO> result = new ArrayList<>();
+
+ typeInfoMap.keySet().stream().map(businessMap::get).forEach(dto -> {
+ if (dto != null)
+ result.add(dto);
+ });
+ /*
Stream<String> stream = typeInfoMap.keySet().stream();
businessMap.getClass();
stream.map((v1) -> {
@@ -252,7 +128,7 @@
if (dto != null) {
result.add(dto);
}
- });
+ });*/
return result;
}
@@ -263,23 +139,29 @@
CacheUtil.evict("blade:notify", "template:id:", templateEntity.getId(), false);
}
checkTemplateAndType(notifyBusinessVO);
+ NotifyConfigEntity entity = this.notifyConfigService.getOne(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .eq(NotifyConfigEntity::getType, notifyBusinessVO.getBusinessNotify().getNotifyType()));
+ /*
NotifyConfigEntity entity = (NotifyConfigEntity) this.notifyConfigService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getType();
- }, notifyBusinessVO.getBusinessNotify().getNotifyType()));
+ }, notifyBusinessVO.getBusinessNotify().getNotifyType()));*/
notifyBusinessVO.getBusinessNotify().setNotifyId(entity.getId());
this.notifyTemplateService.save(notifyBusinessVO.getTemplateEntity());
notifyBusinessVO.getBusinessNotify().setNotifyTemplateId(notifyBusinessVO.getTemplateEntity().getId());
- save((BaseEntity) notifyBusinessVO.getBusinessNotify());
+ save(notifyBusinessVO.getBusinessNotify());
return notifyBusinessVO;
}
@Override // org.springblade.modules.notify.service.IBusinessNotifyService
public Boolean change(NotifyBusinessChangeStatusVO changeStatusVO) {
+ BusinessNotify businessNotify = (BusinessNotify)getOne(Wrappers.lambdaQuery(BusinessNotify.class)
+ .eq(BusinessNotify::getBusinessKey, changeStatusVO.getBusinessKey()).eq(BusinessNotify::getNotifyType, changeStatusVO.getNotifyType()));
+ /*
BusinessNotify businessNotify = (BusinessNotify) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery(BusinessNotify.class).eq((v0) -> {
return v0.getBusinessKey();
}, changeStatusVO.getBusinessKey())).eq((v0) -> {
return v0.getNotifyType();
- }, changeStatusVO.getNotifyType()));
+ }, changeStatusVO.getNotifyType()));*/
if (Objects.isNull(businessNotify)) {
throw new ServiceException(MessageUtils.message("notify.business.template.status.not.be.change", new Object[0]));
}
@@ -299,33 +181,38 @@
@Override // org.springblade.modules.notify.service.IBusinessNotifyService
public boolean remove(Long templateId) {
this.notifyTemplateService.removeById(templateId);
+ return remove(Wrappers.lambdaQuery(BusinessNotify.class).eq(BusinessNotify::getNotifyTemplateId, templateId));
+ /*
return remove((Wrapper) Wrappers.lambdaQuery(BusinessNotify.class).eq((v0) -> {
return v0.getNotifyTemplateId();
- }, templateId));
+ }, templateId));*/
}
public List<Long> getNoticeEmpIds(List<Long> orgIds, List<Long> empIds) {
List<Employee> employees = this.employeeService.listByOrgIds(orgIds);
- List<Long> itemEmpIds = (List) employees.stream().map((v0) -> {
+ List<Long> itemEmpIds = employees.stream().map((v0) -> {
return v0.getId();
}).collect(Collectors.toList());
empIds.addAll(itemEmpIds);
- return (List) empIds.stream().distinct().collect(Collectors.toList());
+ return empIds.stream().distinct().collect(Collectors.toList());
}
@Override // org.springblade.modules.notify.service.IBusinessNotifyService
public void sendMessage(NotifySendDTO notifySendDTO) {
String businessKey = notifySendDTO.getBusinessKey();
+ List<BusinessNotify> list = list(Wrappers.<BusinessNotify>lambdaQuery().eq(BusinessNotify::getStatus, 1)
+ .eq(BusinessNotify::getBusinessKey, businessKey));
+ /*
List<BusinessNotify> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getStatus();
}, 1)).eq((v0) -> {
return v0.getBusinessKey();
- }, businessKey));
- List<Long> templateIds = (List) list.stream().map((v0) -> {
+ }, businessKey));*/
+ List<Long> templateIds = list.stream().map((v0) -> {
return v0.getNotifyTemplateId();
}).collect(Collectors.toList());
List<NotifyTemplateEntity> notifyTemplateEntities = this.notifyTemplateService.listByIds(templateIds);
- Map<Long, NotifyTemplateEntity> tempMap = (Map) notifyTemplateEntities.stream().collect(Collectors.toMap((v0) -> {
+ Map<Long, NotifyTemplateEntity> tempMap = notifyTemplateEntities.stream().collect(Collectors.toMap((v0) -> {
return v0.getId();
}, item -> {
return item;
@@ -358,32 +245,45 @@
}
private void checkTemplate(NotifyTemplateEntity notifyTemplateEntity) {
+ long count = this.notifyTemplateService.count(Wrappers.<NotifyTemplateEntity>lambdaQuery()
+ .ne(BaseEntity::getId, notifyTemplateEntity.getId())
+ .eq(NotifyTemplateEntity::getType, notifyTemplateEntity.getType())
+ .eq(NotifyTemplateEntity::getBusiness, notifyTemplateEntity.getBusiness()));
+ /*
long count = this.notifyTemplateService.count((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne((v0) -> {
return v0.getId();
}, notifyTemplateEntity.getId())).eq((v0) -> {
return v0.getType();
}, notifyTemplateEntity.getType())).eq((v0) -> {
return v0.getBusiness();
- }, notifyTemplateEntity.getBusiness()));
+ }, notifyTemplateEntity.getBusiness()));*/
if (count > 0) {
throw new ServiceException(MessageUtils.message("notify.business.template.not.be.repeated", new Object[0]));
}
}
private void checkTemplateAndType(NotifyBusinessSaveVO business) {
+ long count = count(Wrappers.lambdaQuery(BusinessNotify.class)
+ .ne(Func.isNotEmpty(business.getBusinessNotify().getId()), BaseEntity::getId, business.getBusinessNotify().getId())
+ .eq(BusinessNotify::getNotifyType, business.getBusinessNotify().getNotifyType())
+ .eq(BusinessNotify::getBusinessKey, business.getBusinessNotify().getBusinessKey()));
+ /*
long count = count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery(BusinessNotify.class).ne(Func.isNotEmpty(business.getBusinessNotify().getId()), (v0) -> {
return v0.getId();
}, business.getBusinessNotify().getId()).eq((v0) -> {
return v0.getNotifyType();
}, business.getBusinessNotify().getNotifyType())).eq((v0) -> {
return v0.getBusinessKey();
- }, business.getBusinessNotify().getBusinessKey()));
+ }, business.getBusinessNotify().getBusinessKey()));*/
if (count > 0) {
throw new ServiceException(MessageUtils.message("notify.business.template.not.be.repeated", new Object[0]));
}
+ long typeCount = this.notifyConfigService.count(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .eq(NotifyConfigEntity::getType, business.getBusinessNotify().getNotifyType()));
+ /*
long typeCount = this.notifyConfigService.count((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getType();
- }, business.getBusinessNotify().getNotifyType()));
+ }, business.getBusinessNotify().getNotifyType()));*/
if (typeCount <= 0) {
throw new ServiceException(MessageUtils.message("notify.service.config.is.null", new Object[0]));
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyStateServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyStateServiceImpl.java
index 0d303fc..9eebd17 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyStateServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/BusinessNotifyStateServiceImpl.java
@@ -1,14 +1,16 @@
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.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.mp.base.BaseServiceImpl;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.smartman.modules.cps.entity.CommonGroup;
@@ -23,9 +25,6 @@
import com.qianwen.smartman.modules.notify.service.IBusinessNotifyStateService;
import com.qianwen.smartman.modules.notify.vo.BusinessNotifyStateVO;
import com.qianwen.smartman.modules.sync.constant.DingConstant;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/BusinessNotifyStateServiceImpl.class */
@@ -34,91 +33,6 @@
private IEmployeeService employeeService;
@Autowired
private ICommonGroupService commonGroupService;
-
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1492577373:
- if (implMethodName.equals("getGroupType")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 584947017:
- if (implMethodName.equals("getBusinessKey")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- z = true;
- break;
- }
- break;
- case 1404342513:
- if (implMethodName.equals("getBusinessId")) {
- 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/notify/entity/BusinessNotifyState") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/BusinessNotifyState") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/BusinessNotifyState") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getBusinessId();
- };
- }
- 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/BusinessNotifyState") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getBusinessId();
- };
- }
- 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getGroupType();
- };
- }
- 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
@Override // org.springblade.modules.notify.service.IBusinessNotifyStateService
public List<BusinessNotifyState> listByBusinessKey(String businessKey) {
@@ -133,7 +47,7 @@
private BusinessNotifyStateVO buildBusinessNotifyStateVO(List<BusinessNotifyState> states) {
BusinessNotifyStateVO stateVO = new BusinessNotifyStateVO();
- Map<Integer, Set<Long>> notifyStateMap = (Map) states.parallelStream().collect(Collectors.groupingBy((v0) -> {
+ Map<Integer, Set<Long>> notifyStateMap = states.parallelStream().collect(Collectors.groupingBy((v0) -> {
return v0.getPersonType();
}, Collectors.mapping((v0) -> {
return v0.getPersonId();
@@ -146,13 +60,16 @@
}
if (notifyStateMap.containsKey(Integer.valueOf(ObjectTypeEnum.ORG.getCode()))) {
Set<Long> ids2 = notifyStateMap.get(Integer.valueOf(ObjectTypeEnum.ORG.getCode()));
+ List<CommonGroup> list = this.commonGroupService.list(Wrappers.<CommonGroup>lambdaQuery().eq(CommonGroup::getStatus, Boolean.valueOf(true))
+ .in(CommonGroup::getId, ids2).eq(CommonGroup::getGroupType, DingConstant.GROUPTYPE));;
+ /*
List<CommonGroup> list = this.commonGroupService.list((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getStatus();
}, true)).in((v0) -> {
return v0.getId();
}, ids2)).eq((v0) -> {
return v0.getGroupType();
- }, DingConstant.GROUPTYPE));
+ }, DingConstant.GROUPTYPE));*/
List<BusinessNotifyStateDTO> stateDTOS2 = BusinessNotifyStateConvert.INSTANCE.convertByOrgList(list);
stateVO.setOrgList(stateDTOS2);
}
@@ -161,11 +78,14 @@
private List<BusinessNotifyState> listByBusinessKeyAndBusinessId(String businessKey, Long businessId) {
boolean notEmpty = Func.isNotEmpty(businessId);
+ return list(Wrappers.<BusinessNotifyState>lambdaQuery().eq(BusinessNotifyState::getBusinessKey, businessKey)
+ .eq(notEmpty, BusinessNotifyState::getBusinessId, businessId));
+ /*
return list(((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getBusinessKey();
}, businessKey)).eq(notEmpty, (v0) -> {
return v0.getBusinessId();
- }, businessId));
+ }, businessId));*/
}
@Override // org.springblade.modules.notify.service.IBusinessNotifyStateService
@@ -193,10 +113,13 @@
}
void deleteListByBusinessId(String businessKey, Long businessId) {
+ remove(Wrappers.<BusinessNotifyState>lambdaQuery().eq(BusinessNotifyState::getBusinessKey, businessKey)
+ .eq(BusinessNotifyState::getBusinessId, businessId));
+ /*
remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getBusinessKey();
}, businessKey)).eq((v0) -> {
return v0.getBusinessId();
- }, businessId));
+ }, businessId));*/
}
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NoticeServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NoticeServiceImpl.java
index cba82c5..9251960 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NoticeServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NoticeServiceImpl.java
@@ -1,25 +1,23 @@
package com.qianwen.smartman.modules.notify.service.impl;
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONUtil;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
-import com.qianwen.smartman.common.constant.DictConstant;
-import com.qianwen.smartman.common.utils.ExtraLambdaQueryWrapper;
-import com.qianwen.smartman.common.utils.Lambda;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.mp.base.BaseServiceImpl;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.core.tool.utils.SpringUtil;
import com.qianwen.core.websocket.distribute.MessageDO;
import com.qianwen.core.websocket.distribute.RedisMessageDistributor;
+import com.qianwen.smartman.common.constant.DictConstant;
+import com.qianwen.smartman.common.utils.Lambda;
import com.qianwen.smartman.modules.notify.convert.NoticeConvert;
import com.qianwen.smartman.modules.notify.entity.Notice;
import com.qianwen.smartman.modules.notify.entity.NotifySystem;
@@ -35,9 +33,11 @@
import com.qianwen.smartman.modules.system.entity.User;
import com.qianwen.smartman.modules.system.service.IDictService;
import com.qianwen.smartman.modules.system.service.IUserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NoticeServiceImpl.class */
@@ -49,65 +49,6 @@
private INotifySystemService notifySystemService;
@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 -75622813:
- if (implMethodName.equals("getCode")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- 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();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
@Override // org.springblade.modules.notify.service.INoticeService
public IPage<NoticeVO> selectNoticePage(IPage<NoticeVO> page, NoticeSelectVO selectVO) {
@@ -127,11 +68,16 @@
sentMessage(notice);
Integer category = notice.getCategory();
NoticeVO convert = NoticeConvert.INSTANCE.convert(notice);
+ Dict dict = this.dictService.getOne(Lambda.<Dict>create()
+ .eq(Dict::getCode, DictConstant.NOTICE_CODE)
+ .eq(Dict::getDictKey, category.toString())
+ .limit());
+ /*
Dict dict = (Dict) this.dictService.getOne(((ExtraLambdaQueryWrapper) ((ExtraLambdaQueryWrapper) Lambda.create().eq((v0) -> {
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();
convert.setCategoryName(dictValue);
@@ -146,11 +92,16 @@
sentMessage(notice);
Integer category = notice.getCategory();
NoticeVO convert = NoticeConvert.INSTANCE.convert(notice);
+ Dict dict = this.dictService.getOne(Lambda.<Dict>create()
+ .eq(Dict::getCode, DictConstant.NOTICE_CODE)
+ .eq(Dict::getDictKey, category.toString())
+ .limit());
+ /*
Dict dict = (Dict) this.dictService.getOne(((ExtraLambdaQueryWrapper) ((ExtraLambdaQueryWrapper) Lambda.create().eq((v0) -> {
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();
convert.setCategoryName(dictValue);
@@ -160,10 +111,12 @@
private void sentMessage(Notice notice) {
Long id = notice.getId();
+ List<User> users = this.userService.list(Wrappers.<User>lambdaQuery().select(User::getId ));
+ /*
List<User> users = this.userService.list(Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> {
return v0.getId();
- }}));
- List<Long> usersIds = (List) users.stream().map((v0) -> {
+ }}));*/
+ List<Long> usersIds = users.stream().map((v0) -> {
return v0.getId();
}).collect(Collectors.toList());
List<NotifySystem> notifySystems = new ArrayList<>();
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotificationServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotificationServiceImpl.java
index 47c2d2e..b41bc19 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotificationServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotificationServiceImpl.java
@@ -1,65 +1,30 @@
package com.qianwen.smartman.modules.notify.service.impl;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.mp.base.BaseServiceImpl;
import com.qianwen.smartman.modules.notify.entity.NotificationEntity;
import com.qianwen.smartman.modules.notify.mapper.NotificationMapper;
import com.qianwen.smartman.modules.notify.service.INotificationService;
-import org.springframework.stereotype.Service;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotificationServiceImpl.class */
public class NotificationServiceImpl extends BaseServiceImpl<NotificationMapper, NotificationEntity> implements INotificationService {
private static final Logger log = LoggerFactory.getLogger(NotificationServiceImpl.class);
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
@Override // org.springblade.modules.notify.service.INotificationService
public NotificationEntity findAndMarkRead(String id) {
+ update(Wrappers.<NotificationEntity>update().lambda().set(NotificationEntity::getStatus, 2).eq(NotificationEntity::getId, id));
+ /*
update((Wrapper) ((LambdaUpdateWrapper) Wrappers.update().lambda().set((v0) -> {
return v0.getStatus();
}, 2)).eq((v0) -> {
return v0.getId();
- }, id));
+ }, id));*/
return (NotificationEntity) getById(id);
}
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyConfigServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyConfigServiceImpl.java
index 4e37ee0..04155e2 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyConfigServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyConfigServiceImpl.java
@@ -1,22 +1,19 @@
package com.qianwen.smartman.modules.notify.service.impl;
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.qianwen.smartman.common.constant.CommonConstant;
-import com.qianwen.smartman.common.constant.NotifyConstant;
-import com.qianwen.smartman.common.utils.MessageUtils;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.cache.utils.CacheUtil;
import com.qianwen.core.log.exception.ServiceException;
import com.qianwen.core.mp.base.BaseServiceImpl;
@@ -25,6 +22,9 @@
import com.qianwen.core.notify.notifier.NotifierProvider;
import com.qianwen.core.tool.metadata.ConfigMetadata;
import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.common.constant.CommonConstant;
+import com.qianwen.smartman.common.constant.NotifyConstant;
+import com.qianwen.smartman.common.utils.MessageUtils;
import com.qianwen.smartman.modules.notify.api.DingTalkApi;
import com.qianwen.smartman.modules.notify.dto.NotifyTypeInfo;
import com.qianwen.smartman.modules.notify.dto.ProviderInfo;
@@ -36,8 +36,9 @@
import com.qianwen.smartman.modules.sync.constant.OuterAppConfigConstant;
import com.qianwen.smartman.modules.sync.entity.OuterAppConfig;
import com.qianwen.smartman.modules.sync.service.IOuterAppConfigService;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotifyConfigServiceImpl.class */
@@ -47,121 +48,6 @@
private final List<NotifierProvider> providers;
private final DingTalkApi dingTalkApi;
private final IOuterAppConfigService outerAppConfigService;
-
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1462663655:
- if (implMethodName.equals("getNotifyType")) {
- z = true;
- break;
- }
- break;
- case -631689286:
- if (implMethodName.equals("getNotifyId")) {
- z = false;
- break;
- }
- break;
- case -75106384:
- if (implMethodName.equals("getType")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/notify/entity/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getNotifyId();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getNotifyId();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/NotifyConfigEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getType();
- };
- }
- 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/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotifyConfigServiceImpl(BusinessNotifyMapper notifyBusinessMapper, List<NotifierProvider> providers, @Lazy DingTalkApi dingTalkApi, @Lazy IOuterAppConfigService outerAppConfigService) {
this.notifyBusinessMapper = notifyBusinessMapper;
@@ -181,11 +67,14 @@
data.put("agentid", agentid);
data.put("corpid", corpid);
data.put("corpsecret", corpsecret);
+ NotifyConfigEntity config = getOne(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .eq(NotifyConfigEntity::getStatus, 1).eq(NotifyConfigEntity::getType, DefaultNotifyType.weiXinQY.name()));
+ /*
NotifyConfigEntity config = (NotifyConfigEntity) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getStatus();
}, 1)).eq((v0) -> {
return v0.getType();
- }, DefaultNotifyType.weiXinQY.name()));
+ }, DefaultNotifyType.weiXinQY.name()));*/
if (config == null) {
config = new NotifyConfigEntity();
config.setName(DefaultNotifyType.weiXinQY.getName());
@@ -203,11 +92,14 @@
Map<String, Object> data2 = new HashMap<>();
data2.put("appKey", appKey);
data2.put("appSecret", appSecret);
+ NotifyConfigEntity config2 = getOne(Wrappers.<NotifyConfigEntity>lambdaQuery().eq(NotifyConfigEntity::getStatus, 1)
+ .eq(NotifyConfigEntity::getType, DefaultNotifyType.dingTalk.name()));
+ /*
NotifyConfigEntity config2 = (NotifyConfigEntity) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getStatus();
}, 1)).eq((v0) -> {
return v0.getType();
- }, DefaultNotifyType.dingTalk.name()));
+ }, DefaultNotifyType.dingTalk.name()));*/
if (config2 == null) {
config2 = new NotifyConfigEntity();
config2.setName(DefaultNotifyType.dingTalk.getName());
@@ -226,11 +118,14 @@
if (Func.equals(notifyType, DefaultNotifyType.dingTalk.name())) {
OuterAppConfig outerAppConfigDing = this.outerAppConfigService.getAppConfig(OuterAppConfigConstant.DING);
if (Func.isNotEmpty(outerAppConfigDing) && outerAppConfigDing.getStatus().equals(CommonConstant.ENABLE)) {
+ NotifyConfigEntity config = getOne(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .eq(NotifyConfigEntity::getType, DefaultNotifyType.dingTalk.name()).eq(NotifyConfigEntity::getStatus, 1));
+ /*
NotifyConfigEntity config = (NotifyConfigEntity) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getType();
}, DefaultNotifyType.dingTalk.name())).eq((v0) -> {
return v0.getStatus();
- }, 1));
+ }, 1));*/
Map<String, Object> configuration = config.getConfiguration();
if (!configuration.containsKey("appKey") || !configuration.containsKey("appSecret")) {
updateServerConfig(outerAppConfigDing);
@@ -256,11 +151,15 @@
if (Func.isNotEmpty(notificationConfig.getId())) {
CacheUtil.evict("blade:notify", "notifier:id:", notificationConfig.getId(), false);
}
+ long count = count(Wrappers.<NotifyConfigEntity>lambdaQuery()
+ .ne(Func.isNotEmpty(notificationConfig.getId()), NotifyConfigEntity::getId, notificationConfig.getId())
+ .eq(NotifyConfigEntity::getType, notificationConfig.getType()));
+ /*
long count = count((Wrapper) Wrappers.lambdaQuery().ne(Func.isNotEmpty(notificationConfig.getId()), (v0) -> {
return v0.getId();
}, notificationConfig.getId()).eq((v0) -> {
return v0.getType();
- }, notificationConfig.getType()));
+ }, notificationConfig.getType()));*/
if (count > 0) {
throw new ServiceException(MessageUtils.message("notify.service.config.not.be.repeated", new Object[0]));
}
@@ -271,9 +170,12 @@
@Override // org.springblade.modules.notify.service.INotifyConfigService
public boolean checkUsedByBusinessNotify(String id) {
+ Long count = this.notifyBusinessMapper.selectCount(Wrappers.<BusinessNotify>lambdaQuery()
+ .eq(BusinessNotify::getNotifyId, id));
+ /*
Long count = this.notifyBusinessMapper.selectCount((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getNotifyId();
- }, id));
+ }, id));*/
if (count.longValue() > 0) {
throw new ServiceException(MessageUtils.message("notify.service.config.not.delete", new Object[0]));
}
@@ -281,7 +183,7 @@
}
public Map<String, NotifyTypeInfo> getNotifyInfo() {
- return (Map) getAllNotifyType().stream().filter(n -> {
+ return getAllNotifyType().stream().filter(n -> {
return ("weiXinMini".equals(n.getId()) || "weiXinMp".equals(n.getId())) ? false : true;
}).collect(Collectors.toMap((v0) -> {
return v0.getId();
@@ -295,13 +197,15 @@
Map<String, NotifyTypeInfo> typeInfoMap = getNotifyInfo();
List<String> typeList = CollectionUtil.list(Boolean.FALSE.booleanValue(), typeInfoMap.keySet());
Map<String, NotifyConfigEntity> configMap = getConfigs(typeList);
+ List<BusinessNotify> businessNotifies = this.notifyBusinessMapper.selectList(Wrappers.<BusinessNotify>lambdaQuery().in(BusinessNotify::getNotifyType, typeList));
+ /*
List<BusinessNotify> businessNotifies = this.notifyBusinessMapper.selectList((Wrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getNotifyType();
- }, typeList));
- Map<String, List<BusinessNotify>> notifyMap = (Map) businessNotifies.stream().collect(Collectors.groupingBy((v0) -> {
+ }, typeList));*/
+ Map<String, List<BusinessNotify>> notifyMap = businessNotifies.stream().collect(Collectors.groupingBy((v0) -> {
return v0.getNotifyType();
}));
- typeInfoMap.forEach(typeId, typeInfo -> {
+ typeInfoMap.forEach((typeId, typeInfo) -> {
if (configMap.containsKey(typeId)) {
NotifyConfigEntity config = (NotifyConfigEntity) configMap.get(typeId);
typeInfo.setConfigEntity(config);
@@ -312,13 +216,13 @@
}
typeInfo.setIsBindBusiness(Boolean.valueOf(notifyMap.containsKey(typeId)));
});
- return new ArrayList(typeInfoMap.values());
+ return new ArrayList<>(typeInfoMap.values());
}
@Override // org.springblade.modules.notify.service.INotifyConfigService
public ConfigMetadata getMetadataByTypeAndProvider(String type, String provider) {
ConfigMetadata result = null;
- List<NotifierProvider> providerList = (List) this.providers.stream().filter(prov -> {
+ List<NotifierProvider> providerList = this.providers.stream().filter(prov -> {
return prov.getType().getId().equalsIgnoreCase(type) && prov.getProvider().getId().equalsIgnoreCase(provider);
}).collect(Collectors.toList());
if (Func.isNotEmpty(providerList)) {
@@ -335,7 +239,7 @@
if (!type.equals(NotifyConstant.SMS_TYPE_VALUE)) {
return;
}
- NotifyConfigEntity configEntity = (NotifyConfigEntity) getOne((Wrapper) Wrappers.lambdaQuery(NotifyConfigEntity.class).eq((v0) -> {
+ NotifyConfigEntity configEntity = (NotifyConfigEntity) getOne(Wrappers.lambdaQuery(NotifyConfigEntity.class).eq((v0) -> {
return v0.getId();
}, notificationConfig.getId()));
if (ObjectUtil.isNull(configEntity)) {
@@ -358,14 +262,16 @@
}
public Map<String, NotifyConfigEntity> getConfigs(List<String> types) {
+ List<NotifyConfigEntity> configList = list(Wrappers.<NotifyConfigEntity>lambdaQuery().in(NotifyConfigEntity::getType, types));
+ /*
List<NotifyConfigEntity> configList = list((Wrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getType();
- }, types));
- return (Map) configList.stream().collect(Collectors.toMap((v0) -> {
+ }, types));*/
+ return configList.stream().collect(Collectors.toMap((v0) -> {
return v0.getType();
}, notifyConfigEntity -> {
return notifyConfigEntity;
- }, a, b -> {
+ }, (a, b) -> {
return a;
}));
}
@@ -373,14 +279,14 @@
@Override // org.springblade.modules.notify.service.INotifyConfigService
public List<NotifyTypeInfo> getAllNotifyType() {
List<NotifyTypeInfo> result = new ArrayList<>();
- Map<NotifyType, List<NotifierProvider>> groups = (Map) this.providers.stream().collect(Collectors.groupingBy((v0) -> {
+ Map<NotifyType, List<NotifierProvider>> groups = this.providers.stream().collect(Collectors.groupingBy((v0) -> {
return v0.getType();
}));
- groups.forEach(type, providerList -> {
+ groups.forEach((type, providerList) -> {
NotifyTypeInfo typeInfo = new NotifyTypeInfo();
typeInfo.setId(type.getId());
typeInfo.setName(type.getName());
- typeInfo.setProviderInfos((List) providerList.stream().map(ProviderInfo::of).collect(Collectors.toList()));
+ typeInfo.setProviderInfos(providerList.stream().map(ProviderInfo::of).collect(Collectors.toList()));
result.add(typeInfo);
});
return result;
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyDefaultPersonServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyDefaultPersonServiceImpl.java
index a847e6c..9629e43 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyDefaultPersonServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyDefaultPersonServiceImpl.java
@@ -34,78 +34,11 @@
@Autowired
private ICommonGroupService commonGroupService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1492577373:
- if (implMethodName.equals("getGroupType")) {
- z = true;
- break;
- }
- break;
- case 98245393:
- if (implMethodName.equals("getId")) {
- z = true;
- break;
- }
- break;
- case 584947017:
- if (implMethodName.equals("getBusinessKey")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/notify/entity/NotifyDefaultPerson") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/NotifyDefaultPerson") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getId();
- };
- }
- 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getGroupType();
- };
- }
- 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
-
@Override // org.springblade.modules.notify.service.INotifyDefaultPersonService
public NotifyDefaultObjectVO getByBusinessKey(String businessKey) {
NotifyDefaultObjectVO notifyDefaultObjectVO = new NotifyDefaultObjectVO();
List<NotifyDefaultPerson> personList = getNotifyDefaultPerson(businessKey);
- Map<Integer, Set<Long>> notifyDefaultPersonMap = (Map) personList.parallelStream().collect(Collectors.groupingBy((v0) -> {
+ Map<Integer, Set<Long>> notifyDefaultPersonMap = personList.parallelStream().collect(Collectors.groupingBy((v0) -> {
return v0.getPersonType();
}, Collectors.mapping((v0) -> {
return v0.getPersonId();
@@ -118,13 +51,17 @@
}
if (notifyDefaultPersonMap.containsKey(Integer.valueOf(ObjectTypeEnum.ORG.getCode()))) {
Set<Long> ids2 = notifyDefaultPersonMap.get(Integer.valueOf(ObjectTypeEnum.ORG.getCode()));
+ List<CommonGroup> list = this.commonGroupService.list(Wrappers.<CommonGroup>lambdaQuery().eq(CommonGroup::getStatus, true)
+ .in(CommonGroup::getId, ids2).eq(CommonGroup::getGroupType, DingConstant.GROUPTYPE));
+ ;
+ /*
List<CommonGroup> list = this.commonGroupService.list((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getStatus();
}, true)).in((v0) -> {
return v0.getId();
}, ids2)).eq((v0) -> {
return v0.getGroupType();
- }, DingConstant.GROUPTYPE));
+ }, DingConstant.GROUPTYPE));*/
List<NotifyDefaultPersonDTO> notifyDefaultPersonDTOS2 = NotifyDefaultPersonConvert.INSTANCE.convertByOrgList(list);
notifyDefaultObjectVO.setOrgList(notifyDefaultPersonDTOS2);
}
@@ -160,15 +97,19 @@
}
private void remove(String businessKey) {
+ remove(Wrappers.<NotifyDefaultPerson>lambdaQuery().eq(NotifyDefaultPerson::getBusinessKey, businessKey));
+ /*
remove((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getBusinessKey();
- }, businessKey));
+ }, businessKey));*/
}
private List<NotifyDefaultPerson> getNotifyDefaultPerson(String businessKey) {
+ Wrapper<NotifyDefaultPerson> defaultPersonWrapper = Wrappers.<NotifyDefaultPerson>lambdaQuery().eq(NotifyDefaultPerson::getBusinessKey, businessKey);
+ /*
Wrapper<NotifyDefaultPerson> defaultPersonWrapper = (Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getBusinessKey();
- }, businessKey);
+ }, businessKey);*/
return list(defaultPersonWrapper);
}
}
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);
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTaskServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTaskServiceImpl.java
index cf95048..be04f90 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTaskServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTaskServiceImpl.java
@@ -1,19 +1,18 @@
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.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.context.task.TaskExecutionContext;
import com.qianwen.core.context.task.TaskExecutorTypeEnum;
import com.qianwen.core.notify.DefaultNotifyType;
@@ -27,11 +26,11 @@
import com.qianwen.smartman.modules.notify.convert.BusinessNotifyConvert;
import com.qianwen.smartman.modules.notify.dto.BusinessNotifyDTO;
import com.qianwen.smartman.modules.notify.dto.NotifyUserDTO;
+import com.qianwen.smartman.modules.notify.entity.BusinessNotify;
import com.qianwen.smartman.modules.notify.mapper.BusinessNotifyMapper;
import com.qianwen.smartman.modules.notify.service.IBusinessNotifyService;
import com.qianwen.smartman.modules.system.service.IUserOauthService;
import com.qianwen.smartman.modules.system.service.IUserService;
-import org.springframework.stereotype.Service;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotifyTaskServiceImpl.class */
@@ -43,41 +42,6 @@
private final IUserOauthService userOauthService;
private final IEmployeeService employeeService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case 584947017:
- if (implMethodName.equals("getBusinessKey")) {
- z = false;
- break;
- }
- break;
- case 771206363:
- if (implMethodName.equals("getTenantId")) {
- 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/notify/entity/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getBusinessKey();
- };
- }
- 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/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
- return (v0) -> {
- return v0.getTenantId();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public NotifyTaskServiceImpl(final IBusinessNotifyService businessNotifyService, final BusinessNotifyMapper businessNotifyMapper, final IUserService userService, final IUserOauthService userOauthService, final IEmployeeService employeeService) {
this.businessNotifyService = businessNotifyService;
@@ -89,6 +53,16 @@
private List<NotifyUserDTO> getNotifySubscriberList(List<String> notifySubscriberList, TaskExecutorTypeEnum taskExecutorTypeEnum) {
List<NotifyUserDTO> result;
+ //娌¢棶棰樹簡锛屾牴鎹娇鐢ㄧ殑service鍒ゆ柇
+ switch (taskExecutorTypeEnum) {
+ case EMPLOYEE://gui: email
+ result = this.employeeService.getNotifySubscriberList(notifySubscriberList);
+ break;
+ default:
+ result = this.userService.getNotifySubscriberList(notifySubscriberList);
+ }
+
+ /*
switch (AnonymousClass1.$SwitchMap$org$springblade$core$context$task$TaskExecutorTypeEnum[taskExecutorTypeEnum.ordinal()]) {
case 1:
result = this.employeeService.getNotifySubscriberList(notifySubscriberList);
@@ -97,7 +71,7 @@
default:
result = this.userService.getNotifySubscriberList(notifySubscriberList);
break;
- }
+ }*/
return result;
}
@@ -105,6 +79,21 @@
List<String> result = new ArrayList<>();
if (Func.isNotEmpty(notifySubscriberList)) {
List<NotifyUserDTO> notifyUserDTOS = getNotifySubscriberList(notifySubscriberList, taskExecutorTypeEnum);
+ switch (DefaultNotifyType.of(defaultNotifyType)) {
+ case email:
+ result.addAll(notifyUserDTOS.stream().map(NotifyUserDTO::getEmail).filter(Func::isNotEmpty).collect(Collectors.toList()));
+ break;
+ case sms:
+ result.addAll(notifyUserDTOS.stream().map(NotifyUserDTO::getPhone).filter(Func::isNotEmpty).collect(Collectors.toList()));
+ break;
+ case weiXinMini:
+ result.addAll(notifyUserDTOS.stream().map(NotifyUserDTO::getWeiXinMiniUserId).filter(Func::isNotEmpty).collect(Collectors.toList()));
+ case internalMessage:
+ default:
+ result.addAll(notifyUserDTOS.stream().map(NotifyUserDTO::getUserId).map(Func::toStr).collect(Collectors.toList()));
+ break;
+ }
+ /*
switch (AnonymousClass1.$SwitchMap$org$springblade$core$notify$DefaultNotifyType[DefaultNotifyType.of(defaultNotifyType).ordinal()]) {
case 1:
result.addAll((Collection) notifyUserDTOS.stream().map((v0) -> {
@@ -133,68 +122,38 @@
return Func.toStr(v0);
}).collect(Collectors.toList()));
break;
- }
+ }*/
}
result.removeAll(Collections.singleton(null));
return result;
}
- /* JADX INFO: Access modifiers changed from: package-private */
- /* renamed from: org.springblade.modules.notify.service.impl.NotifyTaskServiceImpl$1 reason: invalid class name */
- /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotifyTaskServiceImpl$1.class */
- public static /* synthetic */ class AnonymousClass1 {
- static final /* synthetic */ int[] $SwitchMap$org$springblade$core$context$task$TaskExecutorTypeEnum;
- static final /* synthetic */ int[] $SwitchMap$org$springblade$core$notify$DefaultNotifyType = new int[DefaultNotifyType.values().length];
-
- static {
- try {
- $SwitchMap$org$springblade$core$notify$DefaultNotifyType[DefaultNotifyType.email.ordinal()] = 1;
- } catch (NoSuchFieldError e) {
- }
- try {
- $SwitchMap$org$springblade$core$notify$DefaultNotifyType[DefaultNotifyType.sms.ordinal()] = 2;
- } catch (NoSuchFieldError e2) {
- }
- try {
- $SwitchMap$org$springblade$core$notify$DefaultNotifyType[DefaultNotifyType.weiXinMini.ordinal()] = 3;
- } catch (NoSuchFieldError e3) {
- }
- try {
- $SwitchMap$org$springblade$core$notify$DefaultNotifyType[DefaultNotifyType.internalMessage.ordinal()] = 4;
- } catch (NoSuchFieldError e4) {
- }
- $SwitchMap$org$springblade$core$context$task$TaskExecutorTypeEnum = new int[TaskExecutorTypeEnum.values().length];
- try {
- $SwitchMap$org$springblade$core$context$task$TaskExecutorTypeEnum[TaskExecutorTypeEnum.EMPLOYEE.ordinal()] = 1;
- } catch (NoSuchFieldError e5) {
- }
- try {
- $SwitchMap$org$springblade$core$context$task$TaskExecutorTypeEnum[TaskExecutorTypeEnum.USER.ordinal()] = 2;
- } catch (NoSuchFieldError e6) {
- }
- }
- }
-
public List<NotifyExecutionContext> createNotifyExecutionContext(TaskExecutionContext taskExecutionContext) {
List<NotifyExecutionContext> result = new CopyOnWriteArrayList<>();
+ List<BusinessNotifyDTO> finallyBusiness = BusinessNotifyConvert.INSTANCE.convertToDTOList(this.businessNotifyService
+ .list(Wrappers.<BusinessNotify>query().lambda()
+ .eq(BusinessNotify::getBusinessKey, taskExecutionContext.getBusiness())
+ .eq(BusinessNotify::getTenantId, taskExecutionContext.getTenantId())));
+ /*
List<BusinessNotifyDTO> finallyBusiness = BusinessNotifyConvert.INSTANCE.convertToDTOList(this.businessNotifyService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> {
return v0.getBusinessKey();
}, taskExecutionContext.getBusiness())).eq((v0) -> {
return v0.getTenantId();
- }, taskExecutionContext.getTenantId())));
+ }, taskExecutionContext.getTenantId())));*/
if (Func.isNotEmpty(finallyBusiness)) {
finallyBusiness.forEach(notify -> {
List<String> notifiedPartys = getNotifiedPartyList(taskExecutionContext.getTenantId(), taskExecutionContext.getBusiness(), notify.getNotifyType(), taskExecutionContext.getRelatedPersonals(), taskExecutionContext.getTaskExecutorTypeEnum());
Object sendInfo = taskExecutionContext.getExtendInfo().get("notify_direct_address");
if (Func.isNotEmpty(sendInfo)) {
List<NotifyDirectSendInfo> sendInfoList = new ArrayList<>();
- List<Map<String, Object>> data = (List) sendInfo;
+ List<Map<String, Object>> data = (List<Map<String, Object>>)sendInfo;
+ //List<Map<String, Object>> data = sendInfo;
data.forEach(x -> {
NotifyDirectSendInfo notifyDirectSendInfo = (NotifyDirectSendInfo) BeanUtil.toBean(x, NotifyDirectSendInfo.class);
notifyDirectSendInfo.setNotifyType(DefaultNotifyType.of(x.get("notifyType").toString()));
sendInfoList.add(notifyDirectSendInfo);
});
- ((List) sendInfoList.stream().filter(x2 -> {
+ (sendInfoList.stream().filter(x2 -> {
return notify.getNotifyType().equals(x2.getNotifyType().getId());
}).collect(Collectors.toList())).forEach(x3 -> {
notifiedPartys.addAll(x3.getDirectSendAddress());
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTemplateServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTemplateServiceImpl.java
index 4099124..553dd23 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTemplateServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/service/impl/NotifyTemplateServiceImpl.java
@@ -1,14 +1,15 @@
package com.qianwen.smartman.modules.notify.service.impl;
-import cn.hutool.core.convert.Convert;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import java.lang.invoke.SerializedLambda;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.log.exception.ServiceException;
import com.qianwen.core.mp.base.BaseServiceImpl;
import com.qianwen.core.notify.template.TemplateProvider;
@@ -16,49 +17,29 @@
import com.qianwen.core.tool.metadata.ConfigPropertyMetadata;
import com.qianwen.core.tool.metadata.types.StringType;
import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.modules.notify.entity.BusinessNotify;
import com.qianwen.smartman.modules.notify.entity.NotifyTemplateEntity;
import com.qianwen.smartman.modules.notify.enums.NotifyTemplateExpandEnum;
import com.qianwen.smartman.modules.notify.mapper.BusinessNotifyMapper;
import com.qianwen.smartman.modules.notify.mapper.NotifyTemplateMapper;
import com.qianwen.smartman.modules.notify.service.INotifyTemplateService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+
+import cn.hutool.core.convert.Convert;
@Service
-/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotifyTemplateServiceImpl.class */
public class NotifyTemplateServiceImpl extends BaseServiceImpl<NotifyTemplateMapper, NotifyTemplateEntity> implements INotifyTemplateService {
private static final Logger log = LoggerFactory.getLogger(NotifyTemplateServiceImpl.class);
@Autowired
private BusinessNotifyMapper businessNotifyMapper;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -330190124:
- if (implMethodName.equals("getNotifyTemplateId")) {
- z = false;
- 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/notify/entity/BusinessNotify") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
- return (v0) -> {
- return v0.getNotifyTemplateId();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
-
@Override // org.springblade.modules.notify.service.INotifyTemplateService
public boolean checkUsedByBusinessNotify(String id) {
+ Long count = this.businessNotifyMapper.selectCount(Wrappers.<BusinessNotify>lambdaQuery()
+ .eq(BusinessNotify::getNotifyTemplateId, id));
+ /*
Long count = this.businessNotifyMapper.selectCount((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
return v0.getNotifyTemplateId();
- }, id));
+ }, id));*/
if (count.longValue() > 0) {
throw new ServiceException("褰撳墠閫氱煡妯℃澘姝e湪琚笟鍔′娇鐢紝鏃犳硶鍒犻櫎");
}
@@ -69,7 +50,7 @@
public ConfigMetadata getAllTypes(String type, String provider, List<TemplateProvider> providers) {
NotifyTemplateExpandEnum[] values;
ConfigMetadata result = null;
- List<TemplateProvider> providerList = (List) providers.stream().filter(prov -> {
+ List<TemplateProvider> providerList = providers.stream().filter(prov -> {
return prov.getType().getId().equalsIgnoreCase(type) && prov.getProvider().getId().equalsIgnoreCase(provider);
}).collect(Collectors.toList());
if (Func.isNotEmpty(providerList)) {
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/websocket/InternalMessageDataJsonMessageHandler.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/websocket/InternalMessageDataJsonMessageHandler.java
index 87fc715..77f1c9c 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/websocket/InternalMessageDataJsonMessageHandler.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/notify/websocket/InternalMessageDataJsonMessageHandler.java
@@ -1,19 +1,19 @@
package com.qianwen.smartman.modules.notify.websocket;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import io.jsonwebtoken.Claims;
-import java.lang.invoke.SerializedLambda;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.socket.WebSocketSession;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.qianwen.core.jwt.JwtUtil;
import com.qianwen.core.secure.utils.AuthUtil;
import com.qianwen.core.websocket.config.WebSocketMessageSender;
import com.qianwen.core.websocket.handler.JsonMessageHandler;
+import com.qianwen.smartman.modules.notify.entity.NotifySystem;
import com.qianwen.smartman.modules.notify.service.INotifySystemService;
-import org.springframework.stereotype.Component;
-import org.springframework.web.socket.WebSocketSession;
+
+import io.jsonwebtoken.Claims;
@Component
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/websocket/InternalMessageDataJsonMessageHandler.class */
@@ -21,41 +21,6 @@
private static final Logger log = LoggerFactory.getLogger(InternalMessageDataJsonMessageHandler.class);
private INotifySystemService notifySystemService;
- private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
- String implMethodName = lambda.getImplMethodName();
- boolean z = true;
- switch (implMethodName.hashCode()) {
- case -1462639958:
- if (implMethodName.equals("getNotifyUser")) {
- z = false;
- break;
- }
- break;
- case 803533544:
- if (implMethodName.equals("getStatus")) {
- 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/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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
- return (v0) -> {
- return v0.getStatus();
- };
- }
- break;
- }
- throw new IllegalArgumentException("Invalid lambda deserialization");
- }
public InternalMessageDataJsonMessageHandler(final INotifySystemService notifySystemService) {
this.notifySystemService = notifySystemService;
@@ -65,11 +30,15 @@
try {
String uri = session.getUri().getQuery();
Claims claims = AuthUtil.parseJWT(JwtUtil.getToken(uri.substring(uri.lastIndexOf("=") + 1)));
+ long unNotificationCount = this.notifySystemService.count(Wrappers.<NotifySystem>lambdaQuery()
+ .ne(NotifySystem::getStatus, 1)
+ .eq(NotifySystem::getNotifyUser, claims.get("user_id")));
+ /*
long unNotificationCount = this.notifySystemService.count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne((v0) -> {
return v0.getStatus();
}, 1)).eq((v0) -> {
return v0.getNotifyUser();
- }, claims.get("user_id")));
+ }, claims.get("user_id")));*/
InternalMessageResponseJsonWebSocketMessage internalMessageResponseJsonWebSocketMessage = new InternalMessageResponseJsonWebSocketMessage();
internalMessageResponseJsonWebSocketMessage.setHaveUnread(unNotificationCount > 0);
WebSocketMessageSender.send(session, internalMessageResponseJsonWebSocketMessage);
--
Gitblit v1.9.3