diff --git a/src/main/java/kcc/ve/aplct/comweb/CommonWebController.java b/src/main/java/kcc/ve/aplct/comweb/CommonWebController.java index e25f1284..f43673a7 100644 --- a/src/main/java/kcc/ve/aplct/comweb/CommonWebController.java +++ b/src/main/java/kcc/ve/aplct/comweb/CommonWebController.java @@ -858,7 +858,11 @@ public class CommonWebController { for (int i=0;i0) { + VEInstrAsgnmVO p_vEInstrAsgnmVO = new VEInstrAsgnmVO(); + p_vEInstrAsgnmVO.setEduAplctOrd(p_tChasiInfo.getEduAplctOrd()); + p_vEInstrAsgnmVO.setEduChasiOrd(p_tChasiInfo.getEduChasiOrd()); + + p_vEInstrAsgnmVO.setUserId(vEInstrAssiEduAplctVOList.get(0).getUserId()); //배정 강사 + p_vEInstrAsgnmVO.setRmrks("배정기준1순위"); + + p_vEInstrAsgnmVO.setFrstRegisterId(p_loginVO.getUniqId()); + p_vEInstrAsgnmVO.setAsgnmAprvlCd("10"); //수락요청전 + p_vEInstrAsgnmVO.setAsgnmAprvlId(p_loginVO.getUniqId()); + + + System.out.println("===//강사배정-대상 강사가 있어야 강사를 할당한다.==="); + + //저장 + vEEduChasiInstrAsgnmService.insert(p_vEInstrAsgnmVO); + + //저장여부 확인 + //step3-1.해당 차시에 강사 배정이 있는지 확인 + VEInstrAsgnmVO vEInstrAsgnmVOTmp = vEEduChasiInstrAsgnmService.selectDetail(p_vEInstrAsgnmVO); + if (vEInstrAsgnmVOTmp!=null) { + System.out.println("===O저장확인==="); + i_ret = 1; + + }else { + System.out.println("===X저장안됨==="); + } + } + + return i_ret; + } + + + //청소년 강사 배정 - 20231115 + private int setTngrInstrAsgnm20231115_re_20240213( + VEEduAplctVO p_tChasiInfo //대상 차시 정보 + , LoginVO p_loginVO //등록자 정보 + ) throws Exception{ + + int i_ret = 0; //성공시 1 ret + + //eduChasiOrd, 희망일자가 필요 + //VEEduAplctVO tChasiInfo = vEEduAplctVOList.get(i); + + String s_eduHopeDt = p_tChasiInfo.getEduHopeDt(); //교육희망일자 + String s_eduSlctCd = p_tChasiInfo.getEduSlctCd(); //온라인 10, 오프라인 20 + //String s_addr = tChasiInfo.getAddr(); //지역명 + + System.out.println(s_eduHopeDt); + //System.out.println(s_addr); + + + //파라미터 + VEAutoAsgnmVO vEAutoAsgnmVO = null; + + String s_user_id = "'aaa'"; + + //대상 강사 리스트 + List vEInstrAssiEduAplctVOList = null; + + //필수 조건(월별시수제한, 요일, 희망지역) + { + System.out.println("===step2-1.가능 강사중 월별 시수이상을 받지 않은자 & 해당 요일에 수업 가능한 강사 리스트(필)==="); + //step2-1.가능 강사중 월별 시수이상을 받지 않은자 & 해당 요일에 수업 가능한 강사 리스트(필) + vEAutoAsgnmVO = new VEAutoAsgnmVO(); + vEAutoAsgnmVO.setEduHopeMnt(s_eduHopeDt.substring(5,7)); + vEAutoAsgnmVO.setYr(s_eduHopeDt.substring(0,4)); + vEAutoAsgnmVO.setInstrDiv("10"); //10-청소년, 20-성인 + vEAutoAsgnmVO.setEduChasiOrd(p_tChasiInfo.getEduChasiOrd()); + + vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrMntAsgnmtChasiList(vEAutoAsgnmVO); + + + //step2-1-1.동일일자 시간대에 배정이 없는강사찾기 + for (int j=0;j0 THEN 1 ELSE 0 END " + + " + CASE WHEN instr(ddd.rsdne, substr(zzz.addr, 0, 2))>0 THEN 1 ELSE 0 END " + + " ) desc , "; + } + + //연강 쿼리 적용 + if ("Y".equals(vEAStngVO_20.getUseYn())) { + s_orderByQuery = s_orderByQuery + " NVL(eee.cntnsCnt,0) DESC, DECODE(ccc0.cntnsLctrPsblYn,'Y',1,0) desc , "; + } + + //패널티 쿼리 적용 + if ("Y".equals(vEAStngVO_20.getUseYn())) { + s_orderByQuery = s_orderByQuery + " NVL(bbb.pnltyCnt, 0) asc , "; + } + + s_orderByQuery = s_orderByQuery + " NVL(aaa.instrSumChasi*10000,0)/(aaa.asgnmTm+1) asc, ccc0.areaCnt ASC, ccc0.weekCnt asc "; + + //거주지 비교를 위해서 학교 주소에 필요 + vEAutoAsgnmVO.setEduAplctOrd(p_tChasiInfo.getEduAplctOrd()); + + //대상장 강사에 대해서만 검사 + vEAutoAsgnmVO.setUserIds(s_user_id); + + + + + //기본 정렬 쿼리 - 월별시수대비할당이적은자 + vEAutoAsgnmVO.setOrderByQuery(" ORDER BY "+s_orderByQuery); + + vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrPriorityList(vEAutoAsgnmVO); + }else { + System.out.println("===X없음==="); + } + + + /* + SELECT a.user_id AS userId + , count(*) AS pnltyCnt + FROM ve_edu_pnlty a + GROUP BY a.user_id + */ + + + + /* * 연강 적용여부 확인 * diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmMIXService.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmMIXService.java index 9a3cadd4..b0259c52 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmMIXService.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmMIXService.java @@ -7,6 +7,9 @@ public interface VEAutoAsgnmMIXService { //step2-1.가능 강사중 월별 시수이상을 받지 않은자 & 해당 요일에 수업 가능한 강사 리스트(필) List selectInstrMntAsgnmtChasiList(VEAutoAsgnmVO paramVO) throws Exception; + //step2-1-0.거주지별 배정 비율 가능한 강사 리스트(필) + List selectInstrMntAreaChasiList(VEAutoAsgnmVO paramVO) throws Exception; + //해당 차시 학교에 거주하는 강사 List selectRsdneInstrList(VEAutoAsgnmVO paramVO) throws Exception; diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmVO.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmVO.java index 9613a2f4..5ffd2255 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmVO.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEAutoAsgnmVO.java @@ -24,6 +24,7 @@ public class VEAutoAsgnmVO extends ComDefaultVO implements Serializable { private String hopeEduFld; //희망교육부분 private String asgnmTm; //할당된시간 + private String eduAplctOrd; //신청 고유 순번 private String eduChasiOrd; //차시 고유 순번 private String userIds; //강사아이디들 @@ -83,6 +84,11 @@ public class VEAutoAsgnmVO extends ComDefaultVO implements Serializable { private String orderByQuery; //배정을 위한 우선 순위 order by 쿼리 + private String eduSlctAreaCd; //강사거주지별배정비율설정코드 + private String eduSlctCd; //온/오프라인여부 10-온라인, 20-오프라인 + + + public String getPnltyQuery() { return pnltyQuery; } @@ -522,6 +528,30 @@ public class VEAutoAsgnmVO extends ComDefaultVO implements Serializable { public void setAchvmRt(String achvmRt) { this.achvmRt = achvmRt; } + + public String getEduSlctAreaCd() { + return eduSlctAreaCd; + } + + public void setEduSlctAreaCd(String eduSlctAreaCd) { + this.eduSlctAreaCd = eduSlctAreaCd; + } + + public String getEduSlctCd() { + return eduSlctCd; + } + + public void setEduSlctCd(String eduSlctCd) { + this.eduSlctCd = eduSlctCd; + } + + public String getEduAplctOrd() { + return eduAplctOrd; + } + + public void setEduAplctOrd(String eduAplctOrd) { + this.eduAplctOrd = eduAplctOrd; + } } diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduMIXService.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduMIXService.java index 3f254ffa..9334e45d 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduMIXService.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/VEEduMIXService.java @@ -27,6 +27,9 @@ public interface VEEduMIXService { List selectTngrRsltPagingList(VEEduAplctVO paramVO) throws Exception; + //연강 우선으로 쿼리 변경 + List selectTngrCntnsPagingList(VEEduAplctVO paramVO) throws Exception; + //대량강사자동배정대상 - step0,1 - 개별 List selectTngrRsltPagingList_EA(VEEduAplctVO paramVO) throws Exception; diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXDAO.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXDAO.java index 7a5808a3..f2c15b17 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXDAO.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXDAO.java @@ -16,6 +16,12 @@ public class VEAutoAsgnmMIXDAO extends EgovAbstractDAO { return tlist; } + public List selectInstrMntAreaChasiList(VEAutoAsgnmVO paramVO) { + @SuppressWarnings("unchecked") + List tlist = (List) list("VEAutoAsgnmDAO.selectInstrMntAreaChasiList", paramVO); + return tlist; + } + public List selectRsdneInstrList(VEAutoAsgnmVO paramVO) { @SuppressWarnings("unchecked") List tlist = (List) list("VEAutoAsgnmDAO.selectRsdneInstrList", paramVO); diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXServiceImpl.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXServiceImpl.java index 1754da3f..2361e89f 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXServiceImpl.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEAutoAsgnmMIXServiceImpl.java @@ -23,6 +23,11 @@ public class VEAutoAsgnmMIXServiceImpl implements VEAutoAsgnmMIXService { return vEAutoAsgnmMIXDAO.selectInstrMntAsgnmtChasiList(paramVO); } + @Override + public List selectInstrMntAreaChasiList(VEAutoAsgnmVO paramVO) throws Exception{ + return vEAutoAsgnmMIXDAO.selectInstrMntAreaChasiList(paramVO); + } + @Override public List selectRsdneInstrList(VEAutoAsgnmVO paramVO) throws Exception{ return vEAutoAsgnmMIXDAO.selectRsdneInstrList(paramVO); diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXDAO.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXDAO.java index 7aa3f93c..e2251bdc 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXDAO.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXDAO.java @@ -67,6 +67,12 @@ public class VEEduMIXDAO extends EgovAbstractDAO { List tlist = (List) list("VEEduMIXDAO.selectTngrRsltPagingList", paramVO); return tlist; } + + public List selectTngrCntnsPagingList(VEEduAplctVO paramVO) { + @SuppressWarnings("unchecked") + List tlist = (List) list("VEEduMIXDAO.selectTngrCntnsPagingList", paramVO); + return tlist; + } public List selectTngrRsltPagingList_EA(VEEduAplctVO paramVO) { @SuppressWarnings("unchecked") diff --git a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXServiceImpl.java b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXServiceImpl.java index 8155522a..cf1e3783 100644 --- a/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXServiceImpl.java +++ b/src/main/java/kcc/ve/instr/tngrVisitEdu/eduInfo/service/impl/VEEduMIXServiceImpl.java @@ -60,6 +60,11 @@ public class VEEduMIXServiceImpl implements VEEduMIXService { return vEEduMIXDAO.selectTngrRsltPagingList(paramVO); } + @Override + public List selectTngrCntnsPagingList(VEEduAplctVO paramVO) throws Exception{ + return vEEduMIXDAO.selectTngrCntnsPagingList(paramVO); + } + @Override public List selectTngrRsltPagingList_EA(VEEduAplctVO paramVO) throws Exception{ return vEEduMIXDAO.selectTngrRsltPagingList_EA(paramVO); diff --git a/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduCnfrmMng/web/NewEduCnfrmMngTngrController.java b/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduCnfrmMng/web/NewEduCnfrmMngTngrController.java index 9bea8ed3..47ec879e 100644 --- a/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduCnfrmMng/web/NewEduCnfrmMngTngrController.java +++ b/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduCnfrmMng/web/NewEduCnfrmMngTngrController.java @@ -486,7 +486,9 @@ public class NewEduCnfrmMngTngrController { //강사할당이 없는 배정 대상 차시를 가져온다. if (!"".equals(s_searchStartDt) && !"".equals(s_searchEndDt)) { - vEEduAplctVOList = vEEduMIXService.selectTngrRsltPagingList(vEEduAplctVO); + //vEEduAplctVOList = vEEduMIXService.selectTngrRsltPagingList(vEEduAplctVO); + vEEduAplctVOList = vEEduMIXService.selectTngrCntnsPagingList(vEEduAplctVO); + } diff --git a/src/main/resources/egovframework/sqlmap/ve/edu/VEAutoAsgnm_MIX_SQL_Tibero.xml b/src/main/resources/egovframework/sqlmap/ve/edu/VEAutoAsgnm_MIX_SQL_Tibero.xml index 4b6c358e..a2cacbfb 100644 --- a/src/main/resources/egovframework/sqlmap/ve/edu/VEAutoAsgnm_MIX_SQL_Tibero.xml +++ b/src/main/resources/egovframework/sqlmap/ve/edu/VEAutoAsgnm_MIX_SQL_Tibero.xml @@ -335,6 +335,122 @@ END + + + - + + + +