package com.qianwen.smartman.modules.notify.service.impl;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import java.util.List;
|
import java.util.Map;
|
import java.util.stream.Collectors;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import com.qianwen.core.mp.base.BaseServiceImpl;
|
import com.qianwen.core.mp.support.Condition;
|
import com.qianwen.core.mp.support.Query;
|
import com.qianwen.smartman.modules.notify.dto.NotifyTypeInfo;
|
import com.qianwen.smartman.modules.notify.entity.NotifyHistoryEntity;
|
import com.qianwen.smartman.modules.notify.mapper.NotifyHistoryEntityMapper;
|
import com.qianwen.smartman.modules.notify.service.INotifyHistoryService;
|
import org.springframework.stereotype.Service;
|
|
@Service
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/service/impl/NotifyHistoryServiceImpl.class */
|
public class NotifyHistoryServiceImpl extends BaseServiceImpl<NotifyHistoryEntityMapper, NotifyHistoryEntity> implements INotifyHistoryService {
|
private static final Logger log = LoggerFactory.getLogger(NotifyHistoryServiceImpl.class);
|
private final NotifyHistoryEntityMapper notifyHistoryEntityMapper;
|
private final NotifyConfigServiceImpl notifyConfigService;
|
|
public NotifyHistoryServiceImpl(final NotifyHistoryEntityMapper notifyHistoryEntityMapper, final NotifyConfigServiceImpl notifyConfigService) {
|
this.notifyHistoryEntityMapper = notifyHistoryEntityMapper;
|
this.notifyConfigService = notifyConfigService;
|
}
|
|
@Override // org.springblade.modules.notify.service.INotifyHistoryService
|
public IPage<NotifyHistoryEntity> listPage(Query query, String state, String keyword, String beginTime, String endTime) {
|
IPage<NotifyHistoryEntity> iPage = this.notifyHistoryEntityMapper.listPage(Condition.getPage(query), (state == null || !state.contains(",")) ? state : null, keyword, beginTime, endTime);
|
List<NotifyHistoryEntity> records = iPage.getRecords();
|
Map<String, NotifyTypeInfo> notifyInfo = this.notifyConfigService.getNotifyInfo();
|
iPage.setRecords((List) records.stream().peek(p -> {
|
NotifyTypeInfo notifyTypeInfo = (NotifyTypeInfo) notifyInfo.get(p.getNotifyType());
|
p.setNotifyTypeName(notifyTypeInfo.getName());
|
}).collect(Collectors.toList()));
|
return iPage;
|
}
|
}
|