이호영 이호영 2025-01-17
발송결과 페이지 개선중
@9e56bc1ee00be98322b74769ad71cfff7f66ec37
src/main/java/itn/com/cmm/util/FileUtil.java
--- src/main/java/itn/com/cmm/util/FileUtil.java
+++ src/main/java/itn/com/cmm/util/FileUtil.java
@@ -25,45 +25,44 @@
  */
 public final class FileUtil {
 	
-    /** 
-     * @methodName	: downLoad 
-     * @author		: 이호영
-     * @date		: 2023.04.06 
-     * @description	: 파일 다운로드 
-     * @param response
-     * @param fileInfo
-     * @param fileName 
-     * @throws Exception 
-     */
-    public static void downLoad(HttpServletResponse response, String fileInfo, String fileNameP) throws Exception {
-
-    
-        try {
-        	String path = fileInfo; // 경로에 접근할 때 역슬래시('\') 사용
-
-        	File file = new File(path);
-        	
-        	String fileName = "";
-        	if(StringUtils.isNotEmpty(fileNameP))
-        		fileName = URLEncoder.encode(fileNameP,"UTF-8").replaceAll("\\+", "%20");
-        	else
-        		fileName = file.getName();
-        	
-        	response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // 다운로드 되거나 로컬에 저장되는 용도로 쓰이는지를 알려주는 헤더
-        	
-        	FileInputStream fileInputStream = new FileInputStream(path); // 파일 읽어오기 
-        	OutputStream out = response.getOutputStream();
-        	
-        	int read = 0;
-            byte[] buffer = new byte[1024];
-            while ((read = fileInputStream.read(buffer)) != -1) { // 1024바이트씩 계속 읽으면서 outputStream에 저장, -1이 나오면 더이상 읽을 파일이 없음
-                out.write(buffer, 0, read);
-            }
-                
-        } catch (Exception e) {
-            throw new Exception("download error");
-        }
+	/** 
+	 * @methodName	: downLoad 
+	 * @author		: 이호영
+	 * @date		: 2023.04.06 
+	 * @description	: 파일 다운로드 
+	 * @param response
+	 * @param fileInfo
+	 * @param fileName 
+	 * @throws Exception 
+	 */
+	public static void downLoad(HttpServletResponse response, String fileInfo, String fileNameP) throws Exception {
+	
+	
+		try {
+			String path = fileInfo; // 경로에 접근할 때 역슬래시('\') 사용
+		
+			File file = new File(path);
+			
+			String fileName = "";
+			if(StringUtils.isNotEmpty(fileNameP))
+				fileName = URLEncoder.encode(fileNameP,"UTF-8").replaceAll("\\+", "%20");
+			else
+				fileName = file.getName();
+			
+			response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // 다운로드 되거나 로컬에 저장되는 용도로 쓰이는지를 알려주는 헤더
+			
+			FileInputStream fileInputStream = new FileInputStream(path); // 파일 읽어오기 
+			OutputStream out = response.getOutputStream();
+			
+			int read = 0;
+			byte[] buffer = new byte[1024];
+			while ((read = fileInputStream.read(buffer)) != -1) { // 1024바이트씩 계속 읽으면서 outputStream에 저장, -1이 나오면 더이상 읽을 파일이 없음
+				out.write(buffer, 0, read);
+			}
+		} catch (Exception e) {
+			throw new Exception("download error");
+		}
 	}
-    
-    
+	
+	
 }
 
src/main/java/itn/let/mjo/msgsent/service/MjonMsgDetailSentVO.java (added)
+++ src/main/java/itn/let/mjo/msgsent/service/MjonMsgDetailSentVO.java
@@ -0,0 +1,39 @@
+package itn.let.mjo.msgsent.service;
+
+import java.io.Serializable;
+import java.util.List;
+
+import itn.let.cmm.vo.FileInfoVO;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class MjonMsgDetailSentVO implements Serializable{
+
+	private static final long serialVersionUID = 1L;
+
+	
+	private String msgGroupId;
+	private String reqDate;
+	private String msgGroupCnt;
+	private String reserveYn;
+	private String callFrom;
+	private String userId;
+	private String smsTxt;
+	private String subject;
+	private String msgType;
+	private String fileCnt;
+	private String msgKind;
+	private String sentDate;
+	private String filePath1;
+	private String filePath2;
+	private String filePath3;
+	
+	private String callTo;
+	private String statusTxt;
+
+
+	// FileInfo 리스트 필드 추가
+	private List<FileInfoVO> fileInfos;
+}
src/main/java/itn/let/mjo/msgsent/service/MjonMsgSentService.java
--- src/main/java/itn/let/mjo/msgsent/service/MjonMsgSentService.java
+++ src/main/java/itn/let/mjo/msgsent/service/MjonMsgSentService.java
@@ -60,5 +60,9 @@
 
 	public int countAllMsgSentList(MjonMsgSentVO mjonMsgSentVO);
 
+	public Map<String, Object> selectAllMsgSentDetailView(MjonMsgDetailSentVO mjonMsgDetailSentVO) throws Exception;
+
+	public List<MjonMsgDetailSentVO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO);
+
 	
 }
