diff --git a/src/main/java/itn/let/lett/service/LetterService.java b/src/main/java/itn/let/lett/service/LetterService.java
index 7aa727b3..64270d60 100644
--- a/src/main/java/itn/let/lett/service/LetterService.java
+++ b/src/main/java/itn/let/lett/service/LetterService.java
@@ -189,5 +189,19 @@ public interface LetterService {
public void insertBastMsgTag(LetterVO letterVO) throws Exception ;
// 메인베스트 태그 수정
- public void updateBastMsgTag(LetterVO letterVO) throws Exception ;
+ public void updateBastMsgTag(LetterVO letterVO) throws Exception ;
+
+
+ //(메인태그)설정하고자 하는 우선순위를 포함한 뒷 우선순위들을 우선순위 + 체크한 리스트 크기만큼 증가시키기
+ public int updateChkBastMsgTagAfterSortPlus(LetterVO letterVO) throws Exception;
+
+ //(메인태그)체크한 리스트들 우선순위 업데이트
+ public int updateChkBastMsgTagListSort(LetterVO letterVO) throws Exception;
+
+ //(메인태그)그림문자 전체 우선순위 빈값없이 정렬하기
+ public int updateBastMsgTagOrderBySort(LetterVO letterVO) throws Exception;
+
+ //(메인태그)우선순위가 null 인값 우선순위 초기세팅
+ public int updateBastMsgTagNullSort(LetterVO letterVO) throws Exception;
+
}
diff --git a/src/main/java/itn/let/lett/service/impl/LetterDAO.java b/src/main/java/itn/let/lett/service/impl/LetterDAO.java
index f03a9c99..d6af8929 100644
--- a/src/main/java/itn/let/lett/service/impl/LetterDAO.java
+++ b/src/main/java/itn/let/lett/service/impl/LetterDAO.java
@@ -350,4 +350,20 @@ public class LetterDAO extends EgovAbstractDAO {
public void updateBastMsgTag(LetterVO letterVO) throws Exception {
update("LetterDAO.updateBastMsgTag", letterVO);
}
+
+ public int updateChkBastMsgTagAfterSortPlus(LetterVO letterVO) throws Exception {
+ return update("LetterDAO.updateChkBastMsgTagAfterSortPlus", letterVO);
+ }
+
+ public int updateChkBastMsgTagListSort(LetterVO letterVO) throws Exception {
+ return update("LetterDAO.updateChkBastMsgTagListSort", letterVO);
+ }
+
+ public int updateBastMsgTagOrderBySort(LetterVO letterVO) throws Exception {
+ return update("LetterDAO.updateBastMsgTagOrderBySort", letterVO);
+ }
+
+ public int updateBastMsgTagNullSort(LetterVO letterVO) throws Exception {
+ return update("LetterDAO.updateBastMsgTagNullSort", letterVO);
+ }
}
diff --git a/src/main/java/itn/let/lett/service/impl/LetterServiceImpl.java b/src/main/java/itn/let/lett/service/impl/LetterServiceImpl.java
index ef3c1c42..4f9539fc 100644
--- a/src/main/java/itn/let/lett/service/impl/LetterServiceImpl.java
+++ b/src/main/java/itn/let/lett/service/impl/LetterServiceImpl.java
@@ -431,4 +431,24 @@ public class LetterServiceImpl extends EgovAbstractServiceImpl implements Letter
public void updateBastMsgTag(LetterVO letterVO) throws Exception {
letterDAO.updateBastMsgTag(letterVO);
}
+
+ @Override
+ public int updateChkBastMsgTagAfterSortPlus(LetterVO letterVO) throws Exception {
+ return letterDAO.updateChkBastMsgTagAfterSortPlus(letterVO);
+ }
+
+ @Override
+ public int updateChkBastMsgTagListSort(LetterVO letterVO) throws Exception {
+ return letterDAO.updateChkBastMsgTagListSort(letterVO);
+ }
+
+ @Override
+ public int updateBastMsgTagOrderBySort(LetterVO letterVO) throws Exception {
+ return letterDAO.updateBastMsgTagOrderBySort(letterVO);
+ }
+
+ @Override
+ public int updateBastMsgTagNullSort(LetterVO letterVO) throws Exception {
+ return letterDAO.updateBastMsgTagNullSort(letterVO);
+ }
}
diff --git a/src/main/java/itn/let/lett/web/LetterController.java b/src/main/java/itn/let/lett/web/LetterController.java
index 4483e79c..e4e8b0a7 100644
--- a/src/main/java/itn/let/lett/web/LetterController.java
+++ b/src/main/java/itn/let/lett/web/LetterController.java
@@ -2641,6 +2641,45 @@ public class LetterController {
}
+ @RequestMapping("/letter/messages/updateBastMsgTagSortChangeAjax.do")
+ @ResponseBody
+ public ModelAndView updateBastMsgTagSortChangeAjax(LetterVO letterVO,
+ ModelMap model,
+ HttpServletRequest request) throws Exception {
+
+ ModelAndView modelAndView = new ModelAndView();
+ modelAndView.setViewName("jsonView");
+
+ Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
+ if (!isAuthenticated) {
+ modelAndView.addObject("result", "auth_fail");
+ return modelAndView;
+ }
+
+ letterVO.setChkIdsSize(letterVO.getChkIds().length);
+
+ try {
+
+ //1. 설정하고자 하는 우선순위를 포함한 뒷 우선순위들을 우선순위 + 체크한 리스트 크기만큼 증가시키기
+ int result = letterService.updateChkBastMsgTagAfterSortPlus(letterVO);
+ //2. 체크한 리스트들 우선순위 업데이트
+ result += letterService.updateChkBastMsgTagListSort(letterVO);
+ //3. 그림문자 전체 우선순위 빈값없이 정렬하기
+ result += letterService.updateBastMsgTagOrderBySort(letterVO);
+ //4. 우선순위가 null인 값 우선순위 부여
+ result += letterService.updateBastMsgTagNullSort(letterVO);
+
+ modelAndView.addObject("result", "success");
+
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ modelAndView.addObject("result", "fail");
+ }
+
+
+ return modelAndView;
+ }
+
@RequestMapping(value={"/letter/photo/updateMultiMjonMsgAgentStsDataAjax.do"})
public ModelAndView updateMultiMjonMsgAgentStsDataAjax(@ModelAttribute("mjonMsgAgentStsVO") MjonMsgAgentStsVO mjonMsgAgentStsVO) throws Exception {
diff --git a/src/main/resources/egovframework/sqlmap/let/letter/LetterMessages_SQL_Mysql.xml b/src/main/resources/egovframework/sqlmap/let/letter/LetterMessages_SQL_Mysql.xml
index 4e845caa..d492d39b 100644
--- a/src/main/resources/egovframework/sqlmap/let/letter/LetterMessages_SQL_Mysql.xml
+++ b/src/main/resources/egovframework/sqlmap/let/letter/LetterMessages_SQL_Mysql.xml
@@ -1316,4 +1316,81 @@
WHERE 1=1
AND MAIN_SEARCH_TAG_NO = #mainSearchTagNo#
+
+