발송결과 > 상세 > 주소록등록 그룹선택으로 수정
This commit is contained in:
parent
4a899def87
commit
3848fb61b0
@ -653,19 +653,42 @@ public class AddrServiceImpl extends EgovAbstractServiceImpl implements AddrSer
|
||||
|
||||
String userId = addrVO.getMberId();
|
||||
|
||||
AddrGroupVO addrGroupVO = new AddrGroupVO();
|
||||
addrGroupVO.setAddrGrpNm(addrVO.getAddrGrpNm());
|
||||
addrGroupVO.setMberId(userId);
|
||||
addrGroupVO.setFrstRegisterId(userId);
|
||||
log.info("addrVO.getAddrGrpId() :: [{}]", addrVO.getAddrGrpId());
|
||||
|
||||
int usedCnt = addrGroupDAO.selectDuplAddrGroupCnt(addrGroupVO);
|
||||
if(usedCnt > 0) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "이미 등록되어있는 그룹이름입니다.", LocalDateTime.now());
|
||||
if ("NEW".equals(addrVO.getAddrGrpId())) {
|
||||
|
||||
|
||||
AddrGroupVO addrGroupVO = new AddrGroupVO();
|
||||
addrGroupVO.setMberId(userId);
|
||||
addrGroupVO.setAddrGrpNm(addrVO.getAddrGrpNm());
|
||||
addrGroupVO.setFrstRegisterId(userId);
|
||||
|
||||
int usedCnt = addrGroupDAO.selectDuplAddrGroupCnt(addrGroupVO);
|
||||
if(usedCnt > 0) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "이미 등록되어있는 그룹이름입니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
int nextOrderNumber = addrGroupDAO.selectMaxOrderNumber(addrGroupVO);
|
||||
addrGroupVO.setGrpOrder(nextOrderNumber);
|
||||
|
||||
String addrGrpIdTemp = addrGroupDAO.insertAddrGroup(addrGroupVO);
|
||||
|
||||
|
||||
addrVO.setAddrGrpId(addrGrpIdTemp);
|
||||
|
||||
}
|
||||
else if ("bookmark".equals(addrVO.getAddrGrpId()))
|
||||
{
|
||||
addrVO.setBookmark("Y");
|
||||
addrVO.setAddrGrpId("0");
|
||||
}
|
||||
else
|
||||
{
|
||||
addrVO.setBookmark("N");
|
||||
}
|
||||
|
||||
String addrGrpId = addrGroupDAO.insertAddrGroup(addrGroupVO);
|
||||
|
||||
|
||||
String bookmark = addrVO.getBookmark();
|
||||
String addrGrpId = addrVO.getAddrGrpId();
|
||||
|
||||
List<AddrVO> addrDataInfo = new ArrayList<AddrVO>();
|
||||
|
||||
@ -673,7 +696,7 @@ public class AddrServiceImpl extends EgovAbstractServiceImpl implements AddrSer
|
||||
AddrVO addrTempVO = new AddrVO();
|
||||
addrTempVO.setAddrPhoneNo(phone);
|
||||
addrTempVO.setAddrGrpId(addrGrpId);
|
||||
addrTempVO.setBookmark("N"); //북마크 : N
|
||||
addrTempVO.setBookmark(bookmark); //북마크 : N
|
||||
addrTempVO.setFrstRegisterId(userId);
|
||||
addrTempVO.setMberId(userId);
|
||||
addrDataInfo.add(addrTempVO);
|
||||
|
||||
@ -2245,8 +2245,6 @@ public class AddrController {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
|
||||
log.info(" + addrVO.getAddrPhones() :: [{}]", addrVO.getAddrPhones().length);
|
||||
log.info(" + addrVO.getAddrGrpNm() :: [{}]", addrVO.getAddrGrpNm());
|
||||
addrVO.setMberId(userId);
|
||||
|
||||
|
||||
|
||||
@ -32,6 +32,8 @@ $(document).ready(function(){
|
||||
|
||||
// 탭별 하위 버튼 활성화
|
||||
fn_rowBtnSH('전체');
|
||||
// 주소록 그룹 불러오기
|
||||
getAddrGroupList();
|
||||
|
||||
//Tabulator AJAX Data Loading
|
||||
$tbDtailList = new Tabulator("#detailPopup", {
|
||||
@ -127,6 +129,13 @@ $(document).ready(function(){
|
||||
$('#grpNm').val('')
|
||||
});
|
||||
|
||||
|
||||
$(document).on('change', '#addrGrpIdInfo', function() {
|
||||
if ($("#addrGrpIdInfo option:selected").val() != "NEW") {
|
||||
$("#grpNm").val(""); // 새그룹명 Clear;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//검색 실행 함수
|
||||
@ -443,6 +452,14 @@ function fnAddAddrNo(){
|
||||
let url = "/web/mjon/addr/insertByAddrGrpDataAndAddrDataAjax.do";
|
||||
|
||||
|
||||
console.log($("#addrGrpIdInfo option:selected").val());
|
||||
console.log($("#grpNm").val());
|
||||
if ($("#addrGrpIdInfo option:selected").val() == "NEW"
|
||||
&& $("#grpNm").val() == "") {
|
||||
alert("저장할 그룹을 선택하거나 새 그룹명을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 필터링된 데이터 가져오기 (탭 필터 적용)
|
||||
let filteredData = getFilteredDataByTab();
|
||||
|
||||
@ -450,7 +467,7 @@ function fnAddAddrNo(){
|
||||
|
||||
// phone 필드 데이터만 추출
|
||||
let addrPhones = filteredData.map(row => row.phone);
|
||||
console.log('addrPhones : ', addrPhones)
|
||||
// console.log('addrPhones : ', addrPhones)
|
||||
|
||||
if(addrPhones.length < 1){
|
||||
alert('해당 탭에 데이터가 없습니다.');
|
||||
@ -459,11 +476,13 @@ function fnAddAddrNo(){
|
||||
|
||||
// 주소록 그룹명 가져오기
|
||||
let addrGrpNm = $('#grpNm').val();
|
||||
let addrGrpId = $("#addrGrpIdInfo option:selected").val();
|
||||
|
||||
// 데이터 객체 생성
|
||||
let data = {
|
||||
addrPhones: addrPhones,
|
||||
addrGrpNm: addrGrpNm
|
||||
addrPhones : addrPhones
|
||||
, addrGrpNm : addrGrpNm
|
||||
, addrGrpId : addrGrpId
|
||||
};
|
||||
|
||||
if(!confirm("연락처 정보를 주소록에 등록 하시겠습니까?")){
|
||||
@ -509,8 +528,6 @@ function fnDelAddrNo(){
|
||||
// 필터링된 데이터 가져오기 (탭 필터 적용)
|
||||
let filteredData = getFilteredDataByTab();
|
||||
|
||||
console.log('filteredData : ', filteredData)
|
||||
|
||||
// phone 필드 데이터만 추출
|
||||
let addrPhones = filteredData.map(row => row.phone);
|
||||
console.log('addrPhones : ', addrPhones)
|
||||
@ -574,6 +591,42 @@ function getFilteredDataByTab() {
|
||||
return allData.filter(row => tabFilter ? row.result.includes(tabFilter.value) : true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//주소록 그룹정보 불러오기
|
||||
function getAddrGroupList() {
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
async : false,
|
||||
url : "/web/mjon/addr/addrGroupListAjax.do",
|
||||
data : {},
|
||||
dataType:'json',
|
||||
success : function(data) {
|
||||
//alert(JSON.stringify(data.addrGroupList));
|
||||
|
||||
// Show Html
|
||||
getAddrGroupListShow(data.addrGroupList);
|
||||
},
|
||||
error : function(xhr, status, error) {
|
||||
alert(error);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Show Html
|
||||
function getAddrGroupListShow(jsonList) {
|
||||
var sHtml = "";
|
||||
sHtml += "<option value='NEW'>그룹추가</option>";
|
||||
sHtml += "<option value='0'>그룹미지정</option>";
|
||||
sHtml += "<option value='bookmark'>자주보내는 번호</option>";
|
||||
for (var j = 0; j < jsonList.length; j++) {
|
||||
sHtml += " <option value='" + $.trim(jsonList[j].addrGrpId) + "' />" + $.trim(jsonList[j].addrGrpNm) + "</option>";
|
||||
}
|
||||
|
||||
$("#addrGrpIdInfo").html(sHtml);
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="inner">
|
||||
<!-- js 참고용 hidden -->
|
||||
@ -871,7 +924,7 @@ function getFilteredDataByTab() {
|
||||
</div>
|
||||
</div>
|
||||
<!-- //발송대상 리스트 안내 팝업 -->
|
||||
|
||||
<!--
|
||||
<div class="tooltip-wrap">
|
||||
<div class="popup-com adr_layer rev_popup02" tabindex="0" data-tooltip-con="rev_popup02" data-focus="rev_popup02" data-focus-prev="rev_popup02-close" style="width: 500px;">
|
||||
<div class="popup_heading">
|
||||
@ -895,8 +948,43 @@ function getFilteredDataByTab() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 주소록에 등록 팝업 -->
|
||||
<div class="tooltip-wrap">
|
||||
<div class="popup-com adr_layer rev_popup02" tabindex="0" data-tooltip-con="rev_popup02" data-focus="rev_popup02" data-focus-prev="rev_popup02-close" style="width: 510px;">
|
||||
<div class="popup_heading">
|
||||
<p>주소록에 등록</p>
|
||||
<button type="button" class="tooltip-close grpClose" data-focus="rev_popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
|
||||
</div>
|
||||
<div class="layer_in">
|
||||
<table class="layer_tType1 style1">
|
||||
<caption>주소록 그룹선택 표</caption>
|
||||
<colgroup>
|
||||
<col style="width: 80px">
|
||||
<col style="width: auto">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>그룹 선택</th>
|
||||
<td>
|
||||
<label for="" class="label">그룹 선택</label>
|
||||
<select id="addrGrpIdInfo" name="addrGrpIdInfo">
|
||||
</select>
|
||||
<label for="" class="label">그룹명 입력</label>
|
||||
<input type="text" id="grpNm" placeholder="새 그룹명을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='새 그룹명을 입력해주세요.'" class="inputLight">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="popup_btn_wrap2">
|
||||
<button type="button" onclick="fnAddAddrNo()">등록</button>
|
||||
<button type="button" class="tooltip-close grpClose" data-focus="rev_popup02-close" data-focus-next="rev_popup02">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--// 주소록에 등록 팝업 -->
|
||||
|
||||
<!-- 이전 리스트 상태(검색조건, 페이징) 그대로 가기 위한 form -->
|
||||
<form id="goList" name="goList" method="post" action="/web/mjon/msgsent/selectMsgSentView.do">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user