diff --git a/src/main/java/kcc/ve/aplct/tngrVisitEdu/eduAplct/web/EduAplctTngrController.java b/src/main/java/kcc/ve/aplct/tngrVisitEdu/eduAplct/web/EduAplctTngrController.java index 75d4464f..b59f3a5e 100644 --- a/src/main/java/kcc/ve/aplct/tngrVisitEdu/eduAplct/web/EduAplctTngrController.java +++ b/src/main/java/kcc/ve/aplct/tngrVisitEdu/eduAplct/web/EduAplctTngrController.java @@ -554,12 +554,6 @@ public class EduAplctTngrController { 2-4.동일한 날짜에 기 신청된 건이 있는지(구현) * */ try { - - - - - - //차시 저장 String s_rndsOrd = request.getParameter("rndsOrd"); //회차순번 @@ -579,18 +573,33 @@ public class EduAplctTngrController { vEAStngVO.setFrstRegisterId(loginVO.getUniqId()); vEAStngVO.setRndsOrd(s_rndsOrd); - - System.out.println(vEAStngVO.toString()); - + //1.교육희망일 체크 - 교육희망일이 필수값이다.{ + //회차/신청일자 { + String s_flag3 = ""; + s_flag3 = this._checkEduHopeDt(s_rndsOrd, s_eduHopeDt); + + if(!"".equals(s_flag3)){ + modelAndView.addObject("result", "fail3"); + modelAndView.addObject("msg", s_flag3); + return modelAndView; + } + + /* + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==start=="); + String s_flag3 = ""; if (!"".equals(s_rndsOrd) && !"".equals(s_eduHopeDt)) { + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==before=="); + s_flag3 = vEAStngMixService.eduAplctEAChkDateToStr(s_rndsOrd, s_eduHopeDt); //회차값 , 교육희망일 + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==after=="); + } if(!"".equals(s_flag3)){ @@ -598,18 +607,31 @@ public class EduAplctTngrController { modelAndView.addObject("msg", s_flag3); return modelAndView; } + + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==end=="); + */ } //작업 필요함 2023-10-17 //2.신청 시간이 해당 지역의 가능한 시간인지 fail - //신청한 교육 일자 및 시간이 신청기간에 받을수 있는 지역의 시간, 일자 조건에 맞는지 확인 한다. + //신청한 교육시간이 해당 회차의 지역에서 신청 가능한 시간인지 확인 한다. + //boolean flag = vEAStngMixService.eduAplctChkTime(vEAStngVO, request); //접수기간에 속한 회차의 년도에서 해당 지역이 신청가능한 시간인지 확인한다. //2.교육신청시간체크 - //회차, 지역코드값, 시작시간, 종료시간 { String s_flag = ""; + s_flag = this._checkEduTime4Area(s_rndsOrd, s_eduSlctCd, s_eduSlctAreaCd, s_strtTm, s_endTm); + + if(!"".equals(s_flag)){ + modelAndView.addObject("result", "fail"); + modelAndView.addObject("msg", s_flag); + return modelAndView; + } + + /* if (!"".equals(s_rndsOrd) && !"".equals(s_eduSlctCd) && !"".equals(s_eduSlctAreaCd) @@ -631,13 +653,15 @@ public class EduAplctTngrController { modelAndView.addObject("result", "fail"); modelAndView.addObject("msg", s_flag); return modelAndView; - } + } + */ } //2-3.해당일 신청가능한 차시가 남았는지 확인 - //3.교육신청시간체크 - //회차, 지역코드값, 시작시간, 종료시간 + //현업 요청으로 제거 해당일 신청가능한 차시가 없으면 대기로 등록됨 + /* { String s_flag4 = ""; @@ -653,6 +677,7 @@ public class EduAplctTngrController { return modelAndView; } } + */ //동일한 신청건이 있는지 확인(신청자아이디, 교육희망일, 교육대상 동일 건 비교) @@ -660,12 +685,16 @@ public class EduAplctTngrController { { boolean flag2 = true; + flag2 = this._checkDupEduDateNTrgt(s_eduHopeDt, s_trgt); + + /* + if (!"".equals(s_eduHopeDt) && !"".equals(s_trgt)) { flag2 = eduAplctTngrService.eduAplctDuplEAChkProcess(s_eduHopeDt, s_trgt); //교육희망일, 대상자 } - + */ if(!flag2){ modelAndView.addObject("result", "fail2"); @@ -1396,4 +1425,160 @@ public class EduAplctTngrController { return vEAStngVO; } + + // + /** + * 해당 일자가 해당 회차에서 신청가능한 일자인지 확인한다. + * @param p_modelAndView + * @param p_rndsOrd + * @param p_eduHopeDt + * @return + * @throws Exception + */ + private String _checkEduHopeDt( + String p_rndsOrd + , String p_eduHopeDt + ) throws Exception{ + String s_flag3 = ""; + + try{ + + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==start=="); + + + if (!"".equals(p_rndsOrd) && !"".equals(p_eduHopeDt)) { + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==before=="); + + s_flag3 = vEAStngMixService.eduAplctEAChkDateToStr(p_rndsOrd, p_eduHopeDt); //회차값 , 교육희망일 + + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==after=="); + + } + + System.out.println("==요청한 일자가 신청가능한 일자인지 확인(불가능여부 체크)==end=="); + + /* + if(!"".equals(s_flag3)){ + p_modelAndView.addObject("result", "fail3"); + p_modelAndView.addObject("msg", s_flag3); + //return modelAndView; + } + */ + + }catch(Exception ex){ + s_flag3 = "해당 일자가 해당 회차에서 신청가능한 일자인지 확인중 오류 발생"; + ex.printStackTrace(); + } + + return s_flag3; + } + + + // + /** + * 해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인한다. + * @param p_modelAndView + * @param p_rndsOrd + * @param p_eduHopeDt + * @return + * @throws Exception + */ + private String _checkEduTime4Area( + String p_rndsOrd + , String p_eduSlctCd //온라인, 오프라인 여부 + , String p_eduSlctAreaCd //지역코드 + , String p_strtTm //시작시간 + , String p_endTm //종료시간 + ) throws Exception{ + + String s_flag = ""; + + try{ + + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==start=="); + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==start=="+p_rndsOrd); + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==start=="+p_eduSlctCd); + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==start=="+p_eduSlctAreaCd); + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==start=="+p_strtTm); + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==start=="+p_endTm); + + if (!"".equals(p_rndsOrd) + && !"".equals(p_eduSlctCd) + && !"".equals(p_eduSlctAreaCd) + && !"".equals(p_strtTm) + && !"".equals(p_endTm) + ) { + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==before=="); + + s_flag = eduAplctTngrService.eduAplctEAChkProcessToStr( + p_rndsOrd + , p_eduSlctCd + , p_eduSlctAreaCd + , p_strtTm + , p_endTm + ); //회차, 지역코드값, 시작시간, 종료시간 + + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==after=="); + + } + + System.out.println("==해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인(시간 체크)==end=="); + + + }catch(Exception ex){ + s_flag = "해당 시간이 해당 회차 & 지역에서 신청가능한 시간인지 확인중 오류 발생"; + ex.printStackTrace(); + } + + return s_flag; + } + + + // + /** + * 동일한 신청(교육희망일, 대상자)이 있었는지 확인한다. + * //교육희망일, 대상자 + * + * @param p_modelAndView + * @param p_rndsOrd + * @param p_eduHopeDt + * @return + * @throws Exception + */ + private boolean _checkDupEduDateNTrgt( + String p_eduHopeDt //교육희망일 + , String p_trgt //교육대상 + ) throws Exception{ + + boolean flag2 = true; + + try{ + + System.out.println("==동일한 신청(교육희망일, 대상자)이 있었는지 확인(시간 체크)==start=="); + System.out.println("==동일한 신청(교육희망일, 대상자)이 있었는지 확인(시간 체크)==start=="+p_eduHopeDt); + System.out.println("==동일한 신청(교육희망일, 대상자)이 있었는지 확인(시간 체크)==start=="+p_trgt); + + + if (!"".equals(p_eduHopeDt) + && !"".equals(p_trgt)) { + System.out.println("==동일한 신청(교육희망일, 대상자)이 있었는지 확인(시간 체크)==before=="); + + flag2 = eduAplctTngrService.eduAplctDuplEAChkProcess(p_eduHopeDt, p_trgt); //교육희망일, 대상자 + + System.out.println("==동일한 신청(교육희망일, 대상자)이 있었는지 확인(시간 체크)==before=="); + + } + + + System.out.println("==동일한 신청(교육희망일, 대상자)이 있었는지 확인(시간 체크)==end=="); + + + }catch(Exception ex){ + flag2 = false; + ex.printStackTrace(); + } + + return flag2; + } + } diff --git a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/tngrVisitEdu/eduAplct/eduAplctReg.jsp b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/tngrVisitEdu/eduAplct/eduAplctReg.jsp index a0ca05d9..e7daf7c3 100644 --- a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/tngrVisitEdu/eduAplct/eduAplctReg.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/tngrVisitEdu/eduAplct/eduAplctReg.jsp @@ -138,11 +138,13 @@ function _fncEduHopeDtStep1( alert("로그인 후 다시 교육신청해 주세요."); flag = false; return; + /* }else if(returnData.result == "fail4"){ //alert("가능한 교육희망일자가 아닙니다."); alert(returnData.msg+"일에 신청 가능한 차시수를 넘어서 더 이상 신청이 불가능합니다."); flag = false; - return; + return; + */ }else if(returnData.result == "fail3"){ //alert("가능한 교육희망일자가 아닙니다."); $('.duet-date__input:eq('+p_idx+')').val(''); @@ -807,34 +809,43 @@ function _chkChasiTime(p_this){ var lrnTm = Number($('input[name=lrnTm]:eq('+idx+')').val()); - var scholDivCd = $('#scholDivCd').val(); + //var scholDivCd = $('#scholDivCd').val(); + var scholDivCd = $('input[name=scholDivCd]:checked').val(); // 초등, 특수 , 기타 if(scholDivCd == VeConstants.CLASS_CD_10 || scholDivCd == VeConstants.CLASS_CD_40 || scholDivCd == VeConstants.CLASS_CD_50){ - if(lrnTm < v_TR0E*1){ + if(lrnTm*1 < v_TR0E*1){ alert('학교구분이 초등/특수/기타와 같다면 최소교육시간 '+v_TR0E+'분 이상이여야합니다.'); $('input[name=strtTm]:eq('+idx+')').focus(); return flag = false; } // 중등 }else if(scholDivCd == VeConstants.CLASS_CD_20 ){ - if(lrnTm < v_TR0M){ + if(lrnTm*1 < v_TR0M*1){ alert('학교구분이 중등과 같다면 최소교육시간 '+v_TR0M+'분 이상이여야합니다.'); $('input[name=strtTm]:eq('+idx+')').focus(); return flag = false; } // 고등 }else if(scholDivCd == VeConstants.CLASS_CD_30){ - if(lrnTm < v_TR0H){ + if(lrnTm*1 < v_TR0H*1){ alert('학교구분이 고등과 같다면 최소교육시간 '+v_TR0H+'분 이상이여야합니다.'); $('input[name=strtTm]:eq('+idx+')').focus(); return flag = false; } } + + alert(scholDivCd); + alert(lrnTm); + alert(v_TR0E); + alert(v_TR0M); + alert(v_TR0H); }); + + return true; }