rosewiper 2023-12-13
20건 선거문자 기능 변경 - 전체선택 기능 추가 - 후보자 등록 정보 체크
 - 전체선택 기능 추가
 - 후보자 등록 정보 체크
@e563ff812f519f72d6fdda8e7e9b1a6a9b20f13f
src/main/java/itn/let/mjo/pay/service/MjonPayService.java
--- src/main/java/itn/let/mjo/pay/service/MjonPayService.java
+++ src/main/java/itn/let/mjo/pay/service/MjonPayService.java
@@ -76,9 +76,10 @@
 	
 	void updatePointUseByCase(MjonPayVO mjonPayVO)  throws Exception;
 	
-	
 	String selectSumPayMoney(String userId) throws Exception;
-
+	
+	String selectAgentSumPayMoney(String userId) throws Exception;
+	
 	String selectSumPoint(String userId) throws Exception;
 	
 	List<MjonPayVO> selectPayListForRefund(MjonPayVO mjonPayVO) throws Exception;
src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java
--- src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java
+++ src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java
@@ -179,6 +179,10 @@
 		return (String) select("mjonPayDAO.selectSumPayMoney", userId);
 	}
 	
+	public String selectAgentSumPayMoney(String userId) throws Exception{
+		return (String) select("mjonPayDAO.selectAgentSumPayMoney", userId);
+	}
+	
 	public String selectSumPoint(String userId) throws Exception{
 		return (String) select("mjonPayDAO.selectSumPoint", userId);
 	}
src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
--- src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
+++ src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
@@ -2499,11 +2499,14 @@
 		}
 	}	
 	
-	
-	
 	@Override
 	public String selectSumPayMoney(String userId) throws Exception{
 		return mjonPayDAO.selectSumPayMoney(userId);
+	}
+	
+	@Override
+	public String selectAgentSumPayMoney(String userId) throws Exception {
+		return mjonPayDAO.selectAgentSumPayMoney(userId);
 	}
 	
 	@Override
@@ -2740,4 +2743,6 @@
 		return mjonPayDAO.selectPointInfoList(userId);
 	}
 
+	
+
 }
src/main/java/itn/let/mjo/pay/web/MjonPayController.java
--- src/main/java/itn/let/mjo/pay/web/MjonPayController.java
+++ src/main/java/itn/let/mjo/pay/web/MjonPayController.java
@@ -2409,7 +2409,7 @@
 		mjonMsgVO.setUserId(userId);
 		
 		{ // 충전캐시
-			String sumPayMoney = mjonPayService.selectSumPayMoney(userId); 
+			String sumPayMoney = mjonPayService.selectAgentSumPayMoney(userId); 
 			model.addAttribute("sumPayMoney", sumPayMoney);
 		}
 		
@@ -2480,7 +2480,7 @@
 		
 		
 		{ // 충전캐시
-			String sumPayMoney = mjonPayService.selectSumPayMoney(userId); 
+			String sumPayMoney = mjonPayService.selectAgentSumPayMoney(userId); 
 			model.addAttribute("sumPayMoney", sumPayMoney);
 		}
 		
src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml
--- src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml
@@ -1285,6 +1285,14 @@
 	
 	<select id="mjonPayDAO.selectSumPayMoney" parameterClass="String" resultClass="String">
 		
+		SELECT SUM(AMT)
+		FROM   MJ_PG
+		WHERE  USER_ID = #userId# AND PG_STATUS = 1
+	
+	</select>
+	
+	<select id="mjonPayDAO.selectAgentSumPayMoney" parameterClass="String" resultClass="String">
+		
 		SELECT SUM(CASH)
 		FROM   MJ_PG
 		WHERE  USER_ID = #userId# AND PG_STATUS = 1
@@ -2180,7 +2188,7 @@
 	<select id="mjonPayDAO.selectCashInfoList" parameterClass="String" resultClass="mjonPayVO">
 		SELECT
 			'chargeCash'	AS divFlag
