- 이슈 추가,수정 시 이력 남기는 부분 코드 수정
| | |
| | | private Long childSectorId; |
| | | private Long regionId; |
| | | private Long statusId; |
| | | private String statusName; |
| | | |
| | | @ManyToOne(fetch = FetchType.LAZY) |
| | | @JoinColumn(name = "issue_id") |
| | |
| | | this.statusId = statusId; |
| | | } |
| | | |
| | | public String getStatusName() { |
| | | return statusName; |
| | | } |
| | | |
| | | public void setStatusName(String statusName) { |
| | | this.statusName = statusName; |
| | | } |
| | | } |
| | |
| | | |
| | | public interface IssueCompanyRepository extends JpaRepository<IssueCompany, Long> { |
| | | |
| | | IssueCompany findByIssueId(@Param("issueId") Long issueId); |
| | | |
| | | void deleteByIssueId(@Param("issueId") Long issueId); |
| | | } |
| | |
| | | import kr.wisestone.owl.vo.IssueHistoryVo; |
| | | import kr.wisestone.owl.vo.IssueVo; |
| | | import kr.wisestone.owl.web.condition.IssueHistoryCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import kr.wisestone.owl.web.form.HostingFieldForm; |
| | | import kr.wisestone.owl.web.form.IspFieldForm; |
| | | import kr.wisestone.owl.web.form.IssueForm; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | void detectSendIssueMail(IssueHistoryType type, IssueForm issueForm, StringBuilder description); |
| | | void detectSendIssueMail(IssueHistoryType type, List<String> sendMails, StringBuilder description); |
| | | |
| | | void detectIssueCompany(IssueHistoryType type, Map<String, Object> param, CompanyField companyField, IssueCompany issueCompany, StringBuilder description); |
| | | void detectIssueCompany(IssueHistoryType type, Map<String, Object> param, CompanyFieldForm companyFieldForm, IssueCompany issueCompany, StringBuilder description); |
| | | |
| | | void detectIssueIsp(IssueHistoryType type, Map<String, Object> param, IspField ispField, IssueIsp issueIsp, StringBuilder description); |
| | | void detectIssueIsp(IssueHistoryType type, Map<String, Object> param, IspFieldForm ispFieldForm, IssueIsp issueIsp, StringBuilder description); |
| | | |
| | | void detectIssueHosting(IssueHistoryType type, Map<String, Object> param, HostingField hostingField, IssueHosting issueHosting, StringBuilder description); |
| | | void detectIssueHosting(IssueHistoryType type, Map<String, Object> param, HostingFieldForm hostingFieldForm, IssueHosting issueHosting, StringBuilder description); |
| | | |
| | | void recodeRemoveCustomFieldOptionValue(CustomField customField, String oldValue, String newValue, StringBuilder description); |
| | | |
| | |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | import kr.wisestone.owl.web.condition.IssueCondition; |
| | | import kr.wisestone.owl.web.form.CompanyFieldForm; |
| | | import kr.wisestone.owl.web.form.IspFieldForm; |
| | | import kr.wisestone.owl.web.form.IssueForm; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | private CompanyFieldService companyFieldService; |
| | | |
| | | @Autowired |
| | | private CompanyFieldCategoryService companyFieldCategoryService; |
| | | |
| | | @Autowired |
| | | private IssueHistoryService issueHistoryService; |
| | | |
| | | @Autowired |
| | |
| | | return this.issueCompanyRepository; |
| | | } |
| | | |
| | | /** |
| | | * 새로운 업체 직접 추가 |
| | | * @param issueForm IssueForm |
| | | * @param issue Issue |
| | | */ |
| | | private void CreateCompanyField(IssueForm issueForm, Issue issue) { |
| | | |
| | | CompanyFieldForm companyFieldForm = new CompanyFieldForm(); |
| | | companyFieldForm.setName(issueForm.getCompanyName()); |
| | | companyFieldForm.setEmail(issueForm.getCompanyEmail()); |
| | | companyFieldForm.setUrl(issueForm.getCompanyUrl()); |
| | | companyFieldForm.setManager(issueForm.getCompanyManager()); |
| | | companyFieldForm.setTel(issueForm.getCompanyTel()); |
| | | companyFieldForm.setMemo(issueForm.getCompanyMemo()); |
| | | companyFieldForm.setCompanyTypeName(issueForm.getCompanyTypeName()); |
| | | companyFieldForm.setParentSectorName(issueForm.getParentSectorName()); |
| | | companyFieldForm.setChildSectorName(issueForm.getChildSectorName()); |
| | | companyFieldForm.setRegionName(issueForm.getRegionName()); |
| | | companyFieldForm.setStatusName(issueForm.getStatusName()); |
| | | |
| | | IssueCompany newIssueCompany = CreateIssueCompany(companyFieldForm, issue); |
| | | CompanyField companyField = new CompanyField(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | // 사용자가 직접 입력 시 COMPANY 목록에 추가 |
| | | if (newIssueCompany.getCompanyField() == null) { |
| | | companyField = this.companyFieldService.addCompany(companyFieldForm); |
| | | newIssueCompany.setCompanyField(companyField); |
| | | IssueCompany oldIssueCompany = this.issueCompanyRepository.findByIssueId(issue.getId()); |
| | | if (oldIssueCompany != null) { |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.MODIFY, null, companyFieldForm, oldIssueCompany, sb); |
| | | this.issueCompanyRepository.deleteById(oldIssueCompany.getId()); |
| | | } else { |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.ADD, null, companyFieldForm, newIssueCompany, sb); |
| | | } |
| | | } |
| | | // 추가 이력 |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueCompanyRepository.saveAndFlush(newIssueCompany); |
| | | } |
| | | |
| | | /** |
| | | * 이슈 Company 만들기 |
| | | * @param companyFieldForm CompanyFieldForm |
| | | * @param issue 이슈 |
| | | * @return issueCompany |
| | | */ |
| | | private IssueCompany CreateIssueCompany(CompanyFieldForm companyFieldForm, Issue issue) { |
| | | IssueCompany issueCompany = ConvertUtil.copyProperties(companyFieldForm, IssueCompany.class); |
| | | issueCompany.setIssue(issue); |
| | | if (companyFieldForm.getId() != null && companyFieldForm.getId() != -1) { |
| | | CompanyField companyField = this.companyFieldService.getCompany(companyFieldForm.getId()); |
| | | issueCompany.setCompanyField(companyField); |
| | | } |
| | | return issueCompany; |
| | | } |
| | | |
| | | // 이슈에서 사용되는 업체 값을 업데이트한다. |
| | | @Override |
| | | @Transactional |
| | | public void modifyIssueCompanyField(Issue issue, IssueForm issueForm) { |
| | | if (issue != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | List<Map<String, Object>> issueCompanyFields = issueForm.getIssueCompanyFields(); |
| | | |
| | | if (issueCompanyFields != null && issueCompanyFields.size() > 0) { |
| | | Map<String, Object> param = issueCompanyFields.get(0); |
| | | IssueCompany issueCompany = this.issueCompanyRepository.findByIssueId(issue.getId()); |
| | | |
| | | if (param != null && param.get("companyId") != null && param.get("companyId") != "") { |
| | | CompanyField companyField = this.companyFieldService.getCompany(MapUtil.getLong(param, "companyId")); //companyId 가져오기 |
| | | 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.setUrl(MapUtil.getString(param, "url")); |
| | | issueCompany.setManager(MapUtil.getString(param, "manager")); |
| | | issueCompany.setTel(MapUtil.getString(param, "tel")); |
| | | issueCompany.setMemo(MapUtil.getString(param, "memo")); |
| | | issueCompany.setCompanyTypeId(MapUtil.getLong(param, "companyTypeId")); |
| | | issueCompany.setParentSectorId(MapUtil.getLong(param, "parentSectorId")); |
| | | issueCompany.setChildSectorId(MapUtil.getLong(param, "childSectorId")); |
| | | issueCompany.setRegionId(MapUtil.getLong(param, "regionId")); |
| | | issueCompany.setStatusId(MapUtil.getLong(param, "statusId")); |
| | | |
| | | Set<IssueCompany> issueCompanies = issue.getIssueCompanies(); |
| | | IssueCompany issueCompany = null; |
| | | if (issueCompanies != null && issueCompanies.size() > 0) { //수정 할 경우 |
| | | issueCompany = issueCompanies.iterator().next(); |
| | | // 변경 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.MODIFY, param, null, issueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | issueCompany.setCompanyField(companyField); |
| | | issueCompany.setName(MapUtil.getString(param, "name")); |
| | | issueCompany.setEmail(MapUtil.getString(param, "email")); |
| | | issueCompany.setUrl(MapUtil.getString(param, "url")); |
| | | issueCompany.setManager(MapUtil.getString(param, "manager")); |
| | | issueCompany.setTel(MapUtil.getString(param, "tel")); |
| | | issueCompany.setMemo(MapUtil.getString(param, "memo")); |
| | | issueCompany.setCompanyTypeId(MapUtil.getLong(param, "companyTypeId")); |
| | | issueCompany.setParentSectorId(MapUtil.getLong(param, "parentSectorId")); |
| | | issueCompany.setChildSectorId(MapUtil.getLong(param, "childSectorId")); |
| | | issueCompany.setRegionId(MapUtil.getLong(param, "regionId")); |
| | | issueCompany.setStatusId(MapUtil.getLong(param, "statusId")); |
| | | } else { //추가 할 경우 |
| | | issueCompany = ConvertUtil.convertMapToClass(param, IssueCompany.class); |
| | | issueCompany.setIssue(issue); |
| | | if (companyField != null) { |
| | | issueCompany.setCompanyField(companyField); |
| | | } |
| | | // 추가 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.ADD, param, null, issueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | } |
| | | this.issueCompanyRepository.saveAndFlush(issueCompany); |
| | | } else { |
| | | this.issueCompanyRepository.deleteById(MapUtil.getLong(param, "id")); |
| | | } |
| | | } else if(issueForm.getCompanyName() != null && !issueForm.getCompanyName().equals("")) { //업체정보 직접 추가 |
| | | CompanyFieldForm companyFieldForm = new CompanyFieldForm(); |
| | | companyFieldForm.setName(issueForm.getCompanyName()); |
| | | companyFieldForm.setEmail(issueForm.getCompanyEmail()); |
| | | companyFieldForm.setUrl(issueForm.getCompanyUrl()); |
| | | companyFieldForm.setManager(issueForm.getCompanyManager()); |
| | | companyFieldForm.setTel(issueForm.getCompanyTel()); |
| | | companyFieldForm.setMemo(issueForm.getCompanyMemo()); |
| | | companyFieldForm.setCompanyTypeName(issueForm.getCompanyTypeName()); |
| | | companyFieldForm.setParentSectorName(issueForm.getParentSectorName()); |
| | | companyFieldForm.setChildSectorName(issueForm.getChildSectorName()); |
| | | companyFieldForm.setRegionName(issueForm.getRegionName()); |
| | | companyFieldForm.setStatusName(issueForm.getStatusName()); |
| | | } else { //추가 시 |
| | | CompanyFieldForm companyFieldForm = ConvertUtil.convertMapToClass(param, CompanyFieldForm.class); |
| | | companyFieldForm.setId(MapUtil.getLong(param, "companyId")); |
| | | |
| | | CompanyField companyField = this.companyFieldService.addCompany(companyFieldForm); |
| | | IssueCompany newIssueCompany = CreateIssueCompany(companyFieldForm, issue); |
| | | |
| | | IssueCompany issueCompany = ConvertUtil.copyProperties(companyFieldForm, IssueCompany.class); |
| | | issueCompany.setIssue(issue); |
| | | if (companyField != null) { |
| | | issueCompany.setCompanyField(companyField); |
| | | 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()); |
| | | } |
| | | |
| | | // 추가 이력 |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.ADD, param, companyFieldForm, newIssueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueCompanyRepository.saveAndFlush(newIssueCompany); |
| | | } |
| | | // 추가 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueCompany(IssueHistoryType.ADD, null, companyField, issueCompany, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueCompanyRepository.saveAndFlush(issueCompany); |
| | | |
| | | } else if(issueForm.getCompanyName() != null && !issueForm.getCompanyName().equals("")) { |
| | | //업체정보 직접 추가 |
| | | CreateCompanyField(issueForm, issue); |
| | | } else { |
| | | this.issueCompanyRepository.deleteByIssueId(issue.getId()); |
| | | this.issueCompanyRepository.flush(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import kr.wisestone.owl.vo.IssueHistoryVo; |
| | | import kr.wisestone.owl.vo.IssueVo; |
| | | import kr.wisestone.owl.web.condition.IssueHistoryCondition; |
| | | import kr.wisestone.owl.web.form.EmailTemplateForm; |
| | | import kr.wisestone.owl.web.form.IssueForm; |
| | | import kr.wisestone.owl.web.form.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | |
| | | // 업체 정보 변경 정보를 기록한다. |
| | | @Override |
| | | public void detectIssueCompany(IssueHistoryType type, Map<String, Object> param, CompanyField companyField, IssueCompany issueCompany, StringBuilder description) { |
| | | public void detectIssueCompany(IssueHistoryType type, Map<String, Object> param, CompanyFieldForm companyFieldForm, IssueCompany issueCompany, StringBuilder description) { |
| | | Long companyFieldId = 0L; |
| | | Long id = 0L; |
| | | String name = ""; |
| | | /*String manager = ""; |
| | | String tel = ""; |
| | | String email = ""; |
| | | String memo = ""; |
| | | Long companyTypeId = 0L; |
| | | Long parentSectorId = 0L; |
| | | Long childSectorId = 0L; |
| | | Long regionId = 0L; |
| | | Long statusId = 0L; |
| | | String companyTypeName = ""; |
| | | String parentSectorName = ""; |
| | | String childSectorName = ""; |
| | | String regionName = ""; |
| | | String statusName = "";*/ |
| | | |
| | | if (param != null) { |
| | | id = MapUtil.getLong(param, "companyId"); |
| | | }else if(companyField != null) { |
| | | id = companyField.getId(); |
| | | name = MapUtil.getString(param, "name"); |
| | | /*manager = MapUtil.getString(param, "manager"); |
| | | tel = MapUtil.getString(param, "tel"); |
| | | email = MapUtil.getString(param, "email"); |
| | | memo = MapUtil.getString(param, "memo"); |
| | | 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");*/ |
| | | }else if(companyFieldForm != null) { |
| | | id = companyFieldForm.getId(); |
| | | name = companyFieldForm.getName(); |
| | | /*manager = companyFieldForm.getManager(); |
| | | tel = companyFieldForm.getTel(); |
| | | email = companyFieldForm.getEmail(); |
| | | memo = companyFieldForm.getMemo(); |
| | | companyTypeName = companyFieldForm.getCompanyTypeName(); |
| | | parentSectorName = companyFieldForm.getParentSectorName(); |
| | | childSectorName = companyFieldForm.getChildSectorName(); |
| | | regionName = companyFieldForm.getRegionName(); |
| | | statusName = companyFieldForm.getStatusName();*/ |
| | | } |
| | | Long companyFieldId = issueCompany.getCompanyField().getId(); |
| | | if (issueCompany.getCompanyField() != null && issueCompany.getCompanyField().getId() != null) { |
| | | companyFieldId = issueCompany.getCompanyField().getId(); |
| | | } |
| | | |
| | | if (type == IssueHistoryType.ADD) { //추가 할 경우 |
| | | description.append("<span translate=\"issue.issueCompanyAddHistory\">업체 정보가 추가되었습니다. </span>"); |
| | |
| | | } else if (type == IssueHistoryType.MODIFY) { //수정 할 경우 |
| | | if (id != null && !companyFieldId.equals(id)) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyHistory\">업체 정보가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("name") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + name + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && param.get("manager") != null && (issueCompany.getManager() == null || !issueCompany.getManager().equals(param.get("manager")))) { |
| | | /*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\"> > " + param.get("manager") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + manager + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && param.get("tel") != null && (issueCompany.getTel() == null || !issueCompany.getTel().equals(param.get("tel")))) { |
| | | if (companyFieldId.equals(id) && tel != null && (issueCompany.getTel() == null || !issueCompany.getTel().equals(tel))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyTelHistory\"> > 업체 정보의 전화번호가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("tel") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + tel + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && param.get("email") != null && (issueCompany.getEmail() == null || !issueCompany.getEmail().equals(param.get("email")))) { |
| | | if (companyFieldId.equals(id) && email != null && (issueCompany.getEmail() == null || !issueCompany.getEmail().equals(email))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyEmailHistory\"> > 업체 정보의 이메일이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("email") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + email + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && param.get("memo") != null && (issueCompany.getMemo() == null || !issueCompany.getMemo().equals(param.get("memo")))) { |
| | | if (companyFieldId.equals(id) && memo != null && (issueCompany.getMemo() == null || !issueCompany.getMemo().equals(memo))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyMemoHistory\"> > 업체 정보의 비고가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("memo") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + memo + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && companyTypeName != null && (issueCompany.getCompanyTypeId() == null || !issueCompany.getCompanyTypeId().equals(companyTypeId))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyCompanyTypeHistory\"> > 업체 정보의 기업구분이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + companyTypeName + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && parentSectorName != null && (issueCompany.getParentSectorId() == null || !issueCompany.getParentSectorId().equals(parentSectorId))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyParentSectorHistory\"> > 업체 정보의 업종(대분류)이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + parentSectorName + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && childSectorName != null && (issueCompany.getChildSectorId() == null || !issueCompany.getChildSectorId().equals(childSectorId))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyChildSectorHistory\"> > 업체 정보의 업종(중분류)이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + childSectorName + "</span>"); |
| | | } |
| | | if (companyFieldId.equals(id) && statusName != null && (issueCompany.getStatusId() == null || !issueCompany.getStatusId().equals(statusId))) { |
| | | description.append("<span translate=\"issue.issueCompanyModifyStatusHistory\"> > 업체 정보의 상태가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + statusName + "</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>"); |
| | |
| | | |
| | | // ISP 정보 변경 정보를 기록한다. |
| | | @Override |
| | | public void detectIssueIsp(IssueHistoryType type, Map<String, Object> param, IspField ispField, IssueIsp issueIsp, StringBuilder description) { |
| | | public void detectIssueIsp(IssueHistoryType type, Map<String, Object> param, IspFieldForm ispFieldForm, IssueIsp issueIsp, StringBuilder description) { |
| | | Long ispFieldId = 0L; |
| | | Long id = 0L; |
| | | String name = ""; |
| | | String manager = ""; |
| | | String tel = ""; |
| | | String email = ""; |
| | | String memo = ""; |
| | | if (param != null) { |
| | | id = MapUtil.getLong(param, "ispId"); |
| | | } else if(ispField != null) { |
| | | id = ispField.getId(); |
| | | name = MapUtil.getString(param, "name"); |
| | | /*manager = MapUtil.getString(param, "manager"); |
| | | tel = MapUtil.getString(param, "tel"); |
| | | email = MapUtil.getString(param, "email"); |
| | | memo = MapUtil.getString(param, "memo");*/ |
| | | }else if(ispFieldForm != null) { |
| | | id = ispFieldForm.getId(); |
| | | name = ispFieldForm.getName(); |
| | | /*manager = ispFieldForm.getManager(); |
| | | tel = ispFieldForm.getTel(); |
| | | email = ispFieldForm.getEmail(); |
| | | memo = ispFieldForm.getMemo();*/ |
| | | } |
| | | Long ispFieldId = issueIsp.getIspField().getId(); |
| | | |
| | | if (issueIsp.getIspField() != null && issueIsp.getIspField().getId() != null) { |
| | | ispFieldId = issueIsp.getIspField().getId(); |
| | | } |
| | | |
| | | if (type == IssueHistoryType.ADD) { |
| | | description.append("<span translate=\"issue.issueIspAddHistory\">ISP 정보가 추가되었습니다. </span>"); |
| | |
| | | } else if (type == IssueHistoryType.MODIFY) { |
| | | if (id != null && !ispFieldId.equals(id)) { //수정 할 경우 |
| | | description.append("<span translate=\"issue.issueIspModifyHistory\">ISP 정보가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("name") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + name + "</span>"); |
| | | } |
| | | if (ispFieldId.equals(id) && param.get("manager") != null && (issueIsp.getManager() == null || !issueIsp.getManager().equals(param.get("manager")))) { |
| | | /*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\"> > " + param.get("manager") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + manager + "</span>"); |
| | | } |
| | | if (ispFieldId.equals(id) && param.get("tel") != null && (issueIsp.getTel() == null || !issueIsp.getTel().equals(param.get("tel")))) { |
| | | if (ispFieldId.equals(id) && tel != null && (issueIsp.getTel() == null || !issueIsp.getTel().equals(tel))) { |
| | | description.append("<span translate=\"issue.issueIspModifyTelHistory\">ISP 정보의 전화번호가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("tel") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + tel + "</span>"); |
| | | } |
| | | if (ispFieldId.equals(id) && param.get("email") != null && (issueIsp.getEmail() == null || !issueIsp.getEmail().equals(param.get("email")))) { |
| | | if (ispFieldId.equals(id) && email != null && (issueIsp.getEmail() == null || !issueIsp.getEmail().equals(email))) { |
| | | description.append("<span translate=\"issue.issueIspModifyEmailHistory\">ISP 정보의 이메일이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("email") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + email + "</span>"); |
| | | } |
| | | if (ispFieldId.equals(id) && param.get("memo") != null && (issueIsp.getMemo() == null || !issueIsp.getMemo().equals(param.get("memo")))) { |
| | | 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\"> > " + param.get("memo") + "</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>"); |
| | |
| | | |
| | | // 호스팅 정보 변경 정보를 기록한다. |
| | | @Override |
| | | public void detectIssueHosting(IssueHistoryType type, Map<String, Object> param, HostingField hostingField, IssueHosting issueHosting, StringBuilder description) { |
| | | public void detectIssueHosting(IssueHistoryType type, Map<String, Object> param, HostingFieldForm hostingFieldForm, IssueHosting issueHosting, StringBuilder description) { |
| | | Long hostingFieldId = 0L; |
| | | Long id = 0L; |
| | | String name = ""; |
| | | String manager = ""; |
| | | String tel = ""; |
| | | String email = ""; |
| | | String memo = ""; |
| | | if (param != null) { |
| | | id = MapUtil.getLong(param, "hostingId"); |
| | | }else if(hostingField != null) { |
| | | id = hostingField.getId(); |
| | | name = MapUtil.getString(param, "name"); |
| | | /*manager = MapUtil.getString(param, "manager"); |
| | | tel = MapUtil.getString(param, "tel"); |
| | | email = MapUtil.getString(param, "email"); |
| | | memo = MapUtil.getString(param, "memo");*/ |
| | | }else if(hostingFieldForm != null) { |
| | | id = hostingFieldForm.getId(); |
| | | name = hostingFieldForm.getName(); |
| | | /*manager = hostingFieldForm.getManager(); |
| | | tel = hostingFieldForm.getTel(); |
| | | email = hostingFieldForm.getEmail(); |
| | | memo = hostingFieldForm.getMemo();*/ |
| | | } |
| | | Long hostingFieldId = issueHosting.getHostingField().getId(); |
| | | |
| | | if (issueHosting.getHostingField() != null && issueHosting.getHostingField().getId() != null) { |
| | | hostingFieldId = issueHosting.getHostingField().getId(); |
| | | } |
| | | |
| | | if (type == IssueHistoryType.ADD) { |
| | | description.append("<span translate=\"issue.issueHostingAddHistory\">호스팅 정보가 추가되었습니다. </span>"); |
| | |
| | | }else if(type == IssueHistoryType.MODIFY){ |
| | | if(id != null && !hostingFieldId.equals(id)){ //수정 할 경우 |
| | | description.append("<span translate=\"issue.issueHostingModifyHistory\">호스팅 정보가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("name") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + name + "</span>"); |
| | | } |
| | | if(hostingFieldId.equals(id) && param.get("manager") != null && (issueHosting.getManager() == null || !issueHosting.getManager().equals(param.get("manager")))){ |
| | | /*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\"> > " + param.get("manager") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + manager + "</span>"); |
| | | } |
| | | if(hostingFieldId.equals(id) && param.get("tel") != null && (issueHosting.getTel() == null || !issueHosting.getTel().equals(param.get("tel")))){ |
| | | if(hostingFieldId.equals(id) && tel != null && (issueHosting.getTel() == null || !issueHosting.getTel().equals(tel))){ |
| | | description.append("<span translate=\"issue.issueHostingModifyTelHistory\">호스팅 정보의 전화번호가 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("tel") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + tel + "</span>"); |
| | | } |
| | | if(hostingFieldId.equals(id) && param.get("email") != null && (issueHosting.getEmail() == null || !issueHosting.getEmail().equals(param.get("email")))){ |
| | | if(hostingFieldId.equals(id) && email != null && (issueHosting.getEmail() == null || !issueHosting.getEmail().equals(email))){ |
| | | description.append("<span translate=\"issue.issueHostingModifyEmailHistory\">호스팅 정보의 이메일이 변경되었습니다. </span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + param.get("email") + "</span>"); |
| | | description.append("<span class=\"text-primary bold\"> > " + email + "</span>"); |
| | | } |
| | | if(hostingFieldId.equals(id) && param.get("memo") != null && (issueHosting.getMemo() == null || !issueHosting.getMemo().equals(param.get("memo")))){ |
| | | 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\"> > " + param.get("memo") + "</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>"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 새로운 호스팅 직접 추가 |
| | | * @param issueForm IssueForm |
| | | * @param issue Issue |
| | | */ |
| | | private void CreateHostingField(IssueForm issueForm, Issue issue) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | // issueHosting 필드 폼 만들기 |
| | | HostingFieldForm hostingFieldForm = new HostingFieldForm(); |
| | | hostingFieldForm.setName(issueForm.getHostingName()); |
| | | hostingFieldForm.setCode(issueForm.getHostingCode()); |
| | | hostingFieldForm.setEmail(issueForm.getHostingEmail()); |
| | | hostingFieldForm.setUrl(issueForm.getHostingUrl()); |
| | | hostingFieldForm.setManager(issueForm.getHostingManager()); |
| | | hostingFieldForm.setTel(issueForm.getHostingTel()); |
| | | hostingFieldForm.setMemo(issueForm.getHostingMemo()); |
| | | |
| | | IssueHosting newIssueHosting = CreateIssueHosting(hostingFieldForm, issue); |
| | | HostingField hostingField = new HostingField(); |
| | | |
| | | // 사용자가 직접 입력시에 호스팅 목록에 추가 |
| | | if (newIssueHosting.getHostingField() == null) { |
| | | hostingField = this.hostingFieldService.add(hostingFieldForm); |
| | | newIssueHosting.setHostingField(hostingField); |
| | | IssueHosting oldIssueHosting = this.issueHostingRepository.findByIssueId(issue.getId()); |
| | | if (oldIssueHosting != null) { |
| | | this.issueHostingRepository.deleteById(oldIssueHosting.getId()); |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.MODIFY, null, hostingFieldForm, oldIssueHosting, sb); |
| | | } else { |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.ADD, null, hostingFieldForm, newIssueHosting, sb); |
| | | } |
| | | } |
| | | // 추가 이력 |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueHostingRepository.saveAndFlush(newIssueHosting); |
| | | } |
| | | |
| | | /** |
| | | * 이슈 호스팅 만들기 |
| | | * @param hostingFieldForm HostingFieldForm |
| | | * @param issue 이슈 |
| | |
| | | private IssueHosting CreateIssueHosting(HostingFieldForm hostingFieldForm, Issue issue) { |
| | | IssueHosting issueHosting = ConvertUtil.copyProperties(hostingFieldForm, IssueHosting.class); |
| | | issueHosting.setIssue(issue); |
| | | HostingField hostingField = this.hostingFieldService.getHosting(hostingFieldForm.getId()); |
| | | if (hostingField != null) { |
| | | if (hostingFieldForm.getId() != null && hostingFieldForm.getId() != -1) { |
| | | HostingField hostingField = this.hostingFieldService.getHosting(hostingFieldForm.getId()); |
| | | issueHosting.setHostingField(hostingField); |
| | | } |
| | | return issueHosting; |
| | |
| | | @Transactional |
| | | public void modifyIssueHostingField(Issue issue, IssueForm issueForm) { |
| | | if (issue != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | List<Map<String, Object>> issueHostingFields = issueForm.getIssueHostingFields(); |
| | | Map<String, Object> param = issueHostingFields.get(0); |
| | | |
| | | if (issueHostingFields != null && issueHostingFields.size() > 0) { |
| | | Map<String, Object> param = issueHostingFields.get(0); |
| | | IssueHosting issueHosting = this.issueHostingRepository.findByIssueId(issue.getId()); |
| | | |
| | | 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.setCode(MapUtil.getString(param, "code")); |
| | |
| | | issueHosting.setManager(MapUtil.getString(param, "manager")); |
| | | issueHosting.setTel(MapUtil.getString(param, "tel")); |
| | | issueHosting.setMemo(MapUtil.getString(param, "memo")); |
| | | // 변경 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.MODIFY, param, null, issueHosting, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | this.issueHostingRepository.saveAndFlush(issueHosting); |
| | | |
| | | } else { //추가 시 |
| | | IssueHosting newIssueHosting = CreateIssueHosting(param, issue); |
| | | // 추가 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | 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("")) { |
| | | // issueHosting 필드 폼 만들기 |
| | | HostingFieldForm hostingFieldForm = new HostingFieldForm(); |
| | | hostingFieldForm.setName(issueForm.getHostingName()); |
| | | hostingFieldForm.setCode(issueForm.getHostingCode()); |
| | | hostingFieldForm.setEmail(issueForm.getHostingEmail()); |
| | | hostingFieldForm.setUrl(issueForm.getHostingUrl()); |
| | | hostingFieldForm.setManager(issueForm.getHostingManager()); |
| | | hostingFieldForm.setTel(issueForm.getHostingTel()); |
| | | hostingFieldForm.setMemo(issueForm.getHostingMemo()); |
| | | |
| | | IssueHosting newIssueHosting = CreateIssueHosting(hostingFieldForm, issue); |
| | | HostingField hostingField = new HostingField(); |
| | | if (newIssueHosting.getHostingField() == null) { // 사용자가 직접 입력시에 호스팅 목록에 추가 |
| | | hostingField = this.hostingFieldService.add(hostingFieldForm); |
| | | newIssueHosting.setHostingField(hostingField); |
| | | } |
| | | // 추가 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueHosting(IssueHistoryType.ADD, param, null, newIssueHosting, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueHostingRepository.saveAndFlush(newIssueHosting); |
| | | // 호스팅 정보 직접 추가 |
| | | CreateHostingField(issueForm, issue); |
| | | } else { |
| | | this.issueHostingRepository.deleteByIssueId(issue.getId()); |
| | | this.issueHostingRepository.flush(); |
| | | } |
| | | } |
| | | } |
| | |
| | | return this.issueIspRepository; |
| | | } |
| | | |
| | | /** |
| | | * 새로운 ISP 직접 추가 |
| | | * @param issueForm IssueForm |
| | | * @param issue Issue |
| | | */ |
| | | private void CreateIspField(IssueForm issueForm, Issue issue) { |
| | | // issueIsp 필드 폼 만들기 |
| | | IspFieldForm ispFieldForm = new IspFieldForm(); |
| | | ispFieldForm.setName(issueForm.getIspName()); |
| | | ispFieldForm.setCode(issueForm.getIspCode()); |
| | | ispFieldForm.setEmail(issueForm.getIspEmail()); |
| | | ispFieldForm.setUrl(issueForm.getIspUrl()); |
| | | ispFieldForm.setManager(issueForm.getIspManager()); |
| | | ispFieldForm.setTel(issueForm.getIspTel()); |
| | | ispFieldForm.setMemo(issueForm.getIspMemo()); |
| | | |
| | | IssueIsp newIssueIsp = CreateIssueIsp(ispFieldForm, issue); |
| | | IspField ispField = new IspField(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | // 사용자가 직접 입력시에 ISP 목록에 추가 |
| | | if (newIssueIsp.getIspField() == null) { |
| | | ispField = this.ispFieldService.add(ispFieldForm); |
| | | newIssueIsp.setIspField(ispField); |
| | | IssueIsp oldIssueIsp = this.issueIspRepository.findByIssueId(issue.getId()); |
| | | if (oldIssueIsp != null) { |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.MODIFY, null, ispFieldForm, oldIssueIsp, sb); |
| | | this.issueIspRepository.deleteById(oldIssueIsp.getId()); |
| | | } else { |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.ADD, null, ispFieldForm, newIssueIsp, sb); |
| | | } |
| | | } |
| | | // 추가 이력 |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueIspRepository.saveAndFlush(newIssueIsp); |
| | | } |
| | | |
| | | /** |
| | | * 이슈 ISP 만들기 |
| | |
| | | private IssueIsp CreateIssueIsp(IspFieldForm ispFieldForm, Issue issue) { |
| | | IssueIsp issueIsp = ConvertUtil.copyProperties(ispFieldForm, IssueIsp.class); |
| | | issueIsp.setIssue(issue); |
| | | IspField ispField = this.ispFieldService.getIsp(ispFieldForm.getId()); |
| | | if (ispField != null) { |
| | | if (ispFieldForm.getId() != null && ispFieldForm.getId() != -1) { |
| | | IspField ispField = this.ispFieldService.getIsp(ispFieldForm.getId()); |
| | | issueIsp.setIspField(ispField); |
| | | } |
| | | |
| | | return issueIsp; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 이슈 ISP 만들기 |
| | | * @param ispFieldMap Map<String, Object> IspFieldForm map |
| | | * @param issue 이슈 |
| | | * @return ISPIssue |
| | | * @return IssueIsp CreateIssueIsp |
| | | */ |
| | | private IssueIsp CreateIssueIsp(Map<String, Object> ispFieldMap, Issue issue) { |
| | | IspFieldForm ispFieldForm = ConvertUtil.convertMapToClass(ispFieldMap, IspFieldForm.class); |
| | |
| | | return CreateIssueIsp(ispFieldForm, issue); |
| | | } |
| | | |
| | | |
| | | // 이슈에서 사용되는 업체 값을 업데이트한다. |
| | | @Override |
| | | @Transactional |
| | | public void modifyIssueIspField(Issue issue, IssueForm issueForm) { |
| | | if (issue != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | List<Map<String, Object>> issueIspFields = issueForm.getIssueIspFields(); |
| | | Map<String, Object> param = issueIspFields.get(0); |
| | | |
| | | if (issueIspFields != null && issueIspFields.size() > 0) { |
| | | Map<String, Object> param = issueIspFields.get(0); |
| | | IssueIsp issueIsp = this.issueIspRepository.findByIssueId(issue.getId()); |
| | | |
| | | 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.setCode(MapUtil.getString(param, "code")); |
| | |
| | | issueIsp.setManager(MapUtil.getString(param, "manager")); |
| | | issueIsp.setTel(MapUtil.getString(param, "tel")); |
| | | issueIsp.setMemo(MapUtil.getString(param, "memo")); |
| | | // 변경 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.MODIFY, param, null, issueIsp, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | this.issueIspRepository.saveAndFlush(issueIsp); |
| | | |
| | | } else { //추가 시 |
| | | IssueIsp newIssueIsp = CreateIssueIsp(param, issue); |
| | | // 추가 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | 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("")) { |
| | | // issueIsp 필드 폼 만들기 |
| | | IspFieldForm ispFieldForm = new IspFieldForm(); |
| | | ispFieldForm.setName(issueForm.getIspName()); |
| | | ispFieldForm.setCode(issueForm.getIspCode()); |
| | | ispFieldForm.setEmail(issueForm.getIspEmail()); |
| | | ispFieldForm.setUrl(issueForm.getIspUrl()); |
| | | ispFieldForm.setManager(issueForm.getIspManager()); |
| | | ispFieldForm.setTel(issueForm.getIspTel()); |
| | | ispFieldForm.setMemo(issueForm.getIspMemo()); |
| | | |
| | | IssueIsp newIssueIsp = CreateIssueIsp(ispFieldForm, issue); |
| | | IspField ispField = new IspField(); |
| | | // 사용자가 직접 입력시에 ISP 목록에 추가 |
| | | if (newIssueIsp.getIspField() == null) { |
| | | ispField = this.ispFieldService.add(ispFieldForm); |
| | | newIssueIsp.setIspField(ispField); |
| | | } |
| | | // 추가 이력 |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectIssueIsp(IssueHistoryType.ADD, param, null, newIssueIsp, sb); |
| | | issueHistoryService.addIssueHistory(issue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueIspRepository.saveAndFlush(newIssueIsp); |
| | | //ISP정보 직접 추가 |
| | | CreateIspField(issueForm, issue); |
| | | } else { |
| | | this.issueIspRepository.deleteByIssueId(issue.getId()); |
| | | this.issueIspRepository.flush(); |
| | | } |
| | | } |
| | | } |
| | |
| | | "issueCompanyModifyTelHistory" : "업체 정보의 전화번호가 변경되었습니다.", |
| | | "issueCompanyModifyEmailHistory" : "업체 정보의 이메일이 변경되었습니다.", |
| | | "issueCompanyModifyMemoHistory" : "업체 정보의 비고가 변경되었습니다.", |
| | | "issueCompanyModifyCompanyTypeHistory" : "업체 정보의 기업구분이 변경되었습니다.", |
| | | "issueCompanyModifyParentSectorHistory" : "업체 정보의 업종(대분류)이 변경되었습니다.", |
| | | "issueCompanyModifyChildSectorHistory" : "업체 정보의 업종(중분류)이 변경되었습니다.", |
| | | "issueCompanyModifyRegionHistory" : "업체 정보의 지역이 변경되었습니다.", |
| | | "issueCompanyModifyStatusHistory" : "업체 정보의 상태가 변경되었습니다.", |
| | | |
| | | "issueIspRemoveHistory" : "ISP 정보가 삭제되었습니다.", |
| | | "issueIspAddHistory" : "ISP 정보가 추가되었습니다.", |
| | |
| | | return false; |
| | | } |
| | | |
| | | $scope.$on("companyTypeEvent", function (event, result) { |
| | | $scope.vm.form.companyTypeId = result[0].id; |
| | | }); |
| | | $scope.$on("parentSectorEvent", function (event, result) { |
| | | $scope.vm.form.parentSectorId = result[0].id; |
| | | }); |
| | | $scope.$on("childSectorEvent", function (event, result) { |
| | | $scope.vm.form.childSectorId = result[0].id; |
| | | }); |
| | | $scope.$on("regionEvent", function (event, result) { |
| | | $scope.vm.form.regionId = result[0].id; |
| | | }); |
| | | $scope.$on("statusEvent", function (event, result) { |
| | | $scope.vm.form.statusId = result[0].id; |
| | | }); |
| | | |
| | | // 업체정보 결과 값 Event 처리(set) |
| | | $scope.$on("companyFieldEvent", function (event, result) { |
| | | var ispFieldVo = result[0].ispFieldVo; |
| | |
| | | $scope.vm.hostingMemo = ""; |
| | | |
| | | if (ispFieldVo != null){ |
| | | $scope.vm.form.issueIspFields[0] = angular.copy(ispFieldVo); |
| | | $scope.vm.ispId = ispFieldVo.id; |
| | | $scope.vm.ispName = ispFieldVo.name; |
| | | $scope.vm.ispCode = ispFieldVo.code; |
| | |
| | | $scope.vm.ispMemo = ispFieldVo.memo; |
| | | } |
| | | if (hostingFieldVo != null){ |
| | | $scope.vm.form.issueHostingFields[0] = angular.copy(hostingFieldVo); |
| | | $scope.vm.hostingId = hostingFieldVo.id; |
| | | $scope.vm.hostingName = hostingFieldVo.name; |
| | | $scope.vm.hostingCode = hostingFieldVo.code; |
| | |
| | | issueCompanyFields : (function () { |
| | | var issueCompanyFields = []; |
| | | if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0 ){ |
| | | |
| | | var companyField = $scope.vm.form.issueCompanyFields[0]; |
| | | if (companyField.name !== $scope.vm.companyName) { //사용자가 직접 업체 추가 할 경우 |
| | | return issueCompanyFields; |
| | | } |
| | | |
| | | issueCompanyFields.push({ |
| | | id : companyField.id, |
| | |
| | | email :$scope.vm.companyEmail, |
| | | url :$scope.vm.companyUrl, |
| | | memo : $scope.vm.companyMemo, |
| | | companyTypeId : companyField.companyTypeId, |
| | | parentSectorId : companyField.parentSectorId, |
| | | childSectorId : companyField.childSectorId, |
| | | regionId : companyField.regionId, |
| | | statusId : companyField.statusId |
| | | companyTypeId : $scope.vm.form.companyTypeId, |
| | | parentSectorId : $scope.vm.form.parentSectorId, |
| | | childSectorId : $scope.vm.form.childSectorId, |
| | | regionId : $scope.vm.form.regionId, |
| | | statusId : $scope.vm.form.statusId |
| | | }); |
| | | } |
| | | |
| | |
| | | if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0 |
| | | && $scope.vm.form.issueCompanyFields[0].ispFieldVo != null |
| | | || $scope.vm.form.issueIspFields != null && $scope.vm.form.issueIspFields.length > 0 ){ |
| | | |
| | | var ispField = $scope.vm.form.issueIspFields[0]; |
| | | if (ispField.name !== $scope.vm.ispName) { //사용자가 직접 ISP 추가 할 경우 |
| | | return issueIspFields; |
| | | } |
| | | |
| | | issueIspFields.push({ |
| | | ispId : $scope.vm.ispId, |
| | |
| | | && $scope.vm.form.issueCompanyFields[0].hostingFieldVo != null |
| | | || $scope.vm.form.issueHostingFields != null && $scope.vm.form.issueHostingFields.length > 0 ){ |
| | | |
| | | var hostingField = $scope.vm.form.issueHostingFields[0]; |
| | | if (hostingField.name !== $scope.vm.hostingName) { //사용자가 직접 호스팅 추가 할 경우 |
| | | return issueHostingFields; |
| | | } |
| | | |
| | | issueHostingFields.push({ |
| | | hostingId : $scope.vm.hostingId, |
| | | name : $scope.vm.hostingName, |
| | |
| | | parentId : (function () { // 업종(대분류) |
| | | var parentId = ""; |
| | | if (parentSector != null && parentSector !== "") { |
| | | parentId = parentSector[0].id; |
| | | parentId = parentSector; |
| | | }else { |
| | | parentId = parentSectorId; |
| | | } |
| | |
| | | ng-model="vm.form.childSector" |
| | | custom-input="false" |
| | | search="vm.form.childSector" |
| | | source="fn.getCompanyChildSector(vm.form.parentSectors, vm.form.parentSectorId, vm.typeCategory.childSector, vm.form.childSector, vm.form.childSectors, vm.autoCompletePage.childSector.page, fn.getChildSectorListCallBack)" |
| | | source="fn.getCompanyChildSector(vm.form.parentSectorId, vm.form.parentSectors[0].id, vm.typeCategory.childSector, vm.form.childSector, vm.form.childSectors, vm.autoCompletePage.childSector.page, fn.getChildSectorListCallBack)" |
| | | page="vm.autoCompletePage.childSector.page" |
| | | total-page="vm.autoCompletePage.childSector.totalPage" |
| | | input-disabled="false" |
| | |
| | | page="vm.autoCompletePage.companyType.page" |
| | | total-page="vm.autoCompletePage.companyType.totalPage" |
| | | input-disabled="false" |
| | | broad-cast="companyTypeEvent" |
| | | translation-texts="{ empty : 'common.emptyCompanyType' }" |
| | | extra-settings="{ displayProp : 'useValue' , idProp : 'id', imageable : false, imagePathProp : '', |
| | | type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single> |
| | |
| | | page="vm.autoCompletePage.parentSector.page" |
| | | total-page="vm.autoCompletePage.parentSector.totalPage" |
| | | input-disabled="false" |
| | | broad-cast="parentSectorEvent" |
| | | translation-texts="{ empty : 'common.emptyParentSector' }" |
| | | extra-settings="{ displayProp : 'useValue' , idProp : 'id', imageable : false, imagePathProp : '', |
| | | type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single> |
| | |
| | | page="vm.autoCompletePage.childSector.page" |
| | | total-page="vm.autoCompletePage.childSector.totalPage" |
| | | input-disabled="false" |
| | | broad-cast="childSectorEvent" |
| | | translation-texts="{ empty : 'common.emptyChildSector' }" |
| | | extra-settings="{ displayProp : 'useValue' , idProp : 'id', imageable : false, imagePathProp : '', |
| | | type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single> |
| | |
| | | page="vm.autoCompletePage.region.page" |
| | | total-page="vm.autoCompletePage.region.totalPage" |
| | | input-disabled="false" |
| | | broad-cast="regionEvent" |
| | | translation-texts="{ empty : 'common.emptyRegion' }" |
| | | extra-settings="{ displayProp : 'useValue' , idProp : 'id', imageable : false, imagePathProp : '', |
| | | type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single> |
| | |
| | | page="vm.autoCompletePage.status.page" |
| | | total-page="vm.autoCompletePage.status.totalPage" |
| | | input-disabled="false" |
| | | broad-cast="statusEvent" |
| | | translation-texts="{ empty : 'common.emptyStatus' }" |
| | | extra-settings="{ displayProp : 'useValue' , idProp : 'id', imageable : false, imagePathProp : '', |
| | | type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single> |