선택한 그림문자의 우선선위 변경 기능 추가
@9c4357dd2e4fa4ebb57e1bc7c3c1970a9f7083fc
--- src/main/java/itn/let/lett/service/LetterService.java
+++ src/main/java/itn/let/lett/service/LetterService.java
... | ... | @@ -189,5 +189,19 @@ |
| 189 | 189 |
public void insertBastMsgTag(LetterVO letterVO) throws Exception ; |
| 190 | 190 |
|
| 191 | 191 |
// 메인베스트 태그 수정 |
| 192 |
- public void updateBastMsgTag(LetterVO letterVO) throws Exception ; |
|
| 192 |
+ public void updateBastMsgTag(LetterVO letterVO) throws Exception ; |
|
| 193 |
+ |
|
| 194 |
+ |
|
| 195 |
+ //(메인태그)설정하고자 하는 우선순위를 포함한 뒷 우선순위들을 우선순위 + 체크한 리스트 크기만큼 증가시키기 |
|
| 196 |
+ public int updateChkBastMsgTagAfterSortPlus(LetterVO letterVO) throws Exception; |
|
| 197 |
+ |
|
| 198 |
+ //(메인태그)체크한 리스트들 우선순위 업데이트 |
|
| 199 |
+ public int updateChkBastMsgTagListSort(LetterVO letterVO) throws Exception; |
|
| 200 |
+ |
|
| 201 |
+ //(메인태그)그림문자 전체 우선순위 빈값없이 정렬하기 |
|
| 202 |
+ public int updateBastMsgTagOrderBySort(LetterVO letterVO) throws Exception; |
|
| 203 |
+ |
|
| 204 |
+ //(메인태그)우선순위가 null 인값 우선순위 초기세팅 |
|
| 205 |
+ public int updateBastMsgTagNullSort(LetterVO letterVO) throws Exception; |
|
| 206 |
+ |
|
| 193 | 207 |
} |
--- src/main/java/itn/let/lett/service/impl/LetterDAO.java
+++ src/main/java/itn/let/lett/service/impl/LetterDAO.java
... | ... | @@ -350,4 +350,20 @@ |
| 350 | 350 |
public void updateBastMsgTag(LetterVO letterVO) throws Exception {
|
| 351 | 351 |
update("LetterDAO.updateBastMsgTag", letterVO);
|
| 352 | 352 |
} |
| 353 |
+ |
|
| 354 |
+ public int updateChkBastMsgTagAfterSortPlus(LetterVO letterVO) throws Exception {
|
|
| 355 |
+ return update("LetterDAO.updateChkBastMsgTagAfterSortPlus", letterVO);
|
|
| 356 |
+ } |
|
| 357 |
+ |
|
| 358 |
+ public int updateChkBastMsgTagListSort(LetterVO letterVO) throws Exception {
|
|
| 359 |
+ return update("LetterDAO.updateChkBastMsgTagListSort", letterVO);
|
|
| 360 |
+ } |
|
| 361 |
+ |
|
| 362 |
+ public int updateBastMsgTagOrderBySort(LetterVO letterVO) throws Exception {
|
|
| 363 |
+ return update("LetterDAO.updateBastMsgTagOrderBySort", letterVO);
|
|
| 364 |
+ } |
|
| 365 |
+ |
|
| 366 |
+ public int updateBastMsgTagNullSort(LetterVO letterVO) throws Exception {
|
|
| 367 |
+ return update("LetterDAO.updateBastMsgTagNullSort", letterVO);
|
|
| 368 |
+ } |
|
| 353 | 369 |
} |
--- src/main/java/itn/let/lett/service/impl/LetterServiceImpl.java
+++ src/main/java/itn/let/lett/service/impl/LetterServiceImpl.java
... | ... | @@ -431,4 +431,24 @@ |
| 431 | 431 |
public void updateBastMsgTag(LetterVO letterVO) throws Exception {
|
| 432 | 432 |
letterDAO.updateBastMsgTag(letterVO); |
| 433 | 433 |
} |
| 434 |
+ |
|
| 435 |
+ @Override |
|
| 436 |
+ public int updateChkBastMsgTagAfterSortPlus(LetterVO letterVO) throws Exception {
|
|
| 437 |
+ return letterDAO.updateChkBastMsgTagAfterSortPlus(letterVO); |
|
| 438 |
+ } |
|
| 439 |
+ |
|
| 440 |
+ @Override |
|
| 441 |
+ public int updateChkBastMsgTagListSort(LetterVO letterVO) throws Exception {
|
|
| 442 |
+ return letterDAO.updateChkBastMsgTagListSort(letterVO); |
|
| 443 |
+ } |
|
| 444 |
+ |
|
| 445 |
+ @Override |
|
| 446 |
+ public int updateBastMsgTagOrderBySort(LetterVO letterVO) throws Exception {
|
|
| 447 |
+ return letterDAO.updateBastMsgTagOrderBySort(letterVO); |
|
| 448 |
+ } |
|
| 449 |
+ |
|
| 450 |
+ @Override |
|
| 451 |
+ public int updateBastMsgTagNullSort(LetterVO letterVO) throws Exception {
|
|
| 452 |
+ return letterDAO.updateBastMsgTagNullSort(letterVO); |
|
| 453 |
+ } |
|
| 434 | 454 |
} |
--- src/main/java/itn/let/lett/web/LetterController.java
+++ src/main/java/itn/let/lett/web/LetterController.java
... | ... | @@ -2641,6 +2641,45 @@ |
| 2641 | 2641 |
} |
| 2642 | 2642 |
|
| 2643 | 2643 |
|
| 2644 |
+ @RequestMapping("/letter/messages/updateBastMsgTagSortChangeAjax.do")
|
|
| 2645 |
+ @ResponseBody |
|
| 2646 |
+ public ModelAndView updateBastMsgTagSortChangeAjax(LetterVO letterVO, |
|
| 2647 |
+ ModelMap model, |
|
| 2648 |
+ HttpServletRequest request) throws Exception {
|
|
| 2649 |
+ |
|
| 2650 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 2651 |
+ modelAndView.setViewName("jsonView");
|
|
| 2652 |
+ |
|
| 2653 |
+ Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); |
|
| 2654 |
+ if (!isAuthenticated) {
|
|
| 2655 |
+ modelAndView.addObject("result", "auth_fail");
|
|
| 2656 |
+ return modelAndView; |
|
| 2657 |
+ } |
|
| 2658 |
+ |
|
| 2659 |
+ letterVO.setChkIdsSize(letterVO.getChkIds().length); |
|
| 2660 |
+ |
|
| 2661 |
+ try {
|
|
| 2662 |
+ |
|
| 2663 |
+ //1. 설정하고자 하는 우선순위를 포함한 뒷 우선순위들을 우선순위 + 체크한 리스트 크기만큼 증가시키기 |
|
| 2664 |
+ int result = letterService.updateChkBastMsgTagAfterSortPlus(letterVO); |
|
| 2665 |
+ //2. 체크한 리스트들 우선순위 업데이트 |
|
| 2666 |
+ result += letterService.updateChkBastMsgTagListSort(letterVO); |
|
| 2667 |
+ //3. 그림문자 전체 우선순위 빈값없이 정렬하기 |
|
| 2668 |
+ result += letterService.updateBastMsgTagOrderBySort(letterVO); |
|
| 2669 |
+ //4. 우선순위가 null인 값 우선순위 부여 |
|
| 2670 |
+ result += letterService.updateBastMsgTagNullSort(letterVO); |
|
| 2671 |
+ |
|
| 2672 |
+ modelAndView.addObject("result", "success");
|
|
| 2673 |
+ |
|
| 2674 |
+ } catch (Exception e) {
|
|
| 2675 |
+ System.out.println(e.getMessage()); |
|
| 2676 |
+ modelAndView.addObject("result", "fail");
|
|
| 2677 |
+ } |
|
| 2678 |
+ |
|
| 2679 |
+ |
|
| 2680 |
+ return modelAndView; |
|
| 2681 |
+ } |
|
| 2682 |
+ |
|
| 2644 | 2683 |
@RequestMapping(value={"/letter/photo/updateMultiMjonMsgAgentStsDataAjax.do"})
|
| 2645 | 2684 |
public ModelAndView updateMultiMjonMsgAgentStsDataAjax(@ModelAttribute("mjonMsgAgentStsVO") MjonMsgAgentStsVO mjonMsgAgentStsVO) throws Exception {
|
| 2646 | 2685 |
|
--- src/main/resources/egovframework/sqlmap/let/letter/LetterMessages_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/letter/LetterMessages_SQL_Mysql.xml
... | ... | @@ -1316,4 +1316,81 @@ |
| 1316 | 1316 |
WHERE 1=1 |
| 1317 | 1317 |
AND MAIN_SEARCH_TAG_NO = #mainSearchTagNo# |
| 1318 | 1318 |
</update> |
| 1319 |
+ |
|
| 1320 |
+ <update id="LetterDAO.updateChkBastMsgTagAfterSortPlus" parameterClass="letterVO"> |
|
| 1321 |
+ UPDATE |
|
| 1322 |
+ MJ_MAIN_SEARCH_TAG |
|
| 1323 |
+ SET |
|
| 1324 |
+ SORT = SORT + #chkIdsSize# |
|
| 1325 |
+ WHERE SORT >= #sort# |
|
| 1326 |
+ </update> |
|
| 1327 |
+ |
|
| 1328 |
+ <update id="LetterDAO.updateChkBastMsgTagListSort" parameterClass="letterVO"> |
|
| 1329 |
+ UPDATE |
|
| 1330 |
+ MJ_MAIN_SEARCH_TAG a |
|
| 1331 |
+ ,( |
|
| 1332 |
+ SELECT |
|
| 1333 |
+ e.MAIN_SEARCH_TAG_NO |
|
| 1334 |
+ , @rownum:=@rownum+1 AS rowNum |
|
| 1335 |
+ FROM |
|
| 1336 |
+ MJ_MAIN_SEARCH_TAG e |
|
| 1337 |
+ ,(SELECT @rownum := #sort#-1)rn |
|
| 1338 |
+ WHERE |
|
| 1339 |
+ e.MAIN_SEARCH_TAG_NO IN |
|
| 1340 |
+ <iterate property="chkIds" open="(" close=")" conjunction=",">
|
|
| 1341 |
+ #chkIds[]# |
|
| 1342 |
+ </iterate> |
|
| 1343 |
+ ORDER BY e.SORT |
|
| 1344 |
+ )b |
|
| 1345 |
+ SET a.SORT = b.rowNum |
|
| 1346 |
+ WHERE a.MAIN_SEARCH_TAG_NO = b.MAIN_SEARCH_TAG_NO |
|
| 1347 |
+ </update> |
|
| 1348 |
+ |
|
| 1349 |
+ <update id="LetterDAO.updateBastMsgTagOrderBySort" parameterClass="letterVO"> |
|
| 1350 |
+ UPDATE |
|
| 1351 |
+ MJ_MAIN_SEARCH_TAG a |
|
| 1352 |
+ ,( |
|
| 1353 |
+ SELECT |
|
| 1354 |
+ e.SORT |
|
| 1355 |
+ , @rownum:=@rownum+1 AS rowNum |
|
| 1356 |
+ FROM |
|
| 1357 |
+ MJ_MAIN_SEARCH_TAG e |
|
| 1358 |
+ , (SELECT @rownum := 0) rn |
|
| 1359 |
+ WHERE |
|
| 1360 |
+ e.SORT is not null |
|
| 1361 |
+ ORDER BY e.SORT |
|
| 1362 |
+ )b |
|
| 1363 |
+ SET |
|
| 1364 |
+ a.SORT = b.rowNum |
|
| 1365 |
+ WHERE |
|
| 1366 |
+ a.SORT = b.SORT |
|
| 1367 |
+ AND a.SORT is not null |
|
| 1368 |
+ |
|
| 1369 |
+ </update> |
|
| 1370 |
+ |
|
| 1371 |
+ <update id="LetterDAO.updateBastMsgTagNullSort" parameterClass="letterVO"> |
|
| 1372 |
+ |
|
| 1373 |
+ UPDATE |
|
| 1374 |
+ MJ_MAIN_SEARCH_TAG a |
|
| 1375 |
+ ,( |
|
| 1376 |
+ SELECT |
|
| 1377 |
+ @rownum:=@rownum+1 AS rowNum |
|
| 1378 |
+ , e.MAIN_SEARCH_TAG_NO |
|
| 1379 |
+ FROM |
|
| 1380 |
+ MJ_MAIN_SEARCH_TAG e |
|
| 1381 |
+ , (SELECT @rownum := |
|
| 1382 |
+ (SELECT |
|
| 1383 |
+ CASE |
|
| 1384 |
+ WHEN MAX(c.SORT) is null |
|
| 1385 |
+ THEN 0 |
|
| 1386 |
+ else MAX(c.SORT) |
|
| 1387 |
+ END |
|
| 1388 |
+ FROM MJ_MAIN_SEARCH_TAG c |
|
| 1389 |
+ ) |
|
| 1390 |
+ ) rn |
|
| 1391 |
+ WHERE e.SORT IS NULL |
|
| 1392 |
+ ) b |
|
| 1393 |
+ SET a.SORT = b.rowNum |
|
| 1394 |
+ WHERE a.MAIN_SEARCH_TAG_NO = b.MAIN_SEARCH_TAG_NO |
|
| 1395 |
+ </update> |
|
| 1319 | 1396 |
</sqlMap> |
--- src/main/webapp/WEB-INF/jsp/letter/messages/BastMsgTagList.jsp
+++ src/main/webapp/WEB-INF/jsp/letter/messages/BastMsgTagList.jsp
... | ... | @@ -27,6 +27,7 @@ |
| 27 | 27 |
function linkPage(pageNo){
|
| 28 | 28 |
var listForm = document.listForm ; |
| 29 | 29 |
listForm.pageIndex.value = pageNo ; |
| 30 |
+ listForm.action = "/letter/messages/selectBastMsgTagList.do"; |
|
| 30 | 31 |
listForm.submit(); |
| 31 | 32 |
} |
| 32 | 33 |
|
... | ... | @@ -86,7 +87,7 @@ |
| 86 | 87 |
} |
| 87 | 88 |
} |
| 88 | 89 |
} |
| 89 |
- var url = "/letter/messages/updateMainTagSortChangeAjax.do"; |
|
| 90 |
+ var url = "/letter/messages/updateBastMsgTagSortChangeAjax.do"; |
|
| 90 | 91 |
|
| 91 | 92 |
//배열 직렬화 |
| 92 | 93 |
jQuery.ajaxSettings.traditional = true; |
... | ... | @@ -117,7 +118,7 @@ |
| 117 | 118 |
}); |
| 118 | 119 |
} |
| 119 | 120 |
</script> |
| 120 |
-<form name="listForm" action="<c:url value='/letter/messages/selectMainTagList.do'/>" method="post"> |
|
| 121 |
+<form name="listForm" action="<c:url value='/letter/messages/selectBastMsgTagList.do'/>" method="post"> |
|
| 121 | 122 |
<input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>"/>
|
| 122 | 123 |
<input type="hidden" name="mainSearchTagNo" /> |
| 123 | 124 |
<input type="hidden" name="searchSortCnd" value="<c:out value="${searchVO.searchSortCnd}" />" />
|
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?