-			,SUM(AMT)		AS cashSum
+			,SUM(CASH)		AS cashSum
 		FROM
 			MJ_PG
 		WHERE 1=1
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
@@ -11,15 +11,25 @@
 	var sendComplete = '${resultTotCallToInfo.sendComplete}';
 	var sendReady = '${resultTotCallToInfo.sendReady}';
 	
-	$("#totCallToCnt").text(totCallToCnt);
-	$("#sendComplete").text(sendComplete);
-	$("#sendReady").text(sendReady);
+	if(sendReady > 0){
+		
+		$("#totCallToCnt").text(totCallToCnt);
+		$("#sendComplete").text(sendComplete);
+		$("#sendReady").text(sendReady);
+		
+	}else{
+		
+		$("#totCallToCnt").text(0);
+		$("#sendComplete").text(0);
+		$("#sendReady").text(0);
+		
+	}
 	
 	
 </script>
 <div class="listType list">
 	<ul class="thead_ul table_ul">
-		<li></li>
+		<li><div class="input_wrap"><input type="checkbox" id="checkAll" name="receipt_number_check"></div></li>
 		<li>
 			번호
 			<!-- <button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
@@ -307,7 +307,7 @@
 
 			onlongclick(".btn_check_one", 1000, function () {
 				var checkbox = $('[name=chkCallTo]');
-				publishCommon.longMousePressCheck(checkbox, 10);
+				publishCommon.longMousePressCheck(checkbox, 10, $(".btn_check_one"));
 				publishCommon.clickCheckPrice();
 			});
 
@@ -316,12 +316,25 @@
 				publishCommon.clickCheck(checkbox);
 				publishCommon.clickCheckPrice();
 			});
+			
+			$("#checkAll").change(function(){
+				
+				publishCommon.clickCheckAll();
+				publishCommon.clickCheckPrice();
+				
+			});
 
 		});
 		//수신자 목록 추가된 건수 및 발송 금액 변경해주기
 		fnChkCallToChange();
 		
 	});
+	
+	//후보자 등록 체크
+	var candiNm = '${mjonCandidateVO.candidateNm}';
+	if(candiNm == ""){
+		fn_candidateChk();
+	};
 	
 }
 
