OWL ITS + 탐지시스템(인터넷 진흥원)
- 이슈 엑셀 임포트시에 isp 검색한 데이터 가져오도록 수정 및 기간 미입력 시에도 추가 되도록 수정
2개 파일 변경됨
81 ■■■■■ 파일 변경됨
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java 73 ●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/java/kr/wisestone/owl/vo/IssueVo.java 8 ●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -16,10 +16,7 @@
import kr.wisestone.owl.mapper.IssueMapper;
import kr.wisestone.owl.mapper.IssueRelationMapper;
import kr.wisestone.owl.mapper.ProjectMapper;
import kr.wisestone.owl.repository.IssueRelationRepository;
import kr.wisestone.owl.repository.IssueRepository;
import kr.wisestone.owl.repository.UserDepartmentRepository;
import kr.wisestone.owl.repository.WorkflowDepartmentRepository;
import kr.wisestone.owl.repository.*;
import kr.wisestone.owl.service.*;
import kr.wisestone.owl.util.*;
import kr.wisestone.owl.util.DateUtil;
@@ -181,6 +178,15 @@
    private IssueMapper issueMapper;
    @Autowired
    private IssueCompanyRepository issueCompanyRepository;
    @Autowired
    private IssueIspRepository issueIspRepository;
    @Autowired
    private IssueHostingRepository issueHostingRepository;
    @Autowired
    private ExcelConditionCheck excelConditionCheck;
    @Autowired
