| | |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | import kr.wisestone.owl.vo.IssueHostingVo; |
| | | import kr.wisestone.owl.web.condition.IssueCondition; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | Map<String, Object> param = issueIspFields.get(0); |
| | | |
| | | if (param != null) { |
| | | IssueHosting newIssueHosting = ConvertUtil.convertMapToClass(param, IssueHosting.class); |
| | | newIssueHosting.setIssue(issue); |
| | | HostingField hostingField = this.hostingFieldService.getHosting(MapUtil.getLong(param, "hostingId")); |
| | | newIssueHosting.setHostingField(hostingField); |
| | | |
| | | Set<IssueHosting> issueHostings = issue.getIssueHostingFields(); |
| | | if (issueHostings != null && issueHostings.size() > 0) { |
| | | IssueHosting oldIssueHosting = issueHostings.iterator().next(); |
| | | ConvertUtil.copyProperties(newIssueHosting, oldIssueHosting); |
| | | } |
| | | IssueHosting issueHosting = null; |
| | | |
| | | this.issueHostingRepository.saveAndFlush(newIssueHosting); |
| | | if (issueHostings != null && issueHostings.size() >0){//수정 할 경우 |
| | | issueHosting = issueHostings.iterator().next(); |
| | | issueHosting.setHostingField(hostingField); |
| | | issueHosting.setName(MapUtil.getString(param, "name")); |
| | | issueHosting.setEmail(MapUtil.getString(param, "email")); |
| | | issueHosting.setCode(MapUtil.getString(param, "code")); |
| | | issueHosting.setManager(MapUtil.getString(param, "manager")); |
| | | issueHosting.setTel(MapUtil.getString(param, "tel")); |
| | | issueHosting.setMemo(MapUtil.getString(param, "memo")); |
| | | }else{//추가 할 경우 |
| | | issueHosting = ConvertUtil.convertMapToClass(param, IssueHosting.class); |
| | | issueHosting.setIssue(issue); |
| | | issueHosting.setHostingField(hostingField); |
| | | } |
| | | this.issueHostingRepository.saveAndFlush(issueHosting); |
| | | } |
| | | } |
| | | } |
| | |
| | | public List<Map<String, Object>> findInIssueIds(IssueCondition issueCondition) { |
| | | return issueHostingMapper.findInIssueIds(issueCondition); |
| | | } |
| | | |
| | | |
| | | } |