주소록 그룹삭제 기능 수정 -> grp 테이블에 delete y 처리 후 select에서 where delete='N' 만
가져오게 수정
This commit is contained in:
parent
6c43799f2b
commit
259f27d6cc
@ -130,6 +130,8 @@ public class AddrVO extends ComDefaultVO{
|
|||||||
|
|
||||||
private int batchSize;
|
private int batchSize;
|
||||||
private int lastProcessedId;
|
private int lastProcessedId;
|
||||||
|
private int startIndex;
|
||||||
|
private int endIndex;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -117,4 +117,8 @@ public class AddrGroupDAO extends EgovAbstractDAO {
|
|||||||
public int selectMaxOrderNumber(AddrGroupVO addrGroupVO) throws Exception{
|
public int selectMaxOrderNumber(AddrGroupVO addrGroupVO) throws Exception{
|
||||||
return (Integer)select("AddrGroupDAO.selectMaxOrderNumber", addrGroupVO);
|
return (Integer)select("AddrGroupDAO.selectMaxOrderNumber", addrGroupVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteAddrGroup_advc(AddrGroupVO addrGroupVO) {
|
||||||
|
update("AddrGroupDAO.deleteAddrGroup_advc", addrGroupVO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,10 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@ -16,6 +18,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -611,33 +614,7 @@ public class AddrServiceImpl extends EgovAbstractServiceImpl implements AddrSer
|
|||||||
|
|
||||||
|
|
||||||
public void deleteAddr_advc(AddrGroupVO addrGroupVO) throws Exception {
|
public void deleteAddr_advc(AddrGroupVO addrGroupVO) throws Exception {
|
||||||
|
addrGroupDAO.deleteAddrGroup_advc(addrGroupVO);
|
||||||
addrGroupDAO.deleteAddrGroup(addrGroupVO);
|
|
||||||
|
|
||||||
AddrVO addrVO = new AddrVO();
|
|
||||||
addrVO.setAddrGrpId(addrGroupVO.getAddrGrpId());
|
|
||||||
addrVO.setGrpDelete("Y");
|
|
||||||
addrVO.setMberId(addrGroupVO.getMberId());
|
|
||||||
|
|
||||||
|
|
||||||
// boolean hasMoreData = true;
|
|
||||||
//
|
|
||||||
// while (hasMoreData) {
|
|
||||||
// // 1. addrVO에 마지막으로 처리된 ID와 배치 크기를 설정
|
|
||||||
// addrVO.setBatchSize(50000);
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
// 2. 현재 배치에서 삭제된 레코드 수를 확인
|
|
||||||
// int affectedRows = addrDAO.deleteAddr(addrVO);
|
|
||||||
|
|
||||||
// // 3. 더 이상 삭제할 데이터가 없으면 종료
|
|
||||||
// if (affectedRows < BATCH_SIZE) {
|
|
||||||
// hasMoreData = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
addrDAO.deleteAddr(addrVO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -570,8 +570,7 @@ public class AddrController {
|
|||||||
for(String id:addrCheck) {
|
for(String id:addrCheck) {
|
||||||
try {
|
try {
|
||||||
addrVO.setAddrId(id);
|
addrVO.setAddrId(id);
|
||||||
// addrService.deleteAddr(addrVO);
|
addrService.deleteAddr(addrVO);
|
||||||
System.out.println("??????");
|
|
||||||
|
|
||||||
modelAndView.addObject("result", "success");
|
modelAndView.addObject("result", "success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -185,21 +185,44 @@ 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);
|
|
||||||
|
|
||||||
|
// * JSPark 2023.08.30 => Ajax 로 변경
|
||||||
|
//회원별 주소록 전체 갯수 조회
|
||||||
|
// int addrTotalCount = addrService.selectAddrTotalCount(addrVO);
|
||||||
addrVO.setType("bookmark");
|
addrVO.setType("bookmark");
|
||||||
List<AddrVO> addrBookmarkList = addrService.selectAddrBasicGrpList(addrVO);
|
List<AddrVO> addrBookmarkList = addrService.selectAddrBasicGrpList(addrVO);
|
||||||
|
|
||||||
addrVO.setType("noGrp");
|
addrVO.setType("noGrp");
|
||||||
List<AddrVO> addrNoGrpList = addrService.selectAddrBasicGrpList(addrVO);
|
List<AddrVO> addrNoGrpList = addrService.selectAddrBasicGrpList(addrVO);
|
||||||
|
|
||||||
|
int totalGrpCount = addrGroupList.stream()
|
||||||
|
.mapToInt(group -> {
|
||||||
|
String grpCountStr = group.getGrpCount();
|
||||||
|
if (grpCountStr != null && !grpCountStr.isEmpty()) {
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(grpCountStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// 파싱에 실패한 경우 0을 반환하거나 예외 처리를 합니다.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.sum();
|
||||||
|
|
||||||
|
// 결과 출력
|
||||||
|
|
||||||
|
System.out.println("totalGrpCount :: "+ totalGrpCount);
|
||||||
|
|
||||||
|
int addrTotalCount = (addrNoGrpList.size() >0 ? addrNoGrpList.get(0).getTotcnt() : 0)
|
||||||
|
+ (addrBookmarkList.size() >0 ? addrBookmarkList.get(0).getTotcnt() : 0)
|
||||||
|
+ totalGrpCount
|
||||||
|
;
|
||||||
|
|
||||||
model.addAttribute("addrTotalCount", addrTotalCount);
|
model.addAttribute("addrTotalCount", addrTotalCount);
|
||||||
model.addAttribute("addrBookmarkList", addrBookmarkList);
|
model.addAttribute("addrBookmarkCnt", addrBookmarkList.size() >0 ? addrBookmarkList.get(0).getTotcnt() : 0);
|
||||||
model.addAttribute("addrNoGrpList", addrNoGrpList);
|
model.addAttribute("addrNoGrpCnt", addrNoGrpList.size() >0 ? addrNoGrpList.get(0).getTotcnt() : 0);
|
||||||
*/
|
|
||||||
|
|
||||||
model.addAttribute("addrGroupList", addrGroupList);
|
model.addAttribute("addrGroupList", addrGroupList);
|
||||||
model.addAttribute("userId", userId);
|
model.addAttribute("userId", userId);
|
||||||
@ -729,11 +752,11 @@ public class AddrGroupController {
|
|||||||
for(String id:grpCheck) {
|
for(String id:grpCheck) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// id = "13026";
|
|
||||||
addrGroupVO.setAddrGrpId(id);
|
addrGroupVO.setAddrGrpId(id);
|
||||||
addrGroupVO.setMberId(user.getId());
|
addrGroupVO.setMberId(user.getId());
|
||||||
int tot = addrService.getAddrCount(addrGroupVO);
|
addrGroupVO.setLastUpdusrId(user.getId());
|
||||||
addrGroupVO.setTotCnt(tot);
|
// int tot = addrService.getAddrCount(addrGroupVO);
|
||||||
|
// addrGroupVO.setTotCnt(tot);
|
||||||
|
|
||||||
addrService.deleteAddr_advc(addrGroupVO);
|
addrService.deleteAddr_advc(addrGroupVO);
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
<!-- 주소록 그룹 목록 조회 -->
|
<!-- 주소록 그룹 목록 조회 -->
|
||||||
<select id="AddrGroupDAO.selectAddrGroupList" parameterClass="addrGroupVO" resultClass="addrGroupVO">
|
<select id="AddrGroupDAO.selectAddrGroupList" parameterClass="addrGroupVO" resultClass="addrGroupVO">
|
||||||
|
/* AddrGroupDAO.selectAddrGroupList */
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(1) OVER() AS totCnt
|
COUNT(1) OVER() AS totCnt
|
||||||
,A.ADDR_GRP_ID AS addrGrpId
|
,A.ADDR_GRP_ID AS addrGrpId
|
||||||
@ -26,6 +27,7 @@
|
|||||||
<isNotEmpty property="mberId">
|
<isNotEmpty property="mberId">
|
||||||
AND A.MBER_ID = #mberId#
|
AND A.MBER_ID = #mberId#
|
||||||
</isNotEmpty>
|
</isNotEmpty>
|
||||||
|
AND A.DELETE_YN = 'N'
|
||||||
<isNotEmpty property="searchKeyword">
|
<isNotEmpty property="searchKeyword">
|
||||||
<isEqual property="searchCondition" compareValue="">
|
<isEqual property="searchCondition" compareValue="">
|
||||||
AND ( A.MBER_ID LIKE CONCAT ('%', #searchKeyword#,'%')
|
AND ( A.MBER_ID LIKE CONCAT ('%', #searchKeyword#,'%')
|
||||||
@ -82,6 +84,7 @@
|
|||||||
|
|
||||||
<!-- 주소록 그룹 카운트 조회(그룹미지정) -->
|
<!-- 주소록 그룹 카운트 조회(그룹미지정) -->
|
||||||
<select id="AddrGroupDAO.selectAddrGroupNogrpCnt" parameterClass="addrGroupVO" resultClass="addrGroupVO">
|
<select id="AddrGroupDAO.selectAddrGroupNogrpCnt" parameterClass="addrGroupVO" resultClass="addrGroupVO">
|
||||||
|
/* AddrGroupDAO.selectAddrGroupNogrpCnt */
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(0) AS nogrpCnt
|
COUNT(0) AS nogrpCnt
|
||||||
FROM MJ_ADDR A
|
FROM MJ_ADDR A
|
||||||
@ -152,6 +155,24 @@
|
|||||||
</isNotEmpty>
|
</isNotEmpty>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<!-- 주소록 그룹삭제 -->
|
||||||
|
<delete id="AddrGroupDAO.deleteAddrGroup_advc" parameterClass="addrGroupVO">
|
||||||
|
/* AddrGroupDAO.deleteAddrGroup_advc*/
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE
|
||||||
|
MJ_ADDR_GRP
|
||||||
|
SET
|
||||||
|
DELETE_YN = 'Y'
|
||||||
|
,LAST_UPDT_PNTTM = NOW()
|
||||||
|
,LAST_UPDUSR_ID = #lastUpdusrId#
|
||||||
|
WHERE
|
||||||
|
MBER_ID = #mberId#
|
||||||
|
AND
|
||||||
|
ADDR_GRP_ID = #addrGrpId#
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
|
||||||
<!-- 주소록 그룹삭제 By Admin -->
|
<!-- 주소록 그룹삭제 By Admin -->
|
||||||
<delete id="AddrGroupDAO.deleteAddrGroupByAdmin" parameterClass="addrGroupVO">
|
<delete id="AddrGroupDAO.deleteAddrGroupByAdmin" parameterClass="addrGroupVO">
|
||||||
DELETE FROM
|
DELETE FROM
|
||||||
|
|||||||
@ -42,6 +42,7 @@
|
|||||||
MJ_ADDR_GRP B
|
MJ_ADDR_GRP B
|
||||||
ON
|
ON
|
||||||
A.ADDR_GRP_ID = B.ADDR_GRP_ID
|
A.ADDR_GRP_ID = B.ADDR_GRP_ID
|
||||||
|
AND B.DELETE_YN ='N'
|
||||||
LEFT OUTER JOIN
|
LEFT OUTER JOIN
|
||||||
MJ_ADDR_TRANS_HIST C
|
MJ_ADDR_TRANS_HIST C
|
||||||
ON
|
ON
|
||||||
@ -66,7 +67,9 @@
|
|||||||
<isNotEmpty property="mberId">
|
<isNotEmpty property="mberId">
|
||||||
AND MBER_ID = #mberId#
|
AND MBER_ID = #mberId#
|
||||||
</isNotEmpty>
|
</isNotEmpty>
|
||||||
AND ADDR_GRP_ID = #searchAddrGrpId#
|
<isNotEmpty property="searchAddrGrpId">
|
||||||
|
AND ADDR_GRP_ID = #searchAddrGrpId#
|
||||||
|
</isNotEmpty>
|
||||||
)
|
)
|
||||||
|
|
||||||
<isNotEmpty property="searchKeyword">
|
<isNotEmpty property="searchKeyword">
|
||||||
@ -771,11 +774,12 @@
|
|||||||
AND
|
AND
|
||||||
ADDR_ID = #addrId#
|
ADDR_ID = #addrId#
|
||||||
</isNotEqual>
|
</isNotEqual>
|
||||||
<isNotEmpty property="batchSize">
|
<!-- <isNotEmpty property="batchSize"> -->
|
||||||
LIMIT #batchSize#
|
<!-- LIMIT #batchSize# -->
|
||||||
</isNotEmpty>
|
<!-- </isNotEmpty> -->
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
<!-- 주소록 삭제 -->
|
<!-- 주소록 삭제 -->
|
||||||
<select id="AddrDAO.getAddrCount" parameterClass="addrVO" resultClass="int">
|
<select id="AddrDAO.getAddrCount" parameterClass="addrVO" resultClass="int">
|
||||||
|
|
||||||
@ -807,6 +811,7 @@
|
|||||||
|
|
||||||
<!-- 주소록 기본 그룹 조회 (자주보내는번호, 그룹미지정)-->
|
<!-- 주소록 기본 그룹 조회 (자주보내는번호, 그룹미지정)-->
|
||||||
<select id="AddrDAO.selectAddrBasicGrpList" parameterClass="addrVO" resultClass="addrVO">
|
<select id="AddrDAO.selectAddrBasicGrpList" parameterClass="addrVO" resultClass="addrVO">
|
||||||
|
/* AddrDAO.selectAddrBasicGrpList */
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(1) OVER() AS totCnt
|
COUNT(1) OVER() AS totCnt
|
||||||
,A.ADDR_ID AS addrId
|
,A.ADDR_ID AS addrId
|
||||||
|
|||||||
@ -11,13 +11,13 @@ var successHtml="";
|
|||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
// 주소록 그룹 카운트(전체)
|
// 주소록 그룹 카운트(전체)
|
||||||
getAddrGroupTotCnt();
|
// getAddrGroupTotCnt();
|
||||||
|
|
||||||
//주소록 그룹 카운트(그룹미지정)
|
//주소록 그룹 카운트(그룹미지정)
|
||||||
getAddrGroupNogrpCnt();
|
// getAddrGroupNogrpCnt();
|
||||||
|
|
||||||
//주소록 그룹 카운트(자주보내는 번호)
|
//주소록 그룹 카운트(자주보내는 번호)
|
||||||
getAddrGroupBookmarkCnt();
|
// getAddrGroupBookmarkCnt();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -684,7 +684,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" id="addrTotCnt"></span>/최대 500,000]</p>
|
<p class="open" onclick="openThisGroup('');"><img src="/publish/images/content/open_folder.png" alt="폴더 열림">전체[<span class="c_002c9a fwMd" id="addrTotCnt">${addrTotalCount }</span>/최대 1,000,000]</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="adr1_btnWrap">
|
<div class="adr1_btnWrap">
|
||||||
<div>
|
<div>
|
||||||
@ -703,13 +703,13 @@ function listAddrTransHistAjax(pageNo) {
|
|||||||
<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 id="nogrpCnt"></span>명]</p>
|
<p onclick="openThisGroup('noGrp');"><img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">그룹미지정[<span id="nogrpCnt"><c:out value="${addrNoGrpCnt}" /></span>명]</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- 고정그룹 : 자주보내는번호 -->
|
<!-- 고정그룹 : 자주보내는번호 -->
|
||||||
<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 id="bookmarkCnt"></span>명]
|
<p onclick="openThisGroup('bookmark');"><img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">자주보내는 번호[<span id="bookmarkCnt"><c:out value="${addrBookmarkCnt }"/></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