2023-07-18 16:27 사용자 화면 달력 예제
This commit is contained in:
parent
c0154540aa
commit
1201b60194
@ -23,6 +23,7 @@ import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
@ -36,6 +37,8 @@ import kcc.com.cmm.util.IpUtil;
|
||||
import kcc.com.cmm.web.EgovFileDownloadController;
|
||||
import kcc.com.utl.user.service.CheckFileUtil;
|
||||
import kcc.com.utl.user.service.CheckLoginUtil;
|
||||
import kcc.kccadr.sch.service.SchduleManageService;
|
||||
import kcc.kccadr.sch.service.SchduleManageVO;
|
||||
import kcc.let.uat.uia.service.SsoLoginVO;
|
||||
import kcc.let.utl.fcc.service.EgovCryptoUtil;
|
||||
import kcc.let.utl.fcc.service.EgovCryptoUtil4VO;
|
||||
@ -111,6 +114,10 @@ public class VEAdultEduEndController {
|
||||
@Resource(name="vEAsgnmNotiService")
|
||||
private VEAsgnmNotiService vEAsgnmNotiService;
|
||||
|
||||
//일정 정보
|
||||
@Resource(name = "schduleManageService")
|
||||
private SchduleManageService schduleManageService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovFileDownloadController.class);
|
||||
|
||||
/**
|
||||
@ -192,6 +199,76 @@ public class VEAdultEduEndController {
|
||||
return "/web/ve/instr/adultVisitEdu/endInfo/instrEduEndList";
|
||||
}
|
||||
|
||||
//청소년강사 강의 종료교육 목록
|
||||
@RequestMapping("/web/ve/instr/adultVisitEdu/endInfo/instrEduEndSchdl.do")
|
||||
public String instrEduEndSchdl(
|
||||
@ModelAttribute("vEInstrAsgnmVO") VEInstrAsgnmVO vEInstrAsgnmVO
|
||||
|
||||
, ModelMap model
|
||||
, RedirectAttributes redirectAttributes
|
||||
, HttpSession session
|
||||
, HttpServletRequest request
|
||||
) throws Exception {
|
||||
|
||||
//로그인 처리====================================
|
||||
//로그인 정보 가져오기
|
||||
|
||||
LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); //권한에 따른 로그인 정보 가져오기
|
||||
SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
|
||||
|
||||
if (loginVO == null || ssoLoginVO == null) {
|
||||
return checkLoginUtil.getUserLoginPage(model); //로그인 정보가 없으면 로그인 페이지로 이동한다.
|
||||
}
|
||||
model.addAttribute("ssoLoginVO", ssoLoginVO);
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
//로그인 처리====================================
|
||||
|
||||
|
||||
//3.pageing step1
|
||||
PaginationInfo paginationInfo = this.setPagingStep1(vEInstrAsgnmVO);
|
||||
|
||||
|
||||
//4. pageing step2
|
||||
vEInstrAsgnmVO = this.setPagingStep2(vEInstrAsgnmVO, paginationInfo);
|
||||
|
||||
vEInstrAsgnmVO.setUserId(loginVO.getUniqId());
|
||||
vEInstrAsgnmVO.setInstrDiv("20");
|
||||
vEInstrAsgnmVO.setAsgnmAprvlCd("30"); // 강사확정코드 => 요청대기 : 10, 수락요청 : 20, 교육확정 : 30, 수락거절 : 40, 추가신청 : 50
|
||||
|
||||
try {
|
||||
System.out.println("session.getAttribute(menuNo).toString()");
|
||||
System.out.println(session.getAttribute("menuNo").toString());
|
||||
vEInstrAsgnmVO.setMenuNo(session.getAttribute("menuNo").toString());
|
||||
}catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
vEInstrAsgnmVO.setMenuNo("9991300");
|
||||
}
|
||||
|
||||
List<VEInstrAsgnmVO> vEInstrAsgnmVOList = vEAsgnmMIXService.selectAsgnmPagingList(vEInstrAsgnmVO);
|
||||
|
||||
//6.pageing step3
|
||||
paginationInfo = this.setPagingStep3(vEInstrAsgnmVOList, paginationInfo);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
|
||||
//대상 리스트, 페이징 정보 전달
|
||||
model.addAttribute("vEInstrAsgnmVOList", vEInstrAsgnmVOList);
|
||||
|
||||
|
||||
return "/web/ve/instr/adultVisitEdu/endInfo/instrEduEndSchdl";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/ve/instr/adultVisitEdu/endInfo/adultSchduleManagerAjaxLoadData.do")
|
||||
@ResponseBody
|
||||
public List<SchduleManageVO> adultSchduleManagerAjaxLoadData(@ModelAttribute("schduleManageVO") SchduleManageVO schduleManageVO, ModelMap model) throws Exception {
|
||||
schduleManageVO.setAprvlCd("60");
|
||||
schduleManageVO.setLctrDivCd("10");
|
||||
|
||||
schduleManageVO.setSearchStartDt(schduleManageVO.getSearchStartDt().split("T")[0].replaceAll("-", ""));
|
||||
|
||||
return schduleManageService.selectSchManageStatusList(schduleManageVO);
|
||||
}
|
||||
|
||||
//청소년강사 강의 종료교육 상세
|
||||
@RequestMapping("/web/ve/instr/adultVisitEdu/endInfo/instrEduEndDetail.do")
|
||||
public String instrEduEndDetail(
|
||||
|
||||
@ -281,8 +281,5 @@ var ex_s_todate;// = info.startStr;
|
||||
</div>
|
||||
</div>
|
||||
<!-- //cont -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
@ -29,6 +29,12 @@
|
||||
listForm.action = "<c:url value='/web/ve/instr/adultVisitEdu/endInfo/instrEduEndList.do'/>";
|
||||
listForm.submit();
|
||||
}
|
||||
|
||||
function schdlPage(){
|
||||
var listForm = document.listForm ;
|
||||
listForm.action = "<c:url value='/web/ve/instr/adultVisitEdu/endInfo/instrEduEndSchdl.do'/>";
|
||||
listForm.submit();
|
||||
}
|
||||
|
||||
function goReqStatus(){
|
||||
$("#listForm").attr("action","${pageContext.request.contextPath}/web/ve/instr/adultVisitEdu/instrInfo/instrPrflReg.do").submit();
|
||||
@ -81,6 +87,7 @@
|
||||
<script src="${pageContext.request.contextPath}/visitEdu/usr/publish/script/duetdatepicker.js"></script>
|
||||
<button type="button" class="btnType01" onclick="linkPage(1)">검색</button>
|
||||
<button type="button" class="btnType02" onclick="fncReset(this);">초기화</button>
|
||||
<button type="button" class="btnType01" onclick="schdlPage()">교육일정달력</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -0,0 +1,280 @@
|
||||
<!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" %>
|
||||
<%
|
||||
/**
|
||||
* @Class Name : eduSchdlMngList.jsp
|
||||
* @Description : 관리자 일정관리
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2021.08.16 김봉호 최초 생성
|
||||
* @author 김봉호
|
||||
* @since 2021.08.16
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
%>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<style type="text/css">
|
||||
.fc-day-sat { color:#0000FF; } /* 토요일 */
|
||||
.fc-day-sun { color:#FF0000; } /* 일요일 */
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="<c:url value='/js/fullcalendar/5.9.0/main.css' />" />
|
||||
<script type="text/javascript" src="<c:url value='/js/fullcalendar/5.9.0/main.js'/>"></script>
|
||||
<script type="text/javascript" src="<c:url value='/js/fullcalendar/5.9.0/locales-all.js'/>"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
});
|
||||
|
||||
var ex_s_todate;// = info.startStr;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var calendarEl = document.getElementById('schduleManager');
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
locale: 'ko',
|
||||
timezone : "local",
|
||||
weekends : true,
|
||||
editable : false,
|
||||
firstDay : 0, //월요일이 먼저 오게 하려면 1
|
||||
dayMaxEvents: true,
|
||||
navLinks: true,
|
||||
customButtons: {
|
||||
myCustomButton: {
|
||||
text: '오늘',
|
||||
click: function(event, elm) {
|
||||
alert('clicked the custom button!');
|
||||
}
|
||||
},viewWeekends : {
|
||||
text : '주말',
|
||||
click : function (event, elm) {
|
||||
calendar.setOption("weekends" , calendar.getOption("weekends") ? false : true);
|
||||
}
|
||||
}
|
||||
},buttonText: {
|
||||
listMonth: '일정'
|
||||
},
|
||||
headerToolbar: {
|
||||
left: 'prevYear nextYear today',
|
||||
center: 'prev title next',
|
||||
right: 'dayGridMonth,listMonth'
|
||||
},
|
||||
eventSources: [
|
||||
{
|
||||
events: function(info, successCallback, failureCallback) {
|
||||
console.log(info);
|
||||
/*
|
||||
alert(info.start);
|
||||
alert(info.startStr);
|
||||
alert(JSON.stringify(info));
|
||||
alert(JSON.stringify(info.startStr));
|
||||
*/
|
||||
|
||||
var s_todate = info.startStr;
|
||||
ex_s_todate = info.startStr;
|
||||
|
||||
var searchDt = $("#searchCalendarCode").val();
|
||||
$.ajax({
|
||||
url: '<c:url value="/web/ve/instr/adultVisitEdu/endInfo/adultSchduleManagerAjaxLoadData.do"/>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
searchStartDt : "",
|
||||
searchStartDt : s_todate,
|
||||
todate : info.start,
|
||||
//todate : info.startStr,
|
||||
//todate : s_todate,
|
||||
//todate : "",
|
||||
searchYearMonth : function(){
|
||||
return "";
|
||||
}
|
||||
},
|
||||
success: function(data) {
|
||||
successCallback(data);
|
||||
|
||||
// 날짜 계산
|
||||
setCalDate(data, info.startStr);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
],
|
||||
eventContent: function(arg, createElement) {
|
||||
event.preventDefault();
|
||||
console.log(arg.event._def.url);
|
||||
arg.event._def.url = "#none";
|
||||
},
|
||||
eventClick: function(info) {
|
||||
info.jsEvent.preventDefault();
|
||||
schDetailPop(info.event._def.extendedProps.schSeq, info.event._def.extendedProps.schChasiSeq);
|
||||
return false;
|
||||
},
|
||||
});
|
||||
calendar.render();
|
||||
|
||||
|
||||
});
|
||||
|
||||
function schDetailPop(schSeq, schChasiSeq) {
|
||||
|
||||
window.open('', 'schDetailPop', "width=800, height=520, left=100, top=130","location = no","status= no","toolbars= no");
|
||||
document.listForm.eduAplctOrd.value = schSeq ;
|
||||
document.listForm.eduChasiOrd.value = schChasiSeq ;
|
||||
|
||||
document.listForm.method = "post";
|
||||
document.listForm.action = "${pageContext.request.contextPath}/kccadr/oprtn/tngrVisitEdu/popup/SchduleManagerPopDetail.do";
|
||||
document.listForm.target = "schDetailPop" ;
|
||||
document.listForm.submit();
|
||||
|
||||
}
|
||||
|
||||
function excelDownLoad(){
|
||||
var listForm = document.listForm ;
|
||||
listForm.searchStartDt.value = ex_s_todate ;
|
||||
listForm.action = "<c:url value='/kccadr/oprtn/tngrVisitEdu/tngrSchduleManagerExcelDownLoad.do'/>";
|
||||
listForm.submit();
|
||||
}
|
||||
|
||||
/*
|
||||
*##############################################################################
|
||||
* START
|
||||
*##############################################################################
|
||||
*/
|
||||
|
||||
// 날짜 계산
|
||||
function setCalDate(data, startStr) {
|
||||
// 현재월 구하기
|
||||
startStr = startStr.substr(0, 10);
|
||||
startStr = replaceAll(startStr, "-", "");
|
||||
startStr = replaceAll(startStr, ".", "");
|
||||
startStr = replaceAll(startStr, "/", "");
|
||||
|
||||
var todayYear = startStr.substring(0,4);
|
||||
var todayMonth = 0;
|
||||
var todayDay = startStr.substring(6,8);
|
||||
|
||||
if (todayDay == "01") {
|
||||
todayMonth = startStr.substring(4,6);
|
||||
}
|
||||
else {
|
||||
if (startStr.substring(4,6) == "12") {
|
||||
todayMonth = "01";
|
||||
}
|
||||
else {
|
||||
todayMonth = parseInt(startStr.substring(4,6), 10) + 1;
|
||||
if (todayMonth < 10) {
|
||||
todayMonth = "0" + todayMonth;
|
||||
}
|
||||
}
|
||||
}
|
||||
// End
|
||||
//alert(todayMonth);
|
||||
|
||||
var monthCnt = 0;
|
||||
var week1Cnt = 0, week2Cnt = 0, week3Cnt = 0, week4Cnt = 0, week5Cnt = 0, week6Cnt = 0;
|
||||
|
||||
var sHtml = "";
|
||||
for (var j = 0; j < data.length; j++) {
|
||||
var schStartDate = data[j].start.substr(0, 10);
|
||||
schStartDate = replaceAll(schStartDate, "-", "");
|
||||
schStartDate = replaceAll(schStartDate, ".", "");
|
||||
schStartDate = replaceAll(schStartDate, "/", "");
|
||||
|
||||
var thisYear = schStartDate.substring(0,4);
|
||||
var thisMonth = schStartDate.substring(4,6);
|
||||
var thisDay = schStartDate.substring(6,8);
|
||||
var thisWeek = getSecofWeek(schStartDate);
|
||||
|
||||
// 해당월 데이터만 처리
|
||||
if (todayMonth == thisMonth) {
|
||||
monthCnt++;
|
||||
|
||||
if (thisWeek == 1) {
|
||||
week1Cnt++;
|
||||
}
|
||||
else if (thisWeek == 2) {
|
||||
week2Cnt++;
|
||||
}
|
||||
else if (thisWeek == 3) {
|
||||
week3Cnt++;
|
||||
}
|
||||
else if (thisWeek == 4) {
|
||||
week4Cnt++;
|
||||
}
|
||||
else if (thisWeek == 5) {
|
||||
week5Cnt++;
|
||||
}
|
||||
else if (thisWeek == 6) {
|
||||
week6Cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sHtml += "전체 : " + monthCnt + "건";
|
||||
sHtml += " (1주차 : " + week1Cnt + "건";
|
||||
sHtml += ", 2주차 : " + week2Cnt + "건";
|
||||
sHtml += ", 3주차 : " + week3Cnt + "건";
|
||||
sHtml += ", 4주차 : " + week4Cnt + "건";
|
||||
sHtml += ", 5주차 : " + week5Cnt + "건";
|
||||
sHtml += ", 6주차 : " + week6Cnt + "건)";
|
||||
|
||||
sHtml += ' <button type="button" class="btn_down_excel" onclick="excelDownLoad();">일정현황 엑셀 다운로드</button>';
|
||||
|
||||
|
||||
//$("#weekCnt").html(sHtml);
|
||||
}
|
||||
|
||||
// 해당일 주차 계산
|
||||
function getSecofWeek(date) {
|
||||
var d = new Date( date.substring(0,4), parseInt(date.substring(4,6))-1, date.substring(6,8) );
|
||||
var fd = new Date( date.substring(0,4), parseInt(date.substring(4,6))-1, 1 );
|
||||
|
||||
return Math.ceil((parseInt(date.substring(6,8))+fd.getDay())/7);
|
||||
}
|
||||
|
||||
// ReplaceAll
|
||||
function replaceAll(str, searchStr, replaceStr) {
|
||||
return str.split(searchStr).join(replaceStr);
|
||||
}
|
||||
|
||||
</script>
|
||||
<title>일정현황</title>
|
||||
</head>
|
||||
<body>
|
||||
<form:form id="listForm" name="listForm" method="post">
|
||||
<input type="hidden" name="eduAplctOrd" value="" />
|
||||
<input type="hidden" name="eduChasiOrd" value="" />
|
||||
<input type="hidden" name="searchStartDt" value="" />
|
||||
|
||||
</form:form>
|
||||
<div class="cont_wrap">
|
||||
<div class="cont_tit">
|
||||
<h2>성인 강의 종료교육 목록</h2>
|
||||
<div class="sns_go">
|
||||
<button type="button" title="새창열림"><img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/content/facebook_icon.png" alt="페이스북 바로가기"></button>
|
||||
<button type="button" title="새창열림"><img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/content/twitter_icon.png" alt="트위터 바로가기"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
|
||||
<br />
|
||||
<div style="float: right; padding-right: 40px; color: #777777;" id="weekCnt"></div>
|
||||
|
||||
<div class="cont">
|
||||
<div id="schduleManager"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //cont -->
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user