OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-01-27 7cc3dc11ec3a48635b75040ca1117befe8c47f3c
업체 url 필수값 제거
2개 파일 변경됨
44 ■■■■ 파일 변경됨
src/main/java/kr/wisestone/owl/service/impl/CompanyFieldServiceImpl.java 41 ●●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/webapp/views/companyField/companyFieldAdd.html 3 ●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/java/kr/wisestone/owl/service/impl/CompanyFieldServiceImpl.java
@@ -83,8 +83,11 @@
    public CompanyField addCompany(CompanyFieldForm companyFieldForm) {
        //  업체명 중복 체크
        this.verifyTitle(companyFieldForm.getName(), null);
        //  url 유효성 체크
        this.verifyUrl(companyFieldForm.getUrl(), null);
        if (companyFieldForm.getUrl() != null) {
            //  url 유효성 체크
            this.verifyUrl(companyFieldForm.getUrl(), null);
        }
        if (companyFieldForm.getTelList() != null && companyFieldForm.getTelList().size() > 0) {
            String tels = companyFieldForm.getTelList().toString();
@@ -109,12 +112,11 @@
    //  url 유효성 체크
    private void verifyUrl(String url, Long id) {
        if (StringUtils.isEmpty(url)) {
        /*if (StringUtils.isEmpty(url)) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.COMPANY_NOT_URL));
        }
        }*/
        CompanyField companyField;
        if(id == null){
            companyField = this.companyFieldRepository.findByUrl(url);
        } else {
@@ -222,8 +224,11 @@
    public void modifyCompany(CompanyFieldForm companyFieldForm) {
        //  업체명 유효성 체크
        this.verifyTitle(companyFieldForm.getName(), companyFieldForm.getId());
        //  url 유효성 체크
        this.verifyUrl(companyFieldForm.getUrl(), companyFieldForm.getId());
        if (companyFieldForm.getUrl() != null) {
            //  url 유효성 체크
            this.verifyUrl(companyFieldForm.getUrl(), companyFieldForm.getId());
        }
        if (companyFieldForm.getTelList() != null && companyFieldForm.getTelList().size() > 0) {
            String tels = companyFieldForm.getTelList().toString();
@@ -466,7 +471,9 @@
                case 1:
                    //  url
                    this.setCompanyFormUrl(cell, companyFieldForm, rowIndex);
                    if (cellNullCheck(cell)) {
                        this.setCompanyFormUrl(cell, companyFieldForm, rowIndex);
                    }
                    break;
                case 2:
@@ -687,17 +694,15 @@
    }
    private void setCompanyFormUrl(Cell cell, CompanyFieldForm companyFieldForm, int rowIndex) {
        if (cell == null) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_URL_IS_NULL, rowIndex));
        }
        String url = CommonUtil.convertExcelStringToCell(cell);
        if (url.contains(" ")) {
            url = url.replace(" ", "");
        }
        this.verifyUrl(url, null); //url 유효성 검사
        if (cell != null) {
            String url = CommonUtil.convertExcelStringToCell(cell);
            if (url.contains(" ")) {
                url = url.replace(" ", "");
            }
            this.verifyUrl(url, null); //url 유효성 검사
        companyFieldForm.setUrl(url);
            companyFieldForm.setUrl(url);
        }
    }
    //  업체명 유효성 체크
src/main/webapp/views/companyField/companyFieldAdd.html
@@ -33,7 +33,6 @@
            <div class="form-group">
                <label for="companyFieldAddForm10" class="issue-label">
                    <span translate="companyField.url">url</span>
                    <code class="highlighter-rouge">*</code>
                </label>
                <input id="companyFieldAddForm10"
                       name="url"
@@ -45,7 +44,7 @@
                       ng-maxlength="200"
                       maxlength="200"
                       ng-pattern="/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/"
                       required>
                       >
                <div ng-show="companyFieldAddForm.url.$error.pattern" class="help-block form-text text-danger"
                     translate="common.invalidUrlFormat">url 형식이 맞지 않습니다.
                </div>