하석형 하석형 04-28
250428 하석형 try catch Exception throw 구문 수정
@6ce39126c9e35c690d751f79b86a11dfb86f0bed
src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
--- src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
+++ src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
@@ -334,8 +334,6 @@
             return result;
         } catch (DataAccessException dae){
             throw dae;
-        } catch (RuntimeException re){
-            throw re;
         } catch (Exception e) {
             throw e;
         }
src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
--- src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
+++ src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
@@ -101,7 +101,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -131,7 +131,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -157,7 +157,7 @@
         } catch(DataAccessException dae) {
             throw dae;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -181,7 +181,7 @@
         } catch(DataAccessException dae) {
             throw dae;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
     /************************************** Hierachy 전용 **************************************/
@@ -217,7 +217,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -264,7 +264,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -273,7 +273,6 @@
      * @return int - 부서 정보 삭제 결과
      * @throws CustomDeleteFailException - 삭제 실패 예외 발생 시
      * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
-     * @throws NullPointerException - Null 값이 발생할 경우
      * @throws Exception - 그 외 예외 발생 시
      *
      * 부서 정보 삭제
@@ -281,22 +280,28 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int deptDelete(DeptVO deptVO) {
-        int delResult = 0; // 부서 삭제 결과
-        delResult = deptDAO.deleteDept(deptVO.getDeptId());
-        if (delResult == 0) {
-            throw new CustomDeleteFailException("부서 삭제 실패");
-        }
-
-        int deptMberCnt = deptDAO.countDeptInDeptMbr(deptVO.getDeptId()); // 부서에 등록된 사용자 수 조회
-        // 사용자가 있다면 부서 사용자 삭제 진행
-        if(deptMberCnt > 0) {
-            int deleteDeptAuth = 0; // 부서 사용자 삭제 결과
-            deleteDeptAuth = deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId());
-            if (deleteDeptAuth == 0) {
-                throw new CustomDeleteFailException("부서 사용자 삭제 실패");
+        try {
+            int delResult = 0; // 부서 삭제 결과
+            delResult = deptDAO.deleteDept(deptVO.getDeptId());
+            if (delResult == 0) {
+                throw new CustomDeleteFailException("부서 삭제 실패");
             }
+
+            int deptMberCnt = deptDAO.countDeptInDeptMbr(deptVO.getDeptId()); // 부서에 등록된 사용자 수 조회
+            // 사용자가 있다면 부서 사용자 삭제 진행
+            if (deptMberCnt > 0) {
+                int deleteDeptAuth = 0; // 부서 사용자 삭제 결과
+                deleteDeptAuth = deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId());
+                if (deleteDeptAuth == 0) {
+                    throw new CustomDeleteFailException("부서 사용자 삭제 실패");
+                }
+            }
+            return delResult;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
         }
-        return delResult;
     }
 
     /**
@@ -304,7 +309,6 @@
      * @return int - 부서 사용자 정보 삭제 결과
      * @throws CustomDeleteFailException - 삭제 실패 예외 발생 시
      * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
-     * @throws NullPointerException - Null 값이 발생할 경우
      * @throws Exception - 그 외 예외 발생 시
      *
      * 부서 사용자 삭제
@@ -312,21 +316,27 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int deptMbrDelete(List<DeptMbrVO> deptMbrList) {
-        int result = 0; // 부서 사용자 삭제 결과
-        if(deptMbrList.size() == 0) return 0;
+        try {
+            int result = 0; // 부서 사용자 삭제 결과
+            if (deptMbrList.size() == 0) return 0;
 
-        for(DeptMbrVO vo : deptMbrList) {
-            Map<String, String> param = new HashMap<String, String>();
-            param.put("mbrId", vo.getMbrId());
-            if(deptDAO.findByDeptMber(param).size() > 0) {
-                int delMbrResult = deptDAO.deleteDeptMbr(param); // 부서 사용자 삭제
-                if (delMbrResult == 0) {
-                    throw new CustomDeleteFailException("부서 사용자 삭제 실패");
+            for (DeptMbrVO vo : deptMbrList) {
+                Map<String, String> param = new HashMap<String, String>();
+                param.put("mbrId", vo.getMbrId());
+                if (deptDAO.findByDeptMber(param).size() > 0) {
+                    int delMbrResult = deptDAO.deleteDeptMbr(param); // 부서 사용자 삭제
+                    if (delMbrResult == 0) {
+                        throw new CustomDeleteFailException("부서 사용자 삭제 실패");
+                    }
+                    result += delMbrResult;
                 }
-                result += delMbrResult;
             }
+            return result;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
         }
-        return result;
     }
 
     /**
@@ -368,7 +378,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -420,7 +430,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
     /**
@@ -471,7 +481,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 }
(파일 끝에 줄바꿈 문자 없음)
src/main/java/com/takensoft/cms/menu/vo/MenuDgstfnVO.java
--- src/main/java/com/takensoft/cms/menu/vo/MenuDgstfnVO.java
+++ src/main/java/com/takensoft/cms/menu/vo/MenuDgstfnVO.java
@@ -32,6 +32,7 @@
     private String regDt; // 등록일
 
     private String menuNm; // 메뉴 명
+    private String rspnsTotCnt; // 응답 총 개수
     private String rspnsFiveCnt; // 응답 5 개수
     private String rspnsFourCnt; // 응답 4 개수
     private String rspnsThreeCnt; // 응답 3 개수
@@ -51,6 +52,7 @@
             int totalScore = (five * 5) + (four * 4) + (three * 3) + (two * 2) + (one * 1);
             int totalCount = one + two + three + four + five;
 
+            this.rspnsTotCnt = String.valueOf(totalCount);
             this.avrgRspnsScore = totalCount == 0 ? "0.00" : String.format("%.2f", (double) totalScore / totalCount);
         } catch (Exception e) {
             this.avrgRspnsScore = "0.00";
src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
--- src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
+++ src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
@@ -97,7 +97,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -253,7 +253,7 @@
         } catch (NullPointerException ne) {
             throw ne;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
@@ -294,7 +294,7 @@
         } catch (DataAccessException dae) {
             throw dae;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            throw e;
         }
     }
 
src/main/java/com/takensoft/common/config/SecurityConfig.java
--- src/main/java/com/takensoft/common/config/SecurityConfig.java
+++ src/main/java/com/takensoft/common/config/SecurityConfig.java
@@ -166,9 +166,8 @@
         );
 
         http.authorizeHttpRequests((auth) -> auth
-                .requestMatchers("/", "/mbr/**", "/company/**", "/refresh/**", "/sys/**").permitAll() // 회원관련, 시스템 제공 관련, 기업용페이지는 누구나 접근 가능
+                .requestMatchers("/", "/mbr/**", "/refresh/**", "/sys/**", "/editFileUpload/**", "/fileUpload/**").permitAll() // 회원, 토큰, 시스템 제공, 파일 접근 모두 허용
                 .requestMatchers("/admin/**").hasRole("ADMIN") // 관리자 페이지는 ADMIN 권한을 가진 사용자만 접근 가능
-                .requestMatchers("/editFileUpload/**", "/fileUpload/**").permitAll() // 에디터 파일 업로드
                 .anyRequest().authenticated() // 그 외에는 로그인한 사용자만 접근 가능
 //                .anyRequest().permitAll() // 모든 사용자 접근 가능
         );
src/main/java/com/takensoft/common/filter/AccesFilter.java
--- src/main/java/com/takensoft/common/filter/AccesFilter.java
+++ src/main/java/com/takensoft/common/filter/AccesFilter.java
@@ -8,6 +8,7 @@
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.util.AntPathMatcher;
 import org.springframework.web.filter.OncePerRequestFilter;
 
 import jakarta.servlet.FilterChain;
@@ -64,9 +65,15 @@
             List<AccesCtrlVO> accesCtrlList = accesCtrlService.findAllAccesCtrlSecurity(ipAdrs);
 
             // 접근 제어 정보가 없거나 접근 제어가 허용된 경우 다음 필터로 이동
-            if(accesCtrlList.isEmpty() || isAccesCntrl(accesCtrlList, request)) {
-                filterChain.doFilter(request, response);
-                return;
+            if(accesCtrlList.isEmpty()) {
+                // 대역대 확인
+                String bandIp = ipAdrs.replaceAll("\\.\\d+$", ".*");
+                accesCtrlList = accesCtrlService.findAllAccesCtrlSecurity(bandIp);
+                if(accesCtrlList.isEmpty() || isAccesCntrl(accesCtrlList, request)) {
+
+                    filterChain.doFilter(request, response);
+                    return;
+                }
             }
             // 접근 제어가 제한된 경우 에러 발생
             ErrorResponse errorResponse = new ErrorResponse();
Add a comment
List