| | |
| | | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/BusinessNotifyServiceImpl.class */ |
| | | |
| | | public class BusinessNotifyServiceImpl extends BaseServiceImpl<BusinessNotifyMapper, BusinessNotify> implements IBusinessNotifyService { |
| | | private static final Logger log = LoggerFactory.getLogger(BusinessNotifyServiceImpl.class); |
| | | private final NotifyConfigServiceImpl notifyConfigService; |
| | |
| | | this.notifyBusinessManager = notifyBusinessManager; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.notify.service.IBusinessNotifyService |
| | | |
| | | public List<NotifyBusinessTreeVO> tree() { |
| | | List<NotifyBusinessTreeDTO> notifyList = this.businessNotifyMapper.treeList(NotifyConstant.NOTIFY_BUSINESS_KEY); |
| | | List<NotifyBusinessTreeVO> vos = BusinessNotifyConvert.INSTANCE.convertDTOToVO(notifyList); |
| | |
| | | return trees; |
| | | } |
| | | |
| | | @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)); |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.notify.service.IBusinessNotifyService |
| | | |
| | | public NotifyBusinessSaveVO save(NotifyBusinessSaveVO notifyBusinessVO) { |
| | | NotifyTemplateEntity templateEntity = notifyBusinessVO.getTemplateEntity(); |
| | | if (Func.isNotEmpty(templateEntity) && Func.isNotEmpty(templateEntity.getId())) { |
| | |
| | | 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())); |
| | |
| | | return Boolean.valueOf(changeStatus(Collections.singletonList(businessNotify.getId()), changeStatusVO.getStatus())); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.notify.service.IBusinessNotifyService |
| | | |
| | | public NotifyTemplateEntity modify(NotifyTemplateEntity notifyTemplateEntity) { |
| | | if (Func.isNotEmpty(notifyTemplateEntity) && Func.isNotEmpty(notifyTemplateEntity.getId())) { |
| | | CacheUtil.evict("blade:notify", "template:id:", notifyTemplateEntity.getId(), false); |
| | |
| | | return notifyTemplateEntity; |
| | | } |
| | | |
| | | @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 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) |