| | |
| | | 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<>(); |