2024-01-22 17:23 강사거리계산수정

This commit is contained in:
myname 2024-01-22 17:23:46 +09:00
parent 0b8958afec
commit 6b0b4bf3ee
11 changed files with 350 additions and 32 deletions

View File

@ -114,6 +114,9 @@ public interface VEAsgnmMIXService {
//거리계산 대상 - step3
List<VEInstrAsgnmVO> selectInstrDstncStep3(VEEduAplctVO vEEduAplctVO) throws Exception;
//거리계산 대상 - step-no chasi
List<VEInstrAsgnmVO> selectInstrDstncStepNoChasi(VEEduAplctVO vEEduAplctVO) throws Exception;
//동일 일자에 강사 배정 여부 체크
List<VEInstrAsgnmVO> selectInstrAsgnmScholCheck(VEInstrAsgnmVO paramVO) throws Exception;

View File

@ -204,6 +204,11 @@ public class VEAsgnmMIXDAO extends EgovAbstractDAO {
List<VEInstrAsgnmVO> tlist = (List<VEInstrAsgnmVO>) list("VEAsgnmMIXDAO.selectInstrDstncStep3", paramVO);
return tlist;
}
public List<VEInstrAsgnmVO> selectInstrDstncStepNoChasi(VEEduAplctVO paramVO) throws Exception {
List<VEInstrAsgnmVO> tlist = (List<VEInstrAsgnmVO>) list("VEAsgnmMIXDAO.selectInstrDstncStepNoChasi", paramVO);
return tlist;
}
public List<VEInstrAsgnmVO> selectInstrAsgnmScholCheck(VEInstrAsgnmVO paramVO) throws Exception {
List<VEInstrAsgnmVO> tlist = (List<VEInstrAsgnmVO>) list("VEAsgnmMIXDAO.selectInstrAsgnmScholCheck", paramVO);

View File

@ -186,6 +186,10 @@ public class VEAsgnmMIXServiceImpl implements VEAsgnmMIXService {
return vEAsgnmMIXDAO.selectInstrDstncStep3(paramVO);
}
public List<VEInstrAsgnmVO> selectInstrDstncStepNoChasi(VEEduAplctVO paramVO) throws Exception{
return vEAsgnmMIXDAO.selectInstrDstncStepNoChasi(paramVO);
}
public List<VEInstrAsgnmVO> selectInstrAsgnmScholCheck(VEInstrAsgnmVO paramVO) throws Exception{
return vEAsgnmMIXDAO.selectInstrAsgnmScholCheck(paramVO);
}

View File

@ -240,7 +240,7 @@ public class EduAsgnmCnfrmMngTngrController {
System.out.println("vEInstrAsgnmVOList.get(i).getOnewayDstnc()");
System.out.println(vEInstrAsgnmVOList.get(i).getOnewayDstnc());
System.out.println(vEInstrAsgnmVOList.get(i).getOnewayDstnc());
if ("".equals(vEInstrAsgnmVOList.get(i).getOnewayDstnc())) {
if ("".equals(vEInstrAsgnmVOList.get(i).getOnewayDstnc()) || vEInstrAsgnmVOList.get(i).getOnewayDstnc()==null) {
i_disnc_n++;
}else {
i_disnc_y++;

View File

@ -469,6 +469,57 @@ public class EduCnfrmMngTngrController {
return "oprtn/tngrVisitEdu/popup/instrAsgnmDstncPopupCount";
}
/**
* 강사거리계산 팝업 - 배정전에
*/
@RequestMapping("popup/instrAsgnmDstncPopupCountNoChasi.do")
public String instrAsgnmDstncPopupCountNoChasi(
@ModelAttribute("vEInstrDetailVO") VEInstrDetailVO vEInstrDetailVO
,@ModelAttribute("vEEduAplctVO") VEEduAplctVO vEEduAplctVO
,@ModelAttribute("vEInstrAsgnmVO") VEInstrAsgnmVO vEInstrAsgnmVO
, ModelMap model
, HttpServletRequest request
, HttpSession session
) throws Exception {
LoginVO user = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
String[] s_param = vEEduAplctVO.getEduAplctOrd().split("@");
vEEduAplctVO.setEduAplctOrd(s_param[0]);
vEEduAplctVO.setUserId(s_param[1]);
System.out.println(s_param[0]);
System.out.println(s_param[1]);
// 확정
vEEduAplctVO.setSearchStatusArr(new String[]{"60"});
// 청소년
vEEduAplctVO.setLctrDivCd(VeConstants.LCTR_DIV_CD_10);
//1.pageing step1
PaginationInfo paginationInfo = this.setPagingStep1(vEEduAplctVO);
//2. pageing step2
vEEduAplctVO = this.setPagingStep2(vEEduAplctVO, paginationInfo);
vEEduAplctVO.setNotiUserId(user.getUniqId());
vEEduAplctVO.setMenuNo(session.getAttribute("menuNo").toString());
List<VEInstrAsgnmVO> vEInstrAsgnmVOList = vEAsgnmMIXService.selectInstrDstncStepNoChasi(vEEduAplctVO);
//이름 복호화
vEInstrAsgnmVOList = egovCryptoUtil.decryptVEInstrAsgnmVOList(vEInstrAsgnmVOList);
//3.pageing step3
paginationInfo = this.setPagingAsgnmStep3(vEInstrAsgnmVOList, paginationInfo);
//model.addAttribute("paginationInfo", paginationInfo);
//대상 리스트, 페이징 정보 전달
model.addAttribute("list", vEInstrAsgnmVOList);
model.addAttribute("resultMap", vEInstrAsgnmVOList.get(0));
return "oprtn/tngrVisitEdu/popup/instrAsgnmDstncPopupCount";
}
/**
* 강사배정관리 상세 화면
*/

View File

@ -250,6 +250,10 @@
오프라인 청소년 - VEAsgnmMIX2023DAO.selectInstrAsgnmOffPagingList_202310
*/
/* 차시 신청 정보 와 신청 학교 주소 정보 + 학교 소재지명 + 신청 가능한 강사 리스트( 주소, 설정 정보 and 패널티) */
SELECT aaaa.*
, ffff.oneway_dstnc AS onewayDstnc
FROM (
SELECT COUNT(1) OVER() AS totCnt ,
aaa.edu_aplct_ord AS eduAplctOrd,
aaa.edu_chasi_ord AS eduChasiOrd,
@ -427,7 +431,12 @@
<isNotEmpty property="searchKeyword">
AND bbb.instr_nm = #searchKeyword#
</isNotEmpty>
)aaaa
LEFT OUTER JOIN ve_edu_instr_dstnc ffff
on(
aaaa.eduaplctord=ffff.edu_aplct_ord
AND aaaa.userid=ffff.user_id
)
</select>

View File

@ -4682,13 +4682,14 @@
<isEmpty property="searchStartDt">
<isEmpty property="searchEndDt">
AND 1=2
AND 1=1
</isEmpty>
</isEmpty>
ORDER BY 1 ,
ORDER BY e.oneway_dstnc desc,
1 ,
A.EDU_APLCT_ORD DESC
</select>
@ -4784,7 +4785,7 @@
/* VEAsgnmMIXDAO.selectInstrDstncStep3 */
SELECT b.new_addr AS sAddr
, d.addr AS iAddr
, ifnull(e.oneway_dstnc,'') AS onewayDstnc
, NVL(e.oneway_dstnc,'') AS onewayDstnc
, a.schol_instt_nm AS scholInsttNm
, a.edu_aplct_ord AS eduAplctOrd
, c.edu_chasi_ord AS eduChasiOrd
@ -4802,7 +4803,7 @@
WHERE 1 =1
AND a.stndrd_schol_cd=b.stndrd_schol_cd
AND IFNULL(A.USE_YN, 'Y') != 'N'
AND NVL(A.USE_YN, 'Y') != 'N'
AND A.SBMT_YN = 'Y'
AND A.LCTR_DIV_CD = '10'
AND A.APRVL_CD IN ( '60')
@ -4850,8 +4851,8 @@
<isEmpty property="searchCondition">
<isNotEmpty property="searchKeyword">
AND (
A.SCHOL_INSTT_NM LIKE CONCAT('%' , #searchKeyword# , '%') OR
A.INSTT_NM LIKE CONCAT('%' , #searchKeyword# , '%')
A.SCHOL_INSTT_NM LIKE '%'||#searchKeyword#||'%' OR
A.INSTT_NM LIKE '%'||#searchKeyword#||'%'
)
</isNotEmpty>
</isEmpty>
@ -4864,11 +4865,79 @@
AND TO_CHAR(A.APRVL_PNTTM, 'YYYYMMDD') <![CDATA[ <= ]]> REPLACE(#searchEndAprvlPnttm#, '.' , '')
</isNotEmpty>
ORDER BY 1=1 ,
ORDER BY 1 ,
A.EDU_APLCT_ORD DESC
</select>
<!-- 강사대량 거리 계산을 위한 대상 step1-->
<select id="VEAsgnmMIXDAO.selectInstrDstncStepNoChasi" parameterClass="VEEduAplctVO" resultClass="VEInstrAsgnmVO">
/* VEAsgnmMIXDAO.selectInstrDstncStepNoChasi */
SELECT b.new_addr AS sAddr
, d.addr AS iAddr
, a.schol_instt_nm AS scholInsttNm
, a.edu_aplct_ord AS eduAplctOrd
, d.instr_nm AS instrNm
, d.user_id AS userId
FROM VE_EDU_APLCT A
, ve_schol b
, ve_instr_detail d
WHERE 1 =1
AND a.stndrd_schol_cd=b.stndrd_schol_cd
AND NVL(A.USE_YN, 'Y') != 'N'
AND A.SBMT_YN = 'Y'
AND A.LCTR_DIV_CD = '10'
AND A.APRVL_CD IN ( '60')
AND a.edu_aplct_ord=#eduAplctOrd#
AND d.user_id=#userId#
AND d.instr_div='10'
AND d.use_yn='Y'
<isNotEmpty property="searchScholDivCd">
AND A.SCHOL_DIV_CD = #searchScholDivCd#
</isNotEmpty>
<isNotEmpty property="searchEduSlctAreaCd">
AND (
(
A.EDU_SLCT_AREA_CD = #searchEduSlctAreaCd#
AND
A.EDU_SLCT_CD = '20'
)
OR
(
'400' = #searchEduSlctAreaCd#
AND
A.EDU_SLCT_CD = '10'
)
)
</isNotEmpty>
<isEmpty property="searchCondition">
<isNotEmpty property="searchKeyword">
AND (
A.SCHOL_INSTT_NM LIKE '%'||#searchKeyword#||'%' OR
A.INSTT_NM LIKE '%'||#searchKeyword#||'%'
)
</isNotEmpty>
</isEmpty>
<isNotEmpty property="searchStratAprvlPnttm">
AND TO_CHAR(A.APRVL_PNTTM, 'YYYYMMDD') <![CDATA[ >= ]]> REPLACE(#searchStratAprvlPnttm#, '.' , '')
</isNotEmpty>
<isNotEmpty property="searchEndAprvlPnttm">
AND TO_CHAR(A.APRVL_PNTTM, 'YYYYMMDD') <![CDATA[ <= ]]> REPLACE(#searchEndAprvlPnttm#, '.' , '')
</isNotEmpty>
ORDER BY 1 ,
A.EDU_APLCT_ORD DESC
</select>
<select id="VEAsgnmMIXDAO.selectFndtnVisitAsgnmPagingList" parameterClass="VEPrcsDetailVO" resultClass="VEPrcsDetailVO">
/* VEAsgnmMIXDAO.selectFndtnVisitAsgnmPagingList */

View File

@ -256,7 +256,67 @@
function reloadPage(){
location.reload();
}
//계산하기
var cnt_ttl=0;
var cnt_n=0;
function fncInstrMassAsgnm30(){
//step1.전체 대상 수량 카운트
//step2.첫번째, 전체 수량 넘기면서 호출, sAddr, iAddr, edu_aplct_ord, edu_chasi_ord, cnt_n, cnt_ttl
//step3.다음 수량 호출
cnt_ttl = $('input:checkbox[name="chk"]:checked').length;
cnt_n = cnt_n + 1;
//alert($('input:checkbox[name="chk"]:checked').eq(0).val());
if (cnt_ttl<=0){
alert("선택된 항목이 없습니다.");
return;
}
fncInstrDstncInfo(
$('input:checkbox[name="chk"]:checked').eq(0).val(),
cnt_ttl,
cnt_n
);
}
function fncInstrDstncInfo_outer(p_ttl, p_n) {
//alert(p_ttl);
//alert(p_n);
fncInstrDstncInfo(
$('input:checkbox[name="chk"]:checked').eq(p_n).val(),
p_ttl,
p_n*1+1
);
}
// 강사 거리계산
function fncInstrDstncInfo(p_varEduAplctOrd, p_ttl, p_n) {
var form = document.create2Form ;
form.eduAplctOrd.value=p_varEduAplctOrd;
form.phone1.value=p_ttl;
form.phone2.value=p_n;
form.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/popup/instrAsgnmDstncPopupCount.do'/>";
window.open("#", "_dstncCountPop", "scrollbars = no, top=200px, left=200px, height=450px, width=600px");
form.target = "_dstncCountPop";
form.submit();
}
//체크박스 전체 선택
function chkAll(thisObj){
$("input[name=chk]").prop("checked" , $(thisObj).is(":checked"));
}
</script>
</head>
@ -294,7 +354,12 @@
<input type="hidden" name="frstRegisterId" id="frstRegisterId" />
<input type="hidden" name="instrDetailOrd" id="instrDetailOrd" /> <!-- 강사구분 -->
</form:form>
<form:form id="create2Form" name="create2Form" method="post" commandName="vEInstrAsgnmVO" onsubmit="return false;">
<input type="hidden" name="eduAplctOrd" value="" />
<input type="hidden" name="phone1" value="" />
<input type="hidden" name="phone2" value="" />
</form:form>
<form id="createForm" name="createForm" method="post">
<input type="hidden" name="frstRegisterId" value="" />
<input type="hidden" name="instrDiv" value="<c:out value="${info.lctrDivCd}" />" />
@ -508,8 +573,8 @@
<!-- 교육차시 정보 list -->
<div class="tb_tit01">
<p>교육차시 정보</p>(*이동거리는 교육장소부터 강사주소까지의 거리를 TMAP API를 이용하여 계산하였습니다.)
</div>
<div class="tb_type01 list2">
</div>
<div class="tb_type01 list2" style="margin-bottom:10px;">
<table>
<colgroup>
<col style="width: 5%;">
@ -524,7 +589,9 @@
</colgroup>
<thead>
<tr>
<th scope="col">no</th>
<th scope="col">no
<input type="checkbox" name="checkAll" id="checkAll" onclick="chkAll(this);" /><label for="checkAll"></label>
</th>
<th scope="col">교육희망일</th>
<th scope="col">시간</th>
<th scope="col">구분</th>
@ -544,7 +611,18 @@
<c:set var="qustnrRespondIdYn" value="Y" />
</c:if>
<tr>
<td><c:out value="${status.count}" /></td>
<td><c:out value="${status.count}" />
<c:choose>
<c:when test="${list.instrNm ne null}">
<input name="chk" class="${list.asgnmAprvlCd}"
value="${list.eduAplctOrd}@${list.eduChasiOrd}"
title="Check" type="checkbox"/>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</td>
<td>
<c:choose>
<c:when test="${not empty list.eduHopeDt}">
@ -625,13 +703,13 @@
</table>
</div>
<div class="btn_wrap btn_layout01">
<div class="btn_wrap btn_layout01" style="margin-top:10px;">
<div class="btn_left"></div>
<div class="btn_center"></div>
<div class="btn_right">
<button type="button" class="btn_type03" onclick="reloadPage();" id="btnDstnc" style="display:none;">이동거리확인</button>
<button type="button" class="btn_type04" onclick="fncInstrMassAsgnm30();">이동거리 계산하기</button>
</div>
</div>
</div>
<!-- //교육차시 정보 상세 -->
@ -991,6 +1069,7 @@
<script type="text/javascript">
//강사 주소지 변환 호출
/*
tmapAPIgetLat(
"<c:out value='${list.iAddr}'/>"
, "<c:out value='${list.userId}_i1'/>"
@ -1007,7 +1086,10 @@
, "<c:out value='${list.iAddr}'/>"
); //강사 주소지
*/
/*
//학교 주소지 변환 호출
tmapAPIgetLat(
"<c:out value='${list.sAddr}'/>"
@ -1023,7 +1105,7 @@
, "<c:out value='${list.sAddr}'/>"
, "<c:out value='${list.iAddr}'/>"
); //학교 주소지
*/
</script>

View File

@ -254,13 +254,16 @@
<tr>
<td>
<c:choose>
<c:when test="${list.onewayDstnc eq '' }">
<c:when test="${list.onewayDstnc eq '' or empty list.onewayDstnc}">
<input name="chk" class="${list.asgnmAprvlCd}"
value="${list.eduAplctOrd}@${list.eduChasiOrd}"
title="Check" type="checkbox"/>
</c:when>
<c:otherwise>
계산완료
계산완료
<input name="chk" class="${list.asgnmAprvlCd}"
value="${list.eduAplctOrd}@${list.eduChasiOrd}"
title="Check" type="checkbox"/>
</c:otherwise>
</c:choose>

View File

@ -26,9 +26,9 @@
<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>
@ -83,7 +83,7 @@
if ('${vEEduAplctVO.phone1}'=='${vEEduAplctVO.phone2}'){
alert("완료되었습니다.");
opener.reloadPage();
window.close();
//window.close();
}else{
opener.fncInstrDstncInfo_outer('${vEEduAplctVO.phone1}','${vEEduAplctVO.phone2}');
@ -498,7 +498,12 @@
//체크 수량 증가
i_chk_cnt = i_chk_cnt + 1;
console.log('response-start');
console.log(response);
console.log('response------');
console.log(resultData);
console.log('response-end');
var tDistance = (resultData[0].properties.totalDistance / 1000).toFixed(1);

View File

@ -147,15 +147,79 @@
function reloadPage(){
location.reload();
}
//체크박스 전체 선택
function chkAll(thisObj){
$("input[name=chk]").prop("checked" , $(thisObj).is(":checked"));
}
//계산하기
var cnt_ttl=0;
var cnt_n=0;
function fncInstrMassAsgnm30(){
//step1.전체 대상 수량 카운트
//step2.첫번째, 전체 수량 넘기면서 호출, sAddr, iAddr, edu_aplct_ord, edu_chasi_ord, cnt_n, cnt_ttl
//step3.다음 수량 호출
cnt_ttl = $('input:checkbox[name="chk"]:checked').length;
cnt_n = cnt_n + 1;
//alert($('input:checkbox[name="chk"]:checked').eq(0).val());
if (cnt_ttl<=0){
alert("선택된 항목이 없습니다.");
return;
}
fncInstrDstncInfo(
$('input:checkbox[name="chk"]:checked').eq(0).val(),
cnt_ttl,
cnt_n
);
}
function fncInstrDstncInfo_outer(p_ttl, p_n) {
//alert(p_ttl);
//alert(p_n);
fncInstrDstncInfo(
$('input:checkbox[name="chk"]:checked').eq(p_n).val(),
p_ttl,
p_n*1+1
);
}
// 강사 거리계산
function fncInstrDstncInfo(p_varEduAplctOrd, p_ttl, p_n) {
var form = document.create2Form ;
form.eduAplctOrd.value=p_varEduAplctOrd;
form.phone1.value=p_ttl;
form.phone2.value=p_n;
form.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/popup/instrAsgnmDstncPopupCountNoChasi.do'/>";
window.open("#", "_dstncCountPop", "scrollbars = no, top=200px, left=200px, height=450px, width=600px");
form.target = "_dstncCountPop";
form.submit();
}
</script>
</head>
<body>
<div class="area_popup supm_popup">
<div class="cont_popup">
<form:form id="create2Form" name="create2Form" method="post" commandName="vEInstrAsgnmVO" onsubmit="return false;">
<input type="hidden" name="eduAplctOrd" value="" />
<input type="hidden" name="phone1" value="" />
<input type="hidden" name="phone2" value="" />
</form:form>
<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}" />" />
@ -194,9 +258,10 @@
<div class="btn_left"></div>
<div class="btn_center"></div>
<div class="btn_right">
<button type="button" class="btn_type03" onclick="reloadPage();" id="btnDstnc" style="display:none;">이동거리확인</button>
<button type="button" class="btn_type03" onclick="fncInstrMassAsgnm30();" id="btnDstnc" style="display:;">이동거리 계산하기</button>
</div>
</div>
<div class="pop_tb_tit01">
<p>강사 목록</p>
@ -205,8 +270,9 @@
<div class="pop_tb_type01">
<table>
<colgroup>
<col style="width: 5%;">
<col style="width: 15%">
<col style="width: 3%;">
<col style="width: 8%;">
<col style="width: 18%">
<col style="width: auto;">
<%-- <col style="width: 9%;"> --%>
@ -217,9 +283,12 @@
<col style="width: 8%;">
<col style="width: 9%;">
<col style="width: 7%;">
<col style="width: 7%;">
</colgroup>
<thead>
<tr>
<th><input type="checkbox" name="checkAll" id="checkAll" onclick="chkAll(this);" /><label for="checkAll"></label></th>
<th scope="col">이름</th>
<th scope="col">거주<br>지역</th>
<th scope="col">강의희망지역</th>
@ -253,7 +322,18 @@
</c:if>
</c:if>
<tr>
<tr>
<td>
<c:choose>
<c:when test="${list.onewayDstnc eq '' or empty list.onewayDstnc}">
<input name="chk" class="${list.asgnmAprvlCd}"
value="${list.eduAplctOrd}@${list.userId}"
title="Check" type="checkbox"/>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</td>
<td><c:out value='${list.instrNm}'/>
<br/>(${fn:split(list.userId,'_')[1]*1})
</td>
@ -302,12 +382,15 @@
</div>
<div class="pop_tb_tit01">
<br/>*배정우선순위
<br/>*배정우선순위
<!--
<br/>1.거리기준(①거주지 우선 ②거주지내 가까운 희망지역 기준)
<br/>2.본강의 시간 균등 분배(강사별 강의가능일수 기준 적용)
<br/>3.연강기준 적용
<br/>4.패널티 후순위 기준 배치
-->
</div>
<!-- page -->
@ -604,8 +687,9 @@
<input type="hidden" id="${list.userId}_s2" name="${list.userId}_s2" value=""/>
<script type="text/javascript">
//강사 주소지 변환 호출
//강사 주소지 변환 호출
/*
tmapAPIgetLat(
"<c:out value='${list.iAddr}'/>"
, "<c:out value='${list.userId}_i1'/>"
@ -622,7 +706,9 @@
, "<c:out value='${list.iAddr}'/>"
); //강사 주소지
*/
/*
//학교 주소지 변환 호출
tmapAPIgetLat(
"<c:out value='${list.sAddr}'/>"
@ -638,6 +724,7 @@
, "<c:out value='${list.sAddr}'/>"
, "<c:out value='${list.iAddr}'/>"
); //학교 주소지
*/
</script>