| | |
| | | import com.qianwen.core.notify.notifier.NotifierManager; |
| | | import com.qianwen.core.tool.metadata.Values; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.modules.cps.entity.Employee; |
| | | import com.qianwen.smartman.modules.cps.service.IEmployeeService; |
| | | import com.qianwen.smartman.modules.smis.entity.Employee; |
| | | import com.qianwen.smartman.modules.smis.service.IEmployeeService; |
| | | import com.qianwen.smartman.modules.notify.api.DingTalkApi; |
| | | import com.qianwen.smartman.modules.notify.dto.NotifySendMethodDTO; |
| | | import com.qianwen.smartman.modules.system.service.IUserOauthService; |
| | |
| | | @Component |
| | | public class NotifyBusinessManager { |
| | | private static final Logger log = LoggerFactory.getLogger(NotifyBusinessManager.class); |
| | | private final NotifierManager notifierManager; |
| | | //private final NotifierManager notifierManager; |
| | | private final DingTalkApi dingTalkApi; |
| | | private final IEmployeeService employeeService; |
| | | private final IUserOauthService userOauthService; |
| | | |
| | | |
| | | public NotifyBusinessManager(final NotifierManager notifierManager, final DingTalkApi dingTalkApi, final IEmployeeService employeeService, final IUserOauthService userOauthService) { |
| | | this.notifierManager = notifierManager; |
| | | public NotifyBusinessManager(final DingTalkApi dingTalkApi, final IEmployeeService employeeService, final IUserOauthService userOauthService) {//final NotifierManager notifierManager |
| | | //this.notifierManager = notifierManager; |
| | | this.dingTalkApi = dingTalkApi; |
| | | this.employeeService = employeeService; |
| | | this.userOauthService = userOauthService; |
| | |
| | | String notifyId = notifyDTO.getNotifyId(); |
| | | String templateId = notifyDTO.getTemplateId(); |
| | | String notifyType = notifyDTO.getNotifyType(); |
| | | /* |
| | | Notifier notifier = (Notifier) Optional.ofNullable(this.notifierManager.getNotifier((NotifyType) null, notifyId)).orElseThrow(() -> { |
| | | return new ServiceException("通知器[" + notifyId + "]不存在"); |
| | | }); |
| | | List<String> providerName = getProviderName(notifyType, empIds); |
| | | if (!Func.isEmpty(providerName)) { |
| | | notifier.send(templateId, LogTraceUtil.getTraceId(), Values.of(data), providerName); |
| | | } |
| | | }*/ |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |