이슈 히스토리 - 중복되어서 나오는 문제 해결 및 업체에 추가된 항목들도 변경 시 이력 남기도록 수정
| | |
| | | ModelAndView downloadExcelTemplate(HttpServletRequest request, Model model); |
| | | |
| | | void importExcel(MultipartFile multipartFile) throws Exception; |
| | | |
| | | CompanyFieldVo CreateCompanyFieldCategory(CompanyFieldVo companyFieldVo, CompanyField companyField); |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | public interface IssueCompanyService extends AbstractService<IssueCompany, Long, JpaRepository<IssueCompany, Long>>{ |
| | | void modifyIssueCompanyField(Issue issue, IssueForm issueForm); |
| | | void modifyIssueCompanyField(Issue issue, IssueForm issueForm, StringBuilder detectIssueChange); |
| | | |
| | | List<Map<String, Object>> findInIssueIds(IssueCondition issueCondition); |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | public interface IssueHostingService extends AbstractService<IssueHosting, Long, JpaRepository<IssueHosting, Long>>{ |
| | | void modifyIssueHostingField(Issue issue, IssueForm issueForm); |
| | | void modifyIssueHostingField(Issue issue, IssueForm issueForm, StringBuilder detectIssueChange); |
| | | |
| | | List<Map<String, Object>> findInIssueIds(IssueCondition issueCondition); |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | public interface IssueIspService extends AbstractService<IssueIsp, Long, JpaRepository<IssueIsp, Long>>{ |
| | | void modifyIssueIspField(Issue issue, IssueForm issueForm); |
| | | void modifyIssueIspField(Issue issue, IssueForm issueForm, StringBuilder detectIssueChange); |
| | | |
| | | List<Map<String, Object>> findInIssueIds(IssueCondition issueCondition); |
| | | } |
| | |
| | | * @param companyFieldVo CompanyFieldVo |
| | | * @param companyField CompanyField |
| | | */ |
| | | private CompanyFieldVo CreateCompanyFieldCategory(CompanyFieldVo companyFieldVo, CompanyField companyField) { |
| | | @Override |
| | | public CompanyFieldVo CreateCompanyFieldCategory(CompanyFieldVo companyFieldVo, CompanyField companyField) { |
| | | if (companyField.getCompanyTypeId() != null && companyField.getCompanyTypeId() != -1) { |
| | | CompanyFieldCategory companyType = this.companyFieldCategoryService.find(companyField.getCompanyTypeId()); |
| | | if (companyType != null) { |
| | |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | import kr.wisestone.owl.vo.CompanyFieldVo; |
| | | import kr.wisestone.owl.web.condition.IssueCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import kr.wisestone.owl.web.form.IspFieldForm; |
| | |
| | | * @param issueForm IssueForm |
| | | * @param issue Issue |
| | | */ |
| | | private void CreateCompanyField(IssueForm issueForm, Issue issue) { |
| | | private void CreateCompanyField(IssueForm issueForm, Issue issue, StringBuilder sb) { |
| | | |
| | | CompanyFieldForm companyFieldForm = new CompanyFieldForm(); |
| | | companyFieldForm.setName(issueForm.getCompanyName()); |
| | |
| | | |
| | | IssueCompany newIssueCompany = CreateIssueCompany(companyFieldForm, issue); |
| | | CompanyField companyField = new CompanyField(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | // 사용자가 직접 입력 시 COMPANY 목록에 추가 |
| | | if (newIssueCompany.getCompanyField() == null) { |
| | |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.ADD, null, companyFieldForm, newIssueCompany, sb); |
| | | } |
| | | } |
| | | // 추가 이력 |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueCompanyRepository.saveAndFlush(newIssueCompany); |
| | | } |
| | | |
| | |
| | | // 이슈에서 사용되는 업체 값을 업데이트한다. |
| | | @Override |
| | | @Transactional |
| | | public void modifyIssueCompanyField(Issue issue, IssueForm issueForm) { |
| | | public void modifyIssueCompanyField(Issue issue, IssueForm issueForm, StringBuilder sb) { |
| | | if (issue != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | IssueCompany issueCompany = this.issueCompanyRepository.findByIssueId(issue.getId()); |
| | | List<Map<String, Object>> issueCompanyFields = issueForm.getIssueCompanyFields(); |
| | | |
| | | if (issueCompanyFields != null && issueCompanyFields.size() > 0) { |
| | | Map<String, Object> param = issueCompanyFields.get(0); |
| | | |
| | | CompanyFieldVo companyFieldVo = new CompanyFieldVo(); |
| | | CompanyField companyField = ConvertUtil.convertMapToClass(param, CompanyField.class); |
| | | companyFieldVo = this.companyFieldService.CreateCompanyFieldCategory(companyFieldVo, companyField); |
| | | param.put("companyTypeName", companyFieldVo.getCompanyTypeName()); |
| | | param.put("parentSectorName", companyFieldVo.getParentSectorName()); |
| | | param.put("childSectorName", companyFieldVo.getChildSectorName()); |
| | | param.put("regionName", companyFieldVo.getRegionName()); |
| | | param.put("statusName", companyFieldVo.getStatusName()); |
| | | |
| | | if (issueCompany != null) { //수정 시 |
| | | // 변경 이력 먼저 남기고 issueCompany에 set하기 |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.MODIFY, param, null, issueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | issueCompany.setName(MapUtil.getString(param, "name")); |
| | | issueCompany.setEmail(MapUtil.getString(param, "email")); |
| | |
| | | |
| | | IssueCompany newIssueCompany = CreateIssueCompany(companyFieldForm, issue); |
| | | |
| | | CompanyFieldCategory companyType = this.companyFieldCategoryService.find(companyFieldForm.getCompanyTypeId()); |
| | | if (companyType != null) { |
| | | companyFieldForm.setCompanyTypeName(companyType.getUseValue()); |
| | | } |
| | | |
| | | CompanyFieldCategory parentSector = this.companyFieldCategoryService.find(companyFieldForm.getParentSectorId()); |
| | | if (parentSector != null) { |
| | | companyFieldForm.setParentSectorName(parentSector.getUseValue()); |
| | | } |
| | | |
| | | CompanyFieldCategory childSector = this.companyFieldCategoryService.find(companyFieldForm.getChildSectorId()); |
| | | if (childSector != null) { |
| | | companyFieldForm.setChildSectorName(childSector.getUseValue()); |
| | | } |
| | | |
| | | CompanyFieldCategory region = this.companyFieldCategoryService.find(companyFieldForm.getRegionId()); |
| | | if (region != null) { |
| | | companyFieldForm.setRegionName(region.getUseValue()); |
| | | } |
| | | |
| | | CompanyFieldCategory status = this.companyFieldCategoryService.find(companyFieldForm.getStatusId()); |
| | | if (status != null) { |
| | | companyFieldForm.setStatusName(status.getUseValue()); |
| | | } |
| | | companyFieldVo = this.companyFieldService.CreateCompanyFieldCategory(companyFieldVo, companyField); |
| | | companyFieldForm.setCompanyTypeName(companyFieldVo.getCompanyTypeName()); |
| | | companyFieldForm.setParentSectorName(companyFieldVo.getParentSectorName()); |
| | | companyFieldForm.setChildSectorName(companyFieldVo.getChildSectorName()); |
| | | companyFieldForm.setRegionName(companyFieldVo.getRegionName()); |
| | | companyFieldForm.setStatusName(companyFieldVo.getStatusName()); |
| | | |
| | | // 추가 이력 |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.ADD, param, companyFieldForm, newIssueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueCompanyRepository.saveAndFlush(newIssueCompany); |
| | | } |
| | | |
| | | } else if(issueForm.getCompanyName() != null && !issueForm.getCompanyName().equals("")) { |
| | | //업체정보 직접 추가 |
| | | CreateCompanyField(issueForm, issue); |
| | | CreateCompanyField(issueForm, issue, sb); |
| | | } else { |
| | | this.issueCompanyRepository.deleteByIssueId(issue.getId()); |
| | | this.issueCompanyRepository.flush(); |
| | | |
| | | if (issueCompany != null) { |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.DELETE, null, null, issueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | } |
| | | //issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | } |
| | | |
| | |
| | | Long companyFieldId = 0L; |
| | | Long id = 0L; |
| | | String name = ""; |
| | | /*String manager = ""; |
| | | String manager = ""; |
| | | String tel = ""; |
| | | String email = ""; |
| | | String memo = ""; |
| | |
| | | String parentSectorName = ""; |
| | | String childSectorName = ""; |
| | | String regionName = ""; |
| | | String statusName = "";*/ |
| | | String statusName = ""; |
| | | |
| | | if (param != null) { |
| | | id = MapUtil.getLong(param, "companyId"); |
| | | name = MapUtil.getString(param, "name"); |
| | | /*manager = MapUtil.getString(param, "manager"); |
| | | manager = MapUtil.getString(param, "manager"); |
| | | tel = MapUtil.getString(param, "tel"); |
| | | email = MapUtil.getString(param, "email"); |
| | | memo = MapUtil.getString(param, "memo"); |
| | | companyTypeId = MapUtil.getLong(param, "companyTypeId"); |
| | | parentSectorId = MapUtil.getLong(param, "parentSectorId"); |
| | | childSectorId = MapUtil.getLong(param, "childSectorId"); |
| | | regionId = MapUtil.getLong(param, "regionId"); |
| | | statusId = MapUtil.getLong(param, "statusId"); |
| | | companyTypeName = MapUtil.getString(param, "companyTypeName"); |
| | | parentSectorName = MapUtil.getString(param, "parentSectorName"); |
| | | childSectorName = MapUtil.getString(param, "childSectorName"); |
| | | regionName = MapUtil.getString(param, "regionName"); |
| | | statusName = MapUtil.getString(param, "statusName");*/ |
| | | statusName = MapUtil.getString(param, "statusName"); |
| | | }else if(companyFieldForm != null) { |
| | | id = companyFieldForm.getId(); |
| | | name = companyFieldForm.getName(); |
| | | /*manager = companyFieldForm.getManager(); |
| | | manager = companyFieldForm.getManager(); |
| | | tel = companyFieldForm.getTel(); |
| | | email = companyFieldForm.getEmail(); |
| | | memo = companyFieldForm.getMemo(); |
| | | companyTypeId = companyFieldForm.getCompanyTypeId(); |
| | | parentSectorId = companyFieldForm.getParentSectorId(); |
| | | childSectorId = companyFieldForm.getChildSectorId(); |
| | | regionId = companyFieldForm.getRegionId(); |
| | | statusId = companyFieldForm.getStatusId(); |
| | | companyTypeName = companyFieldForm.getCompanyTypeName(); |
| | | parentSectorName = companyFieldForm.getParentSectorName(); |
| | | childSectorName = companyFieldForm.getChildSectorName(); |
| | | regionName = companyFieldForm.getRegionName(); |
| | | statusName = companyFieldForm.getStatusName();*/ |
| | | statusName = companyFieldForm.getStatusName(); |
| | | } |
| | | if (issueCompany.getCompanyField() != null && issueCompany.getCompanyField().getId() != null) { |
| | | companyFieldId = issueCompany.getCompanyField().getId(); |
| | |
| | | if (id != null && !companyFieldId.equals(id)) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyHistory\">업체 정보가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + name + "</span>"); |
| | | } |
| | | /*if (companyFieldId.equals(id) && manager != null && (issueCompany.getManager() == null || !issueCompany.getManager().equals(manager))) { |
| | | } else { |
| | | if (companyFieldId.equals(id) && manager != null && (issueCompany.getManager() == null || !issueCompany.getManager().equals(manager))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyManagerHistory\"> > 업체 정보의 담당자가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + manager + "</span>"); |
| | | } |
| | |
| | | if (companyFieldId.equals(id) && regionName != null && (issueCompany.getRegionId() == null || !issueCompany.getRegionId().equals(regionId))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyRegionHistory\"> > 업체 정보의 지역이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + regionName + "</span>"); |
| | | }*/ |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | description.append("<span translate=\"issue.issueCompanyRemoveHistory\">업체 정보가 삭제되었습니다. " + issueCompany.getCompanyField().getName() + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + issueCompany.getCompanyField().getName() + "</span>"); |
| | |
| | | if (param != null) { |
| | | id = MapUtil.getLong(param, "ispId"); |
| | | name = MapUtil.getString(param, "name"); |
| | | /*manager = MapUtil.getString(param, "manager"); |
| | | manager = MapUtil.getString(param, "manager"); |
| | | tel = MapUtil.getString(param, "tel"); |
| | | email = MapUtil.getString(param, "email"); |
| | | memo = MapUtil.getString(param, "memo");*/ |
| | | memo = MapUtil.getString(param, "memo"); |
| | | }else if(ispFieldForm != null) { |
| | | id = ispFieldForm.getId(); |
| | | name = ispFieldForm.getName(); |
| | | /*manager = ispFieldForm.getManager(); |
| | | manager = ispFieldForm.getManager(); |
| | | tel = ispFieldForm.getTel(); |
| | | email = ispFieldForm.getEmail(); |
| | | memo = ispFieldForm.getMemo();*/ |
| | | memo = ispFieldForm.getMemo(); |
| | | } |
| | | |
| | | if (issueIsp.getIspField() != null && issueIsp.getIspField().getId() != null) { |
| | |
| | | if (id != null && !ispFieldId.equals(id)) { //수정 할 경우 |
| | | description.append("<span translate=\"issue.issueIspModifyHistory\">ISP 정보가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + name + "</span>"); |
| | | } |
| | | /*if (ispFieldId.equals(id) && manager != null && (issueIsp.getManager() == null || !issueIsp.getManager().equals(manager))) { |
| | | } else { |
| | | if (ispFieldId.equals(id) && manager != null && (issueIsp.getManager() == null || !issueIsp.getManager().equals(manager))) { |
| | | description.append("<span translate=\"issue.issueIspModifyManagerHistory\">ISP 정보의 담당자가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + manager + "</span>"); |
| | | } |
| | |
| | | if (ispFieldId.equals(id) && memo != null && (issueIsp.getMemo() == null || !issueIsp.getMemo().equals(memo))) { |
| | | description.append("<span translate=\"issue.issueIspModifyMemoHistory\">ISP 정보의 비고가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + memo + "</span>"); |
| | | }*/ |
| | | } |
| | | } |
| | | } else { |
| | | description.append("<span translate=\"issue.issueIspRemoveHistory\">ISP 정보가 삭제되었습니다. " + issueIsp.getIspField().getName() + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + issueIsp.getIspField().getName() + "</span>"); |
| | |
| | | if (param != null) { |
| | | id = MapUtil.getLong(param, "hostingId"); |
| | | name = MapUtil.getString(param, "name"); |
| | | /*manager = MapUtil.getString(param, "manager"); |
| | | manager = MapUtil.getString(param, "manager"); |
| | | tel = MapUtil.getString(param, "tel"); |
| | | email = MapUtil.getString(param, "email"); |
| | | memo = MapUtil.getString(param, "memo");*/ |
| | | memo = MapUtil.getString(param, "memo"); |
| | | }else if(hostingFieldForm != null) { |
| | | id = hostingFieldForm.getId(); |
| | | name = hostingFieldForm.getName(); |
| | | /*manager = hostingFieldForm.getManager(); |
| | | manager = hostingFieldForm.getManager(); |
| | | tel = hostingFieldForm.getTel(); |
| | | email = hostingFieldForm.getEmail(); |
| | | memo = hostingFieldForm.getMemo();*/ |
| | | memo = hostingFieldForm.getMemo(); |
| | | } |
| | | |
| | | if (issueHosting.getHostingField() != null && issueHosting.getHostingField().getId() != null) { |
| | |
| | | if(id != null && !hostingFieldId.equals(id)){ //수정 할 경우 |
| | | description.append("<span translate=\"issue.issueHostingModifyHistory\">호스팅 정보가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + name + "</span>"); |
| | | } |
| | | /*if(hostingFieldId.equals(id) && manager != null && (issueHosting.getManager() == null || !issueHosting.getManager().equals(manager))){ |
| | | } else { |
| | | if(hostingFieldId.equals(id) && manager != null && (issueHosting.getManager() == null || !issueHosting.getManager().equals(manager))){ |
| | | description.append("<span translate=\"issue.issueHostingModifyManagerHistory\">호스팅 정보의 담당자가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + manager + "</span>"); |
| | | } |
| | |
| | | if(hostingFieldId.equals(id) && memo != null && (issueHosting.getMemo() == null || !issueHosting.getMemo().equals(memo))){ |
| | | description.append("<span translate=\"issue.issueHostingModifyMemoHistory\">호스팅 정보의 비고가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + memo + "</span>"); |
| | | }*/ |
| | | } |
| | | } |
| | | } else { |
| | | description.append("<span translate=\"issue.issueHostingRemoveHistory\">호스팅 정보가 삭제되었습니다. " + issueHosting.getHostingField().getName() + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + issueHosting.getHostingField().getName() + "</span>"); |
| | |
| | | switch (customField.getCustomFieldType()) { |
| | | case INPUT : |
| | | case SINGLE_SELECT : |
| | | case NUMBER : |
| | | case DATETIME : |
| | | case IP_ADDRESS : |
| | | case EMAIL : |
| | | case SITE : |
| | | case TEL : |
| | | boolean existIssueCustomFieldValue = false; |
| | | |
| | | for (IssueCustomFieldValue savedIssueCustomFieldValue : issue.getIssueCustomFieldValues()) { |
| | |
| | | * @param issueForm IssueForm |
| | | * @param issue Issue |
| | | */ |
| | | private void CreateHostingField(IssueForm issueForm, Issue issue) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | private void CreateHostingField(IssueForm issueForm, Issue issue, StringBuilder sb) { |
| | | // issueHosting 필드 폼 만들기 |
| | | HostingFieldForm hostingFieldForm = new HostingFieldForm(); |
| | | hostingFieldForm.setName(issueForm.getHostingName()); |
| | |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.ADD, null, hostingFieldForm, newIssueHosting, sb); |
| | | } |
| | | } |
| | | // 추가 이력 |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueHostingRepository.saveAndFlush(newIssueHosting); |
| | | } |
| | | |
| | |
| | | // 이슈에서 사용되는 업체 값을 업데이트한다. |
| | | @Override |
| | | @Transactional |
| | | public void modifyIssueHostingField(Issue issue, IssueForm issueForm) { |
| | | public void modifyIssueHostingField(Issue issue, IssueForm issueForm, StringBuilder sb) { |
| | | if (issue != null) { |
| | | IssueHosting issueHosting = this.issueHostingRepository.findByIssueId(issue.getId()); |
| | | StringBuilder sb = new StringBuilder(); |
| | | List<Map<String, Object>> issueHostingFields = issueForm.getIssueHostingFields(); |
| | | if (issueHostingFields != null && issueHostingFields.size() > 0) { |
| | | Map<String, Object> param = issueHostingFields.get(0); |
| | |
| | | if (issueHosting != null) { //수정 시 |
| | | // 변경 이력 남기고 issueHosting에 set 해주기 |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.MODIFY, param, null, issueHosting, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | issueHosting.setName(MapUtil.getString(param, "name")); |
| | | issueHosting.setEmail(MapUtil.getString(param, "email")); |
| | |
| | | IssueHosting newIssueHosting = CreateIssueHosting(param, issue); |
| | | // 추가 이력 |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.ADD, param, null, newIssueHosting, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueHostingRepository.saveAndFlush(newIssueHosting); |
| | | } |
| | | |
| | | }else if (issueForm.getHostingName() != null && !issueForm.getHostingName().equals("")) { |
| | | // 호스팅 정보 직접 추가 |
| | | CreateHostingField(issueForm, issue); |
| | | CreateHostingField(issueForm, issue, sb); |
| | | } else { |
| | | this.issueHostingRepository.deleteByIssueId(issue.getId()); |
| | | this.issueHostingRepository.flush(); |
| | | |
| | | if (issueHosting != null) { |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.DELETE, null, null, issueHosting, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | } |
| | | //issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param issueForm IssueForm |
| | | * @param issue Issue |
| | | */ |
| | | private void CreateIspField(IssueForm issueForm, Issue issue) { |
| | | private void CreateIspField(IssueForm issueForm, Issue issue, StringBuilder sb) { |
| | | // issueIsp 필드 폼 만들기 |
| | | IspFieldForm ispFieldForm = new IspFieldForm(); |
| | | ispFieldForm.setName(issueForm.getIspName()); |
| | |
| | | |
| | | IssueIsp newIssueIsp = CreateIssueIsp(ispFieldForm, issue); |
| | | IspField ispField = new IspField(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | // 사용자가 직접 입력시에 ISP 목록에 추가 |
| | | if (newIssueIsp.getIspField() == null) { |
| | |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.ADD, null, ispFieldForm, newIssueIsp, sb); |
| | | } |
| | | } |
| | | // 추가 이력 |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueIspRepository.saveAndFlush(newIssueIsp); |
| | | } |
| | | |
| | |
| | | // 이슈에서 사용되는 업체 값을 업데이트한다. |
| | | @Override |
| | | @Transactional |
| | | public void modifyIssueIspField(Issue issue, IssueForm issueForm) { |
| | | public void modifyIssueIspField(Issue issue, IssueForm issueForm, StringBuilder sb) { |
| | | if (issue != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | IssueIsp issueIsp = this.issueIspRepository.findByIssueId(issue.getId()); |
| | | List<Map<String, Object>> issueIspFields = issueForm.getIssueIspFields(); |
| | | |
| | | if (issueIspFields != null && issueIspFields.size() > 0) { |
| | | Map<String, Object> param = issueIspFields.get(0); |
| | | |
| | | if (issueIsp != null) {//수정 시 |
| | | // 변경 이력 남기고 issueIsp에 set해주기 |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.MODIFY, param, null, issueIsp, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | issueIsp.setName(MapUtil.getString(param, "name")); |
| | | issueIsp.setEmail(MapUtil.getString(param, "email")); |
| | |
| | | IssueIsp newIssueIsp = CreateIssueIsp(param, issue); |
| | | // 추가 이력 |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.ADD, param, null, newIssueIsp, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueIspRepository.saveAndFlush(newIssueIsp); |
| | | } |
| | | } // 사용자가 직접 입력시 |
| | | else if (issueForm.getIspName() != null && !issueForm.getIspName().equals("")) { |
| | | |
| | | } else if (issueForm.getIspName() != null && !issueForm.getIspName().equals("")) { |
| | | //ISP정보 직접 추가 |
| | | CreateIspField(issueForm, issue); |
| | | } |
| | | else { |
| | | CreateIspField(issueForm, issue, sb); |
| | | } else { |
| | | this.issueIspRepository.deleteByIssueId(issue.getId()); |
| | | this.issueIspRepository.flush(); |
| | | |
| | | if (issueIsp != null) { |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.DELETE, null, null, issueIsp, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | } |
| | | //issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional |
| | | public Issue addIssue(User user, IssueForm issueForm, List<MultipartFile> multipartFiles) { |
| | | StringBuilder detectIssueChange = new StringBuilder(); |
| | | |
| | | // 사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다. |
| | | Workspace workspace = this.workspaceService.checkUseWorkspace(user, user.getLastWorkspaceId()); |
| | | // 프로젝트 유효성 체크 |
| | |
| | | // 담당부서 지정 |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, user, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm); |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm, detectIssueChange); |
| | | // ISP 정보 저장 |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm); |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm, detectIssueChange); |
| | | // HOSTING 정보 저장 |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm); |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm, detectIssueChange); |
| | | |
| | | // 첨부 파일 저장 |
| | | // multipartFile 을 file Map List 객체로 변경한다. |
| | |
| | | @Override |
| | | @Transactional |
| | | public Issue addDownIssue(User user, IssueForm issueForm, List<MultipartFile> multipartFiles) { |
| | | StringBuilder detectIssueChange = new StringBuilder(); |
| | | |
| | | // 사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다. |
| | | Workspace workspace = this.workspaceService.checkUseWorkspace(user, user.getLastWorkspaceId()); |
| | | // 프로젝트 유효성 체크 |
| | |
| | | // 담당부서 지정 |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, user, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm); |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm, detectIssueChange); |
| | | // ISP 정보 저장 |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm); |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm, detectIssueChange); |
| | | // HOSTING 정보 저장 |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm); |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm, detectIssueChange); |
| | | |
| | | // 첨부 파일 저장 |
| | | // multipartFile 을 file Map List 객체로 변경한다. |
| | |
| | | @Override |
| | | @Transactional |
| | | public Issue addRelIssue(User user, IssueForm issueForm, List<MultipartFile> multipartFiles) { |
| | | StringBuilder detectIssueChange = new StringBuilder(); |
| | | // 사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다. |
| | | Workspace workspace = this.workspaceService.checkUseWorkspace(user, user.getLastWorkspaceId()); |
| | | // 프로젝트 유효성 체크 |
| | |
| | | // 담당부서 지정 |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, user, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm); |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm, detectIssueChange); |
| | | // ISP 정보 저장 |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm); |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm, detectIssueChange); |
| | | // HOSTING 정보 저장 |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm); |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm, detectIssueChange); |
| | | |
| | | // 첨부 파일 저장 |
| | | // multipartFile 을 file Map List 객체로 변경한다. |
| | |
| | | this.checkNotHaveIssueIdAttachedFile(issue, issueForm); |
| | | // 사용자 정의 필드 저장 |
| | | this.issueCustomFieldValueService.modifyIssueCustomFieldValue(issue, issueForm.getIssueCustomFields()); |
| | | // 이슈 이력 등록 |
| | | if (!StringUtils.isEmpty(detectIssueChange.toString())) { |
| | | this.issueHistoryService.addIssueHistory(issue, user, IssueHistoryType.MODIFY, detectIssueChange.toString()); |
| | | } |
| | | // 사용자 시스템 기능 사용 정보 수집 |
| | | UserVo userVo = ConvertUtil.copyProperties(user, UserVo.class); |
| | | log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(userVo, ElasticSearchConstants.ISSUE_MODIFY)); |
| | | |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm); |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm, detectIssueChange); |
| | | // ISP 정보 저장 |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm); |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm, detectIssueChange); |
| | | // HOSTING 정보 저장 |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm); |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm, detectIssueChange); |
| | | |
| | | // 이슈 이력 등록 |
| | | if (!StringUtils.isEmpty(detectIssueChange.toString())) { |
| | | this.issueHistoryService.addIssueHistory(issue, user, IssueHistoryType.MODIFY, detectIssueChange.toString()); |
| | | } |
| | | |
| | | return issue; |
| | | } |