diff --git a/src/main/java/kcc/ve/cmm/VeSendMail.java b/src/main/java/kcc/ve/cmm/VeSendMail.java index 89f6e3b4..06bda137 100644 --- a/src/main/java/kcc/ve/cmm/VeSendMail.java +++ b/src/main/java/kcc/ve/cmm/VeSendMail.java @@ -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", "
"); } - + + System.out.println("==============Cn================= \n"+Cn); //메일제목 message.setSubject("[한국저작권위원회] 찾아가는 교육서비스_알림"); @@ -286,7 +291,7 @@ public class VeSendMail { System.out.println(Cn); message.setFrom(fromAddress); message.addRecipient(Message.RecipientType.TO, toAddress ); - + message.setContent(Cn," text/html; charset=KSC5601"); System.out.println("------------------ 메일발송 시작 ----------------"); Transport.send(message); diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduAplctVO.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduAplctVO.java index 7df39e3c..0a543b26 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduAplctVO.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduAplctVO.java @@ -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; } diff --git a/src/main/java/kcc/ve/oprtn/pblc/sndMng/web/SndMngController.java b/src/main/java/kcc/ve/oprtn/pblc/sndMng/web/SndMngController.java index fa17481a..03c868e6 100644 --- a/src/main/java/kcc/ve/oprtn/pblc/sndMng/web/SndMngController.java +++ b/src/main/java/kcc/ve/oprtn/pblc/sndMng/web/SndMngController.java @@ -1,532 +1,734 @@ -package kcc.ve.oprtn.pblc.sndMng.web; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import egovframework.rte.fdl.idgnr.EgovIdGnrService; -import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import kcc.com.cmm.LoginVO; -import kcc.com.cmm.service.EgovCmmUseService; -import kcc.com.cmm.service.EgovFileMngService; -import kcc.com.cmm.service.EgovFileMngUtil; -import kcc.com.utl.user.service.CheckAdrProcessUtil; -import kcc.com.utl.user.service.CheckFileUtil; -import kcc.com.utl.user.service.CheckLoginUtil; -import kcc.kccadr.adjreqmgr.service.AdjReqMgrService; -import kcc.kccadr.cmm.service.SMSOracleService; -import kcc.kccadr.kccadrCom.service.KccadrMgrUdtService; -import kcc.let.sym.ccm.cde.service.EgovCcmCmmnDetailCodeManageService; -import kcc.let.uss.ion.cnt.service.CntManageVO; -import kcc.let.uss.ion.cnt.service.EgovCntManageService; -import kcc.let.utl.fcc.service.EgovCryptoUtil; -import kcc.ve.cmm.VeSendMail; -import kcc.ve.cmm.VeSendSMS; -import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEAsgnmMIXService; -import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEEduPnltyService; -import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEInstrFeeService; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctService; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctSndHstryService; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctUnqIsuesService; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctVO; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduChasiService; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduCnfrmDsgnService; -import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduMIXService; -import kcc.ve.instr.tngrVisitEdu.instrInfo.service.VEInstrMixService; -import kcc.ve.instr.tngrVisitEdu.lctrInfo.service.VELctrAreaMngService; -import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsMIXService; -import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsService; - -/** - * 발송관리 - * 발송관리에 관한 controller 클래스를 정의한다. - * @author 조용준 - * @since 2021.12.16 - * @version 1.0 - * @see - * - *
- * << 개정이력(Modification Information) >>
- *
- *   수정일      수정자           수정내용
- *  -------    --------    ---------------------------
- *   2021.12.16  조용준          최초 생성
- *
- * 
- */ - -@Controller -@RequestMapping("/kccadr/oprtn/pblc") -public class SndMngController { - - private static final Logger LOGGER = LoggerFactory.getLogger(SndMngController.class); - - //로그인 체크 util - @Resource(name = "checkLoginUtil") - private CheckLoginUtil checkLoginUtil; - - //과정 관리 - @Resource(name = "vEPrcsService") - private VEPrcsService vEPrcsService; - - //신청과정 관리 - @Resource(name = "vEEduMIXService") - private VEEduMIXService vEEduMIXService; - - //강의지역 관리 - @Resource(name = "vELctrAreaMngService") - private VELctrAreaMngService vELctrAreaMngService; - - - - //교육신청 - @Resource(name = "vEEduAplctService") - private VEEduAplctService vEEduAplctService; - - //교육과정신청 - @Resource(name = "vEPrcsMIXService") - private VEPrcsMIXService vEPrcsMIXService; - - //차시 - @Resource(name = "vEEduChasiService") - private VEEduChasiService vVEEduChasiService; - - - // 교육신청 서비스단 - @Resource(name = "AdjReqMgrService") - private AdjReqMgrService adjReqMgrService; - - // eGov 공통코드 - @Resource(name = "EgovCmmUseService") - private EgovCmmUseService cmmUseService; - - @Resource(name = "EgovFileMngService") - private EgovFileMngService fileService; - - // global 프로퍼티 - @Resource(name="globalSettings") - protected Properties propertiesService; - - //첨부파일 경로, realPath 설정 - @Resource(name="EgovFileMngUtil") - private EgovFileMngUtil fileUtil; - - // 첨부파일 정보 - @Resource(name="EgovFileMngService") - private EgovFileMngService fileMngService; - - //암복호화 유틸 - @Resource(name = "egovCryptoUtil") - EgovCryptoUtil egovCryptoUtil; - - - @Resource(name="KccadrMgrUdtService") - private KccadrMgrUdtService kccadrMgrUdtService; - - // 교육신청 서비스단 - @Resource(name = "checkAdrProcessUtil") - private CheckAdrProcessUtil checkAdrProcessUtil; - - // 강의배정정보 - @Resource(name = "vEAsgnmMIXService") - private VEAsgnmMIXService vEAsgnmMIXService; - - //파일 체크 util - @Resource(name = "checkFileUtil") - private CheckFileUtil checkFileUtil; - - //교육확정안 - @Resource(name = "vEEduCnfrmDsgnService") - private VEEduCnfrmDsgnService vEEduCnfrmDsgnService; - - // 교육패널티 - @Resource(name = "vEEduPnltyService") - private VEEduPnltyService vEEduPnltyService; - - // 특이사항 - @Resource(name = "vEEduAplctUnqIsuesService") - private VEEduAplctUnqIsuesService vEEduAplctUnqIsuesService; - - // 강사료 - @Resource(name = "vEInstrFeeService") - private VEInstrFeeService vEInstrFeeService; - - // 강사목록 - @Resource(name = "vEInstrMixService") - private VEInstrMixService vEInstrMixService; - - @Resource(name = "CmmnDetailCodeManageService") - private EgovCcmCmmnDetailCodeManageService cmmnDetailCodeManageService; - - // 교육신청발송이력 - @Resource(name = "vEEduAplctSndHstryService") - private VEEduAplctSndHstryService vEEduAplctSndHstryService; - - //snd_hstry id gen - @Resource(name = "sndGnrService") - private EgovIdGnrService sndGnrService; - - //snd_hstry id gen - @Resource(name = "SMSOracleService") - private SMSOracleService smsOracleService; - - @Resource(name = "egovCntManageService") - private EgovCntManageService egovCntManageService; - - /** - * 오라클 연동 테스트 - */ - - @RequestMapping(value="oracleTest.do") - public void oracleTest() { - - } - - /** - * sms 발송 - */ - - @RequestMapping(value="smsSndAjax.do") - public ModelAndView smsSndAjax( - VEEduAplctVO vEEduAplctVO - //, RedirectAttributes redirectAttributes - , ModelMap model - , HttpServletRequest request - ) throws Exception { - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - //System.out.println("@@@@@@@ 문자전송 시작 ----------------------------------"); - - //로그인 처리==================================== - //로그인 정보 가져오기 - /* - String s_oprtnLoginCheckNInfo = checkLoginUtil.oprtnCheckNInfo(model); - if (!"".equals(s_oprtnLoginCheckNInfo)) { - modelAndView.addObject("result", "loginFail"); - return modelAndView; - } - */ - - LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); //권한에 따른 로그인 정보 가져오기 - //SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기 - - //로그인 처리==================================== - - - try { - String returnMsg = ""; - if(!"".equals(vEEduAplctVO.getChk()) && vEEduAplctVO.getChk() != null) { - //MAIL - String[] splitChk = vEEduAplctVO.getChk().split(","); - String[] phones = vEEduAplctVO.getClphone().split(","); - String[] emails = {}; - - //String[] sendChk = {}; //발송정보체크용 - List sendChk = new ArrayList<>(); - - VeSendMail sendMail = new VeSendMail(); - if("Z".equals(vEEduAplctVO.getSndFlag())) { - emails = vEEduAplctVO.getEmail().split(","); - } - - for(int i=0; i 청소년>교육확정 메일본문 수정 메뉴에서 관리 - if("Z".equals(vEEduAplctVO.getSndFlag())) { - vEEduAplctVO.setEmail(emails[i]); - CntManageVO cntManageVO = new CntManageVO(); - //본문적용소스 - cntManageVO.setCntId("CNT_000000000001"); - cntManageVO.setCntDtId("CNTDT_0000000001"); - - cntManageVO = egovCntManageService.selectCntDtDetail(cntManageVO); - vEEduAplctVO.setSndCn(cntManageVO.getCntCn()); - - String result = sendMail.VeSendMail(vEEduAplctVO.getSndFlag(), vEEduAplctVO.getEmail(), vEEduAplctVO); - if("success".equals(result)) { - //메일 발송 로그 - String snd_mail_ord = sndGnrService.getNextStringId(); - vEEduAplctVO.setSndHstryOrd(snd_mail_ord); - vEEduAplctVO.setSndCd("20"); //문자:10, 메일:20 - vEEduAplctSndHstryService.insert(vEEduAplctVO); - returnMsg = "succ"; - } - } - } - } - } - if(returnMsg == "fail") { - modelAndView.addObject("result", "fail"); - } else if(returnMsg == "succ") { - modelAndView.addObject("result", "success"); - } - - - } else { - //SMS - String snd_ord = sndGnrService.getNextStringId(); - vEEduAplctVO.setSndHstryOrd(snd_ord); - - vEEduAplctVO.setSndId(loginVO.getUniqId()); - //System.out.println("@@@@@@@ 오라클 시작 ----------------------------------"); - returnMsg = smsOracleService.insertSmsSend(vEEduAplctVO); - //System.out.println("@@@@@@@ 오라클 끝 ----------------------------------"); - - //System.out.println("@@@@@@@ 히스토리 시작 ----------------------------------"); - vEEduAplctSndHstryService.insert(vEEduAplctVO); - //System.out.println("@@@@@@@ 히스토리 끝 ----------------------------------"); - - if(returnMsg == "fail") { - //System.out.println("@@@@@@@ fail ----------------------------------"); - modelAndView.addObject("result", "fail"); - } else if(returnMsg == "succ") { - //System.out.println("@@@@@@@ success ----------------------------------"); - modelAndView.addObject("result", "success"); - } - } - }catch(Exception ex) { - //System.out.println("@@@@@@@ ex ----------------------------------"); - ex.printStackTrace(); - } - return modelAndView; - } - - /** - * 메일 발송 - */ - - /** - * @param vEEduAplctVO - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value="emailSndAjax.do") - public ModelAndView emailSndAjax( - VEEduAplctVO vEEduAplctVO - //, RedirectAttributes redirectAttributes - , ModelMap model - , HttpServletRequest request - ) throws Exception { - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - //권한에 따른 로그인 정보 가져오기 - LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); - - //메일 발송 부 시작 - //================================================================ - //메일 발송 VeSendMail 파라미터 정리 - //1. sndFlag = 메뉴 구분 - // C -> 찾교청소년 - // Z -> 찾교청소년-교육확정알림(교육배치목록-확정된 강의 알림 버튼) : 청소년>교육확정 메일본문 수정 메뉴에서 관리 - // S -> 찾교성인 - // G -> 체험교실 - // W -> 교육콘텐츠 - //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 message = "정상적으로 발송되었습니다."; - String result = sendMail.VeSendMail(vEEduAplctVO.getSndFlag(), vEEduAplctVO.getEmail(), vEEduAplctVO); - - 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 - //사용자 ID : Identifier - //발급 키 : ny3v5te9d8131byxllc8c0v7cmx7jqo1 - - //*Request - // POST /send/ HTTP/1.1 - // Host: apis.aligo.in - // Service Port: 443 - - //key |인증용 API Key |필수 |String - //user_id |사용자id |필수 |String - //sender |발신자 전화번호 (최대 16bytes) |필수 |String - //receiver |수신자 전화번호 - 컴마(,)분기 입력 |필수 |String - //msg |메시지 내용 |필수 |String (1~2,000Byte) - //msg_type |SMS(단문) , LMS(장문), MMS(그림문자) 구분 |X |String - //title |문자제목(LMS,MMS만 허용) |X |String (1~44Byte) - //destination |%고객명% 치환용 입력 |X |String - //rdate |예약일 (현재일이상) |X |YYYYMMDD - //rtime |예약시간 - 현재시간기준 10분이후 |X |HHII - //image1 |첨부이미지 (image 또는 image1) |X |JPEG,PNG,GIF - //image2 |첨부이미지 |X |JPEG,PNG,GIF - //image3 |첨부이미지 |X |JPEG,PNG,GIF - //testmode_yn |연동테스트시 Y 적용 |X |String - - //*Response - //result_code |결과코드(API 수신유무) |Integer - //message |결과 메시지( result_code 가 0 보다 작은경우 실패사유 표기) |String - //msg_id |메시지 고유 ID |Integer - //success_cnt |요청성공 건수 |Integer - //error_cnt |요청실패 건수 |Integer - //msg_type |메시지 타입 (1. SMS, 2.LMS, 3. MMS) |String - //================================================================ - @RequestMapping(value="offeduSMSSndAjax.do") - public ModelAndView offeduSMSSndAjax(VEEduAplctVO vEEduAplctVO) throws Exception { - - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - String result = "success"; - String message = "정상적으로 발송되었습니다."; - - VeSendSMS sendSMS = new VeSendSMS(); - Map resultMap = sendSMS.VeSendSMS(vEEduAplctVO.getClphone(), vEEduAplctVO.getSndCn()); - - LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); - - //문자 발송 성공 시 로그 - if("1".equals(resultMap.get("result_code"))){ - String snd_ord = sndGnrService.getNextStringId(); - vEEduAplctVO.setSndHstryOrd(snd_ord); - vEEduAplctVO.setSndId(loginVO.getUniqId()); - vEEduAplctVO.setTrgt(vEEduAplctVO.getClphone()); - vEEduAplctSndHstryService.insert(vEEduAplctVO); - }else { - result = "fail"; - message = resultMap.get("message").toString(); - } - modelAndView.addObject("result", result); - modelAndView.addObject("message", message); - return modelAndView; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // - // private function - // - // - - //페이징을 위한 처리 step1 - 페이징 기본 정보 설정 - private PaginationInfo setPagingStep1( - VEEduAplctVO p_vEEduAplctVO - )throws Exception{ - // pageing step1 - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(p_vEEduAplctVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(p_vEEduAplctVO.getPageUnit()); - paginationInfo.setPageSize(p_vEEduAplctVO.getPageSize()); - - return paginationInfo; - } - - - //페이징을 위한 처리 step2 - 게시물 리스트 수량 설정 및 검색 조건 초기화 - private VEEduAplctVO setPagingStep2( - VEEduAplctVO p_vEEduAplctVO - , PaginationInfo p_paginationInfo - )throws Exception{ - // pageing step2 - p_vEEduAplctVO.setFirstIndex(p_paginationInfo.getFirstRecordIndex()); - p_vEEduAplctVO.setLastIndex(p_paginationInfo.getLastRecordIndex()); - p_vEEduAplctVO.setRecordCountPerPage(p_paginationInfo.getRecordCountPerPage()); - - if("".equals(p_vEEduAplctVO.getSearchSortCnd())){ //최초조회시 최신것 조회List - p_vEEduAplctVO.setSearchSortCnd("prcs_ord"); - p_vEEduAplctVO.setSearchSortOrd("desc"); - } - - return p_vEEduAplctVO; - } - - - //페이징을 위한 처리 step3 - 전체 게시물 수량 설정하기 - private PaginationInfo setPagingStep3( - List p_vEEduAplctVOList - - , PaginationInfo p_paginationInfo - )throws Exception{ - // pageing step3 - int totCnt = 0; - if(p_vEEduAplctVOList.size() > 0) totCnt = p_vEEduAplctVOList.get(0).getTotCnt(); - p_paginationInfo.setTotalRecordCount(totCnt); - - return p_paginationInfo; - } -} +package kcc.ve.oprtn.pblc.sndMng.web; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.annotation.Resource; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +import egovframework.rte.fdl.idgnr.EgovIdGnrService; +import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; +import kcc.com.cmm.LoginVO; +import kcc.com.cmm.service.EgovCmmUseService; +import kcc.com.cmm.service.EgovFileMngService; +import kcc.com.cmm.service.EgovFileMngUtil; +import kcc.com.utl.user.service.CheckAdrProcessUtil; +import kcc.com.utl.user.service.CheckFileUtil; +import kcc.com.utl.user.service.CheckLoginUtil; +import kcc.kccadr.adjreqmgr.service.AdjReqMgrService; +import kcc.kccadr.cmm.service.SMSOracleService; +import kcc.kccadr.kccadrCom.service.KccadrMgrUdtService; +import kcc.let.sym.ccm.cde.service.EgovCcmCmmnDetailCodeManageService; +import kcc.let.uss.ion.cnt.service.CntManageVO; +import kcc.let.uss.ion.cnt.service.EgovCntManageService; +import kcc.let.utl.fcc.service.EgovCryptoUtil; +import kcc.ve.cmm.VeSendMail; +import kcc.ve.cmm.VeSendSMS; +import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEAsgnmMIXService; +import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEEduPnltyService; +import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEInstrFeeService; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctService; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctSndHstryService; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctUnqIsuesService; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctVO; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduChasiService; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduCnfrmDsgnService; +import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduMIXService; +import kcc.ve.instr.tngrVisitEdu.instrInfo.service.VEInstrMixService; +import kcc.ve.instr.tngrVisitEdu.lctrInfo.service.VELctrAreaMngService; +import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsMIXService; +import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsService; + +/** + * 발송관리 + * 발송관리에 관한 controller 클래스를 정의한다. + * @author 조용준 + * @since 2021.12.16 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일      수정자           수정내용
+ *  -------    --------    ---------------------------
+ *   2021.12.16  조용준          최초 생성
+ *
+ * 
+ */ + +@Controller +@RequestMapping("/kccadr/oprtn/pblc") +public class SndMngController { + + private static final Logger LOGGER = LoggerFactory.getLogger(SndMngController.class); + + //로그인 체크 util + @Resource(name = "checkLoginUtil") + private CheckLoginUtil checkLoginUtil; + + //과정 관리 + @Resource(name = "vEPrcsService") + private VEPrcsService vEPrcsService; + + //신청과정 관리 + @Resource(name = "vEEduMIXService") + private VEEduMIXService vEEduMIXService; + + //강의지역 관리 + @Resource(name = "vELctrAreaMngService") + private VELctrAreaMngService vELctrAreaMngService; + + + + //교육신청 + @Resource(name = "vEEduAplctService") + private VEEduAplctService vEEduAplctService; + + //교육과정신청 + @Resource(name = "vEPrcsMIXService") + private VEPrcsMIXService vEPrcsMIXService; + + //차시 + @Resource(name = "vEEduChasiService") + private VEEduChasiService vVEEduChasiService; + + + // 교육신청 서비스단 + @Resource(name = "AdjReqMgrService") + private AdjReqMgrService adjReqMgrService; + + // eGov 공통코드 + @Resource(name = "EgovCmmUseService") + private EgovCmmUseService cmmUseService; + + @Resource(name = "EgovFileMngService") + private EgovFileMngService fileService; + + // global 프로퍼티 + @Resource(name="globalSettings") + protected Properties propertiesService; + + //첨부파일 경로, realPath 설정 + @Resource(name="EgovFileMngUtil") + private EgovFileMngUtil fileUtil; + + // 첨부파일 정보 + @Resource(name="EgovFileMngService") + private EgovFileMngService fileMngService; + + //암복호화 유틸 + @Resource(name = "egovCryptoUtil") + EgovCryptoUtil egovCryptoUtil; + + + @Resource(name="KccadrMgrUdtService") + private KccadrMgrUdtService kccadrMgrUdtService; + + // 교육신청 서비스단 + @Resource(name = "checkAdrProcessUtil") + private CheckAdrProcessUtil checkAdrProcessUtil; + + // 강의배정정보 + @Resource(name = "vEAsgnmMIXService") + private VEAsgnmMIXService vEAsgnmMIXService; + + //파일 체크 util + @Resource(name = "checkFileUtil") + private CheckFileUtil checkFileUtil; + + //교육확정안 + @Resource(name = "vEEduCnfrmDsgnService") + private VEEduCnfrmDsgnService vEEduCnfrmDsgnService; + + // 교육패널티 + @Resource(name = "vEEduPnltyService") + private VEEduPnltyService vEEduPnltyService; + + // 특이사항 + @Resource(name = "vEEduAplctUnqIsuesService") + private VEEduAplctUnqIsuesService vEEduAplctUnqIsuesService; + + // 강사료 + @Resource(name = "vEInstrFeeService") + private VEInstrFeeService vEInstrFeeService; + + // 강사목록 + @Resource(name = "vEInstrMixService") + private VEInstrMixService vEInstrMixService; + + @Resource(name = "CmmnDetailCodeManageService") + private EgovCcmCmmnDetailCodeManageService cmmnDetailCodeManageService; + + // 교육신청발송이력 + @Resource(name = "vEEduAplctSndHstryService") + private VEEduAplctSndHstryService vEEduAplctSndHstryService; + + //snd_hstry id gen + @Resource(name = "sndGnrService") + private EgovIdGnrService sndGnrService; + + //snd_hstry id gen + @Resource(name = "SMSOracleService") + private SMSOracleService smsOracleService; + + @Resource(name = "egovCntManageService") + private EgovCntManageService egovCntManageService; + + /** + * 오라클 연동 테스트 + */ + + @RequestMapping(value="oracleTest.do") + public void oracleTest() { + + } + + /** + * sms 발송 + */ + + @RequestMapping(value="smsSndAjax.do") + public ModelAndView smsSndAjax( + VEEduAplctVO vEEduAplctVO + //, RedirectAttributes redirectAttributes + , ModelMap model + , HttpServletRequest request + ) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + + //System.out.println("@@@@@@@ 문자전송 시작 ----------------------------------"); + + //로그인 처리==================================== + //로그인 정보 가져오기 + /* + String s_oprtnLoginCheckNInfo = checkLoginUtil.oprtnCheckNInfo(model); + if (!"".equals(s_oprtnLoginCheckNInfo)) { + modelAndView.addObject("result", "loginFail"); + return modelAndView; + } + */ + + LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); //권한에 따른 로그인 정보 가져오기 + //SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기 + + //로그인 처리==================================== + + + try { + String returnMsg = ""; + if(!"".equals(vEEduAplctVO.getChk()) && vEEduAplctVO.getChk() != null) { + //MAIL + String[] splitChk = vEEduAplctVO.getChk().split(","); + String[] phones = vEEduAplctVO.getClphone().split(","); + String[] emails = {}; + + //String[] sendChk = {}; //발송정보체크용 + List sendChk = new ArrayList<>(); + + VeSendMail sendMail = new VeSendMail(); + if("Z".equals(vEEduAplctVO.getSndFlag())) { + emails = vEEduAplctVO.getEmail().split(","); + } + + for(int i=0; i 청소년>교육확정 메일본문 수정 메뉴에서 관리 + if("Z".equals(vEEduAplctVO.getSndFlag())) { + vEEduAplctVO.setEmail(emails[i]); + CntManageVO cntManageVO = new CntManageVO(); + //본문적용소스 + cntManageVO.setCntId("CNT_000000000001"); + cntManageVO.setCntDtId("CNTDT_0000000001"); + + cntManageVO = egovCntManageService.selectCntDtDetail(cntManageVO); + vEEduAplctVO.setSndCn(cntManageVO.getCntCn()); + + String result = sendMail.VeSendMail(vEEduAplctVO.getSndFlag(), vEEduAplctVO.getEmail(), vEEduAplctVO); + if("success".equals(result)) { + //메일 발송 로그 + String snd_mail_ord = sndGnrService.getNextStringId(); + vEEduAplctVO.setSndHstryOrd(snd_mail_ord); + vEEduAplctVO.setSndCd("20"); //문자:10, 메일:20 + vEEduAplctSndHstryService.insert(vEEduAplctVO); + returnMsg = "succ"; + } + } + } + } + } + if(returnMsg == "fail") { + modelAndView.addObject("result", "fail"); + } else if(returnMsg == "succ") { + modelAndView.addObject("result", "success"); + } + + + } else { + //SMS + String snd_ord = sndGnrService.getNextStringId(); + vEEduAplctVO.setSndHstryOrd(snd_ord); + + vEEduAplctVO.setSndId(loginVO.getUniqId()); + //System.out.println("@@@@@@@ 오라클 시작 ----------------------------------"); + returnMsg = smsOracleService.insertSmsSend(vEEduAplctVO); + //System.out.println("@@@@@@@ 오라클 끝 ----------------------------------"); + + //System.out.println("@@@@@@@ 히스토리 시작 ----------------------------------"); + vEEduAplctSndHstryService.insert(vEEduAplctVO); + //System.out.println("@@@@@@@ 히스토리 끝 ----------------------------------"); + + if(returnMsg == "fail") { + //System.out.println("@@@@@@@ fail ----------------------------------"); + modelAndView.addObject("result", "fail"); + } else if(returnMsg == "succ") { + //System.out.println("@@@@@@@ success ----------------------------------"); + modelAndView.addObject("result", "success"); + } + } + }catch(Exception ex) { + //System.out.println("@@@@@@@ ex ----------------------------------"); + ex.printStackTrace(); + } + return modelAndView; + } + + /** + * 메일 발송 + */ + + /** + * @param vEEduAplctVO + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value="emailSndAjax.do") + public ModelAndView emailSndAjax( + VEEduAplctVO vEEduAplctVO + //, RedirectAttributes redirectAttributes + , ModelMap model + , HttpServletRequest request + ) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + + //권한에 따른 로그인 정보 가져오기 + LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); + + //메일 발송 부 시작 + //================================================================ + //메일 발송 VeSendMail 파라미터 정리 + //1. sndFlag = 메뉴 구분 + // C -> 찾교청소년 + // Z -> 찾교청소년-교육확정알림(교육배치목록-확정된 강의 알림 버튼) : 청소년>교육확정 메일본문 수정 메뉴에서 관리 + // S -> 찾교성인 + // G -> 체험교실 + // W -> 교육콘텐츠 + //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 message = "정상적으로 발송되었습니다."; + String result = sendMail.VeSendMail(vEEduAplctVO.getSndFlag(), vEEduAplctVO.getEmail(), vEEduAplctVO); + + 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; + + } + + /** + * @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 + //사용자 ID : Identifier + //발급 키 : ny3v5te9d8131byxllc8c0v7cmx7jqo1 + + //*Request + // POST /send/ HTTP/1.1 + // Host: apis.aligo.in + // Service Port: 443 + + //key |인증용 API Key |필수 |String + //user_id |사용자id |필수 |String + //sender |발신자 전화번호 (최대 16bytes) |필수 |String + //receiver |수신자 전화번호 - 컴마(,)분기 입력 |필수 |String + //msg |메시지 내용 |필수 |String (1~2,000Byte) + //msg_type |SMS(단문) , LMS(장문), MMS(그림문자) 구분 |X |String + //title |문자제목(LMS,MMS만 허용) |X |String (1~44Byte) + //destination |%고객명% 치환용 입력 |X |String + //rdate |예약일 (현재일이상) |X |YYYYMMDD + //rtime |예약시간 - 현재시간기준 10분이후 |X |HHII + //image1 |첨부이미지 (image 또는 image1) |X |JPEG,PNG,GIF + //image2 |첨부이미지 |X |JPEG,PNG,GIF + //image3 |첨부이미지 |X |JPEG,PNG,GIF + //testmode_yn |연동테스트시 Y 적용 |X |String + + //*Response + //result_code |결과코드(API 수신유무) |Integer + //message |결과 메시지( result_code 가 0 보다 작은경우 실패사유 표기) |String + //msg_id |메시지 고유 ID |Integer + //success_cnt |요청성공 건수 |Integer + //error_cnt |요청실패 건수 |Integer + //msg_type |메시지 타입 (1. SMS, 2.LMS, 3. MMS) |String + //================================================================ + @RequestMapping(value="offeduSMSSndAjax.do") + public ModelAndView offeduSMSSndAjax(VEEduAplctVO vEEduAplctVO) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + + String result = "success"; + String message = "정상적으로 발송되었습니다."; + + VeSendSMS sendSMS = new VeSendSMS(); + Map resultMap = sendSMS.VeSendSMS(vEEduAplctVO.getClphone(), vEEduAplctVO.getSndCn()); + + LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); + + //문자 발송 성공 시 로그 + if("1".equals(resultMap.get("result_code"))){ + String snd_ord = sndGnrService.getNextStringId(); + vEEduAplctVO.setSndHstryOrd(snd_ord); + vEEduAplctVO.setSndId(loginVO.getUniqId()); + vEEduAplctVO.setTrgt(vEEduAplctVO.getClphone()); + vEEduAplctSndHstryService.insert(vEEduAplctVO); + }else { + result = "fail"; + message = resultMap.get("message").toString(); + } + modelAndView.addObject("result", result); + modelAndView.addObject("message", message); + return modelAndView; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // + // private function + // + // + + //페이징을 위한 처리 step1 - 페이징 기본 정보 설정 + private PaginationInfo setPagingStep1( + VEEduAplctVO p_vEEduAplctVO + )throws Exception{ + // pageing step1 + PaginationInfo paginationInfo = new PaginationInfo(); + paginationInfo.setCurrentPageNo(p_vEEduAplctVO.getPageIndex()); + paginationInfo.setRecordCountPerPage(p_vEEduAplctVO.getPageUnit()); + paginationInfo.setPageSize(p_vEEduAplctVO.getPageSize()); + + return paginationInfo; + } + + + //페이징을 위한 처리 step2 - 게시물 리스트 수량 설정 및 검색 조건 초기화 + private VEEduAplctVO setPagingStep2( + VEEduAplctVO p_vEEduAplctVO + , PaginationInfo p_paginationInfo + )throws Exception{ + // pageing step2 + p_vEEduAplctVO.setFirstIndex(p_paginationInfo.getFirstRecordIndex()); + p_vEEduAplctVO.setLastIndex(p_paginationInfo.getLastRecordIndex()); + p_vEEduAplctVO.setRecordCountPerPage(p_paginationInfo.getRecordCountPerPage()); + + if("".equals(p_vEEduAplctVO.getSearchSortCnd())){ //최초조회시 최신것 조회List + p_vEEduAplctVO.setSearchSortCnd("prcs_ord"); + p_vEEduAplctVO.setSearchSortOrd("desc"); + } + + return p_vEEduAplctVO; + } + + + //페이징을 위한 처리 step3 - 전체 게시물 수량 설정하기 + private PaginationInfo setPagingStep3( + List p_vEEduAplctVOList + + , PaginationInfo p_paginationInfo + )throws Exception{ + // pageing step3 + int totCnt = 0; + if(p_vEEduAplctVOList.size() > 0) totCnt = p_vEEduAplctVOList.get(0).getTotCnt(); + p_paginationInfo.setTotalRecordCount(totCnt); + + return p_paginationInfo; + } + + + + private String getTemplate() { + return "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \"한국저작권위원회-통합회원\n" + + "
\n" + + "

찾아가는 저작권 교육 일정 안내
(※ 개인정보가 기재된 자료이므로 이용 관리에 각별히 주의해 주시기 바랍니다)

\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
교 육 명[[_EduYear_]]년 찾아가는 저작권 교육
의 뢰 처[[_InsttNm_]]
일     시[[_EduHopeDt_]]
교육장소[[_Addr_]]
강의주제[[_HopeSbjct_]]
대     상[[_EduTrgt_]]인     원[[_EduPrsnl_]]
\n" + + "

\n" + + " 저작권 교육을 신청해 주셔서 대단히 감사드리며, 원활한 교육 진행과 사후관리를 위해 몇 가지 요청사항 전달드립니다.

\n" + + " 1. 결과보고서: [1] 양식에 따라 작성(사진 첨부)
\n" + + " - 오프라인: 강사 전면 강의 모습, 전경 등 2매 이상 촬영(※ 수강생 식별되지 않도록 뒷모습 촬영 당부)\n" + + " - 온라인: 참석자 및 강의 모습 화면 캡쳐 화면 등 2매 이상\n" + + " 2. 만족도조사: 설문지 양식을 출력 또는 네이버폼 등을 이용하여 조사, 수집 후 [2] 집계표에 값 입력하여 회신
\n" + + " 3. 강사참석확인서: [3] 양식에 강사 날인(온라인의 경우, 강사에게 양식 전달 후, 스캔본 회신)

\n" + + " ※ 온라인 교육 시 강의 녹화, 재사용, 배포 등은 저작권법 위반이므로 사전에 강사와 협의가 필요합니다.

\n" + + " 1~3 의 요청사항은 교육 후 메일을 통해 회신 부탁 드립니다.(교육 마감 후 일주일 이내)
\n" + + " 기타 문의사항은 한국저작권위원회 교육운영팀 02-2669-0083 으로 연락하여 주시기 바랍니다.

\n" + + " 감사합니다 ^^ \n" + + "

\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \"한국저작권위원회-통합회원\n" + + " \n" + + "

본 메일은 발신전용으로 회신하지 않습니다.

\n" + + "

진주 [우 52852] 경상남도 진주시 충의로 19, 1/2/5층.  대표번호 : 055.792.0000
서울 [우 04323] 서울특별시 용산구 후암로 107, 5/16층.  대표번호 : 02.2669.0010

\n" + + "
\n" + + "
\n" + + "\n" + + ""; + } + + +} diff --git a/src/main/webapp/WEB-INF/jsp/oprtn/adultVisitEdu/eduAplctMngDetail.jsp b/src/main/webapp/WEB-INF/jsp/oprtn/adultVisitEdu/eduAplctMngDetail.jsp index f41686eb..1ba97552 100644 --- a/src/main/webapp/WEB-INF/jsp/oprtn/adultVisitEdu/eduAplctMngDetail.jsp +++ b/src/main/webapp/WEB-INF/jsp/oprtn/adultVisitEdu/eduAplctMngDetail.jsp @@ -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" %> <% /** @@ -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 = ''; + 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": '' + , "hopeSbjct": '' // 희망주제 + , "insttNm": '' // 기관(단체)명 - 의뢰처 + , "addr": '('+''+')'+ ''+ '' // 주소 + , "eduSlct": eduSlct // 온라인 / 오프라인 + , "eduTrgt": '' // 교육대상 + , "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 @@ - - + + <%-- @@ -590,7 +655,7 @@ - - +