2024-01-12 17:51 청소년 강사 자동 배정 수정 및 데이터 이관

This commit is contained in:
myname 2024-01-12 17:51:47 +09:00
parent f940d00135
commit e4d9b22e76
4 changed files with 531 additions and 6 deletions

View File

@ -841,6 +841,7 @@ public class CommonWebController {
System.out.println("===대상차시 가져오기==="); System.out.println("===대상차시 가져오기===");
System.out.println(s_query);
VEEduAplctVO vEEduAplctVO = new VEEduAplctVO(); VEEduAplctVO vEEduAplctVO = new VEEduAplctVO();
vEEduAplctVO.setSelectPagingListQuery(s_query); vEEduAplctVO.setSelectPagingListQuery(s_query);
@ -857,8 +858,9 @@ public class CommonWebController {
} }
} }
System.out.println("p");
//modelAndView.addObject("rsCnt", rs); System.out.println(p);
modelAndView.addObject("cnt", p); //처리된 수량
modelAndView.addObject("result", "success"); modelAndView.addObject("result", "success");
return modelAndView; return modelAndView;
} }

View File

@ -377,6 +377,129 @@ public class NewEduCnfrmMngTngrController {
return modelAndView; return modelAndView;
} }
/**
* 강사 배정(전체)NEW
* fncSpcfcInstrAsgnmInfo
*/
@RequestMapping("popup/instrMassAsgnm20240112Popup.do")
public String instrMassAsgnm20240112Popup(
ModelMap model
, HttpServletRequest request
) throws Exception {
//Step1.자동배정 차시 대상가져오기
//List<VEEduAplctVO> vEEduAplctVOList = null;
{
String s_searchStartDt = request.getParameter("searchStartDt");
String s_searchEndDt = request.getParameter("searchEndDt");
String s_searchScholNm = request.getParameter("searchScholNm");
/*
VEEduAplctVO vEEduAplctVO = new VEEduAplctVO();
vEEduAplctVO.setInstrDiv("10"); //청소년
vEEduAplctVO.setLctrDivCd("10"); //청소년강의
vEEduAplctVO.setAprvlCd("60"); //확정코드
vEEduAplctVO.setSearchStartDt(s_searchStartDt);
vEEduAplctVO.setSearchEndDt(s_searchEndDt);
if(!"".equals(vEEduAplctVO.getSearchInstrNm())) {
vEEduAplctVO.setSearchInstrNm(egovCryptoUtil.encrypt(vEEduAplctVO.getSearchInstrNm()));
}
//모든 리스트를 페이징 없이 가져온다.
vEEduAplctVO.setPageIndex(0);
//강사가 할당안된 리스트만 가져온다.
vEEduAplctVO.setSearchAsgnmAprvlCd("90");
//Step1.자동배정 대상 차시가져오기
//강사할당이 없는 배정 대상 차시를 가져온다.
vEEduAplctVOList = vEEduMIXService.selectTngrRsltPagingList(vEEduAplctVO);
*/
//대상 리스트, 페이징 정보 전달
model.addAttribute("searchStartDt", s_searchStartDt);
model.addAttribute("searchEndDt", s_searchEndDt);
model.addAttribute("searchScholNm", s_searchScholNm);
}
return "oprtn/tngrVisitEdu/popup/instrMassAsgnm20240112Popup";
}
/**
* 강사 배정 조건 관리 팝업
* fncSpcfcInstrAsgnmInfo
*/
@RequestMapping("popup/instrMassAsgnm20240112PopupAjax.do")
public ModelAndView instrMassAsgnm20240112PopupAjax(ModelMap model
, HttpServletRequest request
) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
//로그인 처리====================================
//로그인 정보 가져오기
String s_oprtnLoginCheckNInfo = checkLoginUtil.oprtnCheckNInfo(model);
if (!"".equals(s_oprtnLoginCheckNInfo)) {
modelAndView.addObject("result", "fail");
return modelAndView;
}
//로그인 처리====================================
//Step1.자동배정 차시 대상가져오기
List<VEEduAplctVO> vEEduAplctVOList = null;
{
String s_searchStartDt = request.getParameter("searchStartDt");
String s_searchEndDt = request.getParameter("searchEndDt");
String s_searchScholNm = request.getParameter("searchScholNm");
System.out.println("s_searchStartDt");
System.out.println(s_searchStartDt);
System.out.println(s_searchEndDt);
VEEduAplctVO vEEduAplctVO = new VEEduAplctVO();
vEEduAplctVO.setInstrDiv("10"); //청소년
vEEduAplctVO.setLctrDivCd("10"); //청소년강의
vEEduAplctVO.setAprvlCd("60"); //확정코드
vEEduAplctVO.setSearchStartDt(s_searchStartDt);
vEEduAplctVO.setSearchEndDt(s_searchEndDt);
vEEduAplctVO.setSearchScholNm(s_searchScholNm);
if(!"".equals(vEEduAplctVO.getSearchInstrNm())) {
vEEduAplctVO.setSearchInstrNm(egovCryptoUtil.encrypt(vEEduAplctVO.getSearchInstrNm()));
}
//모든 리스트를 페이징 없이 가져온다.
vEEduAplctVO.setPageIndex(0);
//강사가 할당안된 리스트만 가져온다.
vEEduAplctVO.setSearchAsgnmAprvlCd("90");
//Step1.자동배정 대상 차시가져오기
//강사할당이 없는 배정 대상 차시를 가져온다.
if (!"".equals(s_searchStartDt) && !"".equals(s_searchEndDt)) {
vEEduAplctVOList = vEEduMIXService.selectTngrRsltPagingList(vEEduAplctVO);
}
//대상 리스트, 페이징 정보 전달
modelAndView.addObject("vEEduAplctVOList", vEEduAplctVOList);
}
modelAndView.addObject("result", "success");
return modelAndView;
}
/** /**
* 강사 월별 시수계산 관리 팝업 * 강사 월별 시수계산 관리 팝업
* fncSpcfcInstrAsgnmInfo * fncSpcfcInstrAsgnmInfo

View File

@ -376,8 +376,8 @@
//"searchStartDt" //"searchStartDt"
varEduHopeDtStrt = $('#searchStartDt').val(); varEduHopeDtStrt = $('#listForm #searchStartDt').val();
varEduHopeDtEnd = $('#searchEndDt').val(); varEduHopeDtEnd = $('#listForm #searchEndDt').val();
//alert(varEduHopeDtStrt); //alert(varEduHopeDtStrt);
//alert(varEduHopeDtEnd); //alert(varEduHopeDtEnd);
@ -428,6 +428,36 @@
}); });
} }
//강사배정(전체)-팝업을 통한 수량 카운팅 기능 변환용
function fncInstrMassAsgnm20240112Popup() {
varEduHopeDtStrt = $('#listForm #searchStartDt').val();
varEduHopeDtEnd = $('#listForm #searchEndDt').val();
varSearchScholNm = $('#listForm #searchScholNm').val();
if (varEduHopeDtStrt=='' || varEduHopeDtEnd==''){
alert("대상의 교육일자 기간은 반드시 선택해야 합니다.");
return ;
}
var form = document.pop2Form;
form.searchStartDt.value = varEduHopeDtStrt;
form.searchEndDt.value = varEduHopeDtEnd;
form.searchScholNm.value = varSearchScholNm;
form.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/popup/instrMassAsgnm20240112Popup.do'/>";
window.open("#", "_instrMassAsgnm20240112Pop", "scrollbars = no, top=100px, left=100px, height=350px, width=800px");
form.target = "_instrMassAsgnm20240112Pop";
form.submit();
}
//강사배정(전체)
function fncInstrMassAsgnm20231109(){ //교육일자를 확인 해서 있는 경우만 처리한다. function fncInstrMassAsgnm20231109(){ //교육일자를 확인 해서 있는 경우만 처리한다.
var varEduHopeDtStrt = ''; var varEduHopeDtStrt = '';
@ -437,8 +467,8 @@
//"searchStartDt" //"searchStartDt"
varEduHopeDtStrt = $('#searchStartDt').val(); varEduHopeDtStrt = $('#listForm #searchStartDt').val();
varEduHopeDtEnd = $('#searchEndDt').val(); varEduHopeDtEnd = $('#listForm #searchEndDt').val();
//alert(varEduHopeDtStrt); //alert(varEduHopeDtStrt);
//alert(varEduHopeDtEnd); //alert(varEduHopeDtEnd);
@ -561,6 +591,7 @@
}); });
} }
//강사배정(개별)
function fncInstrMassAsgnmEA20231115(){ //개별 선택한 경우만 처리한다. function fncInstrMassAsgnmEA20231115(){ //개별 선택한 경우만 처리한다.
@ -881,6 +912,11 @@
<title>신청관리</title> <title>신청관리</title>
</head> </head>
<body> <body>
<form:form id="pop2Form" name="pop2Form" method="post" onsubmit="return false;">
<input type="hidden" name="searchStartDt" id="searchStartDt" value=""/>
<input type="hidden" name="searchEndDt" id="searchEndDt" value=""/>
<input type="hidden" name="searchScholNm" id="searchScholNm" value=""/>
</form:form>
<form:form id="popForm" name="popForm" method="post" onsubmit="return false;"> <form:form id="popForm" name="popForm" method="post" onsubmit="return false;">
<input type="hidden" name="pageIndex" value="1"/> <input type="hidden" name="pageIndex" value="1"/>
<input type="hidden" name="eduAplctOrd" value="" /> <input type="hidden" name="eduAplctOrd" value="" />
@ -978,6 +1014,8 @@
</div> </div>
<div class="right_box"> <div class="right_box">
<!-- <button type="button" class="btn_type06" onclick="fncInstrMassAsgnm(); return false;">강사배정(전체)X</button>--> <!-- <button type="button" class="btn_type06" onclick="fncInstrMassAsgnm(); return false;">강사배정(전체)X</button>-->
<button type="button" class="btn_type06" onclick="fncInstrMassAsgnm20240112Popup(); return false;">강사배정(전체)NEW</button>
<button type="button" class="btn_type06" onclick="fncInstrMassAsgnm20231109(); return false;">강사배정(전체)</button> <button type="button" class="btn_type06" onclick="fncInstrMassAsgnm20231109(); return false;">강사배정(전체)</button>
<!-- <button type="button" class="btn_type06" onclick="fncInstrMassAsgnmEA(); return false;">강사배정(개별)X</button> --> <!-- <button type="button" class="btn_type06" onclick="fncInstrMassAsgnmEA(); return false;">강사배정(개별)X</button> -->
<button type="button" class="btn_type06" onclick="fncInstrMassAsgnmEA20231115(); return false;">강사배정(개별)</button> <button type="button" class="btn_type06" onclick="fncInstrMassAsgnmEA20231115(); return false;">강사배정(개별)</button>

View File

@ -0,0 +1,362 @@
<!DOCTYPE html>
<%@ 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="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<%@ taglib prefix="ve" uri="/WEB-INF/tlds/kcc_tld.tld"%>
<%
/**
* @Class Name : instrMassAsgnm20240112Popup.jsp
* @Description : 강사배정(전체) 수량카운트용 팝업
* @Modification Information
* @
* @ 수정일 수정자 수정내용
* @ ------- -------- ---------------------------
* @ 2021.08.09 김봉호 최초 생성
* @author 안주영
* @since 2022.1.8
* @version 1.0
* @see
*
*/
%>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%-- <script type="text/javascript" src="<c:url value='/js/ve/tmapJS.js'/>"></script> --%>
<script type="text/javascript">
</script>
<title>강사배치 팝업</title>
<script type="text/javaScript" language="javascript">
$(document).ready(function() {
// ID를 alpreah_input로 가지는 곳에서 키를 누를 경우
$("#instrNm").keydown(function(key) {
if (key.keyCode == 13) {
linkPage(1);
return false;
}
});
});
function press(event) {
//alert(event.keyCode);
if (event.keyCode==13) {
linkPage(1);
}
return;
}
function fncPopClose(){
self.close();
}
function linkPage(pageNo){
var listForm = document.listForm ;
listForm.pageIndex.value = pageNo ;
listForm.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/popup/spcfcInstrAsgnmPopup.do'/>";
listForm.submit();
}
function reloadLinkPage(){
$("#btnDstnc").show();
/*
var listForm = document.listForm ;
//listForm.pageIndex.value = pageNo ;
listForm.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/popup/spcfcInstrAsgnmPopup.do'/>";
listForm.submit();
*/
}
function fncInstrAsgnmCndtnMng(p_yrMnt) {
$("#yrMnt").val(p_yrMnt);
var data1 = new FormData(document.getElementById("createForm"));
$.ajax({
type:"POST",
url:"${pageContext.request.contextPath}/kccadr/oprtn/tngrVisitEdu/popup/instrMntTmMngPopupAjax.do",
data: data1,
dataType:'json',
async: false,
processData: false,
contentType: false,
cache: false,
success:function(returnData){
if(returnData.result == 'success'){
alert("저장 되었습니다.");
//opener.location.reload();
//fncPopClose();
location.reload();
}
},
error:function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
function fncInstrAsgnmCndtnInitMng(p_yrMnt) {
$("#yrMnt").val(p_yrMnt);
var data1 = new FormData(document.getElementById("createForm"));
$.ajax({
type:"POST",
url:"${pageContext.request.contextPath}/kccadr/oprtn/tngrVisitEdu/popup/instrMntTmInitMngPopupAjax.do",
data: data1,
dataType:'json',
async: false,
processData: false,
contentType: false,
cache: false,
success:function(returnData){
if(returnData.result == 'success'){
alert("저장 되었습니다.");
//opener.location.reload();
//fncPopClose();
location.reload();
}
},
error:function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
//동일 학교 여부 체크
function fncInstrAsgnm_bef(id, p_rank) {
$("#userId").val(id);
$("#rmrks").val("배정기준"+p_rank+"순위");
var data1 = new FormData(document.getElementById("createForm"));
$.ajax({
type:"POST",
url:"${pageContext.request.contextPath}/kccadr/oprtn/tngrVisitEdu/popup/instrAsgnmAjax_bef.do",
data: data1,
dataType:'json',
async: false,
processData: false,
contentType: false,
cache: false,
success:function(returnData){
if(returnData.message == ''){
if(confirm("강사를 선택 하시겠습니까?")){
fncInstrAsgnm(id, p_rank)
}
}else{
if(confirm("동일한 일자에 다른 학교 강의가 있습니다.\n("+returnData.message+")\n강사를 선택 하시겠습니까?")){
fncInstrAsgnm(id, p_rank);
}
}
},
error:function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
function reloadPage(){
location.reload();
}
function fncGoListReset(){
$("#rndsOrd").val('');
linkPage(1);
}
function fncGoList(){
linkPage(1);
}
function linkPage(pageNo){
var listForm = document.createForm ;
//listForm.searchCondition.value = $('#searchCondition').val();
//listForm.searchKeyword.value = $('#searchKeyword').val();
listForm.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/popup/instrMntTmMngPopup.do'/>";
listForm.submit();
}
function fncInstrMassAsgnmEA20231115_Bef(){
$('#ingInfoBtn').html('');
fncInstrMassAsgnmEA20231115(v_returnDatavEEduAplctVOList[v_asgnmCnt].eduAplctOrd+'@'+v_returnDatavEEduAplctVOList[v_asgnmCnt].eduChasiOrd);
}
//강사배정(개별)
function fncInstrMassAsgnmEA20231115(p_varEduAplctOrd){ //개별 선택한 경우만 처리한다.
//alert(p_varEduAplctOrd);
//return;
$.ajax({
type:"POST",
url:"${pageContext.request.contextPath}/web/ve/comm/instrMassAsgnmEAAjax20231115.do",
data: {
"eduAplctOrd":p_varEduAplctOrd,
//"strtOprtnDt" : varEduHopeDtStrt ,
//"endOprtnDt" : varEduHopeDtEnd ,
//"instrDiv" : "10" ,
},
dataType:'json',
success:function(returnData){
if(returnData.result=="success"){
//alert("상태가 변경 되었습니다.");
//linkPage(pageIndex);
v_cnt = v_cnt + returnData.cnt*1;
v_asgnmCnt = v_asgnmCnt + 1;
if (v_asgnmCnt*1>=v_returnDatavEEduAplctVOList.length*1){
alert("모든 내용을 처리했습니다.");
$('#ingInfo').text("자동 배정 완료..."+v_asgnmCnt+'/'+v_returnDatavEEduAplctVOList.length);
$('#ingInfoBtn').html("<p>실제 배정된 수량 : "+v_cnt+"</p>");
top.window.opener.location.reload();
}else{
$('#ingInfo').text("자동 배정 진행 중..."+v_asgnmCnt+'/'+v_returnDatavEEduAplctVOList.length);
fncInstrMassAsgnmEA20231115(v_returnDatavEEduAplctVOList[v_asgnmCnt].eduAplctOrd+'@'+v_returnDatavEEduAplctVOList[v_asgnmCnt].eduChasiOrd);
}
}else{
alert("강사 자동 배정 중에 오류가 발생 되었습니다.-in");
//linkPage(pageIndex);
}
},
error:function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
//배정 대상 데이터 가져오기
function fncGetAsgnmData(p_searchStartDt, p_searchEndDt, p_searchScholNm){ //개별 선택한 경우만 처리한다.
$.ajax({
type:"POST",
url:"${pageContext.request.contextPath}/kccadr/oprtn/tngrVisitEdu/popup/instrMassAsgnm20240112PopupAjax.do",
data: {
"searchStartDt" :p_searchStartDt,
"searchEndDt" :p_searchEndDt,
"searchScholNm" :p_searchScholNm,
//"strtOprtnDt" : varEduHopeDtStrt ,
//"endOprtnDt" : varEduHopeDtEnd ,
//"instrDiv" : "10" ,
},
dataType:'json',
success:function(returnData){
if(returnData.result=="success"){
//alert(returnData.vEEduAplctVOList.length);
//alert("상태가 변경 되었습니다.");
v_returnDatavEEduAplctVOList = returnData.vEEduAplctVOList;
$('#ingInfo').text("배정 대상 확인..."+v_asgnmCnt+'/'+v_returnDatavEEduAplctVOList.length);
$('#ingInfoBtn').html('<button type="button" class="btn_type06" onclick="fncInstrMassAsgnmEA20231115_Bef(); return false;">자동배정시작</button>');
//$('#ingInfoBtn').html('<button type="button" class="btn_type06" onclick="fncInstrMassAsgnmEA20231115(\''+v_returnDatavEEduAplctVOList[0].eduAplctOrd+'@'+v_returnDatavEEduAplctVOList[0].eduChasiOrd+'\'); return false;">자동배정시작</button>');
//"배정 대상 확인..."+v_asgnmCnt+'/'+v_returnDatavEEduAplctVOList.length);
//fncInstrMassAsgnmEA20231115(v_returnDatavEEduAplctVOList[0].eduAplctOrd+'@'+v_returnDatavEEduAplctVOList[0].eduChasiOrd);
}else{
alert("강사 자동 배정 중에 오류가 발생 되었습니다.");
//linkPage(pageIndex);
}
},
error:function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
var v_asgnmCnt = 0; //현재 처리 배열번호
var v_cnt = 0; //실제 처리된 수량
var v_returnDatavEEduAplctVOList; //처리할 전체 배열 정보
fncGetAsgnmData('${searchStartDt }','${searchEndDt }','${searchScholNm }');
</script>
</head>
<body>
<div class="area_popup supm_popup">
<div class="cont_popup">
<form:form id="createForm" name="createForm" method="post" commandName="vEInstrAsgnmVO" onsubmit="return false;">
<input type="hidden" name="eduAplctOrd" value="<c:out value="${vEEduAplctVO.eduAplctOrd}" />" />
<input type="hidden" name="eduChasiOrd" value="<c:out value="${vEEduAplctVO.eduChasiOrd}" />" />
<input type="hidden" name="instrDiv" id="instrDiv" value="<c:out value="${vEEduAplctVO.instrDiv}" />">
<input type="hidden" name="userId" id="userId" />
<input type="hidden" name="rmrks" id="rmrks" />
<input type="hidden" name="asgnmAprvlCd" value="${vEEduAplctVO.asgnmAprvlCd}"/>
<input type="hidden" name="yrMnt" id="yrMnt" />
<div class="area_popup">
<div class="cont_popup">
<div class="pop_tb_tit01">
<p>강사배정(전체)</p>
</div>
<!-- list_top -->
<div class="list_top">
<div class="list_top_1">
<div class="util_left" style="width: 300px;">
<p id="ingInfo">
배정 대상 확인 중...
</p>
</div>
<div class="util_right" id="ingInfoBtn">
</div>
</div>
</div>
<!--
<div class="btn_wrap_pop btn_layout01">
<div class="btn_left">
</div>
<div class="btn_center">
<button type="button" class="btn_type06" onclick="self.close();">저장</button>
<button type="button" class="btn_type04" onclick="self.close();">닫기</button>
</div>
<div class="btn_right">
</div>
</div>
-->
</div>
</div>
</form:form>
</div>
</div>
<!-- 강사 거리계산용 끝 -->
</body>
</html>