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 convertToDTOList(List sources) { if (sources == null) { return null; } List list = new ArrayList<>(sources.size()); for (BusinessNotify businessNotify : sources) { list.add(convertToDTO(businessNotify)); } return list; } @Override // org.springblade.modules.notify.convert.BusinessNotifyConvert public List convertDTOToVO(List business) { if (business == null) { return null; } List 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; } }