src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentDAO.java
--- src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentDAO.java
+++ src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentDAO.java
@@ -9,6 +9,7 @@
 import itn.let.fax.addr.service.FaxAddrGroupVO;
 import itn.let.mjo.addr.service.AddrGroupVO;
 import itn.let.mjo.block.service.MjonBlockVO;
+import itn.let.mjo.msgsent.service.MjonMsgDetailSentVO;
 import itn.let.mjo.msgsent.service.MjonMsgSWFDTO;
 import itn.let.mjo.msgsent.service.MjonMsgSentVO;
 
@@ -175,5 +176,15 @@
 		
 		return (MjonMsgSWFDTO) select("MjonMsgSentDAO.findBySWF", msgGroupId);
 	}
+
+	public MjonMsgDetailSentVO selectAllMsgSentDetailView(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
+		// TODO Auto-generated method stub
+		return (MjonMsgDetailSentVO) select("MjonMsgSentDAO.selectAllMsgSentDetailView", mjonMsgDetailSentVO);
+	}
+
+	public List<MjonMsgDetailSentVO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
+		
+		return (List<MjonMsgDetailSentVO>) list("MjonMsgSentDAO.findByMsgDetailListAjax", mjonMsgDetailSentVO);
+	}
 	
 }
src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentServiceImpl.java
--- src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentServiceImpl.java
+++ src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentServiceImpl.java
@@ -6,17 +6,21 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.annotation.Resource;
 
+import org.apache.commons.io.FilenameUtils;
 import org.springframework.stereotype.Service;
 
 import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
 import egovframework.rte.fdl.idgnr.EgovIdGnrService;
+import itn.let.cmm.vo.FileInfoVO;
 import itn.let.fax.addr.service.FaxAddrGroupVO;
 import itn.let.mjo.addr.service.AddrGroupVO;
 import itn.let.mjo.block.service.MjonBlockVO;
+import itn.let.mjo.msgsent.service.MjonMsgDetailSentVO;
 import itn.let.mjo.msgsent.service.MjonMsgSWFDTO;
 import itn.let.mjo.msgsent.service.MjonMsgSentService;
 import itn.let.mjo.msgsent.service.MjonMsgSentVO;
@@ -133,7 +137,66 @@
 			
 		return resultMap;
 	}
+	
 
+	public Map<String, Object> selectAllMsgSentDetailView(MjonMsgDetailSentVO mjonMsgDetailSentVO) throws Exception{
+
+		Map<String, Object> resultMap = new HashMap<String, Object>();
+
+		// 목록
+		MjonMsgDetailSentVO result = mjonMsgSentDAO.selectAllMsgSentDetailView(mjonMsgDetailSentVO);
+		
+		// 광고일떄 (광고)와 줄바꿈+무료거부 0808800858 삭제
+		if("A".equals(result.getMsgKind())) {
+			result.setSmsTxt(result.getSmsTxt().replace("(광고)", "")
+					.replaceAll("\\s*무료거부 0808800858", ""));
+		}
+		
+		if(Integer.parseInt(result.getFileCnt()) > 0)
+		{
+			
+			List<FileInfoVO> fileInfos = getFileInfo(result);
+			result.setFileInfos(fileInfos);
+		}
+		
+		
+		
+		
+		resultMap.put("result", result);
+		
+		return resultMap;
+	}
+
+
+	private List<FileInfoVO> getFileInfo(MjonMsgDetailSentVO result) throws Exception {
+		
+		
+		List<FileInfoVO> fileInfos = new ArrayList<>();
+		
+		// 파일 경로 필드들을 배열로 관리
+		String[] filePaths = { result.getFilePath1(), result.getFilePath2(), result.getFilePath3() };
+
+		for (String filePath : filePaths) {
+			if (filePath != null) {
+				// 파일 ID 추출
+
+				// 확장자 제외한 파일명
+				String fileId = FilenameUtils.getBaseName(filePath);
+				
+				// 파일 정보 조회
+				MjonMsgSentVO info = mjonMsgSentDAO.selectFileInfo(fileId);
+
+				// FileInfo 객체 생성 및 추가
+				FileInfoVO fileInfo = new FileInfoVO();
+				fileInfo.setAtchFileId(info.getAtchFileId());
+				fileInfo.setFileSn(info.getFileSn());
+
+				fileInfos.add(fileInfo);
+			}
+		}
+		return fileInfos;
+		
+	}
 
 	@Override
 	public int countAllMsgSentList(MjonMsgSentVO mjonMsgSentVO) {
@@ -299,4 +362,12 @@
 	public MjonMsgSentVO selectFileInfo(String streFileId) throws Exception {
 		return mjonMsgSentDAO.selectFileInfo(streFileId);
 	}
+
+	@Override
+	public List<MjonMsgDetailSentVO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
+		
+		List<MjonMsgDetailSentVO> list = mjonMsgSentDAO.findByMsgDetailListAjax(mjonMsgDetailSentVO);
+		
+		return list; 
+	}
 }
