yangys
2024-03-28 25475f31cd0d52ff328bbea9e80f15647dedd80b
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package com.qianwen.smartman.modules.notify.convert;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.qianwen.smartman.modules.notify.dto.NotifyHistoryDTO;
import com.qianwen.smartman.modules.notify.dto.NotifyHistoryQueryDTO;
import com.qianwen.smartman.modules.notify.entity.NotifyHistoryEntity;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/NotifyHistoryConvertImpl.class */
public class NotifyHistoryConvertImpl implements NotifyHistoryConvert {
    @Override // org.springblade.modules.notify.convert.NotifyHistoryConvert
    public NotifyHistoryEntity convertToEntity(NotifyHistoryQueryDTO sources) {
        if (sources == null) {
            return null;
        }
        NotifyHistoryEntity notifyHistoryEntity = new NotifyHistoryEntity();
        notifyHistoryEntity.setState(sources.getState());
        notifyHistoryEntity.setProvider(sources.getProvider());
        notifyHistoryEntity.setNotifyType(sources.getNotifyType());
        return notifyHistoryEntity;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifyHistoryConvert
    public NotifyHistoryEntity convertToEntity(NotifyHistoryDTO sources) {
        if (sources == null) {
            return null;
        }
        NotifyHistoryEntity notifyHistoryEntity = new NotifyHistoryEntity();
        if (sources.getId() != null) {
            notifyHistoryEntity.setId(Long.valueOf(Long.parseLong(sources.getId())));
        }
        notifyHistoryEntity.setTranceId(sources.getTranceId());
        notifyHistoryEntity.setNotifierId(sources.getNotifierId());
        notifyHistoryEntity.setState(sources.getState());
        notifyHistoryEntity.setErrorType(sources.getErrorType());
        notifyHistoryEntity.setErrorStack(sources.getErrorStack());
        notifyHistoryEntity.setTemplateId(sources.getTemplateId());
        notifyHistoryEntity.setTemplate(sources.getTemplate());
        Map<String, Object> map = sources.getContextData();
        if (map != null) {
            notifyHistoryEntity.setContextData(new HashMap(map));
        }
        notifyHistoryEntity.setProvider(sources.getProvider());
        notifyHistoryEntity.setNotifyType(sources.getNotifyType());
        notifyHistoryEntity.setNotifyTime(sources.getNotifyTime());
        notifyHistoryEntity.setRetryTimes(sources.getRetryTimes());
        notifyHistoryEntity.setBusinessName(sources.getBusinessName());
        notifyHistoryEntity.setNotifyTypeName(sources.getNotifyTypeName());
        return notifyHistoryEntity;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifyHistoryConvert
    public NotifyHistoryDTO convertToDto(NotifyHistoryEntity sources) {
        if (sources == null) {
            return null;
        }
        NotifyHistoryDTO notifyHistoryDTO = new NotifyHistoryDTO();
        if (sources.getId() != null) {
            notifyHistoryDTO.setId(String.valueOf(sources.getId()));
        }
        notifyHistoryDTO.setTranceId(sources.getTranceId());
        notifyHistoryDTO.setNotifierId(sources.getNotifierId());
        notifyHistoryDTO.setState(sources.getState());
        notifyHistoryDTO.setErrorType(sources.getErrorType());
        notifyHistoryDTO.setErrorStack(sources.getErrorStack());
        notifyHistoryDTO.setTemplateId(sources.getTemplateId());
        notifyHistoryDTO.setTemplate(sources.getTemplate());
        Map<String, Object> map = sources.getContextData();
        if (map != null) {
            notifyHistoryDTO.setContextData(new HashMap(map));
        }
        notifyHistoryDTO.setProvider(sources.getProvider());
        notifyHistoryDTO.setNotifyType(sources.getNotifyType());
        notifyHistoryDTO.setNotifyTime(sources.getNotifyTime());
        notifyHistoryDTO.setRetryTimes(sources.getRetryTimes());
        notifyHistoryDTO.setBusinessName(sources.getBusinessName());
        notifyHistoryDTO.setNotifyTypeName(sources.getNotifyTypeName());
        return notifyHistoryDTO;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifyHistoryConvert
    public List<NotifyHistoryDTO> convertToDTOList(List<NotifyHistoryEntity> sources) {
        if (sources == null) {
            return null;
        }
        List<NotifyHistoryDTO> list = new ArrayList<>(sources.size());
        for (NotifyHistoryEntity notifyHistoryEntity : sources) {
            list.add(convertToDto(notifyHistoryEntity));
        }
        return list;
    }
}