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
package com.qianwen.smartman.modules.notify.wrapper;
 
import java.util.Objects;
import java.util.Optional;
import com.qianwen.core.mp.support.BaseEntityWrapper;
import com.qianwen.core.tool.utils.BeanUtil;
import com.qianwen.core.tool.utils.SpringUtil;
import com.qianwen.smartman.modules.notify.dto.BusinessNotifyDTO;
import com.qianwen.smartman.modules.notify.entity.BusinessNotify;
import com.qianwen.smartman.modules.notify.service.INotifyConfigService;
import com.qianwen.smartman.modules.notify.service.INotifyTemplateService;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/wrapper/BusinessNotifyWrapper.class */
public class BusinessNotifyWrapper extends BaseEntityWrapper<BusinessNotify, BusinessNotifyDTO> {
    public static BusinessNotifyWrapper build() {
        return new BusinessNotifyWrapper();
    }
 
    public BusinessNotifyDTO entityVO(BusinessNotify entity) {
        BusinessNotifyDTO businessNotifyDTO = (BusinessNotifyDTO) Objects.requireNonNull(BeanUtil.copyProperties(entity, BusinessNotifyDTO.class));
        String str = (String) Optional.ofNullable(((INotifyConfigService) SpringUtil.getBean(INotifyConfigService.class)).getById(entity.getNotifyId())).map(m -> {
            return m.getName();
        }).orElse("");
        String templateName = (String) Optional.ofNullable(((INotifyTemplateService) SpringUtil.getBean(INotifyTemplateService.class)).getById(entity.getNotifyTemplateId())).map(m2 -> {
            return m2.getName();
        }).orElse("");
        businessNotifyDTO.setNotifyTemplateName(templateName);
        return businessNotifyDTO;
    }
}