yangys
2024-03-29 4b479381a65bd3ef526cb92631d3550f2aa17459
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
95
96
97
98
99
100
101
102
103
104
105
106
107
package com.qianwen.smartman.modules.notify.convert;
 
import java.util.ArrayList;
import java.util.List;
import com.qianwen.smartman.modules.notify.dto.BusinessNotifyDTO;
import com.qianwen.smartman.modules.notify.dto.BusinessNotifyQueryDTO;
import com.qianwen.smartman.modules.notify.dto.NotifyBusinessTreeDTO;
import com.qianwen.smartman.modules.notify.entity.BusinessNotify;
import com.qianwen.smartman.modules.notify.vo.NotifyBusinessTreeVO;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/BusinessNotifyConvertImpl.class */
public class BusinessNotifyConvertImpl implements BusinessNotifyConvert {
    @Override // org.springblade.modules.notify.convert.BusinessNotifyConvert
    public BusinessNotify convertToEntity(BusinessNotifyQueryDTO sources) {
        if (sources == null) {
            return null;
        }
        BusinessNotify businessNotify = new BusinessNotify();
        businessNotify.setBusinessKey(sources.getBusinessKey());
        businessNotify.setNotifyType(sources.getNotifyType());
        if (sources.getNotifyId() != null) {
            businessNotify.setNotifyId(Long.valueOf(Long.parseLong(sources.getNotifyId())));
        }
        if (sources.getNotifyTemplateId() != null) {
            businessNotify.setNotifyTemplateId(Long.valueOf(Long.parseLong(sources.getNotifyTemplateId())));
        }
        return businessNotify;
    }
 
    @Override // org.springblade.modules.notify.convert.BusinessNotifyConvert
    public BusinessNotify convertToEntity(BusinessNotifyDTO sources) {
        if (sources == null) {
            return null;
        }
        BusinessNotify businessNotify = new BusinessNotify();
        businessNotify.setId(sources.getId());
        businessNotify.setStatus(sources.getStatus());
        businessNotify.setBusinessKey(sources.getBusinessKey());
        businessNotify.setBusinessName(sources.getBusinessName());
        businessNotify.setNotifyType(sources.getNotifyType());
        if (sources.getNotifyId() != null) {
            businessNotify.setNotifyId(Long.valueOf(Long.parseLong(sources.getNotifyId())));
        }
        if (sources.getNotifyTemplateId() != null) {
            businessNotify.setNotifyTemplateId(Long.valueOf(Long.parseLong(sources.getNotifyTemplateId())));
        }
        return businessNotify;
    }
 
    @Override // org.springblade.modules.notify.convert.BusinessNotifyConvert
    public BusinessNotifyDTO convertToDTO(BusinessNotify sources) {
        if (sources == null) {
            return null;
        }
        BusinessNotifyDTO businessNotifyDTO = new BusinessNotifyDTO();
        businessNotifyDTO.setId(sources.getId());
        businessNotifyDTO.setBusinessKey(sources.getBusinessKey());
        businessNotifyDTO.setBusinessName(sources.getBusinessName());
        if (sources.getNotifyId() != null) {
            businessNotifyDTO.setNotifyId(String.valueOf(sources.getNotifyId()));
        }
        businessNotifyDTO.setNotifyType(sources.getNotifyType());
        if (sources.getNotifyTemplateId() != null) {
            businessNotifyDTO.setNotifyTemplateId(String.valueOf(sources.getNotifyTemplateId()));
        }
        businessNotifyDTO.setStatus(sources.getStatus());
        return businessNotifyDTO;
    }
 
    @Override // org.springblade.modules.notify.convert.BusinessNotifyConvert
    public List<BusinessNotifyDTO> convertToDTOList(List<BusinessNotify> sources) {
        if (sources == null) {
            return null;
        }
        List<BusinessNotifyDTO> list = new ArrayList<>(sources.size());
        for (BusinessNotify businessNotify : sources) {
            list.add(convertToDTO(businessNotify));
        }
        return list;
    }
 
    @Override // org.springblade.modules.notify.convert.BusinessNotifyConvert
    public List<NotifyBusinessTreeVO> convertDTOToVO(List<NotifyBusinessTreeDTO> business) {
        if (business == null) {
            return null;
        }
        List<NotifyBusinessTreeVO> list = new ArrayList<>(business.size());
        for (NotifyBusinessTreeDTO notifyBusinessTreeDTO : business) {
            list.add(notifyBusinessTreeDTOToNotifyBusinessTreeVO(notifyBusinessTreeDTO));
        }
        return list;
    }
 
    protected NotifyBusinessTreeVO notifyBusinessTreeDTOToNotifyBusinessTreeVO(NotifyBusinessTreeDTO notifyBusinessTreeDTO) {
        if (notifyBusinessTreeDTO == null) {
            return null;
        }
        NotifyBusinessTreeVO notifyBusinessTreeVO = new NotifyBusinessTreeVO();
        notifyBusinessTreeVO.setId(notifyBusinessTreeDTO.getId());
        notifyBusinessTreeVO.setParentId(notifyBusinessTreeDTO.getParentId());
        notifyBusinessTreeVO.setBusinessName(notifyBusinessTreeDTO.getBusinessName());
        notifyBusinessTreeVO.setBusinessKey(notifyBusinessTreeDTO.getBusinessKey());
        notifyBusinessTreeVO.setStartCount(notifyBusinessTreeDTO.getStartCount());
        notifyBusinessTreeVO.setRemark(notifyBusinessTreeDTO.getRemark());
        return notifyBusinessTreeVO;
    }
}