[관리자] 성인 찾교 교육확정 시 확정 메일 템플릿 수정 완료

This commit is contained in:
hylee 2023-12-27 17:34:38 +09:00
parent c42c841b6d
commit fa692b62c9
4 changed files with 828 additions and 543 deletions

View File

@ -124,10 +124,15 @@ public class VeSendMail {
//메일 내용
String Cn = vEEduAplctVO.getSndCn();
//메일 내용 textarea 작성 , 메일에 Enter 반영
if(!"".equals(Cn) && Cn != null) {
System.out.println("==============Cn================= \n"+Cn);
if(!"".equals(Cn)
&& Cn != null
&& !"SS".equals(sndFlag)
) {
Cn = Cn.replaceAll("\n", "<br/>");
}
System.out.println("==============Cn================= \n"+Cn);
//메일제목
message.setSubject("[한국저작권위원회] 찾아가는 교육서비스_알림");

View File

@ -20,9 +20,12 @@ public class VEEduAplctVO extends ComDefaultVO implements Serializable {
private String userId; //사용자아이디
private String userNm; //신청자
private String eduYear; //신청자
private String userIdNum; //강사 아이디 고유번호
private String prcsOrd; //과정순번
private String eduSlct; //교육선택코드
private String eduSlctCd; //교육선택코드
private String eduSlctAreaCd; //교육선택지역코드
private String scholInsttNm; //학교기관이름
@ -532,6 +535,12 @@ public class VEEduAplctVO extends ComDefaultVO implements Serializable {
public void setPrcsOrd(String prcsOrd) {
this.prcsOrd = prcsOrd;
}
public String getEduSlct() {
return eduSlct;
}
public void setEduSlct(String eduSlct) {
this.eduSlct = eduSlct;
}
public String getEduSlctCd() {
return eduSlctCd;
}
@ -1034,14 +1043,18 @@ public class VEEduAplctVO extends ComDefaultVO implements Serializable {
public void setChk(String chk) {
this.chk = chk;
}
public String getUserNm() {
return userNm;
}
public void setUserNm(String userNm) {
this.userNm = userNm;
}
public String getEduYear() {
return eduYear;
}
public void setEduYear(String eduYear) {
this.eduYear = eduYear;
}
public String getTxtMsgCn() {
return txtMsgCn;
}

View File

@ -412,6 +412,107 @@ public class SndMngController {
}
/**
* @methodName : emailSndAjax
* @author : 이호영
* @date : 2023.12.27
* @description : 확정 메일 템플릿이 달라져 새로 만듬
* @param vEEduAplctVO
* @param model
* @param request
* @return
* @throws Exception
*/
@RequestMapping(value="emailSndCfnAjax.do")
public ModelAndView emailSndCfnAjax(
VEEduAplctVO vEEduAplctVO
//, RedirectAttributes redirectAttributes
, ModelMap model
, HttpServletRequest request
) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
//권한에 따른 로그인 정보 가져오기
LoginVO loginVO = checkLoginUtil.getAuthLoginVO();
//메일 발송 시작
//================================================================
//메일 발송 VeSendMail 파라미터 정리
//1. sndFlag = 메뉴 구분
// CC -> 찾교청소년
// ZC -> 찾교청소년-교육확정알림(교육배치목록-확정된 강의 알림 버튼) : 청소년>교육확정 메일본문 수정 메뉴에서 관리
// SC -> 찾교성인
// GC -> 체험교실
// WC -> 교육콘텐츠
//2. sndTo = 수신자
//3. vEEduAplctVO = eduAplctOrd(pk)
// sndHstryOrd(pk)
// sndCd(10 - sms, 20 - email)
// sndId(발송자)
// sndCn(발송내용)
//================================================================
VeSendMail sendMail = new VeSendMail();
if("".equals(vEEduAplctVO.getSndFlag())) {
vEEduAplctVO.setSndFlag("test");
}
if("".equals(vEEduAplctVO.getEmail())) {
vEEduAplctVO.setEmail("tolag3@gmail.com");
}
String cn = "";
cn = this.getTemplate()
.replace("[[_InsttNm_]]", vEEduAplctVO.getInsttNm())
.replace("[[_Addr_]]", vEEduAplctVO.getAddr())
.replace("[[_HopeSbjct_]]", vEEduAplctVO.getHopeSbjct())
.replace("[[_EduTrgt_]]", vEEduAplctVO.getEduTrgt())
.replace("[[_EduPrsnl_]]", vEEduAplctVO.getEduPrsnl())
.replace("[[_EduHopeDt_]]", vEEduAplctVO.getEduHopeDt())
.replace("[[_EduYear_]]", vEEduAplctVO.getEduYear())
;
vEEduAplctVO.setSndCn(cn);
String message = "정상적으로 발송되었습니다.";
String result="";
try {
result = sendMail.VeSendMail(vEEduAplctVO.getSndFlag(), vEEduAplctVO.getEmail(), vEEduAplctVO);
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
}
if("success".equals(result)) {
//메일 발송 로그
String snd_ord = sndGnrService.getNextStringId();
vEEduAplctVO.setSndHstryOrd(snd_ord);
vEEduAplctVO.setSndId(loginVO.getUniqId());
vEEduAplctVO.setTrgt(vEEduAplctVO.getEmail());
vEEduAplctSndHstryService.insert(vEEduAplctVO);
}else {
message = "발송 실패하였습니다.";
}
//메일 발송
modelAndView.addObject("result", result);
modelAndView.addObject("message", message);
return modelAndView;
}
//================================================================
//찾교 관리자 SMS 발송 - 알리고 API
@ -529,4 +630,105 @@ public class SndMngController {
return p_paginationInfo;
}
private String getTemplate() {
return "<!DOCTYPE html>\n" +
"<html lang=\"ko\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" +
" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n" +
" <meta name=\"viewport\" content=\"\" />\n" +
" <meta name=\"Keywords\" content=\"\" />\n" +
" <meta name=\"Description\" content=\"\" />\n" +
"</head>\n" +
"<body>\n" +
" <table align=\"center\" width=\"800\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"border:5px solid rgb(241,89,34);\">\n" +
" <tbody>\n" +
" <tr>\n" +
" <td align=\"left\" bgcolor=\"#ffffff\" style=\"padding:25px 40px 0 40px;\">\n" +
" <a href=\"https://oneid.copyright.or.kr/\" rel=\"noreferrer noopener\" target=\"_blank\" data-saferedirecturl=\"https://www.google.com/url?q=https://oneid.copyright.or.kr/&amp;source=gmail&amp;ust=1647666525851000&amp;usg=AOvVaw0ZroUFKmk2_yTWKT0iYs_q\"><img alt=\"한국저작권위원회-통합회원 로고\" src=\"https://www.edu-copyright.or.kr/offedu/visitEdu/usr/publish/images/common/ci.png\" style=\"width:170px; border:0px currentColor;vertical-align:middle\"></a>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding:0 50px;\">\n" +
" <p style=\"text-align: center; font-size:27px; font-weight: bold; padding:25px 0 5px 0; letter-spacing: -1px; border-top:3px solid #f16c23; font-family: 'Noto Sans KR', sans-serif !important;\">찾아가는 저작권 교육 일정 안내<br><span style=\"color:#e95504; padding:0; text-align:center;font-family: 'Noto Sans KR', sans-serif !important; font-size:14px; font-weight: normal; letter-spacing: normal;\">(※ 개인정보가 기재된 자료이므로 이용 관리에 각별히 주의해 주시기 바랍니다)</span></p>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td align=\"center\" bgcolor=\"#ffffff\" style=\"padding:0;\">\n" +
" <table cellspacing=\"0\" cellpadding=\"0\" style=\"width:700px; border-top:2px solid #b1b1b1; border-bottom:1px solid #b1b1b1; font-size:15px; color:#333; margin:0 0 40px 0; padding:0; background:#e0e0e0; \">\n" +
" <colgroup>\n" +
" <col width=\"15%;\">\n" +
" <col width=\"35%;\">\n" +
" <col width=\"15%;\">\n" +
" <col width=\"35%;\">\n" +
" </colgroup>\n" +
" <tr style=\"border-bottom:1px solid #cecece;\">\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">교&nbsp;육&nbsp;명</th>\n" +
" <td colspan=\"3\" style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0;\">[[_EduYear_]]년 찾아가는 저작권 교육</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">의&nbsp;뢰&nbsp;처</th>\n" +
" <td colspan=\"3\" style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0;\">[[_InsttNm_]]</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">일&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시</th>\n" +
" <td colspan=\"3\" style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0;\">[[_EduHopeDt_]]</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">교육장소</th>\n" +
" <td colspan=\"3\" style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0;\">[[_Addr_]]</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">강의주제</th>\n" +
" <td colspan=\"3\" style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0; font-weight: bold;\">[[_HopeSbjct_]]</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">대&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;상</th>\n" +
" <td style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0;\">[[_EduTrgt_]]</td>\n" +
" <th style=\"line-height:20px; padding:10px 0; background:#f5f5f5; border-bottom:1px solid #e0e0e0;font-size:14px; color:#666;\">인&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;원</th>\n" +
" <td style=\"line-height:20px; padding:12px 0 10px 15px; background:#fff; border-bottom:1px solid #e0e0e0;\">[[_EduPrsnl_]]</td>\n" +
" </tr>\n" +
" </table>\n" +
" <p style=\"width:640px; font-size:14px; text-align:left; padding:20px 30px; color:#2f2f2f; border:3px solid #e0e0e0; line-height: 20px;\">\n" +
" 저작권 교육을 신청해 주셔서 대단히 감사드리며, 원활한 교육 진행과 사후관리를 위해 몇 가지 요청사항 전달드립니다.<br><br>\n" +
" <span style=\"color:#e95504;\">1. 결과보고서</span>: [1] 양식에 따라 작성(사진 첨부)<br>\n" +
" <span style=\"padding:0 0 0 8px; display: block;\">- 오프라인: 강사 전면 강의 모습, 전경 등 2매 이상 촬영<span style=\"color:#926b5d; padding:0 0 0 2px;\">(※ 수강생 식별되지 않도록 뒷모습 촬영 당부)</span></span>\n" +
" <span style=\"padding:0 0 0 8px; display: block;\">- 온라인: 참석자 및 강의 모습 화면 캡쳐 화면 등 2매 이상</span>\n" +
" <span style=\"color:#e95504;\">2. 만족도조사</span>: 설문지 양식을 출력 또는 네이버폼 등을 이용하여 조사, 수집 후 <span style=\"font-weight: bold;\">[2] 집계표에 값 입력하여 회신</span><br>\n" +
" <span style=\"color:#e95504;\">3. 강사참석확인서</span>: [3] 양식에 강사 날인(온라인의 경우, 강사에게 양식 전달 후, 스캔본 회신)<br><br>\n" +
" <span style=\"color:#926b5d; font-weight: bold;\">※ 온라인 교육 시 강의 녹화, 재사용, 배포 등은 저작권법 위반이므로 사전에 강사와 협의가 필요합니다.</span><br><br>\n" +
" 1~3 의 요청사항은 교육 후 메일을 통해 회신 부탁 드립니다.(교육 마감 후 일주일 이내)<br>\n" +
" 기타 문의사항은 한국저작권위원회 교육운영팀 <a href=\"02-2669-0083\" style=\"color:#2f2f2f;\">02-2669-0083</a> 으로 연락하여 주시기 바랍니다.<br><br>\n" +
" 감사합니다 ^^ \n" +
" </p>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding:60px 0 0;\">\n" +
" <table width=\"800\" bgcolor=\"#f8f8f8\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"padding:22px 0;border-top:1px solid #cecece; color:#666;\">\n" +
" <tbody>\n" +
" <tr>\n" +
" <td align=\"left\" style=\"padding:0 28px;\">\n" +
" <a href=\"https://oneid.copyright.or.kr/\" rel=\"noreferrer noopener\" style=\"vertical-align:middle;display:table-cell\" target=\"_blank\" data-saferedirecturl=\"https://www.google.com/url?q=https://oneid.copyright.or.kr/&amp;source=gmail&amp;ust=1647666525852000&amp;usg=AOvVaw3aJ4SNBKmUaX89PBd69nPC\"><img alt=\"한국저작권위원회-통합회원 로고\" src=\"https://ci5.googleusercontent.com/proxy/0JqqeL8s5aHiWESa7Hkqq7DoxHF0qGfEGwL3ZsfXSpyh-P9mJolNp4QpMbgMj_A7cR44XGl1C3MdSjQ50oR_vqWDIv87H1E=s0-d-e1-ft#https://oneid.copyright.or.kr/images/mail/f_logo.gif\" style=\"border:0px currentColor;vertical-align:middle; width:150px;\" class=\"CToWUd\"></a>\n" +
" </td>\n" +
" <td align=\"left\" style=\"font-family:'Noto Sans KR';font-size:15px;letter-spacing:-0.2px;\">\n" +
" <p style=\"margin:0px 0px 11px;padding:0px\">본 메일은 발신전용으로 회신하지 않습니다.</p>\n" +
" <p style=\"margin:0px;padding:0px\"><span style=\"font-weight:bold\">진주</span> [우 52852] 경상남도 진주시 충의로 19, 1/2/5층. <span>&nbsp;대표번호 : 055.792.0000</span><br> <span style=\"font-weight:bold\">서울</span> [우 04323] 서울특별시 용산구 후암로 107, 5/16층. <span>&nbsp;대표번호 : 02.2669.0010</span></p>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
"</body>\n" +
"</html>";
}
}

View File

@ -10,6 +10,7 @@
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<%@ taglib prefix="ve" uri="/WEB-INF/tlds/kcc_tld.tld"%>
<%@ taglib prefix="un" uri="http://jakarta.apache.org/taglibs/unstandard-1.0" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<un:useConstants var="VeConstants" className="kcc.ve.cmm.VeConstants" />
<%
/**
@ -127,6 +128,7 @@
return false;
}
console.log(statusVal);
if(confirm("상태를 변경 하시겠습니까?")){
$.ajax({
type:"POST",
@ -140,9 +142,22 @@
success:function(returnData){
if(returnData.rsCnt > 0){
alert("상태가 변경 되었습니다.");
if(statusVal == VeConstants.APRVL_CD_20 ){
if(statusVal == VeConstants.APRVL_CD_60 ){
//교육확정 시 SMS, 메일 안내
try{
fncCfnContent(
"${pageContext.request.contextPath}/kccadr/oprtn/pblc/emailSndCfnAjax.do",
"20",
"SS"
);
}catch (e) {
}
// 확정일경우에 확정 목록으로 가도록 설정
fncGoCnfrmList();
// fncGoCnfrmList();
}else{
fncGoDetail();
}
@ -209,7 +224,7 @@
);
}
//발송
//기본 발송
function fncContent(p_url, p_cd, p_cn, p_flag){
$.ajax({
@ -249,6 +264,56 @@
}
//성공 발송
function fncCfnContent(p_url, p_sndCd, p_sndFlag){
var eduSlctCd = '<c:out value="${info.eduSlctCd}" />';
var eduSlct = '';
if(eduSlctCd == '10'){ //온라인
eduSlct = '온라인'
}else{
eduSlct = '오프라인'
} // 20 // 오프라인
// 교육 일시
var eduHopeDt = $('#eduChasiInfo td').eq(0).text().trim().replace(/\s+/g, ' ')+' '+$('#eduChasiInfo td').eq(1).text().trim().replace(/\s+/g, ' ') // 교육 일시
var eduYear = $('#eduChasiInfo td').eq(0).text().trim().replace(/\s+/g, ' ').split('.')[0];
$.ajax({
type: "POST",
// enctype: 'multipart/form-data',
url:p_url,
//data: data,
data:{
"sndCd": p_sndCd
, "sndFlag": p_sndFlag
// , "eduAplctOrd": $("#eduAplctOrd").val()
, "email": '<c:out value="${info.email}" />'
, "hopeSbjct": '<c:out value="${info.hopeSbjct}" />' // 희망주제
, "insttNm": '<c:out value="${info.insttNm}" />' // 기관(단체)명 - 의뢰처
, "addr": '('+'<c:out value="${info.post}" />'+')'+ '<c:out value="${info.addr}" />'+ '<c:out value="${info.addrDetail}" />' // 주소
, "eduSlct": eduSlct // 온라인 / 오프라인
, "eduTrgt": '<c:out value="${info.eduTrgt}" />' // 교육대상
, "eduPrsnl": '<c:out value="${info.eduPrsnl}" />' // 교육인원
, "eduHopeDt": eduHopeDt // 교육 일시
, "eduYear": eduYear // 교육명에 들어갈 교육명 년도
},
dataType:'json',
success:function(returnData){
if(returnData.result == "success"){
alert(returnData.message);
}else{
alert(returnData.message);
}
},
error:function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
function updateHiddenMemo(){
$("#prvtMemoCn").val($("#hiddenMemo").val());
@ -578,8 +643,8 @@
</thead>
<tbody>
<c:forEach var="list" items="${chasiList}" varStatus="status">
<tr>
<th>
<tr id="eduChasiInfo">
<td>
<c:choose>
<c:when test="${not empty list.eduHopeDt}">
<%-- <fmt:parseDate value="${list.eduHopeDt}" var="eduHopeDt" pattern="yyyyMMdd"/>
@ -590,7 +655,7 @@
-
</c:otherwise>
</c:choose>
</th>
</td>
<td>
<fmt:parseDate value="${list.strtTm}" var="strtTm" pattern="kkmm"/>
<fmt:formatDate value="${strtTm}" pattern="kk:mm"/>