메인페이지 작업 중
This commit is contained in:
parent
a118951837
commit
068e39122b
@ -1,5 +1,8 @@
|
||||
package kcc.let.utl.sim.service;
|
||||
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
//import kcc.com.cmm.service.EgovProperties;
|
||||
@ -35,29 +38,44 @@ public class EgovClntInfo {
|
||||
return ipAddr;
|
||||
}*/
|
||||
public static String getClntIP(HttpServletRequest request) throws Exception {
|
||||
|
||||
// IP주소
|
||||
//String ipAddr = request.getRemoteAddr();
|
||||
|
||||
String ip = request.getHeader("X-Forwarded-For");
|
||||
|
||||
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
String ip = request.getHeader("X-Forwarded-For");
|
||||
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("HTTP_CLIENT_IP");
|
||||
}
|
||||
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getRemoteAddr();
|
||||
}
|
||||
|
||||
return ip;
|
||||
|
||||
// 여러 IP가 있을 경우 첫 번째 IP 사용
|
||||
if (ip != null && ip.contains(",")) {
|
||||
ip = ip.split(",")[0].trim();
|
||||
}
|
||||
|
||||
// IPv6 → IPv4 변환
|
||||
try {
|
||||
InetAddress inetAddress = InetAddress.getByName(ip);
|
||||
if (inetAddress instanceof Inet6Address) {
|
||||
if (ip.startsWith("::ffff:")) { // IPv4-mapped IPv6
|
||||
ip = ip.substring(7);
|
||||
} else {
|
||||
// 실제 IPv6이면 그대로 두거나 원하는 경우 공백 반환
|
||||
// ip = ""; // IPv6은 제외하고 싶을 때
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 무시 (유효하지 않은 IP일 수 있음)
|
||||
}
|
||||
|
||||
return ip;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import kcc.ve.instr.tngrVisitEdu.instrInfo.service.VEInstrDetailVO;
|
||||
import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.impl.VEPrcsAplctPrdDAO;
|
||||
|
||||
public interface VEPrcsAplctPrdService {
|
||||
|
||||
@ -97,4 +98,6 @@ public interface VEPrcsAplctPrdService {
|
||||
List<VEPrcsDetailVO> findByAprvlQustnrAllList(VEPrcsDetailVO vEPrcsDetailVO);
|
||||
|
||||
public VEPrcsDetailVO selectCompleteDocDetail(VEPrcsDetailVO vEPrcsDetailVO);
|
||||
|
||||
public List<VEPrcsDetailVO> selectMainContent() throws Exception ;
|
||||
}
|
||||
|
||||
@ -178,4 +178,9 @@ public class VEPrcsAplctPrdDAO extends EgovAbstractDAO {
|
||||
return (VEPrcsDetailVO) select("VEPrcsAplctPrdDAO.selectCompleteDocDetail", vEPrcsDetailVO);
|
||||
}
|
||||
|
||||
public List<VEPrcsDetailVO> selectMainContent() throws Exception {
|
||||
List<VEPrcsDetailVO> tlist = (List<VEPrcsDetailVO>) list("VEPrcsAplctPrdDAO.selectMainContent");
|
||||
return tlist;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -414,5 +414,10 @@ public class VEPrcsAplctPrdServiceImpl implements VEPrcsAplctPrdService {
|
||||
return vEPrcsAplctPrdDAO.selectCompleteDocDetail(vEPrcsDetailVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VEPrcsDetailVO> selectMainContent() throws Exception {
|
||||
return vEPrcsAplctPrdDAO.selectMainContent();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -98,6 +98,8 @@ import kcc.let.uat.uia.service.SsoLoginVO;
|
||||
import kcc.let.uss.notify.service.NotifyManageService;
|
||||
import kcc.ve.instr.tngrVisitEdu.instrInfo.service.VEInstrDetailVO;
|
||||
import kcc.ve.instr.tngrVisitEdu.instrInfo.service.VEInstrService;
|
||||
import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsAplctPrdService;
|
||||
import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsDetailVO;
|
||||
|
||||
|
||||
|
||||
@ -191,6 +193,9 @@ public class MainController {
|
||||
@Resource(name="vEInstrService")
|
||||
private VEInstrService vEInstrService;
|
||||
|
||||
@Resource(name = "vEPrcsAplctPrdService")
|
||||
private VEPrcsAplctPrdService vEPrcsAplctPrdService;
|
||||
|
||||
@Value("#{globalSettings['Globals.email.host']}")
|
||||
private String Globals_email_host;
|
||||
@Value("#{globalSettings['Globals.email.port']}")
|
||||
@ -387,12 +392,6 @@ public class MainController {
|
||||
public String siteMainPage(HttpServletRequest request, ModelMap model, HttpSession session) throws Exception{
|
||||
//메인이미지
|
||||
try {
|
||||
String referer = (String)request.getHeader("REFERER");
|
||||
|
||||
// LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
// String userAuthority = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority());
|
||||
// model.addAttribute("userAuthority", userAuthority); //권한 - 강사일 시 메인의 청소년, 성인, 체험교실, 콘텐츠 메뉴 링크이동 막기 위해 추가
|
||||
|
||||
/** 메인존 */
|
||||
model.addAttribute("mainzoneList", mainZone()); //PC
|
||||
|
||||
@ -412,6 +411,9 @@ public class MainController {
|
||||
model.addAttribute("atchBbsList", atchBbsList.get("atchBbsList"));
|
||||
model.addAttribute("atchBbsUrl", atchBbsList.get("atchBbsUrl"));
|
||||
|
||||
/** 주요 교육일정 */
|
||||
List<VEPrcsDetailVO> eduAplctList = eduAplctList();
|
||||
|
||||
}catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
System.out.println(ex.getMessage());
|
||||
@ -2099,5 +2101,38 @@ public class MainController {
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
private List<VEPrcsDetailVO> eduAplctList() throws Exception{
|
||||
|
||||
VEPrcsDetailVO vEPrcsDetailVO = new VEPrcsDetailVO();
|
||||
|
||||
//1.pageing step1
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(1);
|
||||
paginationInfo.setRecordCountPerPage(12);
|
||||
paginationInfo.setPageSize(12);
|
||||
//로그인 처리====================================
|
||||
|
||||
//1.pageing step1
|
||||
|
||||
//임시로 페이징 처리를 안하기 위해서 RecordCountPerPage 수를 10000 으로 셋팅함
|
||||
//paginationInfo.setRecordCountPerPage(10000);
|
||||
|
||||
//2. pageing step2
|
||||
vEPrcsDetailVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
vEPrcsDetailVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
vEPrcsDetailVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
vEPrcsDetailVO.setSearchSortCnd("prcs_ord");
|
||||
vEPrcsDetailVO.setSearchSortOrd("desc");
|
||||
|
||||
//기반강화 조회
|
||||
// vEPrcsDetailVO.setLctrDivCd(p_lctr_div_cd);
|
||||
|
||||
vEPrcsDetailVO.setUseYn("Y"); //공개 여부만 조회
|
||||
|
||||
List<VEPrcsDetailVO> vEPrcsDetailVOList = vEPrcsAplctPrdService.selectMainContent();
|
||||
|
||||
return vEPrcsDetailVOList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1963,5 +1963,159 @@
|
||||
a.prcs_aplct_prd_ord = #prcsAplctPrdOrd#
|
||||
</select>
|
||||
|
||||
<select id="selectMainContent" resultClass="VEPrcsDetailVO">
|
||||
/* VEPrcsAplctPrdDAO.selectPagingList4Fndth */
|
||||
SELECT
|
||||
COUNT(1) OVER () AS totCnt
|
||||
, a.prcs_aplct_prd_ord AS prcsAplctPrdOrd
|
||||
, a.lctr_div_cd AS lctrDivCd
|
||||
, a.strt_pnttm AS strtPnttm
|
||||
, a.end_pnttm AS endPnttm
|
||||
, a.use_yn AS useYn
|
||||
, TO_CHAR(a.frst_regist_pnttm, 'YYYY-MM-DD') AS frstRegistPnttm
|
||||
, a.frst_register_id AS frstRegisterId
|
||||
, TO_CHAR(a.last_updt_pnttm, 'YYYY-MM-DD') AS lastUpdtPnttm
|
||||
, a.last_updusr_id AS lastUpdusrId
|
||||
, a.anncm_cn AS anncmCn
|
||||
, a.popup_cn AS popupCn
|
||||
, a.atch_file_id AS atchFileId
|
||||
, a.title AS title
|
||||
, a.dead_line_dt AS deadLineDt
|
||||
, a.prcs_ord AS prcsOrd
|
||||
, a.edu_part_cd AS eduPartCd
|
||||
, a.nos AS nos
|
||||
, a.ddln_cd AS ddlnCd
|
||||
, a.edu_strt_pnttm AS eduStrtPnttm
|
||||
, a.edu_ddln_pnttm AS eduDdlnPnttm
|
||||
, a.dprtm_nm AS dprtmNm
|
||||
, a.cn_atch_file_id AS cnAtchFileId
|
||||
, a.oprtn_atch_file_id AS oprtnAtchFileId
|
||||
, (SELECT
|
||||
user_nm
|
||||
FROM
|
||||
comvnusermaster
|
||||
WHERE
|
||||
esntl_id = a.frst_register_id
|
||||
ORDER BY user_nm DESC
|
||||
LIMIT 1) AS frstRegisterNm
|
||||
, (SELECT
|
||||
orignl_file_nm
|
||||
FROM
|
||||
lettnfiledetail
|
||||
WHERE
|
||||
atch_file_id = a.atch_file_id
|
||||
LIMIT 1) AS atchFileNm
|
||||
, b.prcs_nm AS prcsNm
|
||||
, b.prcs_div AS prcsDiv
|
||||
, (SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
ve_edu_aplct x
|
||||
LEFT OUTER JOIN lettngnrlmber le ON x.user_id = le.esntl_id
|
||||
WHERE
|
||||
x.prcs_ord = a.prcs_aplct_prd_ord
|
||||
AND x.sbmt_yn = 'Y'
|
||||
AND x.aprvl_cd != '100') AS nosCnt1
|
||||
FROM
|
||||
(SELECT
|
||||
t1.prcs_aplct_prd_ord
|
||||
, t1.prcs_ord
|
||||
, t1.lctr_div_cd
|
||||
, t1.strt_pnttm
|
||||
, t1.end_pnttm
|
||||
, t1.use_yn
|
||||
, t1.frst_regist_pnttm
|
||||
, t1.frst_register_id
|
||||
, t1.last_updt_pnttm
|
||||
, t1.last_updusr_id
|
||||
, t1.anncm_cn
|
||||
, t1.popup_cn
|
||||
, t1.atch_file_id
|
||||
, t1.title
|
||||
, t1.dead_line_dt
|
||||
, t1.edu_part_cd
|
||||
, t1.nos
|
||||
, t1.ddln_cd
|
||||
, t1.edu_strt_pnttm
|
||||
, t1.edu_ddln_pnttm
|
||||
, t1.dprtm_nm
|
||||
, t1.cn_atch_file_id
|
||||
, t1.oprtn_atch_file_id
|
||||
FROM
|
||||
ve_prcs_aplct_prd t1
|
||||
WHERE
|
||||
t1.lctr_div_cd = '60'
|
||||
ORDER BY t1.prcs_aplct_prd_ord DESC
|
||||
LIMIT 4
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
t1.prcs_aplct_prd_ord
|
||||
, t1.prcs_ord
|
||||
, t1.lctr_div_cd
|
||||
, t1.strt_pnttm
|
||||
, t1.end_pnttm
|
||||
, t1.use_yn
|
||||
, t1.frst_regist_pnttm
|
||||
, t1.frst_register_id
|
||||
, t1.last_updt_pnttm
|
||||
, t1.last_updusr_id
|
||||
, t1.anncm_cn
|
||||
, t1.popup_cn
|
||||
, t1.atch_file_id
|
||||
, t1.title
|
||||
, t1.dead_line_dt
|
||||
, t1.edu_part_cd
|
||||
, t1.nos
|
||||
, t1.ddln_cd
|
||||
, t1.edu_strt_pnttm
|
||||
, t1.edu_ddln_pnttm
|
||||
, t1.dprtm_nm
|
||||
, t1.cn_atch_file_id
|
||||
, t1.oprtn_atch_file_id
|
||||
FROM
|
||||
ve_prcs_aplct_prd t1
|
||||
WHERE
|
||||
t1.lctr_div_cd = '70'
|
||||
ORDER BY t1.prcs_aplct_prd_ord DESC
|
||||
LIMIT 4
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
t1.prcs_aplct_prd_ord
|
||||
, t1.prcs_ord
|
||||
, t1.lctr_div_cd
|
||||
, t1.strt_pnttm
|
||||
, t1.end_pnttm
|
||||
, t1.use_yn
|
||||
, t1.frst_regist_pnttm
|
||||
, t1.frst_register_id
|
||||
, t1.last_updt_pnttm
|
||||
, t1.last_updusr_id
|
||||
, t1.anncm_cn
|
||||
, t1.popup_cn
|
||||
, t1.atch_file_id
|
||||
, t1.title
|
||||
, t1.dead_line_dt
|
||||
, t1.edu_part_cd
|
||||
, t1.nos
|
||||
, t1.ddln_cd
|
||||
, t1.edu_strt_pnttm
|
||||
, t1.edu_ddln_pnttm
|
||||
, t1.dprtm_nm
|
||||
, t1.cn_atch_file_id
|
||||
, t1.oprtn_atch_file_id
|
||||
FROM
|
||||
ve_prcs_aplct_prd t1
|
||||
WHERE
|
||||
t1.lctr_div_cd = '80'
|
||||
ORDER BY t1.prcs_aplct_prd_ord DESC
|
||||
LIMIT 4) a
|
||||
JOIN ve_prcs b ON a.prcs_ord = b.prcs_ord
|
||||
ORDER BY
|
||||
a.lctr_div_cd, a.prcs_aplct_prd_ord DESC
|
||||
</select>
|
||||
|
||||
|
||||
</sqlMap>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user