
--- src/main/java/com/takensoft/cms/dept/dao/DeptDAO.java
+++ src/main/java/com/takensoft/cms/dept/dao/DeptDAO.java
... | ... | @@ -11,122 +11,144 @@ |
11 | 11 |
|
12 | 12 |
/** |
13 | 13 |
* @author : takensoft |
14 |
- * @since : 2024.04.24 |
|
14 |
+ * @since :2024.04.24 |
|
15 |
+ * @modification |
|
16 |
+ * since | author | description |
|
17 |
+ * 2024.04.24 | takensoft | 최초 등록 |
|
18 |
+ * 2024.05.10 | 박정하 | deptUpdateByHierachy 추가 |
|
19 |
+ * 2025.03.13 | 방선주 | 코드 리펙토링 |
|
15 | 20 |
* |
16 |
- * 부서 정보 관련 Mapper |
|
21 |
+ * 부서 정보 관련 DAO |
|
17 | 22 |
*/ |
18 | 23 |
@Mapper("deptDAO") |
19 | 24 |
public interface DeptDAO { |
20 | 25 |
/** |
21 |
- * @author takensoft |
|
22 |
- * @since 2024.04.25 |
|
26 |
+ * @param deptVO - 부서 정보 객체 |
|
27 |
+ * @return int - 등록 성공 여부 |
|
28 |
+ * |
|
23 | 29 |
* 부서 등록 |
24 | 30 |
*/ |
25 | 31 |
int save(DeptVO deptVO); |
26 | 32 |
|
27 | 33 |
/** |
28 |
- * @author takensoft |
|
29 |
- * @since 2024.04.25 |
|
34 |
+ * @param deptAuthrtVO - 부서 권한 정보 객체 |
|
35 |
+ * @return int - 등록 성공 여부 |
|
36 |
+ * |
|
30 | 37 |
* 부서 권한 등록 |
31 | 38 |
*/ |
32 | 39 |
int authrtSave(DeptAuthrtVO deptAuthrtVO); |
33 | 40 |
|
34 | 41 |
/** |
35 |
- * @author takensoft |
|
36 |
- * @since 2024.04.29 |
|
42 |
+ * @param deptMbrVO - 부서 사용자 정보 객체 |
|
43 |
+ * @return int - 등록 성공 여부 |
|
44 |
+ * |
|
37 | 45 |
* 부서 사용자 등록 |
38 | 46 |
*/ |
39 | 47 |
int deptMbrSave(DeptMbrVO deptMbrVO); |
40 | 48 |
|
41 | 49 |
/** |
42 |
- * @author takensoft |
|
43 |
- * @since 2024.04.25 |
|
50 |
+ * @param upDeptId - 상위 부서 ID |
|
51 |
+ * @return int - 부서 깊이(레벨) |
|
52 |
+ * |
|
44 | 53 |
* 부서 깊이(레벨) 조회 |
45 | 54 |
*/ |
46 | 55 |
int findByDeptGrd(String upDeptId); |
47 | 56 |
|
48 | 57 |
/** |
49 |
- * @author takensoft |
|
50 |
- * @since 2024.04.25 |
|
58 |
+ * @param upDeptId - 상위 부서 ID |
|
59 |
+ * @return int - 부서 순서 |
|
60 |
+ * |
|
51 | 61 |
* 부서 순서 조회 |
52 | 62 |
*/ |
53 | 63 |
int findByDeptSn(String upDeptId); |
54 | 64 |
|
55 | 65 |
/************************************** Hierachy 전용 **************************************/ |
66 |
+ |
|
56 | 67 |
/** |
57 |
- * @author takensoft |
|
58 |
- * @since 2024.04.25 |
|
68 |
+ * @param |
|
69 |
+ * @return List<HierachyVO> - 부서 정보 목록 |
|
70 |
+ * |
|
59 | 71 |
* 최상위 부서 조회 |
60 | 72 |
*/ |
61 | 73 |
List<HierachyVO> findByTopNode(); |
74 |
+ |
|
62 | 75 |
/** |
63 |
- * @author takensoft |
|
64 |
- * @since 2024.04.24 |
|
76 |
+ * @param id - 상위 부서 ID |
|
77 |
+ * @return List<HierachyVO> - 하위 부서 목록 |
|
78 |
+ * |
|
65 | 79 |
* 하위 부서 조회 |
66 | 80 |
*/ |
67 | 81 |
List<HierachyVO> findChildNode(String id); |
68 | 82 |
/************************************** Hierachy 전용 **************************************/ |
69 |
- |
|
70 | 83 |
/** |
71 |
- * @author takensoft |
|
72 |
- * @since 2024.04.26 |
|
84 |
+ * @param deptId - 부서 ID |
|
85 |
+ * @return DeptVO - 부서 정보 객체 |
|
86 |
+ * |
|
73 | 87 |
* 부서 정보 조회 |
74 | 88 |
*/ |
75 | 89 |
DeptVO findByDept(String deptId); |
76 | 90 |
|
77 | 91 |
/** |
78 |
- * @author takensoft |
|
79 |
- * @since 2024.04.26 |
|
92 |
+ * @param deptVO - 부서 정보 객체 |
|
93 |
+ * @return int - 수정 성공 여부 |
|
94 |
+ * |
|
80 | 95 |
* 부서 정보 수정 |
81 | 96 |
*/ |
82 | 97 |
int update(DeptVO deptVO); |
83 | 98 |
|
84 | 99 |
/** |
85 |
- * @author takensoft |
|
86 |
- * @since 2024.04.26 |
|
100 |
+ * @param deptId - 부서 ID |
|
101 |
+ * @return int - 삭제 성공 여부 |
|
102 |
+ * |
|
87 | 103 |
* 부서 권한 삭제 |
88 | 104 |
*/ |
89 | 105 |
int deleteAuth(String deptId); |
90 | 106 |
|
91 | 107 |
/** |
92 |
- * @author takensoft |
|
93 |
- * @since 2024.04.26 |
|
108 |
+ * @param params - 부서 ID, 사용자 ID |
|
109 |
+ * @return int - List<DeptMbrVO> - 부서 사용자 정보 목록 |
|
110 |
+ * |
|
94 | 111 |
* 부서 사용자 등록을 위한 사용자 정보 목록 조회 (부서에 등록되지 않은 사용자 목록) |
95 | 112 |
*/ |
96 | 113 |
List<DeptMbrVO> findByMber(Map<String, String> params); |
97 | 114 |
|
98 | 115 |
/** |
99 |
- * @author takensoft |
|
100 |
- * @since 2024.04.26 |
|
116 |
+ * @param deptId - 부서 ID |
|
117 |
+ * @return int - List<DeptMbrVO>- 부서 사용자 정보 목록 |
|
118 |
+ * |
|
101 | 119 |
* 부서에 등록된 사용자 목록 조회 |
102 | 120 |
*/ |
103 | 121 |
List<DeptMbrVO> findByDeptMber(String deptId); |
104 | 122 |
|
105 | 123 |
/** |
106 |
- * @author takensoft |
|
107 |
- * @since 2024.04.26 |
|
124 |
+ * @param deptId - 부서 ID |
|
125 |
+ * @return int - 삭제 성공 여부 |
|
126 |
+ * |
|
108 | 127 |
* 상위,하위 부서 삭제 |
109 | 128 |
*/ |
110 | 129 |
int deleteDept(String deptId); |
111 | 130 |
|
112 | 131 |
/** |
113 |
- * @author takensoft |
|
114 |
- * @since 2024.04.26 |
|
132 |
+ * @param deptId - 부서 ID |
|
133 |
+ * @return int - 삭제 성공 여부 |
|
134 |
+ * |
|
115 | 135 |
* 상위, 하위 부서 삭제에 따른 부서의 사용자 삭제 |
116 | 136 |
*/ |
117 | 137 |
int deleteDeptInDeptMbr(String deptId); |
118 | 138 |
|
119 | 139 |
/** |
120 |
- * @author takensoft |
|
121 |
- * @since 2024.04.26 |
|
140 |
+ * @param params - 부서 ID, 사용자 ID |
|
141 |
+ * @return int - 삭제 성공 여부 |
|
142 |
+ * |
|
122 | 143 |
* 부서에 등록된 사용자 제거 |
123 | 144 |
*/ |
124 | 145 |
int deleteDeptMbr(Map<String, Object> params); |
125 | 146 |
|
126 | 147 |
/** |
127 |
- * @author 박정하 |
|
128 |
- * @since 2024.05.10 |
|
148 |
+ * @param deptVO - 부서 정보 객체 |
|
149 |
+ * @return int - 수정 성공 여부 |
|
150 |
+ * |
|
129 | 151 |
* 부서 정보 수정 (hierachyVO 사용) |
130 | 152 |
*/ |
131 |
- public int deptUpdateByHierachy(DeptVO deptVO) throws Exception; |
|
153 |
+ int deptUpdateByHierachy(DeptVO deptVO); |
|
132 | 154 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/dept/service/DeptService.java
+++ src/main/java/com/takensoft/cms/dept/service/DeptService.java
... | ... | @@ -9,86 +9,107 @@ |
9 | 9 |
import java.util.Map; |
10 | 10 |
|
11 | 11 |
/** |
12 |
- * @author : takensoft |
|
13 |
- * @since : 2024.04.09 |
|
12 |
+ * @author takensoft |
|
13 |
+ * @since 2024.04.09 |
|
14 |
+ * @modification |
|
15 |
+ * since | author | description |
|
16 |
+ * 2024.04.09 | takensoft | 최초 등록 |
|
17 |
+ * 2024.05.10 | 박정하 | updateList, updateChildNode 추가 |
|
18 |
+ * 2025.03.13 | 방선주 | 코드 리펙토링 |
|
14 | 19 |
* |
15 | 20 |
* 부서 정보 관련 인터페이스 |
16 | 21 |
*/ |
17 | 22 |
public interface DeptService { |
23 |
+ |
|
18 | 24 |
/** |
19 |
- * @author takensoft |
|
20 |
- * @since 2024.04.25 |
|
25 |
+ * @param deptVO - 부서 정보 |
|
26 |
+ * @return int - 등록 성공 여부 |
|
27 |
+ * |
|
21 | 28 |
* 부서 등록 |
22 | 29 |
*/ |
23 |
- public HashMap<String, Object> deptSave(DeptVO deptVO) throws Exception; |
|
30 |
+ HashMap<String, Object> deptSave(DeptVO deptVO); |
|
24 | 31 |
|
25 | 32 |
/** |
26 |
- * @author takensoft |
|
27 |
- * @since 2024.04.29 |
|
33 |
+ * @param deptMbrVO - 부서 사용자 정보 |
|
34 |
+ * @return int - 등록 성공 여부 |
|
35 |
+ * |
|
28 | 36 |
* 부서 사용자 등록 |
29 | 37 |
*/ |
30 |
- public int deptMbrSave(DeptMbrVO deptMbrVO) throws Exception; |
|
38 |
+ int deptMbrSave(DeptMbrVO deptMbrVO); |
|
31 | 39 |
|
32 |
- /************************************** Hierachy 전용 **************************************/ |
|
33 |
- /** |
|
34 |
- * @author takensoft |
|
35 |
- * @since 2024.04.25 |
|
36 |
- * 최상위 코드 조회 |
|
37 |
- */ |
|
38 |
- public List<HierachyVO> findByTopNode() throws Exception; |
|
39 |
- /** |
|
40 |
- * @author takensoft |
|
41 |
- * @since 2024.04.25 |
|
42 |
- * 하위 코드 조회 |
|
43 |
- */ |
|
44 |
- public List<HierachyVO> findChildNode(String id) throws Exception; |
|
45 | 40 |
/************************************** Hierachy 전용 **************************************/ |
46 | 41 |
|
47 | 42 |
/** |
48 |
- * @author takensoft |
|
49 |
- * @since 2024.04.26 |
|
43 |
+ * @param |
|
44 |
+ * @return List<HierachyVO> - 최상위 부서 목록 |
|
45 |
+ * |
|
46 |
+ * 최상위 부서 조회 |
|
47 |
+ */ |
|
48 |
+ List<HierachyVO> findByTopNode(); |
|
49 |
+ |
|
50 |
+ /** |
|
51 |
+ * @param id - 상위 부서 ID |
|
52 |
+ * @return List<HierachyVO> - 하위 부서 목록 |
|
53 |
+ * |
|
54 |
+ * 하위 부서 조회 |
|
55 |
+ */ |
|
56 |
+ List<HierachyVO> findChildNode(String id); |
|
57 |
+ /************************************** Hierachy 전용 **************************************/ |
|
58 |
+ |
|
59 |
+ /** |
|
60 |
+ * @param params - 부서 정보 |
|
61 |
+ * @return Map<String, Object> - 부서 정보 |
|
62 |
+ * |
|
50 | 63 |
* 부서 정보 조회 |
51 | 64 |
*/ |
52 |
- public Map<String, Object> findByDept(HashMap<String, Object> params) throws Exception; |
|
65 |
+ Map<String, Object> findByDept(HashMap<String, Object> params); |
|
53 | 66 |
|
54 | 67 |
/** |
55 |
- * @author takensoft |
|
56 |
- * @since 2024.04.26 |
|
68 |
+ * @param deptVO - 부서 정보 |
|
69 |
+ * @return int - 수정 성공 여부 |
|
70 |
+ * |
|
57 | 71 |
* 부서 정보 수정 |
58 | 72 |
*/ |
59 |
- public int deptUpdate(DeptVO deptVO) throws Exception; |
|
73 |
+ int deptUpdate(DeptVO deptVO); |
|
60 | 74 |
|
61 | 75 |
/** |
62 |
- * @author takensoft |
|
63 |
- * @since 2024.04.26 |
|
76 |
+ * @param deptVO - 부서 정보 |
|
77 |
+ * @return int - 삭제 성공 여부 |
|
78 |
+ * |
|
64 | 79 |
* 부서 정보 삭제 |
65 | 80 |
*/ |
66 |
- public int deptDelete(DeptVO deptVO) throws Exception; |
|
81 |
+ int deptDelete(DeptVO deptVO); |
|
67 | 82 |
|
68 | 83 |
/** |
69 |
- * @author takensoft |
|
70 |
- * @since 2024.04.26 |
|
84 |
+ * @param deptMbrList - 부서 사용자 정보 |
|
85 |
+ * @return int - 삭제 성공 여부 |
|
86 |
+ * |
|
71 | 87 |
* 부서 사용자 삭제 |
72 | 88 |
*/ |
73 |
- public int deptMbrDelete(List<DeptMbrVO> deptMbrList) throws Exception; |
|
89 |
+ int deptMbrDelete(List<DeptMbrVO> deptMbrList); |
|
74 | 90 |
|
75 | 91 |
/** |
76 |
- * @author takensoft |
|
77 |
- * @since 2024.04.29 |
|
92 |
+ * @param params - 부서 사용자 정보 |
|
93 |
+ * @return Map<String, Object> - 부서에 등록되지 않는 사용자 정보 |
|
94 |
+ * |
|
78 | 95 |
* 부서에 등록되지 않는 사용자 조회 |
79 | 96 |
*/ |
80 |
- public Map<String, Object> findByMbr(Map<String, String> params) throws Exception; |
|
97 |
+ Map<String, Object> findByMbr(Map<String, String> params); |
|
81 | 98 |
|
82 | 99 |
/** |
83 |
- * @author 박정하 |
|
84 |
- * @since 2024.05.09 |
|
100 |
+ * @param deptList - 부서 목록 |
|
101 |
+ * @return int - 수정 성공 여부 |
|
102 |
+ * |
|
85 | 103 |
* 부서 목록 수정 |
86 | 104 |
*/ |
87 |
- public int updateList(List<HierachyVO> deptList) throws Exception; |
|
105 |
+ int updateList(List<HierachyVO> deptList); |
|
106 |
+ |
|
88 | 107 |
/** |
89 |
- * @author 박정하 |
|
90 |
- * @since 2024.05.10 |
|
108 |
+ * @param childList - 하위 부서 목록 |
|
109 |
+ * @param upDeptVO - 상위 부서 정보 |
|
110 |
+ * @return int - 수정 성공 여부 |
|
111 |
+ * |
|
91 | 112 |
* 하위 부서 수정 |
92 | 113 |
*/ |
93 |
- public int updateChildNode(List<HierachyVO> childList, DeptVO upDeptVO) throws Exception; |
|
114 |
+ int updateChildNode(List<HierachyVO> childList, DeptVO upDeptVO); |
|
94 | 115 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
+++ src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
... | ... | @@ -6,6 +6,9 @@ |
6 | 6 |
import com.takensoft.cms.dept.vo.DeptMbrVO; |
7 | 7 |
import com.takensoft.cms.dept.vo.DeptVO; |
8 | 8 |
import com.takensoft.common.HierachyVO; |
9 |
+import com.takensoft.common.exception.CustomDeleteFailException; |
|
10 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
11 |
+import com.takensoft.common.exception.CustomUpdateFailException; |
|
9 | 12 |
import com.takensoft.common.idgen.service.IdgenService; |
10 | 13 |
import com.takensoft.common.util.JWTUtil; |
11 | 14 |
import com.takensoft.common.util.Secret; |
... | ... | @@ -13,6 +16,7 @@ |
13 | 16 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
14 | 17 |
import org.slf4j.Logger; |
15 | 18 |
import org.slf4j.LoggerFactory; |
19 |
+import org.springframework.dao.DataAccessException; |
|
16 | 20 |
import org.springframework.stereotype.Service; |
17 | 21 |
import org.springframework.transaction.annotation.Transactional; |
18 | 22 |
|
... | ... | @@ -22,11 +26,17 @@ |
22 | 26 |
|
23 | 27 |
/** |
24 | 28 |
* @author : takensoft |
25 |
- * @since : 2024.04.24 |
|
29 |
+ * @since :2024.04.24 |
|
30 |
+ * @modification |
|
31 |
+ * since | author | description |
|
32 |
+ * 2024.04.24 | takensoft | 최초 등록 |
|
33 |
+ * 2024.05.10 | 박정하 | updateList, updateChildNode 추가 |
|
34 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
26 | 35 |
* |
27 |
- * 부서 정보 관련 구현체 |
|
28 |
- * EgovAbstractServiceImpl : 전자정부 상속 |
|
29 |
- * DeptService : 부서 정보 인터페이스 상속 |
|
36 |
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스 |
|
37 |
+ * DeptService - 부서 정보 관련 서비스 인터페이스 |
|
38 |
+ * |
|
39 |
+ * 부서 정보 관련 DAO |
|
30 | 40 |
*/ |
31 | 41 |
@Service("deptService") |
32 | 42 |
@RequiredArgsConstructor |
... | ... | @@ -38,252 +48,423 @@ |
38 | 48 |
private final IdgenService deptIdgn; |
39 | 49 |
|
40 | 50 |
/** |
41 |
- * @author takensoft |
|
42 |
- * @since 2024.04.25 |
|
51 |
+ * @param deptVO - 부서 정보 VO |
|
52 |
+ * @return HashMap<String, Object> - 부서 정보 |
|
53 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
54 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
55 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
56 |
+ * |
|
43 | 57 |
* 부서 등록 |
44 | 58 |
*/ |
45 | 59 |
@Override |
46 | 60 |
@Transactional(rollbackFor = Exception.class) |
47 |
- public HashMap<String, Object> deptSave(DeptVO deptVO) throws Exception { |
|
48 |
- String deptId = deptIdgn.getNextStringId(); // 부서 아이디 생성 |
|
49 |
- deptVO.setDeptId(deptId); |
|
61 |
+ public HashMap<String, Object> deptSave(DeptVO deptVO) { |
|
62 |
+ try { |
|
63 |
+ int insertResult = 0; // 부서 등록 결과 |
|
64 |
+ String deptId = deptIdgn.getNextStringId(); // 부서 아이디 생성 |
|
65 |
+ deptVO.setDeptId(deptId); |
|
50 | 66 |
|
51 |
- // 상위 부서가 존재하는 경우 |
|
52 |
- if(deptVO.getUpDeptId() != null && !deptVO.getUpDeptId().equals("")) { |
|
53 |
- // 상위 부서보다 깊이(레벨) + 1 |
|
54 |
- deptVO.setDeptGrd(deptDAO.findByDeptGrd(deptVO.getUpDeptId()) + 1); |
|
55 |
- // 동일한 깊이의 부서 순서보다 + 1 |
|
56 |
- deptVO.setDeptSn(deptDAO.findByDeptSn(deptVO.getUpDeptId()) + 1); |
|
57 |
- // 상위 부서가 존재 하지 않는 경우 |
|
58 |
- } else { |
|
59 |
- deptVO.setDeptGrd(0); |
|
60 |
- deptVO.setDeptSn(deptDAO.findByDeptSn(null) + 1); |
|
61 |
- } |
|
62 |
- deptVO.setRgtr(jwtUtil.getWriter()); // 작성자 정보 등록 |
|
63 |
- int insertResult = deptDAO.save(deptVO); |
|
64 |
- // 부서 권한 등록 |
|
65 |
- if(deptVO.getAuthrtList().size() > 0) { |
|
66 |
- for(DeptAuthrtVO vo : deptVO.getAuthrtList()) { |
|
67 |
- vo.setDeptId(deptId); |
|
68 |
- vo.setRgtr(jwtUtil.getWriter()); |
|
69 |
- insertResult += deptDAO.authrtSave(vo); |
|
67 |
+ // 상위 부서가 존재하는 경우 |
|
68 |
+ if (deptVO.getUpDeptId() != null && !deptVO.getUpDeptId().equals("")) { |
|
69 |
+ // 상위 부서보다 깊이(레벨) + 1 |
|
70 |
+ deptVO.setDeptGrd(deptDAO.findByDeptGrd(deptVO.getUpDeptId()) + 1); |
|
71 |
+ // 동일한 깊이의 부서 순서보다 + 1 |
|
72 |
+ deptVO.setDeptSn(deptDAO.findByDeptSn(deptVO.getUpDeptId()) + 1); |
|
73 |
+ // 상위 부서가 존재 하지 않는 경우 |
|
74 |
+ } else { |
|
75 |
+ deptVO.setDeptGrd(0); |
|
76 |
+ deptVO.setDeptSn(deptDAO.findByDeptSn(null) + 1); |
|
70 | 77 |
} |
78 |
+ deptVO.setRgtr(jwtUtil.getWriter()); // 작성자 정보 등록 |
|
79 |
+ insertResult = deptDAO.save(deptVO); |
|
80 |
+ if(insertResult == 0) { |
|
81 |
+ throw new CustomInsertFailException("부서 등록 실패"); |
|
82 |
+ } |
|
83 |
+ // 부서 권한 등록 |
|
84 |
+ if (deptVO.getAuthrtList().size() > 0) { |
|
85 |
+ for (DeptAuthrtVO vo : deptVO.getAuthrtList()) { |
|
86 |
+ vo.setDeptId(deptId); |
|
87 |
+ vo.setRgtr(jwtUtil.getWriter()); |
|
88 |
+ int insertDeptAuth = deptDAO.authrtSave(vo); // 부서 권한 등록 결과 |
|
89 |
+ if(insertDeptAuth == 0) { |
|
90 |
+ throw new CustomInsertFailException("부서 권한 등록 실패"); |
|
91 |
+ } |
|
92 |
+ } |
|
93 |
+ } |
|
94 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
95 |
+ result.put("deptId", deptId); |
|
96 |
+ result.put("insertResult", insertResult); // 부서 등록 |
|
97 |
+ return result; |
|
98 |
+ } catch(DataAccessException dae) { |
|
99 |
+ throw dae; |
|
100 |
+ } catch (NullPointerException ne) { |
|
101 |
+ throw ne; |
|
102 |
+ } catch (Exception e) { |
|
103 |
+ throw new RuntimeException(e); |
|
71 | 104 |
} |
72 |
- HashMap<String, Object> result = new HashMap<>(); |
|
73 |
- result.put("deptId", deptId); |
|
74 |
- result.put("insertResult", insertResult); // 부서 등록 |
|
75 |
- return result; |
|
76 | 105 |
} |
77 | 106 |
|
78 | 107 |
/** |
79 |
- * @author takensoft |
|
80 |
- * @since 2024.04.29 |
|
108 |
+ * @param deptMbrVO - 부서 사용자 정보 VO |
|
109 |
+ * @return int - 부서 사용자 등록 결과 |
|
110 |
+ * @throws CustomInsertFailException - 부서 사용자 등록 실패 시 |
|
111 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
112 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
113 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
114 |
+ * |
|
81 | 115 |
* 부서 사용자 등록 |
82 | 116 |
*/ |
83 | 117 |
@Override |
84 |
- public int deptMbrSave(DeptMbrVO deptMbrVO) throws Exception { |
|
85 |
- deptMbrVO.setRgtr(jwtUtil.getWriter()); // 작성자 정보 등록 |
|
86 |
- return deptDAO.deptMbrSave(deptMbrVO); |
|
118 |
+ public int deptMbrSave(DeptMbrVO deptMbrVO) { |
|
119 |
+ try { |
|
120 |
+ // 부서 사용자 등록 결과 |
|
121 |
+ int result = 0; |
|
122 |
+ deptMbrVO.setRgtr(jwtUtil.getWriter()); // 작성자 정보 등록 |
|
123 |
+ result = deptDAO.deptMbrSave(deptMbrVO); // 부서 사용자 등록 |
|
124 |
+ if(result == 0) { |
|
125 |
+ throw new CustomInsertFailException("부서 사용자 등록 실패"); |
|
126 |
+ } |
|
127 |
+ return result; |
|
128 |
+ } catch(DataAccessException dae) { |
|
129 |
+ throw dae; |
|
130 |
+ } catch (NullPointerException ne) { |
|
131 |
+ throw ne; |
|
132 |
+ } catch (Exception e) { |
|
133 |
+ throw new RuntimeException(e); |
|
134 |
+ } |
|
87 | 135 |
} |
88 | 136 |
|
89 | 137 |
/************************************** Hierachy 전용 **************************************/ |
138 |
+ |
|
90 | 139 |
/** |
91 |
- * @author takensoft |
|
92 |
- * @since 2024.04.25 |
|
140 |
+ * @param |
|
141 |
+ * @return List<HierachyVO> - 최상위 부서 목록 |
|
142 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
143 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
144 |
+ * |
|
93 | 145 |
* 최상위 부서 조회 |
94 | 146 |
*/ |
95 | 147 |
@Override |
96 |
- public List<HierachyVO> findByTopNode() throws Exception { |
|
97 |
- List<HierachyVO> topDeptList = deptDAO.findByTopNode(); |
|
98 |
- for(HierachyVO vo : topDeptList) { |
|
99 |
- List<HierachyVO> child = findChildNode(vo.getId()); |
|
100 |
- vo.setChildList(child); |
|
148 |
+ public List<HierachyVO> findByTopNode() { |
|
149 |
+ try { |
|
150 |
+ List<HierachyVO> topDeptList = deptDAO.findByTopNode(); |
|
151 |
+ for (HierachyVO vo : topDeptList) { |
|
152 |
+ List<HierachyVO> child = findChildNode(vo.getId()); |
|
153 |
+ vo.setChildList(child); |
|
154 |
+ } |
|
155 |
+ return topDeptList; |
|
156 |
+ } catch(DataAccessException dae) { |
|
157 |
+ throw dae; |
|
158 |
+ } catch (Exception e) { |
|
159 |
+ throw new RuntimeException(e); |
|
101 | 160 |
} |
102 |
- return topDeptList; |
|
103 | 161 |
} |
104 | 162 |
|
105 | 163 |
/** |
106 |
- * @author takensoft |
|
107 |
- * @since 2024.04.25 |
|
164 |
+ * @param id - 상위 부서 아이디 |
|
165 |
+ * @return List<HierachyVO> - 하위 부서 목록 |
|
166 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
167 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
168 |
+ * |
|
108 | 169 |
* 하위 부서 조회 |
109 | 170 |
*/ |
110 | 171 |
@Override |
111 |
- public List<HierachyVO> findChildNode(String id) throws Exception { |
|
112 |
- List<HierachyVO> childList = deptDAO.findChildNode(id); |
|
113 |
- for(HierachyVO vo : childList) { |
|
114 |
- List<HierachyVO> child = findChildNode(vo.getId()); |
|
115 |
- vo.setChildList(child); |
|
172 |
+ public List<HierachyVO> findChildNode(String id) { |
|
173 |
+ try { |
|
174 |
+ List<HierachyVO> childList = deptDAO.findChildNode(id); |
|
175 |
+ for (HierachyVO vo : childList) { |
|
176 |
+ List<HierachyVO> child = findChildNode(vo.getId()); |
|
177 |
+ vo.setChildList(child); |
|
178 |
+ } |
|
179 |
+ return childList; |
|
180 |
+ } catch(DataAccessException dae) { |
|
181 |
+ throw dae; |
|
182 |
+ } catch (Exception e) { |
|
183 |
+ throw new RuntimeException(e); |
|
116 | 184 |
} |
117 |
- return childList; |
|
118 | 185 |
} |
119 | 186 |
/************************************** Hierachy 전용 **************************************/ |
120 | 187 |
|
121 | 188 |
/** |
122 |
- * @author takensoft |
|
123 |
- * @since 2024.04.26 |
|
189 |
+ * @param params- 부서 아이디 |
|
190 |
+ * @return Map<String, Object> - 부서 정보 |
|
191 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
192 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
193 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
194 |
+ * |
|
124 | 195 |
* 부서 정보 조회 |
125 | 196 |
*/ |
126 | 197 |
@Override |
127 |
- public Map<String, Object> findByDept(HashMap<String, Object> params) throws Exception { |
|
128 |
- String deptId = params.get("deptId").toString(); // 아이디 추출 |
|
129 |
- DeptVO dept = deptDAO.findByDept(deptId); // 부서 정보 조회 |
|
130 |
- List<DeptMbrVO> deptMbr = deptDAO.findByDeptMber(deptId); // 부서에 등록된 사용자 정보 조회 |
|
131 |
- // 사용자 정보 복호화 |
|
132 |
- if(deptMbr.size() > 0) { |
|
133 |
- for(DeptMbrVO vo : deptMbr) { |
|
134 |
- // 연락처 복호화 |
|
135 |
- vo.setMblTelno(Secret.decrypt(vo.getMblTelno().toString())); |
|
198 |
+ public Map<String, Object> findByDept(HashMap<String, Object> params) { |
|
199 |
+ try { |
|
200 |
+ String deptId = params.get("deptId").toString(); // 아이디 추출 |
|
201 |
+ DeptVO dept = deptDAO.findByDept(deptId); // 부서 정보 조회 |
|
202 |
+ List<DeptMbrVO> deptMbr = deptDAO.findByDeptMber(deptId); // 부서에 등록된 사용자 정보 조회 |
|
203 |
+ // 사용자 정보 복호화 |
|
204 |
+ if (deptMbr.size() > 0) { |
|
205 |
+ for (DeptMbrVO vo : deptMbr) { |
|
206 |
+ // 연락처 복호화 |
|
207 |
+ vo.setMblTelno(Secret.decrypt(vo.getMblTelno().toString())); |
|
208 |
+ } |
|
136 | 209 |
} |
210 |
+ Map<String, Object> result = new HashMap<String, Object>(); // 반환 객체 생성 |
|
211 |
+ result.put("dept", dept); // 부서 상세 정보 |
|
212 |
+ result.put("deptMbr", deptMbr); // 부서 사용자 목록 정보 |
|
213 |
+ return result; |
|
214 |
+ } catch(DataAccessException dae) { |
|
215 |
+ throw dae; |
|
216 |
+ } catch (NullPointerException ne) { |
|
217 |
+ throw ne; |
|
218 |
+ } catch (Exception e) { |
|
219 |
+ throw new RuntimeException(e); |
|
137 | 220 |
} |
138 |
- Map<String, Object> result = new HashMap<String, Object>(); // 반환 객체 생성 |
|
139 |
- result.put("dept", dept); // 부서 상세 정보 |
|
140 |
- result.put("deptMbr", deptMbr); // 부서 사용자 목록 정보 |
|
141 |
- return result; |
|
142 | 221 |
} |
143 | 222 |
|
144 | 223 |
/** |
145 |
- * @author takensoft |
|
146 |
- * @since 2024.04.26 |
|
224 |
+ * @param deptVO - 부서 정보 VO |
|
225 |
+ * @return int - 부서 정보 수정 결과 |
|
226 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
227 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
228 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
229 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
230 |
+ * |
|
147 | 231 |
* 부서 정보 수정 |
148 | 232 |
*/ |
149 | 233 |
@Override |
150 | 234 |
@Transactional(rollbackFor = Exception.class) |
151 |
- public int deptUpdate(DeptVO deptVO) throws Exception { |
|
152 |
- deptVO.setMdfr(jwtUtil.getWriter()); // 토큰에서 사용자 정보 추출 |
|
153 |
- int result = deptDAO.update(deptVO); // 부서정보 수정 |
|
154 |
- result += deptDAO.deleteAuth(deptVO.getDeptId()); // 부서 권한 삭제 |
|
155 |
- // 부서 권한 등록 |
|
156 |
- if(deptVO.getAuthrtList().size() > 0) { |
|
157 |
- for(DeptAuthrtVO vo : deptVO.getAuthrtList()) { |
|
158 |
- vo.setDeptId(deptVO.getDeptId()); |
|
159 |
- vo.setRgtr(jwtUtil.getWriter()); |
|
160 |
- result += deptDAO.authrtSave(vo); |
|
235 |
+ public int deptUpdate(DeptVO deptVO) { |
|
236 |
+ try { |
|
237 |
+ // 부서 정보 수정 결과 |
|
238 |
+ int result = 0; |
|
239 |
+ deptVO.setMdfr(jwtUtil.getWriter()); // 토큰에서 사용자 정보 추출 |
|
240 |
+ result = deptDAO.update(deptVO); // 부서정보 수정 |
|
241 |
+ if (result == 0) { |
|
242 |
+ throw new CustomUpdateFailException("부서 정보 수정 실패"); |
|
161 | 243 |
} |
244 |
+ // 부서 권한 삭제 결과 |
|
245 |
+ int deleteDeptAuth = deptDAO.deleteAuth(deptVO.getDeptId()); // 부서 권한 삭제 |
|
246 |
+ if (deleteDeptAuth == 0) { |
|
247 |
+ throw new CustomUpdateFailException("부서 권한 삭제 실패"); |
|
248 |
+ } |
|
249 |
+ // 부서 권한 등록 |
|
250 |
+ if (deptVO.getAuthrtList().size() > 0) { |
|
251 |
+ for (DeptAuthrtVO vo : deptVO.getAuthrtList()) { |
|
252 |
+ vo.setDeptId(deptVO.getDeptId()); |
|
253 |
+ vo.setRgtr(jwtUtil.getWriter()); |
|
254 |
+ int insertDeptAuth = deptDAO.authrtSave(vo); // 부서 권한 등록 결과 |
|
255 |
+ if (insertDeptAuth == 0) { |
|
256 |
+ throw new CustomInsertFailException("부서 권한 등록 실패"); |
|
257 |
+ } |
|
258 |
+ } |
|
259 |
+ } |
|
260 |
+ return result; |
|
261 |
+ } catch(DataAccessException dae) { |
|
262 |
+ throw dae; |
|
263 |
+ } catch (NullPointerException ne) { |
|
264 |
+ throw ne; |
|
265 |
+ } catch (Exception e) { |
|
266 |
+ throw new RuntimeException(e); |
|
162 | 267 |
} |
163 |
- return result; |
|
164 | 268 |
} |
165 | 269 |
|
166 | 270 |
/** |
167 |
- * @author takensoft |
|
168 |
- * @since 2024.04.26 |
|
271 |
+ * @param deptVO - 부서 정보 VO |
|
272 |
+ * @return int - 부서 정보 삭제 결과 |
|
273 |
+ * @throws CustomDeleteFailException - 삭제 실패 예외 발생 시 |
|
274 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
275 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
276 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
277 |
+ * |
|
169 | 278 |
* 부서 정보 삭제 |
170 | 279 |
*/ |
171 | 280 |
@Override |
172 | 281 |
@Transactional(rollbackFor = Exception.class) |
173 |
- public int deptDelete(DeptVO deptVO) throws Exception { |
|
174 |
- int result = deptDAO.deleteDept(deptVO.getDeptId()); |
|
175 |
- result += deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId()); |
|
176 |
- return result; |
|
282 |
+ public int deptDelete(DeptVO deptVO) { |
|
283 |
+ int delResult = 0; // 부서 삭제 결과 |
|
284 |
+ delResult = deptDAO.deleteDept(deptVO.getDeptId()); |
|
285 |
+ if (delResult == 0) { |
|
286 |
+ throw new CustomDeleteFailException("부서 삭제 실패"); |
|
287 |
+ } |
|
288 |
+ |
|
289 |
+ int deleteDeptAuth = 0; // 부서 권한 삭제 결과 |
|
290 |
+ deleteDeptAuth = deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId()); |
|
291 |
+ if (deleteDeptAuth == 0) { |
|
292 |
+ throw new CustomDeleteFailException("부서 권한 삭제 실패"); |
|
293 |
+ } |
|
294 |
+ return delResult; |
|
177 | 295 |
} |
178 | 296 |
|
179 | 297 |
/** |
180 |
- * @author takensoft |
|
181 |
- * @since 2024.04.26 |
|
298 |
+ * @param deptMbrList - 부서 사용자 정보 VO |
|
299 |
+ * @return int - 부서 사용자 정보 삭제 결과 |
|
300 |
+ * @throws CustomDeleteFailException - 삭제 실패 예외 발생 시 |
|
301 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
302 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
303 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
304 |
+ * |
|
182 | 305 |
* 부서 사용자 삭제 |
183 | 306 |
*/ |
184 | 307 |
@Override |
185 | 308 |
@Transactional(rollbackFor = Exception.class) |
186 |
- public int deptMbrDelete(List<DeptMbrVO> deptMbrList) throws Exception { |
|
187 |
- int result = 0; |
|
309 |
+ public int deptMbrDelete(List<DeptMbrVO> deptMbrList) { |
|
310 |
+ int result = 0; // 부서 사용자 삭제 결과 |
|
188 | 311 |
if(deptMbrList.size() == 0) return 0; |
312 |
+ |
|
189 | 313 |
for(DeptMbrVO vo : deptMbrList) { |
190 | 314 |
Map<String, Object> param = new HashMap<String, Object>(); |
191 | 315 |
param.put("mbrId", vo.getMbrId()); |
192 |
- result += deptDAO.deleteDeptMbr(param); |
|
316 |
+ int delMbrResult = deptDAO.deleteDeptMbr(param); // 부서 사용자 삭제 |
|
317 |
+ if (delMbrResult == 0) { |
|
318 |
+ throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
319 |
+ } |
|
320 |
+ result += delMbrResult; |
|
193 | 321 |
} |
194 | 322 |
return result; |
195 | 323 |
} |
196 | 324 |
|
197 | 325 |
/** |
198 |
- * @author takensoft |
|
199 |
- * @since 2024.04.29 |
|
326 |
+ * @param params - 부서 아이디 |
|
327 |
+ * @return Map<String, Object> - 부서에 등록되지 않는 사용자 정보 |
|
328 |
+ * @throws CustomDeleteFailException - 삭제 실패 예외 발생 시 |
|
329 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
330 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
331 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
332 |
+ * |
|
200 | 333 |
* 부서에 등록되지 않는 사용자 조회 |
201 | 334 |
*/ |
202 | 335 |
@Override |
203 |
- public Map<String, Object> findByMbr(Map<String, String> params) throws Exception { |
|
204 |
- List<DeptMbrVO> mbrList = deptDAO.findByMber(params); // 부서에 등록되지 않는 사용자 조회 |
|
205 |
- // 사용자 정보 복호화 |
|
206 |
- if(mbrList.size() > 0) { |
|
207 |
- for(DeptMbrVO vo : mbrList) { |
|
208 |
- // 연락처 복호화 |
|
209 |
- vo.setMblTelno(Secret.decrypt(vo.getMblTelno().toString())); |
|
336 |
+ public Map<String, Object> findByMbr(Map<String, String> params) { |
|
337 |
+ try { |
|
338 |
+ List<DeptMbrVO> mbrList = deptDAO.findByMber(params); // 부서에 등록되지 않는 사용자 조회 |
|
339 |
+ // 사용자 정보 복호화 |
|
340 |
+ if (mbrList.size() > 0) { |
|
341 |
+ for (DeptMbrVO vo : mbrList) { |
|
342 |
+ // 연락처 복호화 |
|
343 |
+ vo.setMblTelno(Secret.decrypt(vo.getMblTelno().toString())); |
|
344 |
+ } |
|
210 | 345 |
} |
211 |
- } |
|
212 |
- List<DeptMbrVO> deptMbr = deptDAO.findByDeptMber(params.get("deptId").toString()); // 부서에 등록된 사용자 정보 조회 |
|
213 |
- // 사용자 정보 복호화 |
|
214 |
- if(deptMbr.size() > 0) { |
|
215 |
- for(DeptMbrVO vo : deptMbr) { |
|
216 |
- // 연락처 복호화 |
|
217 |
- vo.setMblTelno(Secret.decrypt(vo.getMblTelno().toString())); |
|
346 |
+ List<DeptMbrVO> deptMbr = deptDAO.findByDeptMber(params.get("deptId").toString()); // 부서에 등록된 사용자 정보 조회 |
|
347 |
+ // 사용자 정보 복호화 |
|
348 |
+ if (deptMbr.size() > 0) { |
|
349 |
+ for (DeptMbrVO vo : deptMbr) { |
|
350 |
+ // 연락처 복호화 |
|
351 |
+ vo.setMblTelno(Secret.decrypt(vo.getMblTelno().toString())); |
|
352 |
+ } |
|
218 | 353 |
} |
219 |
- } |
|
220 | 354 |
|
221 |
- Map<String, Object> result = new HashMap<String, Object>(); // 반환 객체 생성 |
|
222 |
- result.put("mbrList", mbrList); // 부서에 등록되지 않는 사용자 정보 |
|
223 |
- result.put("deptMbr", deptMbr); // 부서 사용자 목록 정보 |
|
224 |
- return result; |
|
355 |
+ Map<String, Object> result = new HashMap<String, Object>(); // 반환 객체 생성 |
|
356 |
+ result.put("mbrList", mbrList); // 부서에 등록되지 않는 사용자 정보 |
|
357 |
+ result.put("deptMbr", deptMbr); // 부서 사용자 목록 정보 |
|
358 |
+ return result; |
|
359 |
+ } catch(DataAccessException dae) { |
|
360 |
+ throw dae; |
|
361 |
+ } catch (NullPointerException ne) { |
|
362 |
+ throw ne; |
|
363 |
+ } catch (Exception e) { |
|
364 |
+ throw new RuntimeException(e); |
|
365 |
+ } |
|
225 | 366 |
} |
226 | 367 |
|
227 | 368 |
/** |
228 |
- * @author 박정하 |
|
229 |
- * @since 2024.05.10 |
|
230 |
- * 부서 정보 수정 (hierachyVO 사용) |
|
369 |
+ * @param params - 부서 아이디 |
|
370 |
+ * @return Map<String, Object> - 부서에 등록되지 않는 사용자 정보 |
|
371 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
372 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
373 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
374 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
375 |
+ * |
|
376 |
+ * 부서에 등록되지 않는 사용자 조회 |
|
231 | 377 |
*/ |
232 | 378 |
@Override |
233 | 379 |
@Transactional(rollbackFor = Exception.class) |
234 |
- public int updateList(List<HierachyVO> deptList) throws Exception { |
|
235 |
- int result = 0; |
|
236 |
- String writer = jwtUtil.getWriter(); |
|
380 |
+ public int updateList(List<HierachyVO> deptList) { |
|
381 |
+ try { |
|
382 |
+ int result = 0; |
|
383 |
+ String writer = jwtUtil.getWriter(); |
|
237 | 384 |
|
238 |
- if(deptList != null && deptList.size() > 0) { |
|
239 |
- int sn = 1; |
|
240 |
- for(HierachyVO hierachyVO : deptList) { |
|
241 |
- // 최상위 노드 수정 |
|
242 |
- DeptVO vo = new DeptVO(); |
|
243 |
- vo.setDeptId(hierachyVO.getId()); |
|
244 |
- vo.setUpDeptId(null); |
|
245 |
- vo.setDeptGrd(0); |
|
246 |
- vo.setDeptSn(sn); |
|
247 |
- vo.setMdfr(writer); |
|
248 |
- result += deptDAO.deptUpdateByHierachy(vo); |
|
385 |
+ if (deptList != null && deptList.size() > 0) { |
|
386 |
+ int sn = 1; |
|
387 |
+ for (HierachyVO hierachyVO : deptList) { |
|
388 |
+ // 최상위 노드 수정 |
|
389 |
+ DeptVO vo = new DeptVO(); |
|
390 |
+ vo.setDeptId(hierachyVO.getId()); |
|
391 |
+ vo.setUpDeptId(null); |
|
392 |
+ vo.setDeptGrd(0); |
|
393 |
+ vo.setDeptSn(sn); |
|
394 |
+ vo.setMdfr(writer); |
|
395 |
+ int updateResult = deptDAO.deptUpdateByHierachy(vo); |
|
396 |
+ if (updateResult == 0) { |
|
397 |
+ throw new CustomUpdateFailException("부서 정보 수정 실패"); |
|
398 |
+ } |
|
399 |
+ result += updateResult; |
|
249 | 400 |
|
250 |
- // 하위 노드 수정 |
|
251 |
- if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
|
252 |
- result += updateChildNode(hierachyVO.getChildList(), vo); |
|
401 |
+ // 하위 노드 수정 |
|
402 |
+ if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
|
403 |
+ int updateChild= updateChildNode(hierachyVO.getChildList(), vo); |
|
404 |
+ } |
|
405 |
+ sn++; |
|
253 | 406 |
} |
254 |
- sn++; |
|
255 | 407 |
} |
408 |
+ return result; |
|
409 |
+ } catch(CustomUpdateFailException cufe) { |
|
410 |
+ throw cufe; |
|
411 |
+ } catch(DataAccessException dae) { |
|
412 |
+ throw dae; |
|
413 |
+ } catch (NullPointerException ne) { |
|
414 |
+ throw ne; |
|
415 |
+ } catch (Exception e) { |
|
416 |
+ throw new RuntimeException(e); |
|
256 | 417 |
} |
257 |
- return result; |
|
258 | 418 |
} |
259 | 419 |
/** |
260 |
- * @author 박정하 |
|
261 |
- * @since 2024.05.10 |
|
420 |
+ * @param childList - 부서 자식 목록 객체 |
|
421 |
+ * @param upDeptVO - 상위 부서 객체 |
|
422 |
+ * @return Map<String, Object> - 부서에 등록되지 않는 사용자 정보 |
|
423 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
424 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
425 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
426 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
427 |
+ * |
|
262 | 428 |
* 하위 부서 수정 |
263 | 429 |
*/ |
264 | 430 |
@Override |
265 |
- public int updateChildNode(List<HierachyVO> childList, DeptVO upDeptVO) throws Exception { |
|
266 |
- int result = 0; |
|
267 |
- String upDeptId = upDeptVO.getDeptId(); |
|
268 |
- int grd = upDeptVO.getDeptGrd() + 1; |
|
269 |
- int sn = 1; |
|
270 |
- String mdfr = upDeptVO.getMdfr(); |
|
271 |
- for(HierachyVO hierachyVO : childList) { |
|
272 |
- // 현재 노드 수정 |
|
273 |
- DeptVO vo = new DeptVO(); |
|
274 |
- vo.setDeptId(hierachyVO.getId()); |
|
275 |
- vo.setUpDeptId(upDeptId); |
|
276 |
- vo.setDeptGrd(grd); |
|
277 |
- vo.setDeptSn(sn); |
|
278 |
- vo.setMdfr(mdfr); |
|
279 |
- result += deptDAO.deptUpdateByHierachy(vo); |
|
431 |
+ public int updateChildNode(List<HierachyVO> childList, DeptVO upDeptVO) { |
|
432 |
+ try { |
|
433 |
+ int result = 0; // 부서 정보 수정 결과 |
|
434 |
+ String upDeptId = upDeptVO.getDeptId(); |
|
435 |
+ int grd = upDeptVO.getDeptGrd() + 1; |
|
436 |
+ int sn = 1; |
|
437 |
+ String mdfr = upDeptVO.getMdfr(); |
|
438 |
+ for (HierachyVO hierachyVO : childList) { |
|
439 |
+ // 현재 노드 수정 |
|
440 |
+ DeptVO vo = new DeptVO(); |
|
441 |
+ vo.setDeptId(hierachyVO.getId()); |
|
442 |
+ vo.setUpDeptId(upDeptId); |
|
443 |
+ vo.setDeptGrd(grd); |
|
444 |
+ vo.setDeptSn(sn); |
|
445 |
+ vo.setMdfr(mdfr); |
|
446 |
+ int updateResult = deptDAO.deptUpdateByHierachy(vo); |
|
447 |
+ if (updateResult == 0) { |
|
448 |
+ throw new CustomUpdateFailException("부서 정보 수정 실패"); |
|
449 |
+ } |
|
450 |
+ result += updateResult; |
|
280 | 451 |
|
281 |
- // 하위 노드 수정 |
|
282 |
- if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
|
283 |
- result += updateChildNode(hierachyVO.getChildList(), vo); |
|
452 |
+ // 하위 노드 수정 |
|
453 |
+ if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
|
454 |
+ // 하위 노드 수정 결과 |
|
455 |
+ int updateChild = updateChildNode(hierachyVO.getChildList(), vo); |
|
456 |
+ } |
|
457 |
+ sn++; |
|
284 | 458 |
} |
285 |
- sn++; |
|
459 |
+ return result; |
|
460 |
+ } catch(CustomUpdateFailException cufe) { |
|
461 |
+ throw cufe; |
|
462 |
+ } catch(DataAccessException dae) { |
|
463 |
+ throw dae; |
|
464 |
+ } catch (NullPointerException ne) { |
|
465 |
+ throw ne; |
|
466 |
+ } catch (Exception e) { |
|
467 |
+ throw new RuntimeException(e); |
|
286 | 468 |
} |
287 |
- return result; |
|
288 | 469 |
} |
289 | 470 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/dept/vo/DeptAuthrtVO.java
+++ src/main/java/com/takensoft/cms/dept/vo/DeptAuthrtVO.java
... | ... | @@ -5,6 +5,10 @@ |
5 | 5 |
/** |
6 | 6 |
* @author : takensoft |
7 | 7 |
* @since : 2024.04.25 |
8 |
+ * @modification |
|
9 |
+ * since | author | description |
|
10 |
+ * 2024.04.25 | takensoft | 최초 등록 |
|
11 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
8 | 12 |
* |
9 | 13 |
* 부서 권한 정보 관련 VO |
10 | 14 |
*/ |
... | ... | @@ -15,20 +19,8 @@ |
15 | 19 |
@AllArgsConstructor |
16 | 20 |
@NoArgsConstructor |
17 | 21 |
public class DeptAuthrtVO { |
18 |
- /** |
|
19 |
- * 부서 아이디 |
|
20 |
- */ |
|
21 |
- private String deptId; |
|
22 |
- /** |
|
23 |
- * 권한 코드 |
|
24 |
- */ |
|
25 |
- private String authrtCd; |
|
26 |
- /** |
|
27 |
- * 작성자 |
|
28 |
- */ |
|
29 |
- private String rgtr; |
|
30 |
- /** |
|
31 |
- * 작성일 |
|
32 |
- */ |
|
33 |
- private String regDt; |
|
22 |
+ private String deptId; // 부서 아이디 |
|
23 |
+ private String authrtCd; // 권한 코드 |
|
24 |
+ private String rgtr; // 작성자 |
|
25 |
+ private String regDt; // 작성일 |
|
34 | 26 |
} |
--- src/main/java/com/takensoft/cms/dept/vo/DeptMbrVO.java
+++ src/main/java/com/takensoft/cms/dept/vo/DeptMbrVO.java
... | ... | @@ -8,6 +8,10 @@ |
8 | 8 |
/** |
9 | 9 |
* @author : takensoft |
10 | 10 |
* @since : 2024.04.26 |
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.04.26 | takensoft | 최초 등록 |
|
14 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
11 | 15 |
* |
12 | 16 |
* 부서 사용자 정보 관련 VO |
13 | 17 |
*/ |
... | ... | @@ -16,40 +20,13 @@ |
16 | 20 |
@NoArgsConstructor |
17 | 21 |
@AllArgsConstructor |
18 | 22 |
public class DeptMbrVO { |
19 |
- /** |
|
20 |
- * 부서 아이디 |
|
21 |
- */ |
|
22 |
- private String deptId; |
|
23 |
- /** |
|
24 |
- * 회원 아이디 |
|
25 |
- */ |
|
26 |
- private String mbrId; |
|
27 |
- /** |
|
28 |
- * 로그인 아이디 |
|
29 |
- */ |
|
30 |
- private String lgnId; |
|
31 |
- /** |
|
32 |
- * 회원 이름 |
|
33 |
- */ |
|
34 |
- private String mbrNm; |
|
35 |
- /** |
|
36 |
- * 닉네임 |
|
37 |
- */ |
|
38 |
- private String ncnm; |
|
39 |
- /** |
|
40 |
- * 이메일 |
|
41 |
- */ |
|
42 |
- private String eml; |
|
43 |
- /** |
|
44 |
- * 연락처 |
|
45 |
- */ |
|
46 |
- private String mblTelno; |
|
47 |
- /** |
|
48 |
- * 등록자 |
|
49 |
- */ |
|
50 |
- private String rgtr; |
|
51 |
- /** |
|
52 |
- * 등록일 |
|
53 |
- */ |
|
54 |
- private String regDt; |
|
23 |
+ private String deptId; // 부서 아이디 |
|
24 |
+ private String mbrId; // 회원 아이디 |
|
25 |
+ private String lgnId; // 로그인 아이디 |
|
26 |
+ private String mbrNm; // 회원 이름 |
|
27 |
+ private String ncnm; // 닉네임 |
|
28 |
+ private String eml; // 이메일 |
|
29 |
+ private String mblTelno; // 연락처 |
|
30 |
+ private String rgtr; // 등록자 |
|
31 |
+ private String regDt; // 등록일 |
|
55 | 32 |
} |
--- src/main/java/com/takensoft/cms/dept/vo/DeptVO.java
+++ src/main/java/com/takensoft/cms/dept/vo/DeptVO.java
... | ... | @@ -12,6 +12,10 @@ |
12 | 12 |
/** |
13 | 13 |
* @author : takensoft |
14 | 14 |
* @since : 2024.04.24 |
15 |
+ * @modification |
|
16 |
+ * since | author | description |
|
17 |
+ * 2024.04.24 | takensoft | 최초 등록 |
|
18 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
15 | 19 |
* |
16 | 20 |
* 부서 정보 관련 VO |
17 | 21 |
*/ |
... | ... | @@ -20,57 +24,18 @@ |
20 | 24 |
@NoArgsConstructor |
21 | 25 |
@AllArgsConstructor |
22 | 26 |
public class DeptVO { |
23 |
- /** |
|
24 |
- * 부서 아이디 |
|
25 |
- */ |
|
26 |
- private String deptId; |
|
27 |
- /** |
|
28 |
- * 상위 부서 아이디 |
|
29 |
- */ |
|
30 |
- private String upDeptId; |
|
31 |
- /** |
|
32 |
- * 부서명 |
|
33 |
- */ |
|
34 |
- private String deptNm; |
|
35 |
- /** |
|
36 |
- * 상위부서명 |
|
37 |
- */ |
|
38 |
- private String upDeptNm; |
|
39 |
- /** |
|
40 |
- * 부서설명 |
|
41 |
- */ |
|
42 |
- private String deptExpln; |
|
43 |
- /** |
|
44 |
- * 부서 깊이(레벨) |
|
45 |
- */ |
|
46 |
- private int deptGrd; |
|
47 |
- /** |
|
48 |
- * 부서 순서 |
|
49 |
- */ |
|
50 |
- private int deptSn; |
|
51 |
- /** |
|
52 |
- * 사용여부 |
|
53 |
- */ |
|
54 |
- private String useYn; |
|
55 |
- /** |
|
56 |
- * 작성자 |
|
57 |
- */ |
|
58 |
- private String rgtr; |
|
59 |
- /** |
|
60 |
- * 작성일 |
|
61 |
- */ |
|
62 |
- private String regDt; |
|
63 |
- /** |
|
64 |
- * 수정자 |
|
65 |
- */ |
|
66 |
- private String mdfr; |
|
67 |
- /** |
|
68 |
- * 수정일 |
|
69 |
- */ |
|
70 |
- private String mdfcnDt; |
|
71 |
- /** |
|
72 |
- * 권한정보 |
|
73 |
- */ |
|
74 |
- private List<DeptAuthrtVO> authrtList = new ArrayList<DeptAuthrtVO>(); |
|
27 |
+ private String deptId; // 부서 아이디 |
|
28 |
+ private String upDeptId; // 상위 부서 아이디 |
|
29 |
+ private String deptNm; // 부서명 |
|
30 |
+ private String upDeptNm; // 상위부서명 |
|
31 |
+ private String deptExpln; // 부서설명 |
|
32 |
+ private int deptGrd; // 부서 깊이(레벨) |
|
33 |
+ private int deptSn; // 부서 순서 |
|
34 |
+ private String useYn; // 사용여부 |
|
35 |
+ private String rgtr; // 작성자 |
|
36 |
+ private String regDt; // 작성일 |
|
37 |
+ private String mdfr; // 수정자 |
|
38 |
+ private String mdfcnDt; // 수정일 |
|
39 |
+ private List<DeptAuthrtVO> authrtList = new ArrayList<DeptAuthrtVO>(); // 권한정보 |
|
75 | 40 |
|
76 | 41 |
} |
--- src/main/java/com/takensoft/cms/dept/web/DeptController.java
+++ src/main/java/com/takensoft/cms/dept/web/DeptController.java
... | ... | @@ -21,12 +21,15 @@ |
21 | 21 |
import java.util.HashMap; |
22 | 22 |
import java.util.List; |
23 | 23 |
import java.util.Map; |
24 |
+ |
|
24 | 25 |
/** |
25 |
- * @author takensoft |
|
26 |
- * @since 2024.04.24 |
|
26 |
+ * @author : takensoft |
|
27 |
+ * @since :2024.04.24 |
|
27 | 28 |
* @modification |
28 | 29 |
* since | author | description |
29 | 30 |
* 2024.04.24 | takensoft | 최초 등록 |
31 |
+ * 2024.05.10 | 박정하 | updateListProc 추가 |
|
32 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
30 | 33 |
* |
31 | 34 |
* 부서 정보 관련 컨트롤러 |
32 | 35 |
*/ |
... | ... | @@ -41,39 +44,26 @@ |
41 | 44 |
private final AuthorService authorService; |
42 | 45 |
|
43 | 46 |
/** |
44 |
- * @author takensoft |
|
45 |
- * @since 2024.04.25 |
|
46 |
- * @param deptVO |
|
47 |
- * @return |
|
48 |
- * @throws Exception |
|
49 |
- * |
|
47 |
+ * @param deptVO - 부서 정보 |
|
48 |
+ * @return ResponseEntity - 부서 등록 결과 |
|
49 |
+ * |
|
50 | 50 |
* 부서 등록 |
51 | 51 |
*/ |
52 | 52 |
@PostMapping("/saveProc.json") |
53 |
- public ResponseEntity<?> saveProc(@RequestBody DeptVO deptVO) throws Exception { |
|
53 |
+ public ResponseEntity<?> saveProc(@RequestBody DeptVO deptVO) { |
|
54 | 54 |
// 부서 등록 |
55 | 55 |
HashMap<String, Object> result = deptService.deptSave(deptVO); |
56 |
- int insertResult = (int) result.get("insertResult"); |
|
57 |
- |
|
58 |
- // 응답 처리 |
|
59 |
- if(insertResult > 0) { |
|
60 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
61 |
- } else { |
|
62 |
- return resUtil.errorRes(MessageCode.COMMON_INSERT_FAIL); |
|
63 |
- } |
|
56 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
64 | 57 |
} |
65 | 58 |
|
66 | 59 |
/** |
67 |
- * @author takensoft |
|
68 |
- * @since 2024.04.29 |
|
69 |
- * @param deptMbrVO |
|
70 |
- * @return |
|
71 |
- * @throws Exception |
|
60 |
+ * @param deptMbrVO - 부서 사용자 정보 |
|
61 |
+ * @return ResponseEntity - 부서 사용자 등록 결과 |
|
72 | 62 |
* |
73 | 63 |
* 부서 사용자 등록 |
74 | 64 |
*/ |
75 | 65 |
@PostMapping("/deptMbrSaveProc.json") |
76 |
- public ResponseEntity<?> deptMbrSaveProc(@RequestBody DeptMbrVO deptMbrVO) throws Exception { |
|
66 |
+ public ResponseEntity<?> deptMbrSaveProc(@RequestBody DeptMbrVO deptMbrVO) { |
|
77 | 67 |
// 부서 사용자 등록 |
78 | 68 |
int result = deptService.deptMbrSave(deptMbrVO); |
79 | 69 |
|
... | ... | @@ -86,16 +76,13 @@ |
86 | 76 |
} |
87 | 77 |
|
88 | 78 |
/** |
89 |
- * @author takensoft |
|
90 |
- * @since 2024.04.25 |
|
91 | 79 |
* @param |
92 |
- * @return |
|
93 |
- * @throws Exception |
|
80 |
+ * @return ResponseEntity - 부서 목록 조회 결과 |
|
94 | 81 |
* |
95 | 82 |
* 부서 목록 조회 |
96 | 83 |
*/ |
97 | 84 |
@GetMapping(value = "/findAll.json") |
98 |
- public ResponseEntity<?> findAll() throws Exception { |
|
85 |
+ public ResponseEntity<?> findAll() { |
|
99 | 86 |
// Tree용 |
100 | 87 |
List<HierachyVO> hierachyList = deptService.findByTopNode(); |
101 | 88 |
// 권한 목록 조회 |
... | ... | @@ -111,16 +98,13 @@ |
111 | 98 |
} |
112 | 99 |
|
113 | 100 |
/** |
114 |
- * @author takensoft |
|
115 |
- * @since 2024.04.26 |
|
116 |
- * @param |
|
117 |
- * @return |
|
118 |
- * @throws Exception |
|
101 |
+ * @param params - 부서 정보 |
|
102 |
+ * @return ResponseEntity - 부서 정보 조회 결과 |
|
119 | 103 |
* |
120 |
- * 부서정보 상세 조회 |
|
104 |
+ * 부서 정보 상세 조회 |
|
121 | 105 |
*/ |
122 | 106 |
@PostMapping(value = "/findByDept.json") |
123 |
- public ResponseEntity<?> findByDept(@RequestBody HashMap<String, Object> params) throws Exception { |
|
107 |
+ public ResponseEntity<?> findByDept(@RequestBody HashMap<String, Object> params) { |
|
124 | 108 |
// 부서정보 조회 |
125 | 109 |
Map<String, Object> result = deptService.findByDept(params); |
126 | 110 |
|
... | ... | @@ -129,108 +113,72 @@ |
129 | 113 |
} |
130 | 114 |
|
131 | 115 |
/** |
132 |
- * @author takensoft |
|
133 |
- * @since 2024.04.26 |
|
134 |
- * @param deptVO |
|
135 |
- * @return |
|
136 |
- * @throws Exception |
|
116 |
+ * @param deptVO - 부서 정보 |
|
117 |
+ * @return ResponseEntity - 부서 정보 조회 결과 |
|
137 | 118 |
* |
138 | 119 |
* 부서 수정 |
139 | 120 |
*/ |
140 | 121 |
@PostMapping(value = "/updateProc.json") |
141 |
- public ResponseEntity<?> updateProc(@RequestBody DeptVO deptVO) throws Exception { |
|
122 |
+ public ResponseEntity<?> updateProc(@RequestBody DeptVO deptVO) { |
|
142 | 123 |
// 부서 수정 |
143 | 124 |
int result = deptService.deptUpdate(deptVO); |
144 |
- |
|
145 |
- // 응답 처리 |
|
146 |
- if(result > 0) { |
|
147 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
148 |
- } else { |
|
149 |
- return resUtil.errorRes(MessageCode.COMMON_UPDATE_FAIL); |
|
150 |
- } |
|
125 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
151 | 126 |
} |
152 | 127 |
|
153 | 128 |
/** |
154 |
- * @author takensoft |
|
155 |
- * @since 2024.04.26 |
|
156 |
- * @param deptVO |
|
157 |
- * @return |
|
158 |
- * @throws Exception |
|
129 |
+ * @param deptVO - 부서 정보 |
|
130 |
+ * @return ResponseEntity - 부서 삭제 결과 |
|
159 | 131 |
* |
160 | 132 |
* 부서 삭제 |
161 | 133 |
*/ |
162 | 134 |
@PostMapping(value = "/deleteProc.json") |
163 |
- public ResponseEntity<?> deleteProc(@RequestBody DeptVO deptVO) throws Exception { |
|
135 |
+ public ResponseEntity<?> deleteProc(@RequestBody DeptVO deptVO) { |
|
164 | 136 |
// 부서 수정 |
165 | 137 |
int result = deptService.deptDelete(deptVO); |
166 |
- |
|
167 |
- // 응답 처리 |
|
168 |
- if(result > 0) { |
|
169 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
170 |
- } else { |
|
171 |
- return resUtil.errorRes(MessageCode.COMMON_DELETE_FAIL); |
|
172 |
- } |
|
173 |
- } |
|
174 |
- |
|
175 |
- /** |
|
176 |
- * @author takensoft |
|
177 |
- * @since 2024.04.26 |
|
178 |
- * @param |
|
179 |
- * @return |
|
180 |
- * @throws Exception |
|
181 |
- * |
|
182 |
- * 부서 사용자 삭제 |
|
183 |
- */ |
|
184 |
- @PostMapping(value = "/deptMbrDelProc.json") |
|
185 |
- public ResponseEntity<?> deptMbrDelProc(@RequestBody List<DeptMbrVO> deptMbrList) throws Exception { |
|
186 |
- // 부서 사용자 삭제 |
|
187 |
- int result = deptService.deptMbrDelete(deptMbrList); |
|
188 |
- |
|
189 |
- // 응답 처리 |
|
190 |
- if(result > 0) { |
|
191 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
192 |
- } else { |
|
193 |
- return resUtil.errorRes(MessageCode.COMMON_DELETE_FAIL); |
|
194 |
- } |
|
195 |
- } |
|
196 |
- |
|
197 |
- /** |
|
198 |
- * @author takensoft |
|
199 |
- * @since 2024.04.29 |
|
200 |
- * @param |
|
201 |
- * @return |
|
202 |
- * @throws Exception |
|
203 |
- * |
|
204 |
- * 부서에 등록되지 않는 사용자 조회 |
|
205 |
- */ |
|
206 |
- @PostMapping("/findByMbr.json") |
|
207 |
- public ResponseEntity<?> findByMbr(@RequestBody Map<String, String> params) throws Exception { |
|
208 |
- // 사용자 목록 조회 |
|
209 |
- Map<String, Object> result = deptService.findByMbr(params); |
|
210 |
- |
|
211 | 138 |
// 응답 처리 |
212 | 139 |
return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
213 | 140 |
} |
214 | 141 |
|
215 | 142 |
/** |
216 |
- * @author 박정하 |
|
217 |
- * @since 2024.05.09 |
|
218 |
- * @param deptList |
|
219 |
- * @return |
|
220 |
- * @throws Exception |
|
143 |
+ * @param deptMbrList - 부서 사용자 정보 |
|
144 |
+ * @return ResponseEntity - 부서 사용자 삭제 결과 |
|
221 | 145 |
* |
222 |
- * 부서 목록 수정 |
|
146 |
+ * 부서 사용자 삭제 |
|
147 |
+ */ |
|
148 |
+ @PostMapping(value = "/deptMbrDelProc.json") |
|
149 |
+ public ResponseEntity<?> deptMbrDelProc(@RequestBody List<DeptMbrVO> deptMbrList) { |
|
150 |
+ // 부서 사용자 삭제 |
|
151 |
+ int result = deptService.deptMbrDelete(deptMbrList); |
|
152 |
+ // 응답처리 |
|
153 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
154 |
+ } |
|
155 |
+ |
|
156 |
+ /** |
|
157 |
+ * @param params - 부서 사용자 정보 |
|
158 |
+ * @return ResponseEntity - 부서 사용자 삭제 결과 |
|
159 |
+ * |
|
160 |
+ * 부서에 등록되지 않는 사용자 조회 |
|
161 |
+ */ |
|
162 |
+ @PostMapping("/findByMbr.json") |
|
163 |
+ public ResponseEntity<?> findByMbr(@RequestBody Map<String, String> params) { |
|
164 |
+ // 사용자 목록 조회 |
|
165 |
+ Map<String, Object> result = deptService.findByMbr(params); |
|
166 |
+ // 응답 처리 |
|
167 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
168 |
+ } |
|
169 |
+ |
|
170 |
+ /** |
|
171 |
+ * @param deptList - 부서 사용자 정보 |
|
172 |
+ * @return ResponseEntity - 등록되지 않는 사용자 조회 결과 |
|
173 |
+ * |
|
174 |
+ * 부서에 등록되지 않는 사용자 조회 |
|
223 | 175 |
*/ |
224 | 176 |
@PostMapping(value = "/updateListProc.json") |
225 |
- public ResponseEntity<?> updateListProc(@RequestBody List<HierachyVO> deptList) throws Exception { |
|
177 |
+ public ResponseEntity<?> updateListProc(@RequestBody List<HierachyVO> deptList) { |
|
226 | 178 |
// 부서 목록 수정 |
227 | 179 |
int result = deptService.updateList(deptList); |
228 |
- |
|
229 | 180 |
// 응답 처리 |
230 |
- if(result > 0) { |
|
231 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
232 |
- } else { |
|
233 |
- return resUtil.errorRes(MessageCode.COMMON_UPDATE_FAIL); |
|
234 |
- } |
|
181 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
182 |
+ |
|
235 | 183 |
} |
236 | 184 |
} |
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?