@@ -328,9 +334,8 @@
            List<Map<String, Object>> issueHostingFields = Lists.newArrayList();
            for (Map<String, Object> issueCustomField : issueForm.getIssueCustomFields()) {
                int customFieldId = (Integer) issueCustomField.get("customFieldId");
                Long customId = (long) customFieldId;
                CustomField customField = this.customFieldService.getCustomField(customId);
                Long customFieldId = MapUtil.getLong(issueCustomField, "customFieldId");
                CustomField customField = this.customFieldService.getCustomField(customFieldId);
                if(customField != null && customField.getCustomFieldType().toString().equals("SITE") && customField.getName().equals("도메인")) {
                    String useValue = issueCustomField.get("useValue").toString();
                    if(companyFields != null && companyFields.size() > 0) {
@@ -1543,13 +1548,18 @@
    // 하위 이슈 정보를 셋팅한다
    private void setDownIssues(Issue issue, IssueVo issueVo) {
        //List<Issue> downIssues = this.issueRepository.findByParentIssueId(issue.getId());
        int startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize());
        Pageable pageable = PageRequest.of(startPage, issueVo.getDownPageSize());
        Page<Issue> downIssues = this.issueRepository.findByParentIssueId(issue.getId(), pageable);
        issueVo.setDownTotalPage(downIssues.getTotalPages());
        issueVo.setDownTotalCount(downIssues.getTotalElements());
        Page<Issue> downIssues = null;
        List<Issue> downIssueList = this.issueRepository.findByParentIssueId(issue.getId());
        if(downIssueList != null && downIssueList.size() > 0) {
            int startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize());
            Pageable pageable = PageRequest.of(startPage, issueVo.getDownPageSize());
            downIssues = this.issueRepository.findByParentIssueId(issue.getId(), pageable);
        }
        if(downIssues != null){
            issueVo.setDownTotalPage(downIssues.getTotalPages());
            issueVo.setDownTotalCount(downIssues.getTotalElements());
            List<IssueVo> resultList = new ArrayList<>();
            for(Issue downIssue : downIssues){
                IssueVo downIssueVo = ConvertUtil.copyProperties(downIssue, IssueVo.class);
@@ -1650,14 +1660,14 @@
    // 연관 이슈 정보를 셋팅한다
    private void setRelationIssue(Issue issue, IssueVo issueVo) {
        //Set<IssueRelation> issueRelations = issue.getIssueRelations();
        List<Map<String, Object>> results = this.issueRelationMapper.findByIssueId(issueVo);
        Long totalCount = this.issueRelationMapper.count(issueVo);
        int totalPage = (int) Math.ceil((totalCount - 1) / issueVo.getRelPageSize()) + 1;
        issueVo.setRelTotalPage(totalPage);
        issueVo.setRelTotalCount(totalCount);
        if (issue != null && issueVo != null && results.size() > 0) {
            int totalPage = (int) Math.ceil((totalCount - 1) / issueVo.getRelPageSize()) + 1;
            issueVo.setRelTotalPage(totalPage);
            issueVo.setRelTotalCount(totalCount);
            for (Map<String, Object> result : results) {
                IssueRelationVo issueRelationVo = ConvertUtil.convertMapToClass(result, IssueRelationVo.class);
                Issue relationIssue = this.findOne(issueRelationVo.getId());
@@ -3089,8 +3099,6 @@
            this.bulkInsertIssueCustomFieldValue(issueForms, issueTypeCustomFieldMaps);
            //  3.628 - 3.445
            // 업체,ISP,호스팅 추가
            /*serviceStart.stop();
            log.debug("2차 저장 시간 : " + serviceStart.getTime());*/
@@ -3202,6 +3210,29 @@
                issueCustomField.put("registerId", this.webAppUtil.getLoginId());
                issueCustomFieldValueMaps.add(issueCustomField);
            }
            IssueForm partners = this.findCompanyField(issueForm); // 같은 도메인 업체 찾기
            Issue issue = this.findOne(issueForm.getId());
            if (partners.getIssueCompanyFields() != null && partners.getIssueCompanyFields().size() > 0) {
                for (Map<String, Object> company : partners.getIssueCompanyFields()) {
                    IssueCompany issueCompany = ConvertUtil.convertMapToClass(company, IssueCompany.class);
                    issueCompany.setIssue(issue);
                    this.issueCompanyRepository.saveAndFlush(issueCompany);
                }
            }
            if (partners.getIssueIspFields() != null && partners.getIssueIspFields().size() > 0) {
                for (Map<String, Object> isp : partners.getIssueIspFields()) {
                    IssueIsp issueIsp = ConvertUtil.convertMapToClass(isp, IssueIsp.class);
                    issueIsp.setIssue(issue);
                    this.issueIspRepository.saveAndFlush(issueIsp);
                }
            }
            if (partners.getIssueHostingFields() != null && partners.getIssueHostingFields().size() > 0) {
                for (Map<String, Object> hosting : partners.getIssueHostingFields()) {
                    IssueHosting issueHosting = ConvertUtil.convertMapToClass(hosting, IssueHosting.class);
                    issueHosting.setIssue(issue);
                    this.issueHostingRepository.saveAndFlush(issueHosting);
                }
            }
        }
        if (issueCustomFieldValueMaps.size() > 0) {
@@ -3282,13 +3313,13 @@
                    break;*/
                case 4:
                    //  시작일을 IssueForm 에 저장한다.
                    if (cell != null) {
                    if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
                        this.setIssueFormPeriod(cell, issueForm, true, rowIndex);
                    }
                    break;
                case 5:
                    //  종료일을 IssueForm 에 저장한다.
                    if (cell != null) {
                    if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
                        this.setIssueFormPeriod(cell, issueForm, false, rowIndex);
                    }
                    break;
src/main/java/kr/wisestone/owl/vo/IssueVo.java
@@ -74,14 +74,14 @@
    private int relPage;
    private int relPageNumber;
    private int relPageSize;
    private int relTotalPage;
    private Long relTotalCount;
    private int relTotalPage = 1;
    private Long relTotalCount = 0L;
    private int downPage;
    private int downPageNumber;
    private int downPageSize;
    private int downTotalPage;
    private Long downTotalCount;
    private int downTotalPage = 1;
    private Long downTotalCount = 0L;
    public IssueVo(){}