yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
    }
}