| | |
| | | import kr.wisestone.owl.config.CommonConfiguration; |
| | | import kr.wisestone.owl.constant.MailConstants; |
| | | import kr.wisestone.owl.constant.MsgConstants; |
| | | import kr.wisestone.owl.domain.Department; |
| | | import kr.wisestone.owl.domain.SystemEmail; |
| | | import kr.wisestone.owl.domain.User; |
| | | import kr.wisestone.owl.domain.enumType.EmailType; |
| | |
| | | content = this.springTemplateEngine.process(mailConstants.getMailTemplate(), context); |
| | | break; |
| | | |
| | | case ISSUE_SEND_1: // 이슈 이메일로 대상자에게 발송 |
| | | mailConstants = MailConstants.ISSUE_SEND_1; |
| | | context = StringTemplateUtil.makeContext(params, locale); |
| | | content = this.springTemplateEngine.process(mailConstants.getMailTemplate(), context); |
| | | break; |
| | | |
| | | case ISSUE_SEND_2: // 이슈 이메일로 대상자에게 발송 |
| | | mailConstants = MailConstants.ISSUE_SEND_2; |
| | | context = StringTemplateUtil.makeContext(params, locale); |
| | | content = this.springTemplateEngine.process(mailConstants.getMailTemplate(), context); |
| | | break; |
| | | |
| | | case ISSUE_SEND_3: // 이슈 이메일로 대상자에게 발송 |
| | | mailConstants = MailConstants.ISSUE_SEND_3; |
| | | context = StringTemplateUtil.makeContext(params, locale); |
| | | content = this.springTemplateEngine.process(mailConstants.getMailTemplate(), context); |
| | | break; |
| | | |
| | | case USER_JOIN_STATISTICS: // 일일 사용자 가입 정보 발송 |
| | | mailConstants = MailConstants.USER_JOIN_STATISTICS; |
| | | context = StringTemplateUtil.makeContext(params, locale); |
| | |
| | | return results; |
| | | } |
| | | |
| | | // 프로젝트에서 변경된 담당부서를 찾기 위해 사용 |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public List<String> notificationDepartmentChange(List<Department> totalDepartments, List<Department> targetDepartments) { |
| | | List<String> results = Lists.newArrayList(); |
| | | |
| | | // 제외 대상자 찾기 |
| | | for (Department department : totalDepartments) { |
| | | boolean excludeCheck = true; |
| | | |
| | | for (Department newDepartment : targetDepartments) { |
| | | if (department.getId().equals(newDepartment.getId())) { |
| | | excludeCheck = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (excludeCheck) { |
| | | results.add(department.getDepartmentName()); |
| | | } |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | // 아직 발송되지 않은 이메일을 조회한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |