| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | @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(); |
| | |
| | | } |
| | | |
| | | 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"); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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 = {"系统通知管理"}) |
| | |
| | | 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; |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | @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) |
| | |
| | | @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)));*/ |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 = {"通知配置管理"}) |
| | |
| | | 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; |
| | |
| | | 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) |
| | |
| | | @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) -> { |
| | |
| | | return v0.getName(); |
| | | }, (v0) -> { |
| | | return v0.getProvider(); |
| | | }})); |
| | | }}));*/ |
| | | return R.data(NotifyConfigConvert.INSTANCE.convertToDTOList(result)); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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 = {"消息通知模版"}) |
| | |
| | | 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; |
| | |
| | | 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) -> { |
| | |
| | | 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))); |
| | | } |
| | | |
| | |
| | | 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) -> { |
| | |
| | | return v0.getName(); |
| | | }})).stream().map(x -> { |
| | | return new NameValue(x.getName(), x.getId().toString()); |
| | | }).collect(Collectors.toList()); |
| | | }).collect(Collectors.toList());*/ |
| | | } |
| | | return R.data(result); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 = {"通知公告表管理"}) |
| | |
| | | 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; |
| | |
| | | @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); |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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(); |
| | |
| | | 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()))) { |
| | |
| | | } |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | 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); |
| | |
| | | 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)) { |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | @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; |
| | |
| | | @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; |
| | |
| | | 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) -> { |
| | |
| | | if (dto != null) { |
| | | result.add(dto); |
| | | } |
| | | }); |
| | | });*/ |
| | | return result; |
| | | } |
| | | |
| | |
| | | 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])); |
| | | } |
| | |
| | | @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; |
| | |
| | | } |
| | | |
| | | 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])); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | 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) { |
| | |
| | | |
| | | 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(); |
| | |
| | | } |
| | | 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); |
| | | } |
| | |
| | | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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));*/ |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | |
| | | 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<>(); |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | 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; |
| | |
| | | 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()); |
| | |
| | | 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()); |
| | |
| | | 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); |
| | |
| | | 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])); |
| | | } |
| | |
| | | |
| | | @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])); |
| | | } |
| | |
| | | } |
| | | |
| | | 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(); |
| | |
| | | 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); |
| | |
| | | } |
| | | 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)) { |
| | |
| | | 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)) { |
| | |
| | | } |
| | | |
| | | 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; |
| | | })); |
| | | } |
| | |
| | | @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; |
| | |
| | | @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(); |
| | |
| | | } |
| | | 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); |
| | | } |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | @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(); |
| | |
| | | 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(); |
| | |
| | | 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(); |
| | |
| | | }); |
| | | return voPage; |
| | | } else { |
| | | return new Page(); |
| | | return new Page<>(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | 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) -> { |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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 */ |
| | |
| | | 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; |
| | |
| | | |
| | | 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); |
| | |
| | | default: |
| | | result = this.userService.getNotifySubscriberList(notifySubscriberList); |
| | | break; |
| | | } |
| | | }*/ |
| | | return result; |
| | | } |
| | | |
| | |
| | | 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) -> { |
| | |
| | | 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()); |
| | |
| | | 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; |
| | |
| | | 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("当前通知模板正在被业务使用,无法删除"); |
| | | } |
| | |
| | | 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)) { |
| | |
| | | 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 */ |
| | |
| | | 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; |
| | |
| | | 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); |