src/main/java/itn/let/mjo/msgsent/web/MjonMsgSentController.java
--- src/main/java/itn/let/mjo/msgsent/web/MjonMsgSentController.java
+++ src/main/java/itn/let/mjo/msgsent/web/MjonMsgSentController.java
@@ -25,6 +25,8 @@
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -41,12 +43,14 @@
 import itn.com.cmm.util.DateUtils;
 import itn.com.utl.fcc.service.EgovStringUtil;
 import itn.let.kakao.user.sent.service.KakaoSentService;
+import itn.let.mail.service.StatusResponse;
 import itn.let.mjo.addr.service.AddrGroupService;
 import itn.let.mjo.addr.service.AddrGroupVO;
 import itn.let.mjo.addr.service.AddrService;
 import itn.let.mjo.addr.service.AddrVO;
 import itn.let.mjo.apikey.service.ApiKeyMngService;
 import itn.let.mjo.apikey.service.ApiKeyVO;
+import itn.let.mjo.msgsent.service.MjonMsgDetailSentVO;
 import itn.let.mjo.msgsent.service.MjonMsgSentCntVO;
 import itn.let.mjo.msgsent.service.MjonMsgSentService;
 import itn.let.mjo.msgsent.service.MjonMsgSentVO;
@@ -254,6 +258,35 @@
     	
 		return "web/msgsent/MsgSentView";
 	}
+	
+
+    /**
+     * 발송관리 화면 
+     * @param searchVO
+     * @param model
+     * @return	"/web/mjon/msgtxt/selectMsgTxtView.do"
+     * @throws Exception
+     */
+	@RequestMapping(value= {"/web/mjon/msgsent/msgSentDetailView.do"})
+	public String selectMsgSentDetailView(@ModelAttribute("searchVO") MjonMsgDetailSentVO mjonMsgDetailSentVO,
+			RedirectAttributes redirectAttributes,	ModelMap model) throws Exception{
+		
+			Map<String, Object> resultMap = mjonMsgSentService.selectAllMsgSentDetailView(mjonMsgDetailSentVO);
+			model.addAttribute("result", resultMap.get("result"));
+		
+		return "web/msgsent/MsgSentDetailView";
+	}
+
+    // 팩스 금일 발송통계 갱신
+	@RequestMapping(value= {"/web/mjon/msgsent/findByMsgDetailListAjax.do"})
+ 	public ResponseEntity<StatusResponse> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) throws Exception {
+
+			
+		List<MjonMsgDetailSentVO> resultList = mjonMsgSentService.findByMsgDetailListAjax(mjonMsgDetailSentVO);
+		
+
+		return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, "", resultList));
+ 	}
 
     /**
      * 마이페이지 - 이용내역	-	ajax
@@ -712,6 +745,9 @@
 		return "web/msgsent/MsgSentDetailPopAjax";
 	}
 	
+	
+	
+	
     /**
      * 발송관리 문자 상세보기 내용 
      * @param searchVO
src/main/resources/egovframework/sqlmap/let/msg/MjonMsgSent_SQL_mysql.xml
--- src/main/resources/egovframework/sqlmap/let/msg/MjonMsgSent_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/msg/MjonMsgSent_SQL_mysql.xml
@@ -6,6 +6,7 @@
 <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
 <sqlMap namespace="Msg">
 	<typeAlias  alias="mjonMsgSWFDTO" type="itn.let.mjo.msgsent.service.MjonMsgSWFDTO"/>
+	<typeAlias  alias="mjonMsgDetailSentVO" type="itn.let.mjo.msgsent.service.MjonMsgDetailSentVO"/>
 	<typeAlias  alias="mjonMsgSentVO" type="itn.let.mjo.msgsent.service.MjonMsgSentVO"/>
 	<typeAlias  alias="mjonMsgVO" type="itn.let.mjo.msg.service.MjonMsgVO"/>
 	<typeAlias  alias="addrGroupVO" type="itn.let.mjo.addr.service.AddrGroupVO"/>
@@ -283,6 +284,7 @@
 	
 	<!-- 전체 발송결과 조회  (전송사별) 카운트-->
 	<select id="MjonMsgSentDAO.findBySWF" parameterClass="String" resultClass="mjonMsgSWFDTO">
+	/* MjonMsgSentDAO.findBySWF */
 	select 
 		SUM(IF(aa.result = 'S', 1, 0)) AS resultSValue,
 		SUM(IF(aa.result = 'W', 1, 0)) AS resultWValue,
