
--- src/main/java/com/takensoft/cms/bbs/dao/BbsMngDAO.java
+++ src/main/java/com/takensoft/cms/bbs/dao/BbsMngDAO.java
... | ... | @@ -124,5 +124,5 @@ |
124 | 124 |
* @since 2024.07.18 |
125 | 125 |
* 게시판 관리 목록 조회 개수 (접속 통계용) |
126 | 126 |
*/ |
127 |
- public int findAllCntNotPagination() throws Exception; |
|
127 |
+ public int findAllCntNotPagination(); |
|
128 | 128 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/cntnStats/dao/CntnStatsDAO.java
+++ src/main/java/com/takensoft/cms/cntnStats/dao/CntnStatsDAO.java
... | ... | @@ -10,6 +10,12 @@ |
10 | 10 |
/** |
11 | 11 |
* @author : takensoft |
12 | 12 |
* @since : 2024.05.23 |
13 |
+ * @modification |
|
14 |
+ * since | author | description |
|
15 |
+ * 2024.05.23 | takensoft | 최초 등록 |
|
16 |
+ * 2024.05.29 | takensoft | selectUserCntnStats, selectUserCntnStatsCnt 추가 |
|
17 |
+ * 2024.05.30 | takensoft | selectMenuCntnStats, selectMenuCntnStatsCnt, selectBbsCntnStats, selectBbsCntnStatsCnt 추가 |
|
18 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
13 | 19 |
* |
14 | 20 |
* 접속통계 관련 Mapper |
15 | 21 |
*/ |
... | ... | @@ -17,130 +23,146 @@ |
17 | 23 |
public interface CntnStatsDAO { |
18 | 24 |
|
19 | 25 |
/** |
20 |
- * @author takensoft |
|
21 |
- * @since 2024.05.23 |
|
26 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
27 |
+ * @return boolean - 사용자 접속 통계 등록 검증 |
|
28 |
+ * |
|
22 | 29 |
* 사용자 접속 통계 등록 검증 |
23 | 30 |
*/ |
24 | 31 |
boolean userCntnStatsSaveChck(CntnStatsVO cntnStatsVO); |
25 | 32 |
|
26 | 33 |
/** |
27 |
- * @author takensoft |
|
28 |
- * @since 2024.05.23 |
|
34 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
35 |
+ * @return int - 사용자 접속 통계 등록 결과 |
|
36 |
+ * |
|
29 | 37 |
* 사용자 접속 통계 등록 |
30 | 38 |
*/ |
31 | 39 |
int userCntnStatsSave(CntnStatsVO cntnStatsVO); |
32 | 40 |
|
33 | 41 |
/** |
34 |
- * @author takensoft |
|
35 |
- * @since 2024.05.23 |
|
42 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
43 |
+ * @return int - 사용자 접속 통계 수정 결과 |
|
44 |
+ * |
|
36 | 45 |
* 사용자 접속 통계 수정 |
37 | 46 |
*/ |
38 | 47 |
int userCntnStatsUpdate(CntnStatsVO cntnStatsVO); |
39 | 48 |
|
40 | 49 |
/** |
41 |
- * @author takensoft |
|
42 |
- * @since 2024.05.23 |
|
50 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
51 |
+ * @return boolean - 컨텐츠 접속 통계 등록 검증 |
|
52 |
+ * |
|
43 | 53 |
* 컨텐츠 접속 통계 등록 검증 |
44 | 54 |
*/ |
45 | 55 |
boolean contsCntnStatsSaveChck(CntnStatsVO cntnStatsVO); |
46 | 56 |
|
47 | 57 |
/** |
48 |
- * @author takensoft |
|
49 |
- * @since 2024.05.23 |
|
58 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
59 |
+ * @return int - 컨텐츠 접속 통계 등록 결과 |
|
60 |
+ * |
|
50 | 61 |
* 컨텐츠 접속 통계 등록 |
51 | 62 |
*/ |
52 | 63 |
int contsCntnStatsSave(CntnStatsVO cntnStatsVO); |
53 | 64 |
|
54 | 65 |
/** |
55 |
- * @author takensoft |
|
56 |
- * @since 2024.05.23 |
|
66 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
67 |
+ * @return int - 컨텐츠 접속 통계 수정 결과 |
|
68 |
+ * |
|
57 | 69 |
* 컨텐츠 접속 통계 수정 |
58 | 70 |
*/ |
59 | 71 |
int contsCntnStatsUpdate(CntnStatsVO cntnStatsVO); |
60 | 72 |
|
61 | 73 |
/** |
62 |
- * @author takensoft |
|
63 |
- * @since 2024.05.23 |
|
74 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
75 |
+ * @return boolean - 게시판 접속 통계 등록 검증 |
|
76 |
+ * |
|
64 | 77 |
* 게시판 접속 통계 등록 검증 |
65 | 78 |
*/ |
66 | 79 |
boolean bbsCntnStatsSaveChck(CntnStatsVO cntnStatsVO); |
80 |
+ |
|
67 | 81 |
/** |
68 |
- * @author takensoft |
|
69 |
- * @since 2024.05.23 |
|
82 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
83 |
+ * @return int - 게시판 접속 통계 등록 결과 |
|
84 |
+ * |
|
70 | 85 |
* 게시판 접속 통계 등록 |
71 | 86 |
*/ |
72 | 87 |
int bbsCntnStatsSave(CntnStatsVO cntnStatsVO); |
88 |
+ |
|
73 | 89 |
/** |
74 |
- * @author takensoft |
|
75 |
- * @since 2024.05.23 |
|
90 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
91 |
+ * @return int - 컨텐츠 접속 통계 수정 결과 |
|
92 |
+ * |
|
76 | 93 |
* 컨텐츠 접속 통계 수정 |
77 | 94 |
*/ |
78 | 95 |
int bbsCntnStatsUpdate(CntnStatsVO cntnStatsVO); |
79 | 96 |
|
80 | 97 |
/** |
81 |
- * @author takensoft |
|
82 |
- * @since 2024.05.23 |
|
98 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
99 |
+ * @return boolean - 메뉴 접속 통계 등록 검증 |
|
100 |
+ * |
|
83 | 101 |
* 메뉴 접속 통계 등록 검증 |
84 | 102 |
*/ |
85 | 103 |
boolean menuCntnStatsSaveChck(CntnStatsVO cntnStatsVO); |
104 |
+ |
|
86 | 105 |
/** |
87 |
- * @author takensoft |
|
88 |
- * @since 2024.05.23 |
|
106 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
107 |
+ * @return boolean - 메뉴 접속 통계 등록 |
|
108 |
+ * |
|
89 | 109 |
* 메뉴 접속 통계 등록 |
90 | 110 |
*/ |
91 | 111 |
int menuCntnStatsSave(CntnStatsVO cntnStatsVO); |
112 |
+ |
|
92 | 113 |
/** |
93 |
- * @author takensoft |
|
94 |
- * @since 2024.05.23 |
|
114 |
+ * @param cntnStatsVO - 사용자 접속 통계 VO |
|
115 |
+ * @return boolean - 메뉴 접속 통계 수정 결과 |
|
116 |
+ * |
|
95 | 117 |
* 메뉴 접속 통계 수정 |
96 | 118 |
*/ |
97 | 119 |
int menuCntnStatsUpdate(CntnStatsVO cntnStatsVO); |
98 | 120 |
|
99 | 121 |
/** |
100 |
- * @author 박정하 |
|
101 |
- * @since 2024.05.29 |
|
122 |
+ * @param params - 사용자 접속 통계 조회 조건 |
|
123 |
+ * @return List<HashMap<String, Object>> - 사용자 접속 통계 목록 |
|
102 | 124 |
* |
103 | 125 |
* 사용자 접속 통계 |
104 | 126 |
*/ |
105 |
- public List<HashMap<String, Object>> selectUserCntnStats(HashMap<String, Object> params) throws Exception; |
|
127 |
+ List<HashMap<String, Object>> selectUserCntnStats(HashMap<String, Object> params); |
|
106 | 128 |
|
107 | 129 |
/** |
108 |
- * @author 박정하 |
|
109 |
- * @since 2024.05.29 |
|
130 |
+ * @param params - 사용자 접속 통계 조회 조건 |
|
131 |
+ * @return int - 사용자 접속 통계 총 개수 |
|
110 | 132 |
* |
111 | 133 |
* 사용자 접속 통계 총 개수 |
112 | 134 |
*/ |
113 |
- public int selectUserCntnStatsCnt(HashMap<String, Object> params) throws Exception; |
|
135 |
+ int selectUserCntnStatsCnt(HashMap<String, Object> params); |
|
114 | 136 |
|
115 | 137 |
/** |
116 |
- * @author 박정하 |
|
117 |
- * @since 2024.05.30 |
|
138 |
+ * @param params - 메뉴별 접속 통계 조회 조건 |
|
139 |
+ * @return List<HashMap<String, Object>> - 메뉴별 접속 통계 |
|
118 | 140 |
* |
119 | 141 |
* 메뉴별 접속 통계 |
120 | 142 |
*/ |
121 |
- public List<HashMap<String, Object>> selectMenuCntnStats(HashMap<String, Object> params) throws Exception; |
|
143 |
+ List<HashMap<String, Object>> selectMenuCntnStats(HashMap<String, Object> params); |
|
122 | 144 |
|
123 | 145 |
/** |
124 |
- * @author 박정하 |
|
125 |
- * @since 2024.05.30 |
|
146 |
+ * @param params - 메뉴별 접속 통계 조회 조건 |
|
147 |
+ * @return int - 메뉴별 접속 통계 총 개수 |
|
126 | 148 |
* |
127 | 149 |
* 메뉴별 접속 통계 총 개수 |
128 | 150 |
*/ |
129 |
- public int selectMenuCntnStatsCnt(HashMap<String, Object> params) throws Exception; |
|
151 |
+ int selectMenuCntnStatsCnt(HashMap<String, Object> params); |
|
130 | 152 |
|
131 | 153 |
/** |
132 |
- * @author 박정하 |
|
133 |
- * @since 2024.05.30 |
|
154 |
+ * @param params - 게시판 접속 통계 조회 조건 |
|
155 |
+ * @return List<HashMap<String, Object>> - 게시판 접속 통계 |
|
134 | 156 |
* |
135 | 157 |
* 게시판 접속 통계 |
136 | 158 |
*/ |
137 |
- public List<HashMap<String, Object>> selectBbsCntnStats(HashMap<String, Object> params) throws Exception; |
|
159 |
+ List<HashMap<String, Object>> selectBbsCntnStats(HashMap<String, Object> params); |
|
138 | 160 |
|
139 | 161 |
/** |
140 |
- * @author 박정하 |
|
141 |
- * @since 2024.05.30 |
|
162 |
+ * @param params - 게시판 접속 통계 조회 조건 |
|
163 |
+ * @return int - 게시판 접속 통계 총 개수 |
|
142 | 164 |
* |
143 | 165 |
* 게시판 접속 통계 총 개수 |
144 | 166 |
*/ |
145 |
- public int selectBbsCntnStatsCnt(HashMap<String, Object> params) throws Exception; |
|
167 |
+ int selectBbsCntnStatsCnt(HashMap<String, Object> params); |
|
146 | 168 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/cntnStats/dto/CntnStatsDTO.java
+++ src/main/java/com/takensoft/cms/cntnStats/dto/CntnStatsDTO.java
... | ... | @@ -8,6 +8,10 @@ |
8 | 8 |
/** |
9 | 9 |
* @author : takensoft |
10 | 10 |
* @since : 2024.05.23 |
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.05.23 | takensoft | 최초 등록 |
|
14 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
11 | 15 |
* |
12 | 16 |
* 접속 통계 관련 DTO |
13 | 17 |
*/ |
... | ... | @@ -18,13 +22,7 @@ |
18 | 22 |
@Builder |
19 | 23 |
@ToString |
20 | 24 |
public class CntnStatsDTO { |
21 |
- /** |
|
22 |
- * 타입 아이디 |
|
23 |
- */ |
|
24 |
- private String typeId; |
|
25 |
- /** |
|
26 |
- * 권한 목록 |
|
27 |
- */ |
|
25 |
+ private String typeId; // 타입 아이디 |
|
28 | 26 |
@Builder.Default |
29 |
- private List<String> mbrAuthList = new ArrayList<String>(); |
|
27 |
+ private List<String> mbrAuthList = new ArrayList<String>(); // 권한 목록 |
|
30 | 28 |
} |
--- src/main/java/com/takensoft/cms/cntnStats/dto/CntnStatsExcelDTO.java
+++ src/main/java/com/takensoft/cms/cntnStats/dto/CntnStatsExcelDTO.java
... | ... | @@ -7,6 +7,16 @@ |
7 | 7 |
import lombok.NoArgsConstructor; |
8 | 8 |
import lombok.Setter; |
9 | 9 |
import javax.persistence.*; |
10 |
+/** |
|
11 |
+ * @author : takensoft |
|
12 |
+ * @since : 2024.05.23 |
|
13 |
+ * @modification |
|
14 |
+ * since | author | description |
|
15 |
+ * 2024.05.23 | takensoft | 최초 등록 |
|
16 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
17 |
+ * |
|
18 |
+ * 게시판 계정별 접속 통계 DTO |
|
19 |
+ */ |
|
10 | 20 |
|
11 | 21 |
@Entity |
12 | 22 |
@Getter |
--- src/main/java/com/takensoft/cms/cntnStats/service/CntnStatsService.java
+++ src/main/java/com/takensoft/cms/cntnStats/service/CntnStatsService.java
... | ... | @@ -8,42 +8,49 @@ |
8 | 8 |
import java.util.Map; |
9 | 9 |
|
10 | 10 |
/** |
11 |
- * @author : takensoft |
|
12 |
- * @since : 2024.05.23 |
|
11 |
+ * @author takensoft |
|
12 |
+ * @since 2024.05.23 |
|
13 |
+ * @modification |
|
14 |
+ * since | author | description |
|
15 |
+ * 2024.05.23 | takensoft | 최초 등록 |
|
16 |
+ * 2024.05.29 | 박정하 | userCntnStatsSelect 추가 |
|
17 |
+ * 2024.05.30 | 박정하 | menuCntnStatsSelect, bbsCntnStatsSelect 추가 |
|
18 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
13 | 19 |
* |
14 | 20 |
* 접속통계 관련 인터페이스 |
15 | 21 |
*/ |
16 | 22 |
public interface CntnStatsService { |
17 | 23 |
|
18 | 24 |
/** |
19 |
- * @author : takensoft |
|
20 |
- * @since : 2024.05.23 |
|
25 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
26 |
+ * @return int - 접속 통계 등록 결과 |
|
21 | 27 |
* |
22 | 28 |
* 접속 통계 등록 |
23 | 29 |
*/ |
24 |
- public int cntnStatsSave(CntnStatsDTO cntnStatsDTO) throws Exception; |
|
30 |
+ int cntnStatsSave(CntnStatsDTO cntnStatsDTO); |
|
25 | 31 |
|
26 | 32 |
/** |
27 |
- * @author 박정하 |
|
28 |
- * @since 2024.05.29 |
|
33 |
+ * @param params - 통계 조회 조건 |
|
34 |
+ * @return HashMap<String, Object> - 사용자 접속 통계 결과 |
|
29 | 35 |
* |
30 | 36 |
* 사용자 접속 통계 |
37 |
+ * |
|
31 | 38 |
*/ |
32 |
- public HashMap<String, Object> userCntnStatsSelect(HashMap<String, Object> params) throws Exception; |
|
39 |
+ HashMap<String, Object> userCntnStatsSelect(HashMap<String, Object> params); |
|
33 | 40 |
|
34 | 41 |
/** |
35 |
- * @author 박정하 |
|
36 |
- * @since 2024.05.30 |
|
42 |
+ * @param params - 통계 조회 조건 |
|
43 |
+ * @return HashMap<String, Object> - 메뉴별 접속 통계 결과 |
|
37 | 44 |
* |
38 | 45 |
* 메뉴별 접속 통계 |
39 | 46 |
*/ |
40 |
- public HashMap<String, Object> menuCntnStatsSelect(HashMap<String, Object> params) throws Exception; |
|
47 |
+ HashMap<String, Object> menuCntnStatsSelect(HashMap<String, Object> params); |
|
41 | 48 |
|
42 | 49 |
/** |
43 |
- * @author 박정하 |
|
44 |
- * @since 2024.05.30 |
|
50 |
+ * @param params - 통계 조회 조건 |
|
51 |
+ * @return boolean - 게시판 접속 통계 결과 |
|
45 | 52 |
* |
46 | 53 |
* 게시판 접속 통계 |
47 | 54 |
*/ |
48 |
- public HashMap<String, Object> bbsCntnStatsSelect(HashMap<String, Object> params) throws Exception; |
|
55 |
+ HashMap<String, Object> bbsCntnStatsSelect(HashMap<String, Object> params); |
|
49 | 56 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
+++ src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
... | ... | @@ -6,10 +6,12 @@ |
6 | 6 |
import com.takensoft.cms.cntnStats.service.CntnStatsService; |
7 | 7 |
import com.takensoft.cms.cntnStats.vo.CntnStatsVO; |
8 | 8 |
import com.takensoft.cms.menu.dao.MenuDAO; |
9 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
9 | 10 |
import lombok.RequiredArgsConstructor; |
10 | 11 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
11 | 12 |
import org.slf4j.Logger; |
12 | 13 |
import org.slf4j.LoggerFactory; |
14 |
+import org.springframework.dao.DataAccessException; |
|
13 | 15 |
import org.springframework.stereotype.Service; |
14 | 16 |
import org.springframework.transaction.annotation.Transactional; |
15 | 17 |
|
... | ... | @@ -18,11 +20,18 @@ |
18 | 20 |
|
19 | 21 |
/** |
20 | 22 |
* @author : takensoft |
21 |
- * @since : 2024.05.23 |
|
23 |
+ * @since :2024.05.23 |
|
24 |
+ * @modification |
|
25 |
+ * since | author | description |
|
26 |
+ * 2024.05.23 | takensoft | 최초 등록 |
|
27 |
+ * 2024.05.29 | 박정하 | 최초 등록 |
|
28 |
+ * 2024.05.30 | 박정하 | 최초 등록 |
|
29 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
30 |
+ * |
|
31 |
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스 |
|
32 |
+ * CntnStatsService - 접속 통계 관련 인터페이스 |
|
22 | 33 |
* |
23 | 34 |
* 접속통계 관련 구현체 |
24 |
- * EgovAbstractServiceImpl : 전자정부 상속 |
|
25 |
- * CntnStatsService : 접속 통계 관련 인터페이스 상속 |
|
26 | 35 |
*/ |
27 | 36 |
@Service("cntnStatsService") |
28 | 37 |
@RequiredArgsConstructor |
... | ... | @@ -34,174 +43,301 @@ |
34 | 43 |
private final MenuDAO menuDAO; |
35 | 44 |
|
36 | 45 |
/** |
37 |
- * @author : takensoft |
|
38 |
- * @since : 2024.05.23 |
|
46 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
47 |
+ * @return int - 접속 통계 등록 결과 |
|
48 |
+ * @throws CustomInsertFailException - 등록 실패 시 |
|
49 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
50 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
51 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
39 | 52 |
* |
40 | 53 |
* 접속 통계 등록 |
41 | 54 |
*/ |
42 | 55 |
@Override |
43 | 56 |
@Transactional(rollbackFor = Exception.class) |
44 |
- public int cntnStatsSave(CntnStatsDTO cntnStatsDTO) throws Exception { |
|
45 |
- LocalDate date = LocalDate.now(); // 오늘 금일 날짜 출력 |
|
46 |
- CntnStatsVO vo = new CntnStatsVO(); // 접속 통계 객체 생성 |
|
57 |
+ public int cntnStatsSave(CntnStatsDTO cntnStatsDTO){ |
|
58 |
+ try { |
|
59 |
+ LocalDate date = LocalDate.now(); // 오늘 금일 날짜 출력 |
|
60 |
+ CntnStatsVO vo = new CntnStatsVO(); // 접속 통계 객체 생성 |
|
47 | 61 |
|
48 |
- vo.setCntnYr(String.valueOf(date.getYear())); // 년도 추출 |
|
49 |
- vo.setCntnMm(String.format("%02d", date.getMonthValue())); // 월 추출 |
|
50 |
- vo.setCntnDay(String.format("%02d", date.getDayOfMonth())); // 일 추출 |
|
62 |
+ vo.setCntnYr(String.valueOf(date.getYear())); // 년도 추출 |
|
63 |
+ vo.setCntnMm(String.format("%02d", date.getMonthValue())); // 월 추출 |
|
64 |
+ vo.setCntnDay(String.format("%02d", date.getDayOfMonth())); // 일 추출 |
|
51 | 65 |
|
52 |
- int result = 0; |
|
66 |
+ int result = 0; |
|
53 | 67 |
|
54 |
- // 사용자 접속 통계 생성 |
|
55 |
- if(cntnStatsDTO.getTypeId() == null || cntnStatsDTO.getTypeId().equals("")) { |
|
56 |
- result += userCntnStatsSave(vo, cntnStatsDTO); |
|
57 |
- // 메뉴 접속 통계 생성 |
|
58 |
- } else if(cntnStatsDTO.getTypeId().contains("MENU")) { |
|
59 |
- result += menuCntnStatsSave(vo, cntnStatsDTO); |
|
60 |
- // 게시판 접속 통계 생성 |
|
61 |
- } else if(cntnStatsDTO.getTypeId().contains("BBS")) { |
|
62 |
- result += bbsCntnStatsSave(vo, cntnStatsDTO); |
|
63 |
- // 콘텐츠 접속 통게 생성 |
|
64 |
- } else if(cntnStatsDTO.getTypeId().contains("CONTS")) { |
|
65 |
- result += contsCntnStatsSave(vo, cntnStatsDTO); |
|
68 |
+ // 사용자 접속 통계 생성 |
|
69 |
+ if (cntnStatsDTO.getTypeId() == null || cntnStatsDTO.getTypeId().equals("")) { |
|
70 |
+ result = userCntnStatsSave(vo, cntnStatsDTO); |
|
71 |
+ // 메뉴 접속 통계 생성 |
|
72 |
+ } else if (cntnStatsDTO.getTypeId().contains("MENU")) { |
|
73 |
+ result = menuCntnStatsSave(vo, cntnStatsDTO); |
|
74 |
+ // 게시판 접속 통계 생성 |
|
75 |
+ } else if (cntnStatsDTO.getTypeId().contains("BBS")) { |
|
76 |
+ result = bbsCntnStatsSave(vo, cntnStatsDTO); |
|
77 |
+ // 콘텐츠 접속 통게 생성 |
|
78 |
+ } else if (cntnStatsDTO.getTypeId().contains("CONTS")) { |
|
79 |
+ result = contsCntnStatsSave(vo, cntnStatsDTO); |
|
80 |
+ } |
|
81 |
+ // 접속 통계 등록 실패 시 예외 발생 |
|
82 |
+ if( result == 0) { |
|
83 |
+ throw new CustomInsertFailException("접속 통계 등록 실패"); |
|
84 |
+ } |
|
85 |
+ |
|
86 |
+ return result; |
|
87 |
+ } catch (DataAccessException dae){ |
|
88 |
+ throw dae; |
|
89 |
+ } catch (NullPointerException npe) { |
|
90 |
+ throw npe; |
|
91 |
+ } catch (Exception e) { |
|
92 |
+ throw e; |
|
66 | 93 |
} |
67 |
- |
|
68 |
- return result; |
|
69 | 94 |
} |
70 | 95 |
|
71 | 96 |
/** |
72 |
- * @author takensoft |
|
73 |
- * @since 2024.05.23 |
|
97 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
98 |
+ * @return int - 사용자 접속 통계 등록 결과 |
|
99 |
+ * @throws CustomInsertFailException - 등록 실패 시 |
|
100 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
101 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
102 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
103 |
+ * |
|
74 | 104 |
* 사용자 접속 통계 등록 |
75 | 105 |
*/ |
76 |
- private int userCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO) throws Exception { |
|
77 |
- int result = 0; |
|
78 |
- for(String auth : cntnStatsDTO.getMbrAuthList()) { |
|
79 |
- cntnStatsVO.setAuthrtCd(auth); |
|
80 |
- boolean chck = cntnStatsDAO.userCntnStatsSaveChck(cntnStatsVO); |
|
81 |
- // 카운트 증가 |
|
82 |
- if(chck) { |
|
83 |
- result += cntnStatsDAO.userCntnStatsUpdate(cntnStatsVO); |
|
84 |
- // 신규 등록 |
|
85 |
- } else { |
|
86 |
- result += cntnStatsDAO.userCntnStatsSave(cntnStatsVO); |
|
106 |
+ private int userCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO){ |
|
107 |
+ try { |
|
108 |
+ int result = 0; |
|
109 |
+ for (String auth : cntnStatsDTO.getMbrAuthList()) { |
|
110 |
+ cntnStatsVO.setAuthrtCd(auth); |
|
111 |
+ boolean chck = cntnStatsDAO.userCntnStatsSaveChck(cntnStatsVO); |
|
112 |
+ // 등록 결과 |
|
113 |
+ int saveResult = 0; |
|
114 |
+ // 카운트 증가 |
|
115 |
+ if (chck) { |
|
116 |
+ saveResult = cntnStatsDAO.userCntnStatsUpdate(cntnStatsVO); |
|
117 |
+ // 신규 등록 |
|
118 |
+ } else { |
|
119 |
+ saveResult = cntnStatsDAO.userCntnStatsSave(cntnStatsVO); |
|
120 |
+ } |
|
121 |
+ |
|
122 |
+ // 등록 실패 시 예외 발생 |
|
123 |
+ if( saveResult == 0) { |
|
124 |
+ throw new CustomInsertFailException("사용자 접속 통계 등록 실패"); |
|
125 |
+ }else { |
|
126 |
+ result += saveResult; |
|
127 |
+ } |
|
87 | 128 |
} |
129 |
+ return result; |
|
130 |
+ } catch (DataAccessException dae){ |
|
131 |
+ throw dae; |
|
132 |
+ } catch (NullPointerException npe) { |
|
133 |
+ throw npe; |
|
134 |
+ } catch (Exception e) { |
|
135 |
+ throw e; |
|
88 | 136 |
} |
89 |
- return result; |
|
90 | 137 |
}; |
91 | 138 |
|
92 | 139 |
/** |
93 |
- * @author takensoft |
|
94 |
- * @since 2024.05.23 |
|
140 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
141 |
+ * @return int - 컨텐츠 접속 통계 등록 결과 |
|
142 |
+ * @throws CustomInsertFailException - 등록 실패 시 |
|
143 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
144 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
145 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
146 |
+ * |
|
95 | 147 |
* 컨텐츠 접속 통계 등록 |
96 | 148 |
*/ |
97 |
- private int contsCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO)throws Exception { |
|
149 |
+ private int contsCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO){ |
|
98 | 150 |
int result = 0; |
99 |
- for(String auth : cntnStatsDTO.getMbrAuthList()) { |
|
100 |
- cntnStatsVO.setAuthrtCd(auth); |
|
101 |
- cntnStatsVO.setTypeId(cntnStatsDTO.getTypeId()); |
|
102 |
- boolean chck = cntnStatsDAO.contsCntnStatsSaveChck(cntnStatsVO); |
|
103 |
- // 카운트 증가 |
|
104 |
- if(chck) { |
|
105 |
- result += cntnStatsDAO.contsCntnStatsUpdate(cntnStatsVO); |
|
106 |
- // 신규 등록 |
|
107 |
- } else { |
|
108 |
- result += cntnStatsDAO.contsCntnStatsSave(cntnStatsVO); |
|
151 |
+ try { |
|
152 |
+ for (String auth : cntnStatsDTO.getMbrAuthList()) { |
|
153 |
+ cntnStatsVO.setAuthrtCd(auth); |
|
154 |
+ cntnStatsVO.setTypeId(cntnStatsDTO.getTypeId()); |
|
155 |
+ boolean chck = cntnStatsDAO.contsCntnStatsSaveChck(cntnStatsVO); |
|
156 |
+ int saveResult = 0; |
|
157 |
+ // 카운트 증가 |
|
158 |
+ if (chck) { |
|
159 |
+ saveResult = cntnStatsDAO.contsCntnStatsUpdate(cntnStatsVO); |
|
160 |
+ // 신규 등록 |
|
161 |
+ } else { |
|
162 |
+ saveResult = cntnStatsDAO.contsCntnStatsSave(cntnStatsVO); |
|
163 |
+ } |
|
164 |
+ |
|
165 |
+ // 등록 실패 시 예외 발생 |
|
166 |
+ if( saveResult == 0) { |
|
167 |
+ throw new CustomInsertFailException("컨텐츠 접속 통계 등록 실패"); |
|
168 |
+ } else { |
|
169 |
+ result += saveResult; |
|
170 |
+ } |
|
109 | 171 |
} |
172 |
+ return result; |
|
173 |
+ } catch (DataAccessException dae){ |
|
174 |
+ throw dae; |
|
175 |
+ } catch (NullPointerException npe) { |
|
176 |
+ throw npe; |
|
177 |
+ } catch (Exception e) { |
|
178 |
+ throw e; |
|
110 | 179 |
} |
111 |
- return result; |
|
112 | 180 |
}; |
113 | 181 |
|
114 | 182 |
/** |
115 |
- * @author takensoft |
|
116 |
- * @since 2024.05.23 |
|
117 |
- * 게시판 접속 통계 등록 |
|
183 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
184 |
+ * @return int - 게시판 접속 통계 등록 결과 |
|
185 |
+ * @throws CustomInsertFailException - 등록 실패 시 |
|
186 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
187 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
188 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
189 |
+ * |
|
190 |
+ * 컨텐츠 접속 통계 등록 |
|
118 | 191 |
*/ |
119 |
- private int bbsCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO)throws Exception { |
|
192 |
+ private int bbsCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO){ |
|
120 | 193 |
int result = 0; |
121 |
- for(String auth : cntnStatsDTO.getMbrAuthList()) { |
|
122 |
- cntnStatsVO.setAuthrtCd(auth); |
|
123 |
- cntnStatsVO.setTypeId(cntnStatsDTO.getTypeId()); |
|
124 |
- boolean chck = cntnStatsDAO.bbsCntnStatsSaveChck(cntnStatsVO); |
|
125 |
- // 카운트 증가 |
|
126 |
- if(chck) { |
|
127 |
- result += cntnStatsDAO.bbsCntnStatsUpdate(cntnStatsVO); |
|
128 |
- // 신규 등록 |
|
129 |
- } else { |
|
130 |
- result += cntnStatsDAO.bbsCntnStatsSave(cntnStatsVO); |
|
194 |
+ try { |
|
195 |
+ for (String auth : cntnStatsDTO.getMbrAuthList()) { |
|
196 |
+ cntnStatsVO.setAuthrtCd(auth); |
|
197 |
+ cntnStatsVO.setTypeId(cntnStatsDTO.getTypeId()); |
|
198 |
+ boolean chck = cntnStatsDAO.bbsCntnStatsSaveChck(cntnStatsVO); |
|
199 |
+ // 등록 결과 |
|
200 |
+ int saveResult = 0; |
|
201 |
+ // 카운트 증가 |
|
202 |
+ if (chck) { |
|
203 |
+ saveResult += cntnStatsDAO.bbsCntnStatsUpdate(cntnStatsVO); |
|
204 |
+ // 신규 등록 |
|
205 |
+ } else { |
|
206 |
+ saveResult += cntnStatsDAO.bbsCntnStatsSave(cntnStatsVO); |
|
207 |
+ } |
|
208 |
+ // 등록 실패 시 예외 발생 |
|
209 |
+ if( saveResult == 0) { |
|
210 |
+ throw new CustomInsertFailException("게시판 접속 통계 등록 실패"); |
|
211 |
+ } else { |
|
212 |
+ result += saveResult; |
|
213 |
+ } |
|
131 | 214 |
} |
215 |
+ return result; |
|
216 |
+ } catch (DataAccessException dae){ |
|
217 |
+ throw dae; |
|
218 |
+ } catch (NullPointerException npe) { |
|
219 |
+ throw npe; |
|
220 |
+ } catch (Exception e) { |
|
221 |
+ throw e; |
|
132 | 222 |
} |
133 |
- return result; |
|
134 | 223 |
}; |
135 | 224 |
|
136 | 225 |
/** |
137 |
- * @author takensoft |
|
138 |
- * @since 2024.05.23 |
|
226 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
227 |
+ * @return int - 메뉴 접속 통계 등록 결과 |
|
228 |
+ * @throws CustomInsertFailException - 등록 실패 시 |
|
229 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
230 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
231 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
232 |
+ * |
|
139 | 233 |
* 메뉴 접속 통계 등록 |
140 | 234 |
*/ |
141 |
- private int menuCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO)throws Exception { |
|
235 |
+ private int menuCntnStatsSave(CntnStatsVO cntnStatsVO, CntnStatsDTO cntnStatsDTO){ |
|
142 | 236 |
int result = 0; |
143 |
- for(String auth : cntnStatsDTO.getMbrAuthList()) { |
|
144 |
- cntnStatsVO.setAuthrtCd(auth); |
|
145 |
- cntnStatsVO.setTypeId(cntnStatsDTO.getTypeId()); |
|
146 |
- boolean chck = cntnStatsDAO.menuCntnStatsSaveChck(cntnStatsVO); |
|
147 |
- // 카운트 증가 |
|
148 |
- if(chck) { |
|
149 |
- result += cntnStatsDAO.menuCntnStatsUpdate(cntnStatsVO); |
|
150 |
- // 신규 등록 |
|
151 |
- } else { |
|
152 |
- result += cntnStatsDAO.menuCntnStatsSave(cntnStatsVO); |
|
237 |
+ try { |
|
238 |
+ for (String auth : cntnStatsDTO.getMbrAuthList()) { |
|
239 |
+ cntnStatsVO.setAuthrtCd(auth); |
|
240 |
+ cntnStatsVO.setTypeId(cntnStatsDTO.getTypeId()); |
|
241 |
+ boolean chck = cntnStatsDAO.menuCntnStatsSaveChck(cntnStatsVO); |
|
242 |
+ // 등록 결과 |
|
243 |
+ int saveResult = 0; |
|
244 |
+ // 카운트 증가 |
|
245 |
+ if (chck) { |
|
246 |
+ saveResult = cntnStatsDAO.menuCntnStatsUpdate(cntnStatsVO); |
|
247 |
+ // 신규 등록 |
|
248 |
+ } else { |
|
249 |
+ saveResult = cntnStatsDAO.menuCntnStatsSave(cntnStatsVO); |
|
250 |
+ } |
|
251 |
+ // 등록 실패 시 예외 발생 |
|
252 |
+ if( saveResult == 0) { |
|
253 |
+ throw new CustomInsertFailException("메뉴 접속 통계 등록 실패"); |
|
254 |
+ } else { |
|
255 |
+ result += saveResult; |
|
256 |
+ } |
|
153 | 257 |
} |
258 |
+ return result; |
|
259 |
+ } catch (DataAccessException dae){ |
|
260 |
+ throw dae; |
|
261 |
+ } catch (NullPointerException npe) { |
|
262 |
+ throw npe; |
|
263 |
+ } catch (Exception e) { |
|
264 |
+ throw e; |
|
154 | 265 |
} |
155 |
- return result; |
|
156 | 266 |
}; |
157 | 267 |
|
158 | 268 |
/** |
159 |
- * @author 박정하 |
|
160 |
- * @since 2024.05.29 |
|
269 |
+ * @param params - 접속 통계 조회 조건 |
|
270 |
+ * @return HashMap<String, Object> - 조회 결과 |
|
271 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
272 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
161 | 273 |
* |
162 | 274 |
* 사용자 접속 통계 |
163 | 275 |
*/ |
164 | 276 |
@Override |
165 |
- public HashMap<String, Object> userCntnStatsSelect(HashMap<String, Object> params) throws Exception { |
|
166 |
- HashMap<String, Object> result = new HashMap<>(); |
|
167 |
- result.put("list", cntnStatsDAO.selectUserCntnStats(params)); |
|
168 |
- result.put("totalCnt", cntnStatsDAO.selectUserCntnStatsCnt(params)); |
|
169 |
- return result; |
|
170 |
- }; |
|
277 |
+ public HashMap<String, Object> userCntnStatsSelect(HashMap<String, Object> params){ |
|
278 |
+ try { |
|
279 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
280 |
+ result.put("list", cntnStatsDAO.selectUserCntnStats(params)); |
|
281 |
+ result.put("totalCnt", cntnStatsDAO.selectUserCntnStatsCnt(params)); |
|
282 |
+ return result; |
|
283 |
+ } catch (DataAccessException dae){ |
|
284 |
+ throw dae; |
|
285 |
+ } catch (Exception e) { |
|
286 |
+ throw e; |
|
287 |
+ } |
|
288 |
+ } |
|
171 | 289 |
|
172 | 290 |
/** |
173 |
- * @author 박정하 |
|
174 |
- * @since 2024.05.30 |
|
291 |
+ * @param params - 접속 통계 조회 조건 |
|
292 |
+ * @return HashMap<String, Object> - 조회 결과 |
|
293 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
294 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
175 | 295 |
* |
176 | 296 |
* 메뉴별 접속 통계 |
177 | 297 |
*/ |
178 | 298 |
@Override |
179 |
- public HashMap<String, Object> menuCntnStatsSelect(HashMap<String, Object> params) throws Exception { |
|
180 |
- HashMap<String, Object> result = new HashMap<>(); |
|
181 |
- int menuCnt = menuDAO.findAllCnt(params); |
|
182 |
- result.put("menuCnt", menuCnt); |
|
183 |
- if (menuCnt > 0) { |
|
184 |
- result.put("list", cntnStatsDAO.selectMenuCntnStats(params)); |
|
185 |
- result.put("totalCnt", cntnStatsDAO.selectMenuCntnStatsCnt(params)); |
|
299 |
+ public HashMap<String, Object> menuCntnStatsSelect(HashMap<String, Object> params){ |
|
300 |
+ try { |
|
301 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
302 |
+ int menuCnt = menuDAO.findAllCnt(params); |
|
303 |
+ result.put("menuCnt", menuCnt); |
|
304 |
+ if (menuCnt > 0) { |
|
305 |
+ result.put("list", cntnStatsDAO.selectMenuCntnStats(params)); |
|
306 |
+ result.put("totalCnt", cntnStatsDAO.selectMenuCntnStatsCnt(params)); |
|
307 |
+ } |
|
308 |
+ return result; |
|
309 |
+ } catch (DataAccessException dae){ |
|
310 |
+ throw dae; |
|
311 |
+ } catch (Exception e) { |
|
312 |
+ throw e; |
|
186 | 313 |
} |
187 |
- return result; |
|
188 | 314 |
} |
189 | 315 |
|
190 | 316 |
/** |
191 |
- * @author 박정하 |
|
192 |
- * @since 2024.05.30 |
|
317 |
+ * @param params - 접속 통계 조회 조건 |
|
318 |
+ * @return HashMap<String, Object> - 조회 결과 |
|
319 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
320 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
193 | 321 |
* |
194 | 322 |
* 게시판 접속 통계 |
195 | 323 |
*/ |
196 | 324 |
@Override |
197 |
- public HashMap<String, Object> bbsCntnStatsSelect(HashMap<String, Object> params) throws Exception { |
|
198 |
- HashMap<String, Object> result = new HashMap<>(); |
|
199 |
- int bbsCnt = bbsMngDAO.findAllCntNotPagination(); |
|
200 |
- result.put("bbsCnt", bbsCnt); |
|
201 |
- if (bbsCnt > 0) { |
|
202 |
- result.put("list", cntnStatsDAO.selectBbsCntnStats(params)); |
|
203 |
- result.put("totalCnt", cntnStatsDAO.selectBbsCntnStatsCnt(params)); |
|
325 |
+ public HashMap<String, Object> bbsCntnStatsSelect(HashMap<String, Object> params){ |
|
326 |
+ try { |
|
327 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
328 |
+ int bbsCnt = bbsMngDAO.findAllCntNotPagination(); |
|
329 |
+ result.put("bbsCnt", bbsCnt); |
|
330 |
+ if (bbsCnt > 0) { |
|
331 |
+ result.put("list", cntnStatsDAO.selectBbsCntnStats(params)); |
|
332 |
+ result.put("totalCnt", cntnStatsDAO.selectBbsCntnStatsCnt(params)); |
|
333 |
+ } |
|
334 |
+ return result; |
|
335 |
+ } catch (DataAccessException dae){ |
|
336 |
+ throw dae; |
|
337 |
+ } catch (RuntimeException re){ |
|
338 |
+ throw re; |
|
339 |
+ } catch (Exception e) { |
|
340 |
+ throw e; |
|
204 | 341 |
} |
205 |
- return result; |
|
206 | 342 |
} |
207 | 343 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/cntnStats/vo/CntnStatsVO.java
+++ src/main/java/com/takensoft/cms/cntnStats/vo/CntnStatsVO.java
... | ... | @@ -8,6 +8,10 @@ |
8 | 8 |
/** |
9 | 9 |
* @author : takensoft |
10 | 10 |
* @since : 2024.05.23 |
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.05.23 | takensoft | 최초 등록 |
|
14 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
11 | 15 |
* |
12 | 16 |
* 접속 통계 관련 VO |
13 | 17 |
*/ |
... | ... | @@ -16,24 +20,9 @@ |
16 | 20 |
@NoArgsConstructor |
17 | 21 |
@AllArgsConstructor |
18 | 22 |
public class CntnStatsVO { |
19 |
- /** |
|
20 |
- * 타입 아이디 (게시판/콘텐츠/메뉴) |
|
21 |
- */ |
|
22 |
- private String typeId; |
|
23 |
- /** |
|
24 |
- * 권한 코드 |
|
25 |
- */ |
|
26 |
- private String authrtCd; |
|
27 |
- /** |
|
28 |
- * 접속 년도 |
|
29 |
- */ |
|
30 |
- private String cntnYr; |
|
31 |
- /** |
|
32 |
- * 접속 월 |
|
33 |
- */ |
|
34 |
- private String cntnMm; |
|
35 |
- /** |
|
36 |
- * 접속 일 |
|
37 |
- */ |
|
38 |
- private String cntnDay; |
|
23 |
+ private String typeId; // 타입 아이디(게시판/콘텐츠/메뉴) |
|
24 |
+ private String authrtCd; // 권한 코드 |
|
25 |
+ private String cntnYr; // 접속 년도 |
|
26 |
+ private String cntnMm; // 접속 월 |
|
27 |
+ private String cntnDay; // 접속 일 |
|
39 | 28 |
} |
--- src/main/java/com/takensoft/cms/cntnStats/web/CntnStatsController.java
+++ src/main/java/com/takensoft/cms/cntnStats/web/CntnStatsController.java
... | ... | @@ -18,12 +18,16 @@ |
18 | 18 |
import jakarta.servlet.http.HttpServletResponse; |
19 | 19 |
import java.nio.charset.Charset; |
20 | 20 |
import java.util.*; |
21 |
+ |
|
21 | 22 |
/** |
22 | 23 |
* @author takensoft |
23 | 24 |
* @since 2024.05.23 |
24 | 25 |
* @modification |
25 | 26 |
* since | author | description |
26 | 27 |
* 2024.05.23 | takensoft | 최초 등록 |
28 |
+ * 2024.05.29 | 박정하 | selectUserCntnStatsProc 추가 |
|
29 |
+ * 2024.05.30 | 박정하 | selectMenuCntnStatsProc, selectBbsCntnStatsProc, excelDownload 추가 |
|
30 |
+ * 2025.03.17 | 방선주 | 코드 리펙토링 |
|
27 | 31 |
* |
28 | 32 |
* 접속 통계 관련 컨트롤러 |
29 | 33 |
*/ |
... | ... | @@ -37,73 +41,55 @@ |
37 | 41 |
private final ResponseUtil resUtil; |
38 | 42 |
|
39 | 43 |
/** |
40 |
- * @author takensoft |
|
41 |
- * @since 2024.05.23 |
|
42 |
- * @param cntnStatsDTO |
|
43 |
- * @return |
|
44 |
- * @throws Exception |
|
44 |
+ * @param cntnStatsDTO - 접속 통계 DTO |
|
45 |
+ * @return ResponseEntity - 접속 통계 등록 응답 결과 |
|
45 | 46 |
* |
46 | 47 |
* 접속 통게 등록 |
47 | 48 |
*/ |
48 | 49 |
@PostMapping("/saveProc.json") |
49 |
- public ResponseEntity<?> saveProc(@RequestBody CntnStatsDTO cntnStatsDTO) throws Exception { |
|
50 |
+ public ResponseEntity<?> saveProc(@RequestBody CntnStatsDTO cntnStatsDTO){ |
|
50 | 51 |
int result = cntnStatsService.cntnStatsSave(cntnStatsDTO); |
51 | 52 |
|
52 | 53 |
// 응답 처리 |
53 |
- if(result > 0) { |
|
54 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
55 |
- } else { |
|
56 |
- return resUtil.errorRes(MessageCode.COMMON_INSERT_FAIL); |
|
57 |
- } |
|
54 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
58 | 55 |
} |
59 | 56 |
|
60 | 57 |
/** |
61 |
- * @author 박정하 |
|
62 |
- * @since 2024.05.29 |
|
63 |
- * @param |
|
64 |
- * @return |
|
65 |
- * @throws Exception |
|
58 |
+ * @param params - 접속 통계 조회 파라미터 |
|
59 |
+ * @return ResponseEntity - 사용자 접속 통계 응답 결과 |
|
66 | 60 |
* |
67 | 61 |
* 사용자 접속 통계 |
68 | 62 |
*/ |
69 | 63 |
@PostMapping("/selectUserCntnStatsProc.json") |
70 |
- public ResponseEntity<?> selectUserCntnStatsProc(@RequestBody HashMap<String, Object> params) throws Exception { |
|
64 |
+ public ResponseEntity<?> selectUserCntnStatsProc(@RequestBody HashMap<String, Object> params){ |
|
71 | 65 |
// 사용자 접속 통계 조회 |
72 | 66 |
HashMap<String, Object> result = cntnStatsService.userCntnStatsSelect(params); |
73 |
- |
|
74 | 67 |
// 응답 처리 |
75 | 68 |
return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
76 | 69 |
} |
77 | 70 |
|
78 | 71 |
/** |
79 |
- * @author 박정하 |
|
80 |
- * @since 2024.05.30 |
|
81 |
- * @param |
|
82 |
- * @return |
|
83 |
- * @throws Exception |
|
72 |
+ * @param params - 접속 통계 조회 파라미터 |
|
73 |
+ * @return ResponseEntity - 메뉴별 접속 통계 응답 결과 |
|
84 | 74 |
* |
85 | 75 |
* 메뉴별 접속 통계 |
86 | 76 |
*/ |
87 | 77 |
@PostMapping("/selectMenuCntnStatsProc.json") |
88 |
- public ResponseEntity<?> selectMenuCntnStatsProc(@RequestBody HashMap<String, Object> params) throws Exception { |
|
78 |
+ public ResponseEntity<?> selectMenuCntnStatsProc(@RequestBody HashMap<String, Object> params){ |
|
89 | 79 |
// 메뉴별 접속 통계 조회 |
90 | 80 |
HashMap<String, Object> result = cntnStatsService.menuCntnStatsSelect(params); |
91 |
- |
|
92 | 81 |
// 응답 처리 |
93 | 82 |
return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
94 | 83 |
} |
95 | 84 |
|
96 | 85 |
/** |
97 |
- * @author 박정하 |
|
98 |
- * @since 2024.05.30 |
|
99 |
- * @param |
|
100 |
- * @return |
|
101 |
- * @throws Exception |
|
86 |
+ * @param params - 접속 통계 조회 파라미터 |
|
87 |
+ * @return ResponseEntity - 게시판 접속 통계 응답 결과 |
|
102 | 88 |
* |
103 | 89 |
* 게시판 접속 통계 |
104 | 90 |
*/ |
105 | 91 |
@PostMapping("/selectBbsCntnStatsProc.json") |
106 |
- public ResponseEntity<?> selectBbsCntnStatsProc(@RequestBody HashMap<String, Object> params) throws Exception { |
|
92 |
+ public ResponseEntity<?> selectBbsCntnStatsProc(@RequestBody HashMap<String, Object> params){ |
|
107 | 93 |
// 게시판 접속 통계 조회 |
108 | 94 |
HashMap<String, Object> result = cntnStatsService.bbsCntnStatsSelect(params); |
109 | 95 |
|
... | ... | @@ -112,16 +98,15 @@ |
112 | 98 |
} |
113 | 99 |
|
114 | 100 |
/** |
115 |
- * @author 박정하 |
|
116 |
- * @since 2024.05.30 |
|
117 |
- * @param |
|
118 |
- * @return |
|
119 |
- * @throws Exception |
|
101 |
+ * @param response - HTTP 응답 객체 |
|
102 |
+ * @param cntnStats - 엑셀 다운로드 데이터 |
|
103 |
+ * @param chart - 차트 명 |
|
104 |
+ * @return ResponseEntity - 게시판 접속 통계 응답 결과 |
|
120 | 105 |
* |
121 | 106 |
* 접속 통계 엑셀 다운로드 |
122 | 107 |
*/ |
123 | 108 |
@PostMapping("/excelDownload.file") |
124 |
- public void excelDownload(HttpServletResponse response, @RequestPart List<CntnStatsExcelDTO> cntnStats, @RequestPart String chart) throws Exception { |
|
109 |
+ public void excelDownload(HttpServletResponse response, @RequestPart List<CntnStatsExcelDTO> cntnStats, @RequestPart String chart){ |
|
125 | 110 |
excelService.cntnStatsExcelDownload(response, cntnStats, chart); |
126 | 111 |
} |
127 | 112 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/common/excel/service/ExcelService.java
+++ src/main/java/com/takensoft/common/excel/service/ExcelService.java
... | ... | @@ -11,9 +11,9 @@ |
11 | 11 |
import java.util.List; |
12 | 12 |
|
13 | 13 |
public interface ExcelService { |
14 |
- public void ivstDscsnExcelDownload(HttpServletResponse response, IvstDscsnExcelDTO ivstDscsn) throws Exception; |
|
15 |
- public void rvwMttrExcelDownload(HttpServletResponse response, RvwMttrExcelDTO rvwMttr, List<RvwMttrPrgrsExcelDTO> prgrsList) throws Exception; |
|
16 |
- public void entInfoExcelDownload(HttpServletResponse response, EntInfoExcelDTO entInfo, List<BplcExcelDTO> bplcList) throws Exception; |
|
17 |
- public void cntnStatsExcelDownload(HttpServletResponse response, List<CntnStatsExcelDTO> cntnStats, String chart) throws Exception; |
|
18 |
- public void entInfoExcelDownloadAll(HttpServletResponse response, List<EntInfoExcelDTO> entInfoList) throws Exception; |
|
14 |
+ void ivstDscsnExcelDownload(HttpServletResponse response, IvstDscsnExcelDTO ivstDscsn) throws Exception; |
|
15 |
+ void rvwMttrExcelDownload(HttpServletResponse response, RvwMttrExcelDTO rvwMttr, List<RvwMttrPrgrsExcelDTO> prgrsList) throws Exception; |
|
16 |
+ void entInfoExcelDownload(HttpServletResponse response, EntInfoExcelDTO entInfo, List<BplcExcelDTO> bplcList) throws Exception; |
|
17 |
+ void cntnStatsExcelDownload(HttpServletResponse response, List<CntnStatsExcelDTO> cntnStats, String chart); |
|
18 |
+ void entInfoExcelDownloadAll(HttpServletResponse response, List<EntInfoExcelDTO> entInfoList) throws Exception; |
|
19 | 19 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/common/excel/service/Impl/ExcelServiceImpl.java
+++ src/main/java/com/takensoft/common/excel/service/Impl/ExcelServiceImpl.java
... | ... | @@ -126,26 +126,32 @@ |
126 | 126 |
|
127 | 127 |
// 통계관리 |
128 | 128 |
@Override |
129 |
- public void cntnStatsExcelDownload(HttpServletResponse response, List<CntnStatsExcelDTO> mainDataList, String chart) throws Exception { |
|
130 |
- // 기본 세팅 |
|
131 |
- Workbook workbook = new SXSSFWorkbook(); |
|
132 |
- Sheet sheet = workbook.createSheet(); |
|
133 |
- int rowIndex = 0; |
|
129 |
+ public void cntnStatsExcelDownload(HttpServletResponse response, List<CntnStatsExcelDTO> mainDataList, String chart) { |
|
130 |
+ try { |
|
131 |
+ // 기본 세팅 |
|
132 |
+ Workbook workbook = new SXSSFWorkbook(); |
|
133 |
+ Sheet sheet = workbook.createSheet(); |
|
134 |
+ int rowIndex = 0; |
|
134 | 135 |
|
135 |
- // 개별 설정 |
|
136 |
- ExcelRenderResource mainResource = ExcelRenderResourceFactory.prepareRenderResource(CntnStatsExcelDTO.class); |
|
136 |
+ // 개별 설정 |
|
137 |
+ ExcelRenderResource mainResource = ExcelRenderResourceFactory.prepareRenderResource(CntnStatsExcelDTO.class); |
|
137 | 138 |
|
138 |
- // 엑셀 그리기 |
|
139 |
- ExcelCreateService<CntnStatsExcelDTO> mainExcel = new ExcelCreateService(workbook, sheet, mainDataList, mainDataList.getClass()); |
|
140 |
- mainExcel.chartDraw(sheet, chart, rowIndex, mainResource.getDataFieldNames().size() + 1); |
|
141 |
- rowIndex = mainExcel.createHorizontal(mainResource, mainDataList, rowIndex); |
|
139 |
+ // 엑셀 그리기 |
|
140 |
+ ExcelCreateService<CntnStatsExcelDTO> mainExcel = new ExcelCreateService(workbook, sheet, mainDataList, mainDataList.getClass()); |
|
141 |
+ mainExcel.chartDraw(sheet, chart, rowIndex, mainResource.getDataFieldNames().size() + 1); |
|
142 |
+ rowIndex = mainExcel.createHorizontal(mainResource, mainDataList, rowIndex); |
|
142 | 143 |
|
143 |
- // 엑셀 사이즈 지정 |
|
144 |
- int cellNumber = mainResource.getDataFieldNames().size(); |
|
145 |
- sheetSize(sheet, cellNumber); |
|
144 |
+ // 엑셀 사이즈 지정 |
|
145 |
+ int cellNumber = mainResource.getDataFieldNames().size(); |
|
146 |
+ sheetSize(sheet, cellNumber); |
|
146 | 147 |
|
147 |
- // 엑셀 파일 출력 |
|
148 |
- writeExcel(response, workbook, mainResource); |
|
148 |
+ // 엑셀 파일 출력 |
|
149 |
+ writeExcel(response, workbook, mainResource); |
|
150 |
+ } catch (RuntimeException ex) { |
|
151 |
+ throw new RuntimeException(ex); |
|
152 |
+ }catch (Exception e) { |
|
153 |
+ e.printStackTrace(); |
|
154 |
+ } |
|
149 | 155 |
} |
150 | 156 |
|
151 | 157 |
// 기업정보 전체 다운로드 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?