| | |
| | | import kr.wisestone.owl.constant.*; |
| | | import kr.wisestone.owl.data.CheckIssueData; |
| | | import kr.wisestone.owl.domain.*; |
| | | import kr.wisestone.owl.domain.enumType.CustomFieldType; |
| | | import kr.wisestone.owl.domain.enumType.EmailType; |
| | | import kr.wisestone.owl.domain.enumType.IssueHistoryType; |
| | | import kr.wisestone.owl.domain.enumType.IssueStatusType; |
| | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import static kr.wisestone.owl.domain.enumType.CustomFieldType.*; |
| | | import static kr.wisestone.owl.web.condition.CompanyFieldCondition.IP_DEFAULT; |
| | | |
| | | @Service |
| | | public class IssueServiceImpl extends AbstractServiceImpl<Issue, Long, JpaRepository<Issue, Long>> implements IssueService { |
| | |
| | | IssueForm issueForm = ConvertUtil.copyProperties(issueApiForm, IssueForm.class); |
| | | // issueForm.setFiles(issueApiForm.getFiles()); |
| | | IssueType issueType = this.issueTypeService.getIssueType(issueApiForm.getIssueTypeId()); |
| | | if (issueType == null){ |
| | | if (issueType == null) { |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ISSUE_TYPE_ERROR)); |
| | | } |
| | | |
| | |
| | | issueForm.addDepartmentId(departmentId); |
| | | } |
| | | } |
| | | } else if (issueApiForm.getIssueStatusId() == null){ |
| | | } else if (issueApiForm.getIssueStatusId() == null) { |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_EXIST)); |
| | | } else if (!this.workflowTransitionService.contains(issueApiForm.getIssueStatusId(), workflow.getId())) { |
| | | //이슈 상태 유효성 확인 |
| | |
| | | |
| | | // 프로젝트 입력 |
| | | Project project = issueType.getProject(); |
| | | if (project == null){ |
| | | if (project == null) { |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_PROJECT_ERROR)); |
| | | } |
| | | issueForm.setProjectId(project.getId()); |
| | |
| | | } |
| | | |
| | | // 중복된 상위 이슈검색 |
| | | List<Issue> issues = this.findIssue(issueApiForm, issueForm, customFieldApiOverlaps, user.getId()); |
| | | List<Issue> issues = this.findIssue(issueApiForm, issueForm, customFieldApiOverlaps); |
| | | int size = issues.size(); |
| | | if (size > 0) { |
| | | Issue targetIssue = issues.get(0); |
| | |
| | | |
| | | /** |
| | | * 도메인이 동일한 업체 찾기 |
| | | * |
| | | * @param issueForm IssueForm |
| | | * @return IssueForm |
| | | */ |
| | | private IssueForm findCompanyField(IssueForm issueForm) { |
| | | if(issueForm.getIssueCustomFields() != null && issueForm.getIssueCustomFields().size() > 0) { |
| | | if (issueForm.getIssueCustomFields() != null && issueForm.getIssueCustomFields().size() > 0) { |
| | | CompanyFieldCondition condition = new CompanyFieldCondition(); |
| | | List<Map<String, Object>> companyFields = Lists.newArrayList(); |
| | | List<Map<String, Object>> issueCompanyFields = Lists.newArrayList(); |
| | |
| | | for (Map<String, Object> issueCustomField : issueForm.getIssueCustomFields()) { |
| | | Long customFieldId = MapUtil.getLong(issueCustomField, "customFieldId"); |
| | | CustomField customField = this.customFieldService.getCustomField(customFieldId); |
| | | if(customField != null && customField.getCustomFieldType().equals(SITE) && customField.getName().equals("도메인")) { |
| | | if (customField != null && customField.getCustomFieldType().equals(SITE) && customField.getName().equals("도메인")) { |
| | | String useValue = issueCustomField.get("useValue").toString(); |
| | | String[] urlArr = null; |
| | | List<String> urls = Lists.newArrayList(); |
| | |
| | | condition.setUrls(urls); |
| | | companyFields = this.companyFieldService.find(condition); |
| | | |
| | | if(companyFields != null && companyFields.size() > 0) { |
| | | if (companyFields != null && companyFields.size() > 0) { |
| | | for (Map<String, Object> companyField : companyFields) { |
| | | CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(companyField, CompanyFieldVo.class); |
| | | companyField.put("companyId", companyField.get("id")); |
| | | issueCompanyFields.add(companyField); |
| | | if(companyFieldVo.getIspId() != null && companyFieldVo.getIspId() != -1) { |
| | | if (companyFieldVo.getIspId() != null && companyFieldVo.getIspId() != -1) { |
| | | Map<String, Object> ispField = this.ispFieldService.find(companyFieldVo.getIspId()); |
| | | if (ispField != null) { |
| | | ispField.put("ispId", ispField.get("id")); |
| | | issueIspFields.add(ispField); |
| | | } |
| | | } |
| | | if(companyFieldVo.getHostingId() != null && companyFieldVo.getHostingId() != -1) { |
| | | if (companyFieldVo.getHostingId() != null && companyFieldVo.getHostingId() != -1) { |
| | | Map<String, Object> hostingField = this.hostingFieldService.find(companyFieldVo.getHostingId()); |
| | | if (hostingField != null) { |
| | | hostingField.put("hostingId", hostingField.get("id")); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 입력한 ip가 기존 업체 중에 속해있는지 체크 |
| | | * |
| | | * @param ip IP |
| | | * @param startIps 업체 테이블에 존재하는 start_ip(정수로 변환한 값) |
| | | * @param endIps 업체 테이블에 존재하는 end_ip(정수로 변환한 값) |
| | | * @return IP가 속해 있는지 결과 값 |
| | | */ |
| | | boolean containsIP(Long ip, List<Long> startIps, List<Long> endIps) { |
| | | if (startIps != null && startIps.size() > 0 && endIps != null && endIps.size() > 0) { |
| | | for (int i = 0; i < startIps.size(); i++) { |
| | | if (startIps.get(i) <= ip && endIps.get(i) >= ip) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 조건에 맞는 파트너 정보 찾기 |
| | | * @param condition CompanyFieldCondition |
| | | * |
| | | * @param condition CompanyFieldCondition |
| | | * @param issueCompanyFields List<Map<String, Object>> |
| | | * @param issueIspFields List<Map<String, Object>> |
| | | * @param issueIspFields List<Map<String, Object>> |
| | | * @param issueHostingFields List<Map<String, Object>> |
| | | */ |
| | | private void findPartner(CompanyFieldCondition condition, List<Map<String, Object>> issueCompanyFields |
| | | private CompanyFieldVo findPartner(CompanyFieldCondition condition, List<Map<String, Object>> issueCompanyFields |
| | | , List<Map<String, Object>> issueIspFields, List<Map<String, Object>> issueHostingFields) { |
| | | |
| | | List<Map<String, Object>> companyFields = this.companyFieldService.find(condition); |
| | | Long ip = condition.getIp(); |
| | | List<Map<String, Object>> companyFieldList = Lists.newArrayList(); |
| | | |
| | | if(companyFields != null && companyFields.size() > 0) { |
| | | for (Map<String, Object> companyField : companyFields) { |
| | | CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(companyField, CompanyFieldVo.class); |
| | | if (ip > IP_DEFAULT) { |
| | | List<CompanyField> companyFields = this.companyFieldService.findAll(); |
| | | if (companyFields != null && companyFields.size() > 0) { |
| | | for (CompanyField companyField : companyFields) { |
| | | if (companyField.getIpStart() != null && companyField.getIpEnd() != null) { |
| | | List<Long> startIps = ConvertUtil.ipToLongs(companyField.getIpStart()); |
| | | List<Long> endIps = ConvertUtil.ipToLongs(companyField.getIpEnd()); |
| | | |
| | | if (containsIP(ip, startIps, endIps)) { |
| | | companyFieldList.add(ConvertUtil.convertObjectToMap(companyField)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | // api 사용자정의필드 값에 IP,URL 둘 다 입력 했을 경우 |
| | | if (!StringUtils.isEmpty(condition.getUrl()) && companyFieldList.size() > 0) { |
| | | for (Map<String, Object> companyFieldMap : companyFieldList) { |
| | | CompanyField companyField = ConvertUtil.convertMapToClass(companyFieldMap, CompanyField.class); |
| | | if (companyField != null && !StringUtils.isEmpty(companyField.getUrl())) { |
| | | if (!companyField.getUrl().contains(condition.getUrl())) { |
| | | companyFieldList.clear(); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | companyFieldList = this.companyFieldService.find(condition); |
| | | } |
| | | |
| | | CompanyFieldVo companyFieldVo = null; |
| | | if (companyFieldList != null && companyFieldList.size() > 0) { |
| | | for (Map<String, Object> companyField : companyFieldList) { |
| | | companyFieldVo = ConvertUtil.convertMapToClass(companyField, CompanyFieldVo.class); |
| | | companyField.put("companyId", companyField.get("id")); |
| | | issueCompanyFields.add(companyField); |
| | | if(companyFieldVo.getIspId() != null && companyFieldVo.getIspId() != -1) { |
| | | if (companyFieldVo.getIspId() != null && companyFieldVo.getIspId() != -1) { |
| | | Map<String, Object> ispField = this.ispFieldService.find(companyFieldVo.getIspId()); |
| | | if (ispField != null) { |
| | | ispField.put("ispId", ispField.get("id")); |
| | | issueIspFields.add(ispField); |
| | | } |
| | | } |
| | | if(companyFieldVo.getHostingId() != null && companyFieldVo.getHostingId() != -1) { |
| | | if (companyFieldVo.getHostingId() != null && companyFieldVo.getHostingId() != -1) { |
| | | Map<String, Object> hostingField = this.hostingFieldService.find(companyFieldVo.getHostingId()); |
| | | if (hostingField != null) { |
| | | hostingField.put("hostingId", hostingField.get("id")); |
| | |
| | | } |
| | | } |
| | | } |
| | | return companyFieldVo; |
| | | } |
| | | |
| | | private User convertToUser(String token) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * url 정규식 표현 |
| | | * @param url String |
| | | * 사용자정의 필드 검사 |
| | | * 도메인 or IP 일 경우만 처리하기 위함 |
| | | * |
| | | * @param issueCustomFieldValueForms 사용자 정의 필드 값 배열 |
| | | * @return 업체 검색 조건 |
| | | */ |
| | | private boolean verifyUrl(String url) { |
| | | boolean urlChk = false; |
| | | if (!StringUtils.isEmpty(url)) { |
| | | String reg = "^((http|https)://)?(www.)?([a-zA-Z0-9]+)\\.[a-z]+([a-zA-z0-9.?#]+)?"; |
| | | if(Pattern.matches(reg, url)) { |
| | | urlChk = true; |
| | | } |
| | | } |
| | | return urlChk; |
| | | } |
| | | |
| | | /** |
| | | * ip 정규식 표현 |
| | | * @param ip String |
| | | * @return boolean |
| | | */ |
| | | private boolean verifyIp(String ip) { |
| | | boolean ipChk = false; |
| | | if (!StringUtils.isEmpty(ip)) { |
| | | if (Pattern.matches("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\" + |
| | | ".(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", ip)) { |
| | | ipChk = true; |
| | | } |
| | | } |
| | | |
| | | return ipChk; |
| | | } |
| | | |
| | | // 중복된 상위 이슈 검색 |
| | | private List<Issue> findIssue(IssueApiForm issueApiform, IssueForm issueForm, List<CustomFieldApiOverlap> customFieldApiOverlaps, Long userId) { |
| | | List<IssueCustomFieldValueForm> issueCustomFieldValueForms = issueApiform.getIssueCustomFieldValues(); |
| | | List<Issue> resultIssueVos = Lists.newArrayList(); |
| | | String comma = ","; |
| | | private CompanyFieldCondition validIssueCustomFieldValue(List<IssueCustomFieldValueForm> issueCustomFieldValueForms, List<CustomFieldApiOverlap> customFieldApiOverlaps) { |
| | | CompanyFieldCondition condition = new CompanyFieldCondition(); |
| | | |
| | | if (issueCustomFieldValueForms.size() > 0) { |
| | | String concatUseValue = ""; |
| | | String customFieldType = ""; |
| | | int useIdx = 0; |
| | | int cntIp = 0; |
| | | int cntSite = 0; |
| | | |
| | | IssueCustomFieldValueFormComparator comp = new IssueCustomFieldValueFormComparator(); |
| | | Collections.sort(issueCustomFieldValueForms, comp); |
| | | |
| | | List<String> userValues = Lists.newArrayList(); |
| | | CompanyFieldCondition condition = new CompanyFieldCondition(); |
| | | List<Map<String, Object>> issueCompanyFields = Lists.newArrayList(); |
| | | List<Map<String, Object>> issueIspFields = Lists.newArrayList(); |
| | | List<Map<String, Object>> issueHostingFields = Lists.newArrayList(); |
| | | |
| | | for (IssueCustomFieldValueForm issueCustomFieldValueForm : issueCustomFieldValueForms) { |
| | | userValues.add(issueCustomFieldValueForm.getUseValue()); |
| | | |
| | | for(CustomFieldApiOverlap customFieldApiOverlap : customFieldApiOverlaps) { |
| | | for (CustomFieldApiOverlap customFieldApiOverlap : customFieldApiOverlaps) { |
| | | if (customFieldApiOverlap.getCustomField().getId().equals(issueCustomFieldValueForm.getCustomFieldId())) { |
| | | |
| | | String useValue = issueCustomFieldValueForm.getUseValue(); |
| | | if (useValue.contains(" ")) { |
| | | useValue = useValue.replace(" ",""); |
| | | } |
| | | |
| | | if (this.verifyIp(useValue)) { |
| | | if (CommonUtil.verifyIp(useValue)) { |
| | | long ip = ConvertUtil.ipToLong(useValue); |
| | | customFieldType = IP_ADDRESS.toString(); |
| | | if (cntIp == 0){ |
| | | if (condition.getIp() <= IP_DEFAULT) { |
| | | condition.setIp(ip); |
| | | } |
| | | cntIp ++; |
| | | } |
| | | |
| | | if (this.verifyUrl(useValue)) { |
| | | customFieldType = SITE.toString(); |
| | | if (cntSite == 0) { |
| | | condition.setUrl(useValue); |
| | | } |
| | | cntSite ++; |
| | | } |
| | | |
| | | /*if (customFieldApiOverlap.getCustomField().getCustomFieldType().equals(IP_ADDRESS)) { |
| | | long ip = ConvertUtil.ipToLong(useValue); |
| | | customFieldType = IP_ADDRESS.toString(); |
| | | if (cntIp == 0){ |
| | | condition.setIp(ip); |
| | | } |
| | | cntIp ++; |
| | | }*/ |
| | | |
| | | /*if(customFieldApiOverlap.getCustomField().getCustomFieldType().equals(SITE)) { |
| | | customFieldType = SITE.toString(); |
| | | String[] urlArr = null; |
| | | List<String> urls = Lists.newArrayList(); |
| | | if (useValue.contains(",")) { |
| | | urlArr = useValue.split(","); |
| | | urls.addAll(Arrays.asList(urlArr)); |
| | | } else { |
| | | urls.add(useValue); |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_IP_ERROR)); |
| | | } |
| | | if (cntSite == 0) { |
| | | condition.setUrl(urls); |
| | | } else if (CommonUtil.verifyUrl(useValue)) { |
| | | if (StringUtils.isEmpty(condition.getUrl())) { |
| | | condition.setUrl(useValue); |
| | | } else { |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_URL_ERROR)); |
| | | } |
| | | cntSite ++; |
| | | }*/ |
| | | |
| | | if (useIdx > 0) { |
| | | concatUseValue = concatUseValue.concat(comma); |
| | | } |
| | | concatUseValue = concatUseValue.concat(issueCustomFieldValueForm.getUseValue()); |
| | | useIdx++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return condition; |
| | | } |
| | | |
| | | // 추가 할 url or ip에 포함되어있는 파트너 찾기 |
| | | if ((condition.getIp() > 0) || (condition.getUrl() != null && !condition.getUrl().equals(""))) { |
| | | this.findPartner(condition, issueCompanyFields, issueIspFields, issueHostingFields); |
| | | String ConvertToString(List<IssueCustomFieldValueForm> issueCustomFieldValueForms, List<CustomFieldApiOverlap> customFieldApiOverlaps) { |
| | | String concatUseValue = ""; |
| | | int useIdx = 0; |
| | | |
| | | for (IssueCustomFieldValueForm issueCustomFieldValueForm : issueCustomFieldValueForms) { |
| | | |
| | | for (CustomFieldApiOverlap customFieldApiOverlap : customFieldApiOverlaps) { |
| | | if (customFieldApiOverlap.getCustomField().getId().equals(issueCustomFieldValueForm.getCustomFieldId())) { |
| | | |
| | | if (useIdx > 0) { |
| | | concatUseValue = concatUseValue.concat(CommonUtil.COMMA); |
| | | } |
| | | concatUseValue = concatUseValue.concat(issueCustomFieldValueForm.getUseValue()); |
| | | useIdx++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | issueForm.setIssueCompanyFields(issueCompanyFields); |
| | | issueForm.setIssueIspFields(issueIspFields); |
| | | issueForm.setIssueHostingFields(issueHostingFields); |
| | | return concatUseValue; |
| | | } |
| | | |
| | | List<String> GetOverlapUseValues(List<IssueCustomFieldValueForm> issueCustomFieldValueForms) { |
| | | List<String> resultValues = Lists.newArrayList(); |
| | | for (IssueCustomFieldValueForm issueCustomFieldValueForm : issueCustomFieldValueForms) { |
| | | resultValues.add(issueCustomFieldValueForm.getUseValue()); |
| | | } |
| | | return resultValues; |
| | | } |
| | | |
| | | // 중복된 상위 이슈 검색 |
| | | private List<Issue> findIssue(IssueApiForm issueApiform, IssueForm issueForm, List<CustomFieldApiOverlap> customFieldApiOverlaps) { |
| | | List<IssueCustomFieldValueForm> issueCustomFieldValueForms = issueApiform.getIssueCustomFieldValues(); |
| | | List<Issue> resultIssueVos = Lists.newArrayList(); |
| | | CompanyFieldVo companyFieldVo = null; |
| | | |
| | | CompanyFieldCondition condition = validIssueCustomFieldValue(issueCustomFieldValueForms, customFieldApiOverlaps); |
| | | if (condition.getIp() != null || !StringUtils.isEmpty(condition.getUrl())) { |
| | | // 추가 할 url or ip에 포함되어있는 파트너 찾기 |
| | | companyFieldVo = this.findPartner(condition, issueForm.getIssueCompanyFields(), issueForm.getIssueIspFields(), issueForm.getIssueHostingFields()); |
| | | } |
| | | |
| | | if (issueCustomFieldValueForms.size() > 0) { |
| | | String concatUseValue = ConvertToString(issueCustomFieldValueForms, customFieldApiOverlaps); |
| | | List<String> useValues = GetOverlapUseValues(issueCustomFieldValueForms); |
| | | |
| | | IssueCustomFieldValueCondition issueCustomFieldValueCondition = new IssueCustomFieldValueCondition(); |
| | | issueCustomFieldValueCondition.setUseValue(concatUseValue); |
| | | issueCustomFieldValueCondition.setUseValues(userValues); |
| | | issueCustomFieldValueCondition.setUseValues(useValues); |
| | | issueCustomFieldValueCondition.setIssueTypeId(issueApiform.getIssueTypeId()); |
| | | issueCustomFieldValueCondition.setCustomFieldType(customFieldType); |
| | | // issueCustomFieldValueCondition.setIssueStatusType("CLOSE"); |
| | | // issueCustomFieldValueCondition.setIssueStatusType("CLOSE"); |
| | | List<Map<String, Object>> results = Lists.newArrayList(); |
| | | if (customFieldType.equals(IP_ADDRESS.toString()) && issueForm.getIssueCompanyFields() != null && issueForm.getIssueCompanyFields().size() > 0) { |
| | | long ipValue = 0; |
| | | if (concatUseValue.contains(",")) { |
| | | String[] arr = concatUseValue.split(","); |
| | | for (String str : arr) { |
| | | ipValue = ConvertUtil.ipToLong(str); |
| | | } |
| | | } else { |
| | | ipValue = ConvertUtil.ipToLong(concatUseValue); |
| | | } |
| | | issueCustomFieldValueCondition.setUseValue(String.valueOf(ipValue)); |
| | | } |
| | | |
| | | if (issueCustomFieldValueCondition.getCustomFieldType() != null && !issueCustomFieldValueCondition.getCustomFieldType().equals("")) { |
| | | // 사용자정의필드 타입이 IP_ADDRESS 또는 SITE 일 경우 |
| | | results = this.issueMapper.findByCustomFieldValueByCompany(issueCustomFieldValueCondition); |
| | | if (companyFieldVo != null) { |
| | | // url or ip를 통해 업체를 찾았을 경우 |
| | | issueCustomFieldValueCondition.setUseValue(companyFieldVo.getUrl()); |
| | | results = this.issueMapper.findByCustomFieldValueBySite(issueCustomFieldValueCondition); |
| | | } else { |
| | | results = this.issueMapper.findByCustomFieldValue(issueCustomFieldValueCondition); |
| | | } |
| | |
| | | issue.setIssueType(issueType); |
| | | issue.setPriority(priority); |
| | | issue.setSeverity(severity); |
| | | if (issueForm.getParentIssueId() != null){ |
| | | if (issueForm.getParentIssueId() != null) { |
| | | Issue parentIssue = this.getIssue(issueForm.getParentIssueId()); |
| | | issue.setParentIssue(parentIssue); |
| | | |
| | |
| | | |
| | | issue.setReverseIndex(issue.getId() * -1); // 쿼리 속도 개선을 위해 리버스 인덱스 생성 |
| | | |
| | | if (issueForm.getParentIssueId() != null){ |
| | | if (issueForm.getParentIssueId() != null) { |
| | | Issue parentIssue = this.getIssue(issueForm.getParentIssueId()); |
| | | if (issueForm.getIsApi().equals(Issue.IS_API_YES) |
| | | || (issueForm.getInheritYn() != null && issueForm.getInheritYn())) { |
| | |
| | | issue.setIssueType(issueType); |
| | | issue.setPriority(priority); |
| | | issue.setSeverity(severity); |
| | | if (issueForm.getParentIssueId() != null){ |
| | | if (issueForm.getParentIssueId() != null) { |
| | | Issue parentIssue = this.getIssue(issueForm.getParentIssueId()); |
| | | issue.setParentIssue(parentIssue); |
| | | } |
| | |
| | | |
| | | /** |
| | | * Issue를 IssueVo로 변환(하위이슈의 파트너 정보 상속 시 필요) |
| | | * |
| | | * @param issue Issue |
| | | * @return IssueVo |
| | | */ |
| | |
| | | issue.setIssueType(issueType); |
| | | issue.setPriority(priority); |
| | | issue.setSeverity(severity); |
| | | if (issueForm.getParentIssueId() != null){ |
| | | if (issueForm.getParentIssueId() != null) { |
| | | Issue parentIssue = this.getIssue(issueForm.getParentIssueId()); |
| | | issue.setParentIssue(parentIssue); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 날짜 유효성 체크 |
| | | * @param startDate 시작 일자(문자) |
| | | * |
| | | * @param startDate 시작 일자(문자) |
| | | * @param completeDate 종료 일자(문자) |
| | | */ |
| | | private void checkStartCompleteDate(String startDate, String completeDate) { |
| | |
| | | |
| | | /** |
| | | * 날짜 유효성 체크 |
| | | * |
| | | * @param start 시작 일자 |
| | | * @param end 종료 일자 |
| | | * @param end 종료 일자 |
| | | */ |
| | | private void checkStartCompleteDate(Date start, Date end) { |
| | | if (start.getTime() > end.getTime()) { |
| | |
| | | } |
| | | } |
| | | |
| | | void SetMyDepartmentId(IssueCondition issueCondition){ |
| | | void SetMyDepartmentId(IssueCondition issueCondition) { |
| | | Long loginId = issueCondition.getLoginUserId(); |
| | | List<Long> myDepartmentIds = Lists.newArrayList(); |
| | | List<UserDepartment> myDepartments = this.userDepartmentRepository.findByUserId(loginId); |
| | | |
| | | if(myDepartments != null && myDepartments.size() > 0){ |
| | | for(UserDepartment myDepartment : myDepartments){ |
| | | if (myDepartments != null && myDepartments.size() > 0) { |
| | | for (UserDepartment myDepartment : myDepartments) { |
| | | myDepartmentIds.add(myDepartment.getDepartmentId()); |
| | | } |
| | | } else { |
| | |
| | | issueCondition.setMyDepartmentIds(myDepartmentIds); |
| | | } |
| | | |
| | | void SetAllDepartmentId(IssueCondition issueCondition){ |
| | | void SetAllDepartmentId(IssueCondition issueCondition) { |
| | | List<Long> departmentIds = Lists.newArrayList(); |
| | | List<Map<String, Object>> departmentList = this.departmentMapper.find(null); |
| | | |
| | | if(departmentList != null && departmentList.size() > 0){ |
| | | for(Map<String, Object> department : departmentList){ |
| | | if (departmentList != null && departmentList.size() > 0) { |
| | | for (Map<String, Object> department : departmentList) { |
| | | departmentIds.add((Long) department.get("id")); |
| | | } |
| | | } |
| | | issueCondition.setMyDepartmentIds(departmentIds); |
| | | } |
| | | |
| | | void SetWorkflowDepartment(List<IssueVo> issueVos){ |
| | | for(IssueVo issueVo : issueVos){ |
| | | void SetWorkflowDepartment(List<IssueVo> issueVos) { |
| | | for (IssueVo issueVo : issueVos) { |
| | | Long issueTypeId = issueVo.getIssueTypeId(); |
| | | IssueType issueType = this.issueTypeService.getIssueType(issueTypeId); |
| | | Long workflowId = issueType.getWorkflow().getId(); |
| | | List<WorkflowDepartment> workflowDepartmentList = this.workflowDepartmentRepository.findByWorkflowId(workflowId); |
| | | List<Long> workflowDepartmentIds = Lists.newArrayList(); |
| | | if(workflowDepartmentList != null && workflowDepartmentList.size()>0){ |
| | | for(WorkflowDepartment workflowDepartment : workflowDepartmentList){ |
| | | if (workflowDepartmentList != null && workflowDepartmentList.size() > 0) { |
| | | for (WorkflowDepartment workflowDepartment : workflowDepartmentList) { |
| | | workflowDepartmentIds.add(workflowDepartment.getDepartment().getId()); |
| | | } |
| | | } |
| | | if(issueVo.getIssueTypeId().equals(issueTypeId)){ |
| | | if (issueVo.getIssueTypeId().equals(issueTypeId)) { |
| | | issueVo.setWorkflowDepartmentIds(workflowDepartmentIds); |
| | | } |
| | | } |
| | |
| | | |
| | | // 하위 이슈 세팅(재귀) |
| | | private void setDownIssues(User user, List<IssueVo> issueVos) { |
| | | for(IssueVo issueVo : issueVos) { |
| | | for (IssueVo issueVo : issueVos) { |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issueVo.getId()); |
| | | List<IssueVo> downIssueVos = Lists.newArrayList(); |
| | | IssueCondition issueCondition = new IssueCondition(); |
| | | issueCondition.addIssueIds(String.valueOf(issueVo.getId())); |
| | | |
| | | for(Issue downIssue : downIssues){ |
| | | for (Issue downIssue : downIssues) { |
| | | IssueVo addIssueVo = ConvertUtil.copyProperties(downIssue, IssueVo.class); |
| | | addIssueVo.setIssueTypeId(downIssue.getIssueType().getId()); |
| | | downIssueVos.add(addIssueVo); |
| | |
| | | |
| | | // 연관 이슈 세팅 |
| | | private void setRelationIssues(List<IssueVo> issueVos) { |
| | | for(IssueVo issueVo : issueVos) { |
| | | for (IssueVo issueVo : issueVos) { |
| | | List<IssueVo> relationIssues = this.issueRelationService.findRelationIssue(issueVo.getId()); |
| | | for(IssueVo relationIssue : relationIssues){ |
| | | for (IssueVo relationIssue : relationIssues) { |
| | | issueVo.addRelationIssueVo(ConvertUtil.copyProperties(relationIssue, IssueVo.class)); |
| | | } |
| | | } |
| | |
| | | |
| | | // 상위 이슈 체크 |
| | | private void setParentIssue(List<IssueVo> issueVos) { |
| | | for(IssueVo issueVo : issueVos) { |
| | | if(issueVo.getParentIssueId() != null) { |
| | | for (IssueVo issueVo : issueVos) { |
| | | if (issueVo.getParentIssueId() != null) { |
| | | Issue parentIssue = this.getIssue(issueVo.getParentIssueId()); |
| | | //issueVo.setParentIssueVo(ConvertUtil.copyProperties(parentIssue, IssueVo.class)); |
| | | if(parentIssue.getIssueCustomFieldValues() == null || parentIssue.getIssueCustomFieldValues().size() == 0){ |
| | | if (parentIssue.getIssueCustomFieldValues() == null || parentIssue.getIssueCustomFieldValues().size() == 0) { |
| | | issueVo.setIssueCustomFieldValueVos(null); |
| | | } |
| | | ConvertUtil.copyProperties(parentIssue, issueVo); |
| | |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public void setCountDownIssues(List<IssueVo> issueVos) { |
| | | for (IssueVo issueVo : issueVos){ |
| | | for (IssueVo issueVo : issueVos) { |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issueVo.getId()); //하위이슈 가져오기 |
| | | if(downIssues != null && downIssues.size() > 0){ //상위이슈 가지고 있는 애들이 있으면 |
| | | if (downIssues != null && downIssues.size() > 0) { //상위이슈 가지고 있는 애들이 있으면 |
| | | int downIssueAllCount = 0;// 하위이슈 전체 카운트 |
| | | int downIssueCount = 0;// 하위이슈 미완료 카운트 |
| | | for(Issue downIssue : downIssues){ |
| | | downIssueAllCount ++; |
| | | for (Issue downIssue : downIssues) { |
| | | downIssueAllCount++; |
| | | Long parentIssueId = downIssue.getParentIssue().getId(); |
| | | Issue parentIssue = this.getIssue(parentIssueId); |
| | | IssueVo parentIssueVo = ConvertUtil.copyProperties(parentIssue, IssueVo.class); |
| | |
| | | IssueVo downIssueVo = ConvertUtil.copyProperties(downIssue, IssueVo.class); |
| | | downIssueVo.setIssueStatusType(downIssueStatus.getIssueStatusType().toString()); |
| | | |
| | | if(!downIssueVo.getIssueStatusType().equals("CLOSE")){ //미완료 하위이슈 체크 |
| | | downIssueCount ++; |
| | | if (!downIssueVo.getIssueStatusType().equals("CLOSE")) { //미완료 하위이슈 체크 |
| | | downIssueCount++; |
| | | } |
| | | |
| | | issueVo.setDownIssueCount(downIssueCount); |
| | |
| | | IssueCondition issueCondition, Pageable pageable) { |
| | | |
| | | // 검색 조건을 만든다 |
| | | if (!this.makeIssueSearchCondition(issueCondition,Lists.newArrayList("01", "02", "03"), pageable)) { |
| | | if (!this.makeIssueSearchCondition(issueCondition, Lists.newArrayList("01", "02", "03"), pageable)) { |
| | | // 이슈 목록을 찾지 못할 경우 기본 정보로 리턴한다. |
| | | this.notFoundIssueList(resJsonData, pageable); |
| | | return Lists.newArrayList(); |
| | |
| | | // 프로젝트를 선택하지 않았으면 해당 업무 공간에서 참여하고 있는 프로젝트를 찾는다. |
| | | if (condition.getProjectIds().size() < 1) { |
| | | List<Map<String, Object>> projects = Lists.newArrayList(); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT)){ |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT)) { |
| | | return true; |
| | | }/*else if (MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)){ |
| | | projects = this.projectService.findByWorkspaceIdAndIncludeProjectAll(projectStatues, condition.getProjectType()); |
| | | }*/ |
| | | else { |
| | | }*/ else { |
| | | projects = this.projectService.findByWorkspaceIdAndIncludeProject(projectStatues, condition.getProjectType()); |
| | | } |
| | | |
| | |
| | | || (MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT) && |
| | | MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE))) { |
| | | projects = this.projectMapper.findByWorkspaceManagerAll(projectCondition); |
| | | } else { |
| | | } else { |
| | | projects = this.projectService.findByWorkspaceIdAndIncludeProjectAll(projectCondition); |
| | | } |
| | | List<Long> projectIds = Lists.newArrayList(); |
| | |
| | | Page<Issue> downIssues = null; |
| | | |
| | | List<Issue> downIssueList = this.issueRepository.findByParentIssueId(issue.getId()); |
| | | if(downIssueList != null && downIssueList.size() > 0) { |
| | | if (downIssueList != null && downIssueList.size() > 0) { |
| | | int startPage = 0; |
| | | if (issueVo.getDownPage() != 0) { |
| | | startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize()); |
| | | startPage = (int) Math.floor(issueVo.getDownPage() / issueVo.getDownPageSize()); |
| | | } |
| | | Pageable pageable = PageRequest.of(startPage, issueVo.getDownPageSize()); |
| | | |
| | | if(hideCompleteIssue){ |
| | | if (hideCompleteIssue) { |
| | | downIssues = this.issueRepository.findByParentIssueId(issue.getId(), IssueStatusType.CLOSE, pageable); |
| | | }else { |
| | | } else { |
| | | downIssues = this.issueRepository.findByParentIssueId(issue.getId(), pageable); |
| | | } |
| | | |
| | | } |
| | | if(downIssues != null){ |
| | | if (downIssues != null) { |
| | | issueVo.setDownTotalPage(downIssues.getTotalPages()); |
| | | issueVo.setDownTotalCount(downIssues.getTotalElements()); |
| | | |
| | | List<IssueVo> resultList = new ArrayList<>(); |
| | | for(Issue downIssue : downIssues){ |
| | | for (Issue downIssue : downIssues) { |
| | | IssueVo downIssueVo = ConvertUtil.copyProperties(downIssue, IssueVo.class); |
| | | downIssueVo.setIssueTypeVo(ConvertUtil.copyProperties(downIssue.getIssueType(), IssueTypeVo.class)); |
| | | downIssueVo.setPriorityVo(ConvertUtil.copyProperties(downIssue.getPriority(), PriorityVo.class)); |
| | |
| | | this.setIssueCompanyField(issue, issueVo); //업체 정보 세팅 |
| | | this.setIssueIspField(issue, issueVo); //ISP 정보 세팅 |
| | | this.setIssueHostingField(issue, issueVo); //HOSTING 정보 세팅 |
| | | this.setParentIssue(issue,issueVo); //상위 이슈 정보 세팅 |
| | | this.setParentIssue(issue, issueVo); //상위 이슈 정보 세팅 |
| | | } |
| | | |
| | | // 상위일감 정보 추가 |
| | | private void setParentIssue(Issue issue, IssueVo issueVo) { |
| | | if(issue.getParentIssue() != null){ |
| | | if (issue.getParentIssue() != null) { |
| | | issueVo.setParentIssueVo(ConvertUtil.copyProperties(issue.getParentIssue(), IssueVo.class)); |
| | | } |
| | | } |
| | |
| | | List<UserDepartment> userDepartments = this.userDepartmentRepository.findByDepartmentId(departmentVo.getId()); |
| | | if (userDepartments != null && userDepartments.size() > 0) { |
| | | for (UserDepartment userDepartment : userDepartments) { |
| | | if (userDepartment.getUserId().equals(this.webAppUtil.getLoginId())){ |
| | | if (userDepartment.getUserId().equals(this.webAppUtil.getLoginId())) { |
| | | issueVo.setModifyPermissionCheck(Boolean.TRUE); |
| | | } |
| | | } |
| | |
| | | checkIssueData.setPriority(priority); |
| | | checkIssueData.setSeverity(severity); |
| | | |
| | | return checkIssueData; |
| | | return checkIssueData; |
| | | } |
| | | |
| | | // 이슈 수정(API용) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private Issue saveIssue(IssueForm issueForm, CheckIssueData checkIssueData) { |
| | | Issue issue = checkIssueData.getIssue(); |
| | | ConvertUtil.copyProperties(issueForm, issue, "id"); |
| | |
| | | issue = this.saveIssue(issueForm, checkIssueData); |
| | | //this.issueUserService.modifyIssueUser(issue, project.getWorkspace(), issueForm.getUserIds()); |
| | | // 담당부서 지정 |
| | | if(issueForm.getDepartmentIds().size()>0){ |
| | | if (issueForm.getDepartmentIds().size() > 0) { |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, user, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | } |
| | | |
| | |
| | | // 이슈 담당부서 여부 확인 |
| | | for (DepartmentVo departmentVo : departmentVos) { |
| | | List<UserDepartment> userDepartments = this.userDepartmentService.findByDepartmentId(departmentVo.getId()); |
| | | if(userDepartments != null && userDepartments.size() > 0) { |
| | | if (userDepartments != null && userDepartments.size() > 0) { |
| | | for (UserDepartment userDepartment : userDepartments) { |
| | | if (userDepartment.getUserId().equals(user.getId())){ |
| | | if (userDepartment.getUserId().equals(user.getId())) { |
| | | hasPermission = true; |
| | | break; |
| | | } |
| | |
| | | for (Long issueId : issueForm.getRemoveIds()) { |
| | | //하위이슈 체크 |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issueId); |
| | | if(downIssues != null && downIssues.size() > 0){ |
| | | for(Issue downIssue : downIssues){ |
| | | if(downIssue.getParentIssue() != null){ |
| | | if (downIssues != null && downIssues.size() > 0) { |
| | | for (Issue downIssue : downIssues) { |
| | | if (downIssue.getParentIssue() != null) { |
| | | downIssue.setParentIssue(null); |
| | | } |
| | | } |
| | |
| | | removeIds.add(issueId); |
| | | //하위이슈 체크 |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issueId); |
| | | if(downIssues != null && downIssues.size() > 0){ |
| | | for(Issue downIssue : downIssues){ |
| | | if (downIssues != null && downIssues.size() > 0) { |
| | | for (Issue downIssue : downIssues) { |
| | | Long downIssueId = downIssue.getId(); |
| | | removeIds.add(downIssueId); |
| | | } |
| | |
| | | for (Long issueId : issueForm.getRemoveIds()) { |
| | | //삭제 할 이슈의 하위이슈 체크 |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issueId); |
| | | if(downIssues != null && downIssues.size() > 0){ |
| | | for(Issue downIssue : downIssues){ |
| | | if (downIssues != null && downIssues.size() > 0) { |
| | | for (Issue downIssue : downIssues) { |
| | | downIssueId = downIssue.getId(); |
| | | } |
| | | } |
| | |
| | | |
| | | private Issue issueRemoves(Long issueId, User user) { |
| | | Issue issue = null; |
| | | if(issueId != null){ |
| | | if (issueId != null) { |
| | | issue = this.getIssue(issueId); |
| | | } |
| | | // 이슈 수정 권한을 갖고 있는지 확인 |
| | |
| | | // 지울 이슈가 연관이슈인지 체크 후 연관이슈 테이블에서도 삭제한다. |
| | | List<IssueRelation> issueRelationList = this.issueRelationRepository.findByRelationIssueId(issueId); |
| | | if (issueRelationList != null && issueRelationList.size() > 0) { |
| | | for(IssueRelation issueRelation : issueRelationList){ |
| | | for (IssueRelation issueRelation : issueRelationList) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectRelationIssue(IssueHistoryType.DELETE, issueRelation, sb); |
| | | issueHistoryService.addIssueHistory(issueRelation.getIssue(), IssueHistoryType.MODIFY, sb.toString()); |
| | |
| | | if (issueVo.getId().equals(MapUtil.getLong(issueCustomFieldValue, "issueId"))) { |
| | | IssueCustomFieldValueVo issueCustomFieldValueVo = new IssueCustomFieldValueVo(); |
| | | |
| | | useValues.put("useValue"+count, MapUtil.getString(issueCustomFieldValue, "useValue")); |
| | | useValues.put("useValue" + count, MapUtil.getString(issueCustomFieldValue, "useValue")); |
| | | useValues.put("customFieldId", MapUtil.getLong(issueCustomFieldValue, "customFieldId")); |
| | | issueCustomFieldValueVo.setUseValues(useValues); |
| | | |
| | |
| | | private void setIssueCompanyField(Issue issue, IssueVo issueVo) { |
| | | List<IssueCompanyVo> issueCompanyVos = Lists.newArrayList(); |
| | | |
| | | for(IssueCompany issueCompany : issue.getIssueCompanies()){ |
| | | for (IssueCompany issueCompany : issue.getIssueCompanies()) { |
| | | IssueCompanyVo issueCompanyVo = ConvertUtil.copyProperties(issueCompany, IssueCompanyVo.class); |
| | | issueCompanyVo.setId(issueCompany.getId()); |
| | | CompanyField companyField = issueCompany.getCompanyField(); |
| | |
| | | private void setIssueIspField(Issue issue, IssueVo issueVo) { |
| | | List<IssueIspVo> issueIspVos = Lists.newArrayList(); |
| | | |
| | | for(IssueIsp issueIsp : issue.getIssueIspFields()){ |
| | | for (IssueIsp issueIsp : issue.getIssueIspFields()) { |
| | | IssueIspVo issueIspVo = ConvertUtil.copyProperties(issueIsp, IssueIspVo.class); |
| | | issueIspVo.setId(issueIsp.getId()); |
| | | IspField ispField = issueIsp.getIspField(); |
| | |
| | | private void setIssueHostingField(Issue issue, IssueVo issueVo) { |
| | | List<IssueHostingVo> issueHostingVos = Lists.newArrayList(); |
| | | |
| | | for(IssueHosting issueHosting : issue.getIssueHostingFields()){ |
| | | for (IssueHosting issueHosting : issue.getIssueHostingFields()) { |
| | | IssueHostingVo issueHostingVo = ConvertUtil.copyProperties(issueHosting, IssueHostingVo.class); |
| | | issueHostingVo.setId(issueHosting.getId()); |
| | | HostingField hostingField = issueHosting.getHostingField(); |
| | |
| | | |
| | | /** |
| | | * 엑셀로 입력한 파트너 정보 저장 |
| | | * |
| | | * @param issueForm IssueForm |
| | | */ |
| | | private void setIssuePartners(IssueForm issueForm, Issue issue) { |
| | | //issueCompany 등록 |
| | | if (issueForm.getIssueCompanyFields() != null && issueForm.getIssueCompanyFields().size() > 0) { |
| | | for (Map<String, Object> issueCompanyMap : issueForm.getIssueCompanyFields()) { |
| | | CompanyField companyField = ConvertUtil.convertMapToClass(issueCompanyMap, CompanyField.class); |
| | | CompanyField companyField = ConvertUtil.convertMapToClass(issueCompanyMap, CompanyField.class); |
| | | IssueCompany issueCompany = ConvertUtil.convertMapToClass(issueCompanyMap, IssueCompany.class, "id", "registerDate", "modifyDate"); |
| | | issueCompany.setCompanyField(companyField); |
| | | issueCompany.setIssue(issue); |
| | |
| | | |
| | | /** |
| | | * 엑셀에 업체명을 입력하지 않았을 경우 같은 도메인 업체 찾기 |
| | | * |
| | | * @param issueForm IssueForm |
| | | */ |
| | | private void findPartnerByDomain(IssueForm issueForm) { |
| | |
| | | |
| | | // 이슈의 주요 속성을 map 에 저장하여 엑셀 import 에서 지정한 대상(이슈 속성)을 빠르게 찾을 수 있게 한다. |
| | | private void IssueAttributeMapToList(IssueForm issueForm, Map<String, Priority> priorityMaps, Map<String, Severity> severityMaps, |
| | | Map<String, DepartmentVo> departmentMaps, Map<String, CustomField> customFieldMaps,Map<String, Long> issueTypeCustomFieldMaps, |
| | | Map<String, DepartmentVo> departmentMaps, Map<String, CustomField> customFieldMaps, Map<String, Long> issueTypeCustomFieldMaps, |
| | | Map<String, CompanyField> companyFieldMaps, Map<String, IspField> ispFieldMaps, Map<String, HostingField> hostingFieldMaps) { |
| | | |
| | | Project project = this.projectService.getProject(issueForm.getProjectId()); |
| | |
| | | |
| | | /** |
| | | * cell String으로 변환 함수 |
| | | * @param cell Cell |
| | | * |
| | | * @param cell Cell |
| | | * @param isNull boolean |
| | | * @return String |
| | | */ |
| | | private String stringToCell (Cell cell, boolean isNull) { |
| | | private String stringToCell(Cell cell, boolean isNull) { |
| | | String cellStr = ""; |
| | | if (!isNull) { |
| | | cellStr = CommonUtil.convertExcelStringToCell(cell); |
| | |
| | | /** |
| | | * cell NULL 체크 함수 |
| | | * 빈 값이 아닌 cell 체크 |
| | | * |
| | | * @param cell Cell |
| | | * @return boolean |
| | | */ |
| | | private Boolean cellNullCheck (Cell cell) { |
| | | private Boolean cellNullCheck(Cell cell) { |
| | | int cellType = cell.getCellType(); |
| | | if (cellType < Cell.CELL_TYPE_BLANK) { |
| | | if (cellType == Cell.CELL_TYPE_STRING) { |
| | |
| | | issueForm.setUserIds(userIds); |
| | | } |
| | | } |
| | | |
| | | // 시작일, 종료일을 IssueForm 에 저장한다. |
| | | private void setIssueFormPeriod(String periodDate, IssueForm issueForm, Boolean checkStartDate, int rowIndex, boolean isNull) throws ParseException { |
| | | if (!isNull) { |
| | |
| | | if (issueForm.getSendEmails().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SEND_USER)); |
| | | }else if (issueForm.getTemplate() != null){ |
| | | } else if (issueForm.getTemplate() != null) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SELECT_TEMPLATE)); |
| | | } |
| | |
| | | if (emailTemplateForm.getSendEmails().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SEND_USER)); |
| | | }else if (emailTemplateForm.getTemplate() == null){ |
| | | } else if (emailTemplateForm.getTemplate() == null) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SELECT_TEMPLATE)); |
| | | } else if (emailTemplateForm.getIssueId() == null) { |
| | |
| | | |
| | | Locale locale = CommonUtil.getUserLanguage(user.getLanguage()); |
| | | String[] sendMails = ConvertUtil.ToArray(emailTemplateForm.getSendEmails()); |
| | | for(int i=0; i < sendMails.length; i++) { |
| | | for (int i = 0; i < sendMails.length; i++) { |
| | | sendMails[i] = CommonUtil.decryptAES128(sendMails[i]); |
| | | } |
| | | this.systemEmailService.sendEmail(emailTemplateForm.getTitle(), emailTemplateForm.getTemplate(), sendMails, null, multipartFiles); |
| | |
| | | } |
| | | |
| | | Issue issue = null; |
| | | if(emailCommonForm.getIssueId() != null) { |
| | | if (emailCommonForm.getIssueId() != null) { |
| | | issue = this.getIssue(emailCommonForm.getIssueId()); |
| | | } |
| | | |
| | |
| | | |
| | | Locale locale = CommonUtil.getUserLanguage(user.getLanguage()); |
| | | String[] sendMails = ConvertUtil.ToArray(emailCommonForm.getSendEmails()); |
| | | for(int i=0; i < sendMails.length; i++) { |
| | | for (int i = 0; i < sendMails.length; i++) { |
| | | sendMails[i] = CommonUtil.decryptAES128(sendMails[i]); |
| | | } |
| | | this.systemEmailService.sendEmail(emailCommonForm.getTitle(), emailCommonForm.getDescription(), sendMails, null, multipartFiles); |
| | |
| | | |
| | | for (Map<String, Object> taskDepartment : taskDepartments) { |
| | | Long taskId = MapUtil.getLong(taskDepartment, "taskId"); |
| | | List<DepartmentVo> departmentVos = (List<DepartmentVo>)taskUserSave.get(taskId.toString()); |
| | | List<DepartmentVo> departmentVos = (List<DepartmentVo>) taskUserSave.get(taskId.toString()); |
| | | departmentVos.add(ConvertUtil.convertMapToClass(taskDepartment, DepartmentVo.class)); |
| | | } |
| | | |
| | |
| | | //taskVo.setUserVos(userVos); |
| | | |
| | | // 담당부서 세팅 |
| | | List<DepartmentVo> departmentVos = (List<DepartmentVo>)taskUserSave.get(taskVo.getId().toString()); |
| | | List<DepartmentVo> departmentVos = (List<DepartmentVo>) taskUserSave.get(taskVo.getId().toString()); |
| | | taskVo.setDepartmentVos(departmentVos); |
| | | |
| | | List<IssueVo> taskVos = (List<IssueVo>)tasks.get(MapUtil.getString(result, "workflowStatusId")); |
| | | List<IssueVo> taskVos = (List<IssueVo>) tasks.get(MapUtil.getString(result, "workflowStatusId")); |
| | | taskVos.add(taskVo); |
| | | tasks.put(MapUtil.getString(result, "workflowStatusId"), taskVos); |
| | | } |
| | |
| | | Issue issue = this.getIssue(downId); |
| | | |
| | | Issue parentIssue = issue.getParentIssue(); //변경 전 하위이슈의 상위이슈 |
| | | if(parentIssue != null && parentIssue.getId().equals(newParentIssueId)){ //변경 전 하위이슈의 상위이슈가 존재 할 경우 |
| | | if (parentIssue != null && parentIssue.getId().equals(newParentIssueId)) { //변경 전 하위이슈의 상위이슈가 존재 할 경우 |
| | | this.issueHistoryService.detectDownIssues(IssueHistoryType.DELETE, issue, sb); |
| | | this.issueHistoryService.addIssueHistory(parentIssue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | |
| | | parentIssue = this.getIssue(newParentIssueId); //상위이슈(myIssue) |
| | | issue.setParentIssue(parentIssue); //myIssue를 하위이슈의 상위이슈로 set |
| | | this.issueHistoryService.detectDownIssues(IssueHistoryType.ADD, issue, sb); //issue = 하위이슈 |
| | | } else{ |
| | | } else { |
| | | // 삭제 할 경우 |
| | | this.issueHistoryService.detectDownIssues(IssueHistoryType.DELETE, issue, sb); |
| | | issue.setParentIssue(null); |
| | |
| | | |
| | | /** |
| | | * 상위이슈의 파트너 정보 상속받기 |
| | | * @param issue Issue |
| | | * |
| | | * @param issue Issue |
| | | * @param parentIssue Issue |
| | | * @return Issue |
| | | */ |