@@ -338,6 +340,63 @@
 	
 	
 	
+	<!-- 발송결과 상세 데이터-->
+	<select id="MjonMsgSentDAO.selectAllMsgSentDetailView" parameterClass="mjonMsgDetailSentVO" resultClass="mjonMsgDetailSentVO">
+		/* MjonMsgSentDAO.selectAllMsgSentDetailView */
+		select
+			MGD.MSG_GROUP_ID as msgGroupId
+			, MGD.MSG_GROUP_CNT as msgGroupCnt 
+			, MGD.RESERVE_YN as reserveYn
+			, MGD.CALL_FROM  as callFrom 
+			, MGD.USER_ID as userId
+			, MGD.SMS_TXT as smsTxt
+			, MGD.SUBJECT as subject
+			, MGD.REQ_DATE as reqdate
+			, MGD.MSG_TYPE as msgType
+			, MGD.MSG_KIND as msgKind
+			, MD.SENT_DATE as sentDate
+			, MD.FILE_CNT  as fileCnt
+			, MD.FILE_PATH1 as filePath1
+			, MD.FILE_PATH2 as filePath2
+			, MD.FILE_PATH3 as filePath3 
+		from
+			MJ_MSG_GROUP_DATA MGD
+		inner join MJ_MSG_DATA MD on
+			MGD.MSG_GROUP_ID = MD.MSG_GROUP_ID
+			and MGD.USER_ID = MD.USER_ID
+		where 
+			MGD.MSG_GROUP_ID = #msgGroupId#
+		limit 1
+			
+	</select>
+	
+	
+	<!-- 전체 발송결과 조회  (전송사별)-->
+	<select id="MjonMsgSentDAO.findByMsgDetailListAjax" parameterClass="mjonMsgDetailSentVO" resultClass="mjonMsgDetailSentVO">
+		/* MjonMsgSentDAO.findByMsgDetailListAjax*/
+		
+		SELECT
+			A.USER_ID as userId,
+			A.CALL_TO as callTo,
+			case
+				WHEN A.AGENT_CODE = '01' AND (A.RSLT_CODE = '100' and (A.RSLT_CODE2 = '0')) then '성공'
+				WHEN A.AGENT_CODE = '02' AND (A.RSLT_CODE = '0') then '성공'
+				WHEN A.AGENT_CODE = '03' AND (A.RSLT_CODE in ('100', '101', '110', '800')) then '성공'
+				WHEN A.AGENT_CODE = '04' AND (A.RSLT_CODE in ('4100', '6600', '7000')) then '성공'
+				WHEN A.AGENT_CODE = '05' AND (A.RSLT_CODE in ('1000', '1001')) then '성공'
+				WHEN A.AGENT_CODE = '07' AND (A.RSLT_CODE in ('6', '1000')) then '성공'
+				WHEN A.AGENT_CODE = '08' AND (A.RSLT_CODE in ('1000', '1001')) then '성공'
+				WHEN A.AGENT_CODE = '09' AND (A.RSLT_CODE in ('1000', '1001')) then '성공'
+				WHEN (A.RSLT_CODE is null AND A.RSLT_CODE2 IS NULL AND A.SENT_DATE IS NULL AND A.RSLT_DATE IS NULL) then '대기'
+				ELSE '실패'
+			END as statusTxt
+		from
+			MJ_MSG_DATA A
+		where
+			A.MSG_GROUP_ID = #msgGroupId#
+	
+			
+	</select>
 	
 	
 	<!-- 전체 발송결과 조회  (전송사별)-->
src/main/webapp/WEB-INF/jsp/web/msgsent/MsgSentAllListAjax.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgsent/MsgSentAllListAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgsent/MsgSentAllListAjax.jsp
@@ -60,6 +60,19 @@
 	
 });
 
+
+function fn_sentDetailView(msgGroupId) {
+	// msgGroupId 값을 form에 설정
+	$("#detailForm #msgGroupId").val(msgGroupId);
+
+	// form을 해당 URL로 제출
+	$("#detailForm").attr("action", "/web/mjon/msgsent/msgSentDetailView.do");
+	$("#detailForm").submit();
+}
+
+
+
+
 </script>
     <div class="list_info">
         <p>총 <span class="c_e40000" id="testId"><c:out value="${totalRecordCount}"/></span>건</p>
@@ -82,7 +95,6 @@
 				<col style="width: 8%;">
 				<col style="width: auto;">
 				<col style="width: 8%;">
-				<col style="width: 6%;">
 				<col style="width: 6%;">
 				<col style="width: 6%;">
 				<col style="width: 6%;">
