주소록그룹 성능개선
This commit is contained in:
parent
70e5cb9981
commit
47f4edf866
@ -22,6 +22,9 @@ public interface AddrGroupService {
|
|||||||
|
|
||||||
public AddrGroupVO selectAddrGroupDetail(AddrGroupVO addrGroupVO) throws Exception;
|
public AddrGroupVO selectAddrGroupDetail(AddrGroupVO addrGroupVO) throws Exception;
|
||||||
|
|
||||||
|
// 주소록 그룹 카운트 조회
|
||||||
|
public AddrGroupVO selectAddrGroupCnt(AddrGroupVO addrGroupVO) throws Exception;
|
||||||
|
|
||||||
public String insertAddrGroup(AddrGroupVO addrGroupVO) throws Exception;
|
public String insertAddrGroup(AddrGroupVO addrGroupVO) throws Exception;
|
||||||
|
|
||||||
public int updateAddrGroup(AddrGroupVO addrGroupVO) throws Exception;
|
public int updateAddrGroup(AddrGroupVO addrGroupVO) throws Exception;
|
||||||
|
|||||||
@ -18,6 +18,28 @@ public class AddrGroupVO extends ComDefaultVO{
|
|||||||
private String grpCount; // 그룹에 소속된 주소록 갯수
|
private String grpCount; // 그룹에 소속된 주소록 갯수
|
||||||
private String mergeGrps; // 합치기 그룹 id
|
private String mergeGrps; // 합치기 그룹 id
|
||||||
|
|
||||||
|
private int bookmarkCnt;
|
||||||
|
private int nogrpCnt;
|
||||||
|
private int addrTotCnt;
|
||||||
|
|
||||||
|
public int getBookmarkCnt() {
|
||||||
|
return bookmarkCnt;
|
||||||
|
}
|
||||||
|
public void setBookmarkCnt(int bookmarkCnt) {
|
||||||
|
this.bookmarkCnt = bookmarkCnt;
|
||||||
|
}
|
||||||
|
public int getNogrpCnt() {
|
||||||
|
return nogrpCnt;
|
||||||
|
}
|
||||||
|
public void setNogrpCnt(int nogrpCnt) {
|
||||||
|
this.nogrpCnt = nogrpCnt;
|
||||||
|
}
|
||||||
|
public int getAddrTotCnt() {
|
||||||
|
return addrTotCnt;
|
||||||
|
}
|
||||||
|
public void setAddrTotCnt(int addrTotCnt) {
|
||||||
|
this.addrTotCnt = addrTotCnt;
|
||||||
|
}
|
||||||
public int getTotcnt() {
|
public int getTotcnt() {
|
||||||
return totcnt;
|
return totcnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,15 @@ public class AddrGroupDAO extends EgovAbstractDAO {
|
|||||||
return (AddrGroupVO) select("AddrGroupDAO.selectAddrGroupDetail", addrGroupVO);
|
return (AddrGroupVO) select("AddrGroupDAO.selectAddrGroupDetail", addrGroupVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 주소록 그룹 카운트 조회
|
||||||
|
* @param addrGroupVO
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public AddrGroupVO selectAddrGroupCnt(AddrGroupVO addrGroupVO) throws Exception {
|
||||||
|
return (AddrGroupVO) select("AddrGroupDAO.selectAddrGroupCnt", addrGroupVO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 주소록 그룹 등록
|
* 주소록 그룹 등록
|
||||||
|
|||||||
@ -46,6 +46,11 @@ public class AddrGroupServiceImpl extends EgovAbstractServiceImpl implements Ad
|
|||||||
return addrGroupDAO.selectAddrGroupDetail(addrGroupVO);
|
return addrGroupDAO.selectAddrGroupDetail(addrGroupVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 주소록 그룹 카운트 조회
|
||||||
|
public AddrGroupVO selectAddrGroupCnt(AddrGroupVO addrGroupVO) throws Exception {
|
||||||
|
return addrGroupDAO.selectAddrGroupCnt(addrGroupVO);
|
||||||
|
}
|
||||||
|
|
||||||
public String insertAddrGroup(AddrGroupVO addrGroupVO) throws Exception {
|
public String insertAddrGroup(AddrGroupVO addrGroupVO) throws Exception {
|
||||||
int orderNum = addrGroupDAO.selectMaxOrderNumber(addrGroupVO);
|
int orderNum = addrGroupDAO.selectMaxOrderNumber(addrGroupVO);
|
||||||
addrGroupVO.setGrpOrder(orderNum);
|
addrGroupVO.setGrpOrder(orderNum);
|
||||||
|
|||||||
@ -185,6 +185,8 @@ public class AddrGroupController {
|
|||||||
addrGroupVO.setSiteId("web");
|
addrGroupVO.setSiteId("web");
|
||||||
List<AddrGroupVO> addrGroupList = addrGroupService.selectAddrGroupList(addrGroupVO);
|
List<AddrGroupVO> addrGroupList = addrGroupService.selectAddrGroupList(addrGroupVO);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* JSPark 2023.08.30 => Ajax 로 변경
|
||||||
//회원별 주소록 전체 갯수 조회
|
//회원별 주소록 전체 갯수 조회
|
||||||
int addrTotalCount = addrService.selectAddrTotalCount(addrVO);
|
int addrTotalCount = addrService.selectAddrTotalCount(addrVO);
|
||||||
|
|
||||||
@ -194,12 +196,12 @@ public class AddrGroupController {
|
|||||||
addrVO.setType("noGrp");
|
addrVO.setType("noGrp");
|
||||||
List<AddrVO> addrNoGrpList = addrService.selectAddrBasicGrpList(addrVO);
|
List<AddrVO> addrNoGrpList = addrService.selectAddrBasicGrpList(addrVO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
model.addAttribute("addrTotalCount", addrTotalCount);
|
model.addAttribute("addrTotalCount", addrTotalCount);
|
||||||
model.addAttribute("addrGroupList", addrGroupList);
|
|
||||||
model.addAttribute("addrBookmarkList", addrBookmarkList);
|
model.addAttribute("addrBookmarkList", addrBookmarkList);
|
||||||
model.addAttribute("addrNoGrpList", addrNoGrpList);
|
model.addAttribute("addrNoGrpList", addrNoGrpList);
|
||||||
|
*/
|
||||||
|
|
||||||
|
model.addAttribute("addrGroupList", addrGroupList);
|
||||||
model.addAttribute("userId", userId);
|
model.addAttribute("userId", userId);
|
||||||
|
|
||||||
return "/web/addr/AddrGroupListAjax";
|
return "/web/addr/AddrGroupListAjax";
|
||||||
@ -427,6 +429,54 @@ public class AddrGroupController {
|
|||||||
return "/web/addr/AddrGroupSelectAjax";
|
return "/web/addr/AddrGroupSelectAjax";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 주소록 그룹 카운트 조회 Ajax
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param addrGroupVO
|
||||||
|
* @param redirectAttributes
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping("/web/addr/selectAddrGroupCntAjax.do")
|
||||||
|
public ModelAndView selectAddrGroupCntAjax(HttpServletRequest request,
|
||||||
|
@ModelAttribute("searchVO") AddrGroupVO addrGroupVO
|
||||||
|
, Model model) throws Exception {
|
||||||
|
|
||||||
|
ModelAndView modelAndView = new ModelAndView();
|
||||||
|
modelAndView.setViewName("jsonView");
|
||||||
|
|
||||||
|
boolean isSuccess = true;
|
||||||
|
String msg = "";
|
||||||
|
int bookmarkCnt = 0;
|
||||||
|
int nogrpCnt = 0;
|
||||||
|
int addrTotCnt = 0;
|
||||||
|
|
||||||
|
try{
|
||||||
|
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||||
|
addrGroupVO.setMberId(user.getId());
|
||||||
|
|
||||||
|
addrGroupVO = addrGroupService.selectAddrGroupCnt(addrGroupVO);
|
||||||
|
if (addrGroupVO != null) {
|
||||||
|
bookmarkCnt = addrGroupVO.getBookmarkCnt();
|
||||||
|
nogrpCnt = addrGroupVO.getNogrpCnt();
|
||||||
|
addrTotCnt = addrGroupVO.getAddrTotCnt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e) {
|
||||||
|
isSuccess = false;
|
||||||
|
msg = e.getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
modelAndView.addObject("isSuccess", isSuccess);
|
||||||
|
modelAndView.addObject("msg", msg);
|
||||||
|
modelAndView.addObject("addrTotCnt", addrTotCnt);
|
||||||
|
modelAndView.addObject("nogrpCnt", nogrpCnt);
|
||||||
|
modelAndView.addObject("bookmarkCnt", bookmarkCnt);
|
||||||
|
|
||||||
|
return modelAndView;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 주소록 그룹 수정 로직
|
* 주소록 그룹 수정 로직
|
||||||
|
|||||||
@ -70,6 +70,37 @@
|
|||||||
AND a.ADDR_GRP_ID = #addrGrpId#
|
AND a.ADDR_GRP_ID = #addrGrpId#
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 주소록 그룹 카운트 조회 -->
|
||||||
|
<select id="AddrGroupDAO.selectAddrGroupCnt" parameterClass="addrGroupVO" resultClass="addrGroupVO">
|
||||||
|
SELECT
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT(0)
|
||||||
|
FROM MJ_ADDR A
|
||||||
|
WHERE A.MBER_ID = #mberId#
|
||||||
|
AND A.BOOKMARK = 'Y'
|
||||||
|
AND A.DELETE_YN = 'N'
|
||||||
|
) bookmarkCnt
|
||||||
|
, (
|
||||||
|
SELECT
|
||||||
|
COUNT(0)
|
||||||
|
FROM MJ_ADDR A
|
||||||
|
WHERE A.MBER_ID = #mberId#
|
||||||
|
AND A.ADDR_GRP_ID = '0'
|
||||||
|
AND A.BOOKMARK = 'N'
|
||||||
|
AND A.DELETE_YN = 'N'
|
||||||
|
) nogrpCnt
|
||||||
|
, (
|
||||||
|
SELECT
|
||||||
|
COUNT(0)
|
||||||
|
FROM MJ_ADDR A
|
||||||
|
WHERE A.MBER_ID = #mberId#
|
||||||
|
AND (A.RECV_STATUS = 'Y' OR A.RECV_STATUS = 'S' OR A.RECV_STATUS IS NULL)
|
||||||
|
AND A.DELETE_YN = 'N'
|
||||||
|
) addrTotCnt
|
||||||
|
FROM DUAL
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 주소록 그룹 등록 -->
|
<!-- 주소록 그룹 등록 -->
|
||||||
<insert id="AddrGroupDAO.insertAddrGroup" parameterClass="addrGroupVO">
|
<insert id="AddrGroupDAO.insertAddrGroup" parameterClass="addrGroupVO">
|
||||||
INSERT INTO MJ_ADDR_GRP (
|
INSERT INTO MJ_ADDR_GRP (
|
||||||
|
|||||||
@ -6,9 +6,39 @@
|
|||||||
|
|
||||||
<script src="/publish/js/content.js"></script>
|
<script src="/publish/js/content.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var successHtml="";
|
var successHtml="";
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
// 주소록 그룹 카운트
|
||||||
|
getAddrGroupCnt();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 주소록 그룹 카운트
|
||||||
|
function getAddrGroupCnt() {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/web/addr/selectAddrGroupCntAjax.do",
|
||||||
|
data: {},
|
||||||
|
dataType:'json',
|
||||||
|
async: true,
|
||||||
|
success: function (data) {
|
||||||
|
if (data.isSuccess) {
|
||||||
|
$("#addrTotCnt").html(numberWithCommas(data.addrTotCnt));
|
||||||
|
$("#nogrpCnt").html(data.nogrpCnt);
|
||||||
|
$("#bookmarkCnt").html(data.bookmarkCnt);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//alert("Msg : " + data.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (e) {
|
||||||
|
//alert("ERROR : " + JSON.stringify(e));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 주소록 그룹 리스트 띄우기
|
// 주소록 그룹 리스트 띄우기
|
||||||
function listAddrGroupAjax() {
|
function listAddrGroupAjax() {
|
||||||
var form = document.searchAddrGrpForm;
|
var form = document.searchAddrGrpForm;
|
||||||
@ -599,7 +629,7 @@ function listAddrTransHistAjax(pageNo) {
|
|||||||
<label for="groupAll" class="label">전체 선택</label>
|
<label for="groupAll" class="label">전체 선택</label>
|
||||||
<input type="checkbox" name="groupAll" id="groupAll" value="1" onClick="fnCheckAll();">
|
<input type="checkbox" name="groupAll" id="groupAll" value="1" onClick="fnCheckAll();">
|
||||||
</div>
|
</div>
|
||||||
<p class="open" onclick="openThisGroup('');"><img src="/publish/images/content/open_folder.png" alt="폴더 열림">전체[<span class="c_002c9a fwMd"><fmt:formatNumber value="${addrTotalCount}" pattern="#,###"/></span>/최대 100,000]</p>
|
<p class="open" onclick="openThisGroup('');"><img src="/publish/images/content/open_folder.png" alt="폴더 열림">전체[<span class="c_002c9a fwMd" id="addrTotCnt"></span>/최대 100,000]</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="adr1_btnWrap">
|
<div class="adr1_btnWrap">
|
||||||
<div>
|
<div>
|
||||||
@ -615,18 +645,16 @@ function listAddrTransHistAjax(pageNo) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="adr1_list">
|
<div class="adr1_list">
|
||||||
<!-- 고정그룹 : 그룹미지정 -->
|
<!-- 고정그룹 : 그룹미지정 -->
|
||||||
<c:set var="noGrpSize" value="${fn:length(addrNoGrpList)}" />
|
|
||||||
<div class="adr_cb_wrap list_fixed">
|
<div class="adr_cb_wrap list_fixed">
|
||||||
<label for="group1" class="label"></label>
|
<label for="group1" class="label"></label>
|
||||||
<input type="checkbox" id="group1" disabled="disabled">
|
<input type="checkbox" id="group1" disabled="disabled">
|
||||||
<p onclick="openThisGroup('noGrp');"><img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">그룹미지정[<span><fmt:formatNumber value="${noGrpSize}" pattern="#,###"/></span>명]</p>
|
<p onclick="openThisGroup('noGrp');"><img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">그룹미지정[<span id="nogrpCnt"></span>명]</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- 고정그룹 : 자주보내는번호 -->
|
<!-- 고정그룹 : 자주보내는번호 -->
|
||||||
<c:set var="bookmarkSize" value="${fn:length(addrBookmarkList)}" />
|
|
||||||
<div class="adr_cb_wrap list_fixed">
|
<div class="adr_cb_wrap list_fixed">
|
||||||
<label for="group2" class="label"></label>
|
<label for="group2" class="label"></label>
|
||||||
<input type="checkbox" id="group2" disabled="disabled">
|
<input type="checkbox" id="group2" disabled="disabled">
|
||||||
<p onclick="openThisGroup('bookmark');"><img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">자주보내는 번호[<span><fmt:formatNumber value="${bookmarkSize}" pattern="#,###"/></span>명]
|
<p onclick="openThisGroup('bookmark');"><img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">자주보내는 번호[<span id="bookmarkCnt"></span>명]
|
||||||
</div>
|
</div>
|
||||||
<c:forEach var="addrGroupList" items="${addrGroupList}" varStatus="status">
|
<c:forEach var="addrGroupList" items="${addrGroupList}" varStatus="status">
|
||||||
<div class="adr_cb_wrap list_switch">
|
<div class="adr_cb_wrap list_switch">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user