@@ -567,6 +580,7 @@
 }	
 
 $(document).ready(function (){
+	
 	// 발송금액 단가표시
 	SetPriceWrapOpen();	
 	
@@ -598,87 +612,6 @@
 	if(loginId != "" && loginId != null){
 		addTWCallToInfo();
 	}	
-	
-	
-	//스프레드 시트 Tabulator 초기 셋팅
-	/* var tabledata = [
-	 ]; */
-	
-	//var selectRow;
-	
-	//받는사람 연락처 내용 처리
-	//Tabulator AJAX Data Loading
-	/* tableL = new Tabulator(".callList_box", {
-		height:"255px",
-	    layout:"fitColumns",
-	    //data:tabledata,
-	    //autoColumns:true,
-	    headerHozAlign:"center",
-	    validationMode:"highlight",
-	    //clipboard:false,
-	    //clipboardCopySelector:"table",
-	    //clipboardPasteAction:"insert", // insert, update, replace
-	    placeholder:"복사(Ctrl+C)한 내용을 여기에 붙여넣기(Ctrl+V) 해주세요.", //fit columns to width of table (optional)
-	    resizableColumns:false,
-	 	columns:[ //Define Table Columns
-	 		{formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
-	 	        cell.getRow().toggleSelect();
-		 		}
-		 	}, 
-		 	{title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){
-		 	    //cell - cell component
-		 	    fnReplCell();
-		    }},
-		 	{title:"휴대폰", hozAlign:"center", field:"phone", editor:"input", width:100, validator:["required","minLength:10", "maxLength:12"], cellEdited:function(cell){
-		 	    //cell - cell component
-		 	    fnDuplPhone();
-		    }},
-		 	{title:"[*1*]", hozAlign:"center", field:"rep1", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
-		 	    //cell - cell component
-		 	    fnReplCell();
-		    }},
-		 	{title:"[*2*]", hozAlign:"center", field:"rep2", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
-		 	    //cell - cell component
-		 	    fnReplCell();
-		    }},
-		 	{title:"[*3*]", hozAlign:"center", field:"rep3", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
-		 	    //cell - cell component
-		 	    fnReplCell();
-		    }},
-		 	{title:"[*4*]", hozAlign:"center", field:"rep4", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
-		 	    //cell - cell component
-		 	    fnReplCell();
-		    }},
-		 	
-	 	],
-	 	validationFailed:function(cell, value, parameters){ // 유효성 체크 함수 - 아직 잘 모르겠음 
-	        //take action on validation fail
-	 		var valid = cell.isValid();
-	 		var fieldNm = cell.getField();
-	 		var cellVal = cell.getValue();
-	 		var returnVal = "";
-	 		if(!valid){
-	 			
-	 			if(fieldNm == "name"){
-	 				alert("받는사람 이름은 최대 12글자까지만 입력 가능합니다.");
-	 				cell.setValue(strMaxLengthSubstring(cellVal, 11)); //스크립트 함수가 0부터 시작이므로 원하는 글자수 -1을 해줘야한다.
-	 				cell.clearValidation();
-	 			}else if(fieldNm == "phone"){
-	 				alert("휴대폰번호는 하이픈(-)을 제외한 숫자만 정확히 입력해 주세요.");
-	 			}else{
-		 			alert("치환문자를 정확히 입력해 주세요. 40글자 이내로 입력 가능합니다.");
-		 			cell.setValue(strMaxLengthSubstring(cellVal, 39));
-		 			cell.clearValidation();
-	 			}
-	 			
-	 			//해당 셀 데이터 삭제
-	 			//cell.setValue("");
-	 			
-	 		}
-	 		return value % parameters.phone;
-	    },
-
-	}); */
 	
 	
 	//주소록 불러오기 팝업 내용
@@ -1632,6 +1565,7 @@
 		
 	});
 	
+	
 	/*
 	
 		단문 / 장문 탭 옵션 선택시 실행 
@@ -1887,6 +1821,7 @@
 		$('.send_rev .send_content').css('padding-bottom','0');
 		$('.send_btn .btnType:first-child').html('예약하기');
 	});
+	
 });
 
 //선거 후보자 등록 알림 메세지 처리
@@ -4098,7 +4033,7 @@
 		
 	<!-- <div class="top_content current" id="tab1_1"> -->
 	    <div class="heading">
-	        <h2>선거 20건씩 문자전송</h2>
+	        <h2>20건 문자(수동문자) 전송</h2>
 	        <div class="election_btnWrap">
 	        	<button type="button" class="button2 info" onclick="infoPop('selectMsgDataView2');">발송규정</button>
 	        	<button type="button" class="button2 info" data-tooltip="candidate_popup03">사용안내</button>
@@ -4333,7 +4268,7 @@
 	                                    <div class="put_left" id="twCallToList">
 											<div class="listType list">
 												<ul class="thead_ul table_ul">
-													<li></li>
+													<li><div class="input_wrap"><input type="checkbox" id="checkAll" name="receipt_number_check"></div></li>
 													<li>
 														번호
 														<!-- <button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
@@ -849,6 +849,14 @@
 //문자발송 처리 함수
 function fn_sendMsgData(){
 	
+	var candiNm = $("#candidateNm").val();
+	
+	if(candiNm == ""){
+		fn_candidateChk();
+		return false;
+	}
+	
+	
 	if(!checkConf()){	//문자온 conf-check
 		alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요.");
 		return false;
@@ -1926,10 +1934,9 @@
         <div class="send_top">
             <!-- tab button -->
             <ul class="tabType1">
-                <li class="tab active"><button type="button" onclick="TabType1(this,'1');">단문 · 장문 · 그림 문자</button></li>
-                <li class="tab">
-                	<!-- <button type="button" onclick="TabType1(this,'2');">대량 문자(엑셀·TXT)</button> -->
-                	<button type="button" onclick="javascript:fnMsgDataView(); return false;">단체문자(엑셀·TXT)</button>
+                <li class="tab"><button type="button" onclick="javascript:fnMsgDataView(); return false;">단체문자(자동동보문자)</button></li>
+                <li class="tab active">
+                	<button type="button">20건 문자(수동문자)</button>
                 </li>
             </ul><!--// tab button -->
 			<!-- tab content1 -->
src/main/webapp/publish/js/publish.js
--- src/main/webapp/publish/js/publish.js
+++ src/main/webapp/publish/js/publish.js
@@ -12,7 +12,7 @@
 
 var publishCommon = {
   count: 0,
-  longMousePressCheck: function (checkTarget, checkTime) {
+  longMousePressCheck: function (checkTarget, checkTime , $target) {
     // checkTarget → 체크박스([name='']) / checkTime → 몇초 간격으로 체크 될지
     var checkLength = checkTarget.length; // 체크박스 몇개인지
     var cnt = 0; // 몇개 체크됐는지
@@ -22,18 +22,16 @@
         clearInterval(checkEvent); // 자동체크 끝.
       }
       $(checkTarget[cnt]).prop('checked', true); // 체크박스 체크.
+      $($target).on("mouseup",function(){
+    	  //마우스떼면 멈춤
+    	  clearInterval(checkEvent);
+      });
       cnt++;
       fnChkCallToChange();
     }, checkTime);
   },
   clickCheck: function (checkTarget) {
     // 한번 클릭 했을 때 체크, checkTarget → 체크박스([name=''])
-    /*if (checkTarget.length < this.count) {
-      // 체크 다하면 더이상 작동 x.
-      return false;
-    }
-    $(checkTarget[this.count]).prop('checked', true); // 체크박스 체크
-    this.count++;*/
 	  
 	$("input:checkbox[name='chkCallTo']").each(function(){
 			
@@ -47,6 +45,30 @@
 	});
     
   },