@@ -127,16 +139,15 @@
 							<input type="button" class="sort sortBtn" id="sort_msgGroupCnt">
 						</div>
 					</th>
-					<th colspan="4">결과</th>
-					<th rowspan="2">금액</th>
-					<th rowspan="2">예약관리</th>
+					<th colspan="3">결과</th>
+					<th rowspan="2">금액(원)</th>
+					<th rowspan="2">진행상황</th>
 <!-- 					<th>금액</th> -->
 				</tr>
 				<tr>
 					<th>대기</th>
 					<th>성공</th>
 					<th>실패</th>
-					<th>예약</th>
 				</tr>
 			</thead>
 			<tbody>
@@ -196,10 +207,10 @@
 								</p>
 							</td>
 							<td class="result_cont" title="${resultAllSentList.smsTxt}">
-								<a href="#none" data-tooltip="rev_popup01" onClick="javascript:fnRevDetailPop('${resultAllSentList.msgGroupId}','${resultAllSentList.msgId}','${resultAllSentList.fileCnt}'); return false;">
-<%-- 								<button class="btnType btnType20" data-tooltip="rev_popup01" onClick="javascript:fnRevDetailPop('${resultAllSentList.msgGroupId}','${resultAllSentList.msgId}','${resultAllSentList.fileCnt}'); return false;">상세보기</button> --%>
-									<c:out value="${fn:substring(resultAllSentList.smsTxt, 0, 20)}" />
-									<c:if test="${fn:length(resultAllSentList.smsTxt) > 20}">...</c:if>
+<%-- 								<a href="#none" data-tooltip="rev_popup01" onClick="javascript:fnRevDetailPop('${resultAllSentList.msgGroupId}','${resultAllSentList.msgId}','${resultAllSentList.fileCnt}'); return false;"> --%>
+								<button class="btnType btnType20" data-tooltip="rev_popup01" onClick="javascript:fnRevDetailPop('${resultAllSentList.msgGroupId}','${resultAllSentList.msgId}','${resultAllSentList.fileCnt}'); return false;">상세보기</button>
+								<a href="#none"onclick="fn_sentDetailView('${resultAllSentList.msgGroupId}')">
+									<c:out value="${resultAllSentList.smsTxt}" />
 								</a>
 							</td>
 							<td>
@@ -209,18 +220,17 @@
 								<p><c:out value="${resultAllSentList.resultWValue}"/> </p>
 							</td>
 							<td>
-								<p><c:out value="${resultAllSentList.resultSValue}"/> </p>
+								<p class="c_002c9a"><c:out value="${resultAllSentList.resultSValue}"/> </p>
 							</td>
 							<td>
-								<p><c:out value="${resultAllSentList.resultFValue}"/> </p>
-							</td>
-							<td>
-								<p class="c_222">0</p>
+								<p class="c_e40000"><c:out value="${resultAllSentList.resultFValue}"/> </p>
 							</td>
 							<td>
 								<c:out value="${resultAllSentList.totPrice}"/>원
 							</td>
-							<td>-</td>
+							<td>
+								<p><button class="btnType btnType20">예약취소</button></p>
+							</td>
 							
 							
 						</tr>
@@ -253,3 +263,7 @@
 	       <ui:pagination paginationInfo = "${paginationInfo}"  type="imageWeb" jsFunction="linkPage" />
 	   </ul>
 	</c:if>
+	
+	<form name="detailForm" id="detailForm" method="post">
+		<input type="hidden" name="msgGroupId" id="msgGroupId" value=""/> 
+	</form>
 
