| | |
| | | if (projectRoleUsers != null && !projectRoleUsers.isEmpty()) { |
| | | for (Map<String, Object> projectRoleUser : projectRoleUsers) { |
| | | UserVo userVo = ConvertUtil.convertMapToClass(projectRoleUser, UserVo.class); |
| | | |
| | | // 이슈 생성 알림 메일 전송 |
| | | this.systemEmailService.reservationEmail(new String[]{userVo.getAccount()}, emailType, issueMap); |
| | | } |
| | |
| | | for(IssueIsp issueIsp : issue.getIssueIspFields()){ |
| | | IssueIspVo issueIspVo = ConvertUtil.copyProperties(issueIsp, IssueIspVo.class); |
| | | issueIspVo.setId(issueIsp.getId()); |
| | | IspField ispField = issueIsp.getIspField(); |
| | | if (ispField != null) { |
| | | issueIspVo.setIspId(ispField.getId()); |
| | | } |
| | | issueIspVos.add(issueIspVo); |
| | | } |
| | | issueVo.setIssueIspVos(issueIspVos); |
| | |
| | | for(IssueHosting issueHosting : issue.getIssueHostingFields()){ |
| | | IssueHostingVo issueHostingVo = ConvertUtil.copyProperties(issueHosting, IssueHostingVo.class); |
| | | issueHostingVo.setId(issueHosting.getId()); |
| | | HostingField hostingField = issueHosting.getHostingField(); |
| | | if (hostingField != null) { |
| | | issueHostingVo.setHostingId(hostingField.getId()); |
| | | } |
| | | |
| | | issueHostingVos.add(issueHostingVo); |
| | | } |
| | | issueVo.setIssueHostingVos(issueHostingVos); |
| | |
| | | if (issueForm.getSendEmails().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SEND_USER)); |
| | | }else if (issueForm.getTemplate() != null){ |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SELECT_TEMPLATE)); |
| | | } |
| | | |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | |
| | | |
| | | // 사용자 시스템 기능 사용 정보 수집 |
| | | log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_ANOTHER_USER_SEND_EMAIL)); |
| | | |
| | | this.systemEmailService.directEmail(issueForm.getSendEmails().toArray(new String[issueForm.getSendEmails().size()]), EmailType.ISSUE_SEND, issueMap, null); |
| | | } |
| | | |
| | | // 이슈를 템플릿에 따라 파트너 담당자에게 메일로 발송한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public void sendIssueEmailPartners(IssueForm issueForm) { |
| | | if (issueForm.getSendEmails().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SEND_USER)); |
| | | }else if (issueForm.getTemplate() == null){ |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SELECT_TEMPLATE)); |
| | | } |
| | | |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | | |
| | | Map<String, Object> issueMap = new HashMap<>(); |
| | | // 이슈 정보를 이메일 전송에 사용하기 위해 Map 형태로 변환한다. |
| | | this.makeIssueMapToIssue(issue, issueMap); |
| | | // 발신자 표시 |
| | | UserVo toUser = this.webAppUtil.getLoginUser(); |
| | | issueMap.put("toUser", toUser.getName() + "(" + CommonUtil.decryptAES128(toUser.getAccount()) + ")"); |
| | | |
| | | // 이슈 링크 |
| | | String projectKey = issue.getProject().getProjectKey(); |
| | | Long IssueNumber = issue.getIssueNumber(); |
| | | String link = this.configuration.getEmailSendUrl() + "/#/issues/issueList?projectKey=" + projectKey + "&issueNumber=" + IssueNumber.toString(); |
| | | |
| | | issueMap.put("issueLink", link); |
| | | issueMap.put("projectLink", link); |
| | | |
| | | // 사용자 시스템 기능 사용 정보 수집 |
| | | log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_ANOTHER_USER_SEND_EMAIL)); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | if(issueForm.getTemplate().equals(EmailType.ISSUE_SEND_1.toString())){ |
| | | this.systemEmailService.directEmail(ConvertUtil.ToArray(issueForm.getSendEmails()), EmailType.ISSUE_SEND_1, issueMap, null); |
| | | }else if(issueForm.getTemplate().equals(EmailType.ISSUE_SEND_2.toString())){ |
| | | this.systemEmailService.directEmail(ConvertUtil.ToArray(issueForm.getSendEmails()), EmailType.ISSUE_SEND_2, issueMap, null); |
| | | }else if(issueForm.getTemplate().equals(EmailType.ISSUE_SEND_3.toString())){ |
| | | this.systemEmailService.directEmail(ConvertUtil.ToArray(issueForm.getSendEmails()), EmailType.ISSUE_SEND_3, issueMap, null); |
| | | } |
| | | //메일 전송 이력 남기기 |
| | | this.issueHistoryService.detectSendIssueMail(IssueHistoryType.SEND, issueForm, sb); |
| | | this.issueHistoryService.addIssueHistory(issue, IssueHistoryType.SEND, sb.toString()); |
| | | } |
| | | |
| | | // 예약 발생 이슈를 실행한다 |
| | |
| | | @Override |
| | | public void modifyParentIssue(IssueForm issueDownForm) { |
| | | Issue issue = this.getIssue(issueDownForm.getId()); //하위 이슈 |
| | | Issue parentIssue = issue.getParentIssue(); //변경 전 하위이슈의 상위이슈 |
| | | |
| | | Long newParentIssueId = issueDownForm.getParentIssueId(); //변경할 하위이슈의 상위이슈 |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | Issue parentIssue = issue.getParentIssue(); //변경 전 하위이슈의 상위이슈 |
| | | if(parentIssue != null){ //변경 전 하위이슈의 상위이슈가 존재 할 경우 |
| | | this.issueHistoryService.detectDownIssues(IssueHistoryType.DELETE, issue, sb); |
| | | this.issueHistoryService.addIssueHistory(parentIssue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | |
| | | if (newParentIssueId != null) { // 추가 할 경우 |
| | | // todo 이전 하위 일감 히스토리기록 필요 |
| | | parentIssue = this.getIssue(newParentIssueId); //상위이슈(myIssue) |
| | | issue.setParentIssue(parentIssue); //myIssue를 하위이슈의 상위이슈로 set |
| | | this.issueHistoryService.detectDownIssues(IssueHistoryType.ADD, issue, sb); //issue = 하위이슈 |
| | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, usePartnerVos); |
| | | } |
| | | } |
| | | |
| | | /*@Override |
| | | @Transactional |
| | | public void findMailTargetAll(Map<String, Object> resJsonData, IssueCondition condition, Pageable pageable) { |
| | | IssueVo issueVo = new IssueVo(); |
| | | //Long issueId = MapUtil.getLong(params, "issueId"); |
| | | Long issueId = condition.getId(); |
| | | |
| | | List<String> emailList = Lists.newArrayList(); |
| | | |
| | | if(issueId != null){ |
| | | Issue issue = this.getIssue(issueId); |
| | | issueVo = ConvertUtil.copyProperties(issue, IssueVo.class); |
| | | this.setIssueCompanyField(issue, issueVo); //업체 정보 세팅 |
| | | this.setIssueIspField(issue, issueVo); //ISP 정보 세팅 |
| | | this.setIssueHostingField(issue, issueVo); //HOSTING 정보 세팅 |
| | | for(IssueCompanyVo issueCompanyVo : issueVo.getIssueCompanyVos()) { |
| | | emailList.add(issueCompanyVo.getEmail()); |
| | | } |
| | | for(IssueIspVo issueIspVo : issueVo.getIssueIspVos()) { |
| | | emailList.add(issueIspVo.getEmail()); |
| | | } |
| | | for(IssueHostingVo issueHostingVo : issueVo.getIssueHostingVos()) { |
| | | emailList.add(issueHostingVo.getEmail()); |
| | | } |
| | | |
| | | } |
| | | |
| | | Long totalCount = this.issueMapper.count(condition); |
| | | int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1; |
| | | |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | //resJsonData.put(Constants.RES_KEY_CONTENTS, emailList); |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, emailList); |
| | | resJsonData.put(Constants.REQ_KEY_PAGE_VO, new ResPage(pageable.getPageNumber(), pageable.getPageSize(), |
| | | totalPage, totalCount)); |
| | | }*/ |
| | | |
| | | /*@Override |
| | | @Transactional |
| | | public void findMailTargetCompany(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | IssueVo issueVo = new IssueVo(); |
| | | Long issueId = MapUtil.getLong(params, "issueId"); |
| | | |
| | | List<String> emailList = Lists.newArrayList(); |
| | | |
| | | if(issueId != null){ |
| | | Issue issue = this.getIssue(issueId); |
| | | issueVo = ConvertUtil.copyProperties(issue, IssueVo.class); |
| | | this.setIssueCompanyField(issue, issueVo); //업체 정보 세팅 |
| | | for(IssueCompanyVo issueCompanyVo : issueVo.getIssueCompanyVos()) { |
| | | emailList.add(issueCompanyVo.getEmail()); |
| | | } |
| | | } |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, emailList); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void findMailTargetIsp(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void findMailTargetHosting(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | |
| | | }*/ |
| | | } |