+  clickCheckAll : function(){
+	  
+	var chkCnt = $("input:checkbox[name='chkCallTo']").length;
+	var chkAllSts = $('input:checkbox[name="receipt_number_check"]').is(':checked');
+	
+	if(chkCnt == 0){
+		
+		alert("받는사람을 추가해 주세요.");
+		return false;
+		
+	}
+	
+	$("input:checkbox[name='chkCallTo']").each(function(){
+		
+		if(chkAllSts){
+			$(this).prop("checked",true);
+		}else{
+			$(this).prop("checked",false);
+		}
+		
+	});
+	  
+	  
+  },
   clickCheckPrice : function(){
 	  
 	  fnChkCallToChange();
src/main/webapp/publish/sub_election_2023.html
--- src/main/webapp/publish/sub_election_2023.html
+++ src/main/webapp/publish/sub_election_2023.html
@@ -54,10 +54,20 @@
 				}
 			});
 
-			onlongclick(".btn_check_one", 1000, function () {
+			$(".input_wrap #checkAll").click(function(){
 				var checkbox = $('[name=receipt_number_check]');
-				publishCommon.longMousePressCheck(checkbox, 300);
+				if($(this).is(":checked") !== true){
+					checkbox.prop("checked",false);
+				}else{
+					publishCommon.longMousePressCheck(checkbox, 100);
+				}
 			});
+			
+			onlongclick(".btn_check_one", 100, function (e) {
+				var checkbox = $('[name=receipt_number_check]');
+				publishCommon.longMousePressCheck(checkbox, 100, $(".btn_check_one"));
+			});
+			
 
 			$(".btn_check_one").click(function(){
 				var checkbox = $('[name=receipt_number_check]');
@@ -1339,7 +1349,7 @@
 													<div class="put_left">
 													<div class="listType list">
 														<ul class="thead_ul table_ul">
-															<li></li>
+															<li><div class="input_wrap"><input type="checkbox" id="checkAll" name="receipt_number_check"></div></li>
 															<li>
 																번호
 																<button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
Add a comment
List