src/main/webapp/WEB-INF/jsp/web/msgsent/MsgSentDetailView.jsp (added)
+++ src/main/webapp/WEB-INF/jsp/web/msgsent/MsgSentDetailView.jsp
@@ -0,0 +1,463 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ page import="itn.com.cmm.LoginVO" %>
+
+
+<style>
+	/* #detailPopup {
+		min-width: 400px;
+		width: 50%; 
+		margin: 0 auto; 
+	} */
+	
+	/* Tabulator 헤더 높이 조정 */
+    .tabulator .tabulator-header {
+        height: 36px !important; /* 원하는 높이로 설정 */
+        line-height: 25px; /*  텍스트 정렬을 위해 줄 간격 맞추기 */
+        background-color: #ededed;
+    } 
+    .tabulator .tabulator-col {
+        vertical-align: middle; /* 텍스트를 중앙에 정렬 */
+    }
+    
+        /* Tabulator 헤더 폰트 크기 조정 */
+    .tabulator .tabulator-header .tabulator-col {
+        font-size: 15px; /* 원하는 폰트 크기로 설정 */
+        font-weight: bold; /* 텍스트를 굵게 설정 (옵션) */
+        text-align: center; /* 텍스트 정렬 */
+    }
+</style>
+<script type="text/javascript">
+
+var $tbDtailList = null; //에러 팝업 영역
+$(document).ready(function(){
+
+	
+	//Tabulator AJAX Data Loading
+	$tbDtailList = new Tabulator("#detailPopup", {
+		height: "255px",
+		width: "20%",
+		layout: "fitColumns",
+		autoColumns: false,
+		headerHozAlign: "center",
+		validationMode: "highlight",
+		clipboard: false,
+		clipboardCopySelector: "table",
+		clipboardPasteAction: "insert", // insert, update, replace
+        columns: [
+            {
+                title: "휴대폰",
+                field: "phone",
+                hozAlign: "center",
+                headerHozAlign: "center",
+                width: 200,
+                headerFormatter: () => "<div style='font-size: 18px; font-weight: bold;'>휴대폰</div>"
+            },
+            {
+                title: "상세결과",
+                field: "result",
+                hozAlign: "center",
+                headerHozAlign: "center",
+                width: 180,
+                headerFormatter: () => "<div style='font-size: 18px; font-weight: bold;'>상세결과</div>"
+            }
+        ]
+	});
+	
+	fn_getDetailList();
+	
+	/* 
+	
+
+	
+	
+	 */
+	
+});
+
+/** 
+ * @Discription : 상세결과 팝업 내용 가져오는 로직
+ */
+function fn_getDetailList(){
+	
+	var params = {
+			"msgGroupId" : $('#msgGroupId').val()
+		}
+		
+		$.ajax({
+			type: "POST",
+			url: "/web/mjon/msgsent/findByMsgDetailListAjax.do",
+			data: params,
+			dataType:'json',
+			async: true,
+			success: function (returnData) {
+				console.log('returnData : ', returnData);
+				if(returnData.status == 'OK'){
+					fn_setData(returnData.object);
+					
+				}
+			},
+			error: function (e) { alert("오류가 발생하였습니다."); console.log("ERROR : ", e); }
+		});
+}
+
+
+function fn_setData(data){
+	console.log('data : ', data);
+	
+
+	// $tbDtailList.clearData();
+
+	const resultData = [];  // 오류 데이터를 저장할 배열
+
+	data.forEach((row, index) => {
+
+		resultData.push({ 
+			phone: row.callTo, // 폰번호
+			result: row.statusTxt // 결과 메시지 추가
+		});
+	});
+
+
+	// 오류 및 중복 데이터를 한 번에 추가
+	$tbDtailList.setData(resultData);
+	
+	
+};
+
+
+
+</script>
+<div class="inner">
+	<input id="msgGroupId" name="msgGroupId" type="hidden" value="${result.msgGroupId}"/>
+		<!-- send top -->
+	<div class="send_top">
+		<!-- 결제관리 - 요금 사용내역 -->
+		<div class="rev_admin_cont serv_content current">
+			<div class="heading">
+				<h2>발송결과 상세</h2>						
+				<button type="button" class="button junk" data-tooltip="popupJunk" style="right:0;">통신사 스팸규격안내</button>
+			</div>
+
+			<!-- 발송결과 상세 및 미리보기-->
+			<div class="send_general">
+				<!-- 발송결과 상세 정보 -->
+				<div class="resultcont_left">
+					<!--발송정보-->
+					<div class="res_info">
+						<div class="res_info_in">
+							<div class="res_info_top clearfix">
+								<p>발송정보</p>
+								<p><button type="button" class="btnType btnType3">재전송</button></p>
+							</div>
+							<div class="res_info_btm">
+								<dl>
+									<dt>발송일시</dt>
+									<dd>2024-07-18 15:25</dd>
+								</dl>
+								<dl>
+									<dt>형태</dt>
+									<dd>그림</dd>
+								</dl>
+								<dl>
+									<dt>발송건수</dt>
+									<dd><span class="c_222">100</span>건</dd>
+								</dl>
+								<dl>
+									<dt>발신번호</dt>
+									<dd>010-1234-5678</dd>
+								</dl>
+								<dl>
+									<dt>예약관리</dt>
+									<!--<dd>-</dd>--><!-- 예약건이 아닌 경우는 하이픈 처리-->
+									<dd><button class="btnType btnType25">예약취소</button></dd>
+									<!--<dd>예약취소 2024-07-16 15:07</dd>--><!-- 예역취소 후 버튼 대신 취소 일시 노출 -->
+								</dl>
+							</div>
+							<div class="res_info_btm">
+								<dl>
+									<dt class="btm_charge">발송요금</dt>
+									<dd><span class="stcharge">100</span>원</dd>											
+									<!--<dd><span class="stcharge">-</span>원</dd>--><!-- 예역취소 후 금액은 하이픈 처리--> 
+								</dl>
+							</div>
+						</div>                                
+					</div>
+					 <!--// 발송정보-->
+					<!--상세결과-->
+					<div class="res_info">
+						<div class="res_info_in">
+							<div class="res_info_top clearfix" style="padding:0 0 10px 0;">
+								<p>상세결과</p>
+								<p><button type="button" class="refresh_btn btnType"><i class="refresh_img"></i>새로고침</button></p>
+							</div>
+							<div class="res_num">
+								<div class="res_info_btm1">
+									<dl>
+										<dt>전체건수</dt>
+										<dd><a href="#" data-tooltip="rev_popup04"><span class="c_222_g">101</span>건(100%)</a></dd>
+									</dl>
+								</div>
+								<div class="res_info_btm1">
+									<dl>
+										<dt>성공건수</dt>
+										<dd><span class="c_002c9a_g">100</span>건(100%)</dd>
+									</dl>
+								</div>
+							</div>
+							<div class="res_num">	
+								<div class="res_info_btm1">
+									<dl>
+										<dt>대기건수</dt>
+										<dd><span class="c_666_g">0</span>건(0%)</dd>
+									</dl>
+								</div>
+								<div class="res_info_btm1">
+									<dl>
+										<dt>실패건수</dt>
+										<dd><span class="c_e40000_g">1</span>건(100%)</dd>
+									</dl>
+								</div>
+							</div>
+						</div>                                
+					</div>
+					 <!--// 발송결과-->	
+
+					 <div class="table_btn clearfix">
+						<div class="table_btn_left">
+							<button type="button" data-tooltip="rev_popup02" class="btnType btnType14"><i class="add_img"></i>주소록 등록</button>
+							<button type="button" class="excel_btn btnType"><i class="downroad"></i>엑셀 다운로드</button>
+						</div>
+						<div class="table_btn_right">
+							<p class="table_btn_right_txt">* 전체 건수를 클릭하면 받는 사람 상세정보를 확인하실 수 있습니다.</p>
+						</div>
+					</div>						 
+				</div>
+				<!--// 발송결과 상세 정보 -->
+
+				<!-- 발송결과 미리보기 -->
+				<div class="resultcont_right">
+					<div class="phone">
+						<div class="phoneIn">
+							<div>
+								<p class="prev_p"><img src="/publish/images/search.png">미리보기</p>
+								<div class="text_length2 clearfix" style="display:none;">
+									<span class="msg_com msg_short">단문</span>
+									<div>
+										<span>글자크기</span>
+										<button type="button"><img src="/publish/images/content/font_plus.png"></button>
+										<button type="button"><img src="/publish/images/content/font_minus.png"></button>
+									</div>
+								</div>
+								<div class="text_length2 clearfix" style="display:none;">
+									<span class="msg_com msg_long">장문</span>
+									<div>
+										<span>글자크기</span>
+										<button type="button"><img src="/publish/images/content/font_plus.png"></button>
+										<button type="button"><img src="/publish/images/content/font_minus.png"></button>
+									</div>
+								</div>
+								<div class="text_length2 clearfix">
+									<span class="msg_com ${result.msgType == '4' 
+																? 'msg_short' 
+																: (result.fileCnt == '0' 
+																		? 'msg_long' 
+																		: 'msg_photo')}">
+										${result.msgType == '4' 
+												? 'SMS' 
+												: (result.fileCnt == '0' 
+															? 'LMS' 
+															: 'MMS')}
+									</span>
+								
+<!-- 									<span class="msg_com msg_photo">포토</span> -->
+									<!-- <ul class="photo_msg_num">
+										<li onclick="imgClick(0);"><a href="#none">1</a></ li>
+										<li onclick="imgClick(1);"><a href="#none">2</a></ li>
+										<li onclick="imgClick(2);"><a href="#none">3</a></ li>
+									</ul> -->
+									<!-- <div>
+										<span>글자크기</span>
+										<button type="button"><img src="/publish/images/content/font_plus.png"></button>
+										<button type="button"><img src="/publish/images/content/font_minus.png"></button>
+									</div> -->
+								</div>
+								<!-- 텍스트 미리보기 -->
+								<div class="text_preview">
+									<div class="preiew_img">
+										<c:forEach var="fileInfo" items="${result.fileInfos}">
+											<div class="img_box">
+													<img src="<c:url value='/cmm/fms/getImage2.do'/>?atchFileId=<c:out value="${fileInfo.atchFileId}"/>&fileSn=<c:out value="${fileInfo.fileSn}"/>" alt="발송된 그림문자 미리보기" style="width: 100%">
+											</div>
+										</c:forEach>
+									</div>
+									<div class="preview_auto">
+										<c:if test="${result.msgKind eq 'A' }" >
+										<p class="ad_tit">(광고)</p>
+										</c:if>
+										<p class="none_txt"><c:out value="${result.smsTxt }" /></p>
+										<p class="realtime"></p>
+										<c:if test="${result.msgKind eq 'A' }" >
+										<p class="deny_receipt">무료 거부 080-0000-0000</p>
+										</c:if>
+									</div>
+								</div>
+								<!-- //텍스트 미리보기 -->
+							</div>
+						</div>
+						<p class="addText">※ 단말기 설정에 따라 다르게 보일 수 있습니다<p>
+					</div>
+				</div>
+				<!--// 발송결과 미리보기 -->
+			</div>			
+			<!--// 발송결과 상세 및 미리보기-->
+			<!-- 목록-->
+			<div class="btn_list_type1">
+				<button class="btnType btnType17">목록</button>
+			</div>
+			<!--// 목록-->
+
+		</div>
+	</div>
+	<!--// send top -->
+</div>
+
+
+
+	<!-- 발송대상리스트 팝업 -->
+	<div class="tooltip-wrap">
+		<div class="popup-com ad_layer rev_popup04" tabindex="0" data-tooltip-con="rev_popup04" data-focus="rev_popup04" data-focus-prev="rev_popup04-close" style="width:595px;">
+			<div class="popup_heading">
+				<p>발송대상 리스트</p>
+				<button type="button" class="tooltip-close" data-focus="rev_popup04-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+
+				<div class="gorup_join_cont" style="margin:-15px 0 0 0;">
+					<div class="group_input">
+						<div class="input_left">발신번호</div>
+						<div class="input_right type1"><c:out value="${result.callFrom }" /></div>
+					</div>
+				</div>
+
+				<div class="popup_search_type1">								
+					<label for="" class="label">검색종류 선택</label>
+					<select id="" class="selType2 select_btn">
+						<option value="1">수신번호</option>
+						<option value="2">이름</option>
+						<option value="3">상세결과</option>
+					</select>
+					<label for="" class="label">검색어입력</label>
+					<input type="text" class="send_text" id="" name="" value="" placeholder="3자 이상 입력하세요." onfocus="this.placeholder=''" onblur="this.placeholder='3자 이상 입력하세요.'">
+					<button type="button" class="btnType btnType2" style="width:63px; margin:0;">검색</button>
+				</div>
+
+				<div class="tb_wrap" id="detailPopup" style="min-height:200px;">
+					<%-- <table class="tType4">
+						<colgroup>
+							<col style="width: 30%;">
+							<col style="width: 40%;">
+							<col style="width: 30%;">
+						</colgroup>
+						<thead>
+							<tr>
+								<th>이름
+									<div class="sort_wrap">
+										<input type="button" class="sort sortBtn">
+									</div>
+								</th>
+								<th>수신번호
+									<div class="sort_wrap">
+										<input type="button" class="sort sortBtn">
+									</div>
+								</th>
+								<th>상세결과
+									<div class="sort_wrap">
+										<input type="button" class="sort sortBtn">
+									</div>
+								</th>
+							</tr>
+						</thead>
+						<tbody>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+							<tr>
+								<td>홍길동</td>
+								<td>010-1234-5678</td>
+								<td>성공</td>
+							</tr>
+						</tbody>
+					</table>
+ --%>
+				</div>	
+				
+				<div class="table_btn clearfix">
+					<div class="table_btn_left"></div>
+					<div class="table_btn_right">
+						<button type="button" data-tooltip="rev_popup02" class="btnType btnType14"><i class="add_img"></i>주소록 등록</button>
+					<button type="button" class="excel_btn btnType"><i class="downroad"></i>엑셀 다운로드</button>
+					</div>
+				</div>
+				<!-- 
+				pagination
+				<ul class="pagination">
+					<li class="page_first"><button><img src="/publish/images/content/page_first.png"
+								alt=""></button></li>
+					<li class="page_prev"><button><img src="/publish/images/content/page_prev.png"
+								alt=""></button></li>
+					<li class="on"><button>1</button></li>
+					<li><button>2</button></li>
+					<li><button>3</button></li>
+					<li><button>4</button></li>
+					<li><button>5</button></li>
+					<li><button>6</button></li>
+					<li><button>7</button></li>
+					<li><button>8</button></li>
+					<li><button>9</button></li>
+					<li><button>10</button></li>
+					<li class="page_next"><button><img src="/publish/images/content/page_next.png"
+								alt=""></button></li>
+					<li class="page_last"><button><img src="/publish/images/content/page_last.png"
+								alt=""></button></li>
+				</ul>pagination
+				 -->
+			</div>
+			<div class="popup_btn_wrap2" style="margin: -40px auto 30px auto;">
+				<button type="button" class="tooltip-close" data-focus="adr_popup01-close"  data-focus-next="popup02">닫기</button>                      
+			</div>
+
+		</div>
+	</div>
+	<!-- //발송대상 리스트 안내 팝업 -->	
+
Add a comment
List