집합교육 교육 대상자 명단 추출 기능 추가
parent
2754938948
commit
a07ec5e829
7
list.txt
7
list.txt
|
|
@ -1,4 +1,5 @@
|
|||
src\main\resources\egovframework\egovProps\globals.properties
|
||||
src\main\resources\egovframework\egovProps\globals.properties_thkim_disabled
|
||||
src\main\webapp\WEB-INF\config\springmvc\action-servlet.xml
|
||||
src\main\webapp\WEB-INF\views\admins\user\left.jsp
|
||||
src\main\webapp\images\renew\arrow-right.png
|
||||
src\main\webapp\images\renew\add.png
|
||||
|
|
@ -9,6 +10,10 @@ src\main\webapp\images\renew\minus.png
|
|||
src\main\webapp\css\admins\style.css
|
||||
src\main\webapp\css\admins\style.css.map
|
||||
src\main\java\geoinfo\admins\user\GeneralUserMngController.java
|
||||
src\main\java\geoinfo\admins\user\service\HomeTrainingService.java
|
||||
src\main\java\geoinfo\admins\user\service\impl\HomeTrainingServiceImpl.java
|
||||
src\main\java\geoinfo\admins\user\service\HomeTrainingMapper.java
|
||||
src\main\resources\geoinfo\sqlmap\mappers\admins\user\HomeTrainingMapper.xml
|
||||
src\main\webapp\WEB-INF\views\admins\user\home-training-index.jsp
|
||||
src\main\webapp\WEB-INF\views\admins\user\home-training-approval-system.jsp
|
||||
src\main\webapp\WEB-INF\views\admins\user\visit-training-index.jsp
|
||||
|
|
|
|||
6
pom.xml
6
pom.xml
|
|
@ -462,6 +462,12 @@
|
|||
</dependency>
|
||||
|
||||
<!-- Excel poi -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,12 +19,17 @@ import javax.servlet.http.HttpSession;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.com.cmm.service.EgovProperties;
|
||||
|
|
@ -32,10 +37,12 @@ import egovframework.rte.psl.dataaccess.util.EgovMap;
|
|||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import geoinfo.admins.board.RefrncRoomController;
|
||||
import geoinfo.admins.user.service.GeneralUserMngService;
|
||||
import geoinfo.admins.user.service.HomeTrainingService;
|
||||
import geoinfo.com.EgovExcel;
|
||||
import geoinfo.com.GeoinfoCommon;
|
||||
import geoinfo.comm.util.ScriptUtil;
|
||||
import geoinfo.session.UserInfo;
|
||||
import geoinfo.util.MyUtil;
|
||||
import whois.whoisSMS;
|
||||
|
||||
|
||||
|
|
@ -62,6 +69,10 @@ public class GeneralUserMngController {
|
|||
@Resource(name = "generalUserMngService")
|
||||
private GeneralUserMngService masterService;
|
||||
|
||||
@Resource(name = "homeTrainingService")
|
||||
private HomeTrainingService homeTrainingService;
|
||||
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(RefrncRoomController.class.getName());
|
||||
|
||||
// 운영서버 경로
|
||||
|
|
@ -638,6 +649,323 @@ public class GeneralUserMngController {
|
|||
return "admins/user/home-training-index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 집합교육 추가
|
||||
* @param request
|
||||
* @param strJSON
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "admins/user/home-training-index/add.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public JSONObject addHomeTraining(
|
||||
HttpServletRequest request,
|
||||
@RequestBody String strJSON,
|
||||
HttpServletResponse response) {
|
||||
|
||||
|
||||
JSONObject jsonResponse = new JSONObject();
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"strJSON" + strJSON + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
JSONParser jsonParser = new JSONParser();
|
||||
JSONArray jsonArr = null;
|
||||
boolean isFail = false;
|
||||
String failMsg = "";
|
||||
try {
|
||||
jsonArr = (JSONArray)jsonParser.parse(strJSON);
|
||||
for (Object obj : jsonArr) {
|
||||
JSONObject jsonObject = (JSONObject) obj;
|
||||
|
||||
// JSONObject를 HashMap으로 변환
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
for (Object key : jsonObject.keySet()) {
|
||||
String keyStr = (String) key;
|
||||
Object value = jsonObject.get(keyStr);
|
||||
params.put(keyStr, value);
|
||||
}
|
||||
try {
|
||||
HashMap<String, Object> hashMap = homeTrainingService.addHomeTraining(request, response, params);
|
||||
int nRetCode = MyUtil.getIntegerFromObject(hashMap.get("p_result_code"));
|
||||
String lpszRetMsg = MyUtil.getStringFromObject(hashMap.get("p_err_msg"));
|
||||
|
||||
long lWvtRegId = MyUtil.getLongFromObject(hashMap.get("p_wvt_reg_id"));
|
||||
|
||||
|
||||
if( nRetCode == 100 ) {
|
||||
jsonResponse.put("resultCode", nRetCode);
|
||||
jsonResponse.put("result", "true");
|
||||
jsonResponse.put("message", "등록이 완료되었습니다.");
|
||||
} else {
|
||||
if( nRetCode == 11 ) {
|
||||
lpszRetMsg += "\n" +
|
||||
"사업명: " + params.get("constName");
|
||||
}
|
||||
jsonResponse.put("resultCode", nRetCode);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", lpszRetMsg);
|
||||
|
||||
isFail = true;
|
||||
failMsg = lpszRetMsg;
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
String strTxt =
|
||||
"---------- BUG REPORTING START ----------" + "\n" +
|
||||
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
||||
"strJSON:[\n" + strJSON + "\n]\n" +
|
||||
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
|
||||
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
|
||||
"---------- BUG REPORTING END ----------" + "\n" +
|
||||
"";
|
||||
System.out.println(strTxt);
|
||||
jsonResponse.put("resultCode", -1);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (org.json.simple.parser.ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if( isFail ) {
|
||||
jsonResponse.put("resultCode", -2);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", failMsg);
|
||||
}
|
||||
|
||||
System.out.println("\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " OUT:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
||||
"\n--------------------------------------------------------------\n");
|
||||
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "admins/user/home-training-index/list.do", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public JSONObject getHomeTraining(
|
||||
HttpServletRequest request,
|
||||
@RequestParam HashMap<String, Object> params,
|
||||
HttpServletResponse response) {
|
||||
|
||||
|
||||
JSONObject jsonResponse = new JSONObject();
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"params.toString()" + params.toString() + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
|
||||
try {
|
||||
homeTrainingService.getHomeTraining(request, response, jsonResponse, params);
|
||||
jsonResponse.put("resultCode", 100);
|
||||
jsonResponse.put("result", "true");
|
||||
jsonResponse.put("message", "조회가 완료되었습니다.");
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
String strTxt =
|
||||
"---------- BUG REPORTING START ----------" + "\n" +
|
||||
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
||||
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
|
||||
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
|
||||
"---------- BUG REPORTING END ----------" + "\n" +
|
||||
"";
|
||||
System.out.println(strTxt);
|
||||
|
||||
String eMsg = e.getMessage();
|
||||
if( eMsg != null ) {
|
||||
if( eMsg.equals("로그인이 필요한 서비스입니다.") ) {
|
||||
jsonResponse.put("resultCode", 401);
|
||||
}
|
||||
}
|
||||
|
||||
jsonResponse.put("resultCode", -1);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", e.getMessage());
|
||||
}
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " OUT:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 집합교육에 참여한 사용자 목록을 조회한다.
|
||||
* @param request
|
||||
* @param params
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "admins/user/home-training-index/item/list.do", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public JSONObject getHomeTrainingItemList(
|
||||
HttpServletRequest request,
|
||||
@RequestParam HashMap<String, Object> params,
|
||||
HttpServletResponse response) {
|
||||
|
||||
|
||||
JSONObject jsonResponse = new JSONObject();
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"params.toString()" + params.toString() + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
|
||||
try {
|
||||
homeTrainingService.getHomeTrainingItemList(request, response, jsonResponse, params);
|
||||
jsonResponse.put("resultCode", 100);
|
||||
jsonResponse.put("result", "true");
|
||||
jsonResponse.put("message", "조회가 완료되었습니다.");
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
String strTxt =
|
||||
"---------- BUG REPORTING START ----------" + "\n" +
|
||||
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
||||
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
|
||||
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
|
||||
"---------- BUG REPORTING END ----------" + "\n" +
|
||||
"";
|
||||
System.out.println(strTxt);
|
||||
jsonResponse.put("resultCode", -1);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", e.getMessage());
|
||||
}
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " OUT:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "admins/user/home-training-index/item/delete.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public JSONObject deleteHomeTrainingItem(
|
||||
HttpServletRequest request,
|
||||
@RequestBody String strJSON,
|
||||
HttpServletResponse response) {
|
||||
|
||||
|
||||
JSONObject jsonResponse = new JSONObject();
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"strJSON" + strJSON + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
JSONParser jsonParser = new JSONParser();
|
||||
JSONArray jsonArr = null;
|
||||
boolean isFail = false;
|
||||
String failMsg = "";
|
||||
try {
|
||||
jsonArr = (JSONArray)jsonParser.parse(strJSON);
|
||||
for (Object obj : jsonArr) {
|
||||
JSONObject jsonObject = (JSONObject) obj;
|
||||
|
||||
// JSONObject를 HashMap으로 변환
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
for (Object key : jsonObject.keySet()) {
|
||||
String keyStr = (String) key;
|
||||
Object value = jsonObject.get(keyStr);
|
||||
params.put(keyStr, value);
|
||||
}
|
||||
try {
|
||||
HashMap<String, Object> hashMap = homeTrainingService.deleteHomeTrainingItem(request, response, params);
|
||||
int nRetCode = MyUtil.getIntegerFromObject(hashMap.get("p_result_code"));
|
||||
String lpszRetMsg = MyUtil.getStringFromObject(hashMap.get("p_err_msg"));
|
||||
|
||||
|
||||
if( nRetCode == 100 ) {
|
||||
jsonResponse.put("resultCode", nRetCode);
|
||||
jsonResponse.put("result", "true");
|
||||
jsonResponse.put("message", "삭제가 완료되었습니다.");
|
||||
} else {
|
||||
if( nRetCode == 11 ) {
|
||||
lpszRetMsg += "\n" +
|
||||
"사업명: " + params.get("constName");
|
||||
}
|
||||
jsonResponse.put("resultCode", nRetCode);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", lpszRetMsg);
|
||||
|
||||
isFail = true;
|
||||
failMsg = lpszRetMsg;
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
String strTxt =
|
||||
"---------- BUG REPORTING START ----------" + "\n" +
|
||||
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
||||
"strJSON:[\n" + strJSON + "\n]\n" +
|
||||
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
|
||||
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
|
||||
"---------- BUG REPORTING END ----------" + "\n" +
|
||||
"";
|
||||
System.out.println(strTxt);
|
||||
jsonResponse.put("resultCode", -1);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (org.json.simple.parser.ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if( isFail ) {
|
||||
jsonResponse.put("resultCode", -2);
|
||||
jsonResponse.put("result", "false");
|
||||
jsonResponse.put("message", failMsg);
|
||||
}
|
||||
|
||||
System.out.println("\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " OUT:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
||||
"\n--------------------------------------------------------------\n");
|
||||
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 집합교육 승인 화면
|
||||
* @param params
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package geoinfo.admins.user.service;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
|
||||
@Mapper("homeTrainingMapper")
|
||||
public interface HomeTrainingMapper {
|
||||
public HashMap<String, Object> callSpAddHomeTrainingReg(HashMap<String, Object> params) throws SQLException;
|
||||
public List<EgovMap> callSpGetHomeTrainingReg(HashMap<String, Object> params) throws SQLException;
|
||||
public long callSpCntHomeTrainingReg(HashMap<String, Object> params) throws SQLException;
|
||||
public List<EgovMap> callSpGetHomeTrainingReq(HashMap<String, Object> params) throws SQLException;
|
||||
public long callSpCntHomeTrainingReq(HashMap<String, Object> params) throws SQLException;
|
||||
public void callSpDelHomeTrainingReg(HashMap<String, Object> params) throws SQLException;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package geoinfo.admins.user.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public interface HomeTrainingService {
|
||||
|
||||
HashMap<String, Object> addHomeTraining(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception;
|
||||
void getHomeTraining(HttpServletRequest request, HttpServletResponse response, JSONObject jsonResponse, HashMap<String, Object> params) throws Exception;
|
||||
void getHomeTrainingItemList(HttpServletRequest request, HttpServletResponse response, JSONObject jsonResponse, HashMap<String, Object> params) throws Exception;
|
||||
HashMap<String, Object> deleteHomeTrainingItem(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
package geoinfo.admins.user.service.impl;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import geoinfo.admins.user.service.HomeTrainingMapper;
|
||||
import geoinfo.admins.user.service.HomeTrainingService;
|
||||
import geoinfo.session.UserInfo;
|
||||
import geoinfo.util.MyUtil;
|
||||
import oracle.sql.TIMESTAMP;
|
||||
|
||||
|
||||
@Service("homeTrainingService")
|
||||
public class HomeTrainingServiceImpl implements HomeTrainingService {
|
||||
|
||||
@Resource(name="homeTrainingMapper")
|
||||
private HomeTrainingMapper homeTrainingMapper;
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> addHomeTraining(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception {
|
||||
|
||||
if (!UserInfo.isValidSession(request, response, "admin")) {
|
||||
throw new Exception("로그인이 필요한 서비스입니다.");
|
||||
}
|
||||
|
||||
params.put("trainingAdmin", "류지송");
|
||||
params.put("trainingTel", "031-995-0934");
|
||||
String userId = (String)request.getSession().getAttribute("admin.userID");
|
||||
params.put("userId", userId);
|
||||
|
||||
String str = MyUtil.getStringFromObject(params.get("trainingDatetime") );
|
||||
// DateTimeFormatter를 사용하여 문자열을 LocalDateTime으로 파싱합니다.
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
||||
LocalDateTime dateTime = LocalDateTime.parse(str, formatter);
|
||||
Timestamp timestamp = Timestamp.valueOf(dateTime);
|
||||
params.put("trainingDatetime", timestamp);
|
||||
|
||||
try {
|
||||
homeTrainingMapper.callSpAddHomeTrainingReg(params);
|
||||
return params;
|
||||
} catch (SQLException e) {
|
||||
throw new Exception( e.getMessage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getHomeTraining(HttpServletRequest request, HttpServletResponse response, JSONObject jsonResponse, HashMap<String, Object> params) throws Exception {
|
||||
|
||||
if (!UserInfo.isValidSession(request, response, "admin")) {
|
||||
throw new Exception("로그인이 필요한 서비스입니다.");
|
||||
}
|
||||
|
||||
String userId = (String)request.getSession().getAttribute("admin.userID");
|
||||
|
||||
Enumeration<String> enumeration = request.getSession().getAttributeNames();
|
||||
|
||||
// Enumeration을 사용하여 루프 돌기
|
||||
while (enumeration.hasMoreElements()) {
|
||||
String attributeName = enumeration.nextElement();
|
||||
System.out.println(attributeName);
|
||||
}
|
||||
|
||||
if ( userId == null ) {
|
||||
throw new Exception("로그인이 필요한 서비스입니다.");
|
||||
}
|
||||
params.put("userId", userId);
|
||||
|
||||
params.put("wvtRegId", null); // 조회할 레코드의 일련번호(숫자)
|
||||
params.put("trainingName", null); // 집합교육명
|
||||
params.put("startDate", null); // 확정된 날짜의 검색 시작일자
|
||||
params.put("endDate", null); // 확정된 날짜의 검색 종료일자
|
||||
params.put("stateCode", null); // 상태 코드
|
||||
params.put("ncount", 100); // 페이지당 한번에 가져올 개수
|
||||
params.put("npage", 0); // 페이지 번호
|
||||
|
||||
try {
|
||||
List<EgovMap> list = homeTrainingMapper.callSpGetHomeTrainingReg(params);
|
||||
|
||||
List<EgovMap> dto = new ArrayList<EgovMap>();
|
||||
for( EgovMap item : list ) {
|
||||
if( item.get("crtDt") != null ) {
|
||||
TIMESTAMP oracleTimestampCrtDt = (TIMESTAMP) item.get("crtDt");
|
||||
item.put("crtDt", new Timestamp(oracleTimestampCrtDt.timestampValue().getTime())); // oracle.sql.TIMESTAMP -> java.sql.Timestamp 변환
|
||||
}
|
||||
if( item.get("modDt") != null ) {
|
||||
TIMESTAMP oracleTimestampModDt = (TIMESTAMP) item.get("modDt");
|
||||
item.put("modDt", new Timestamp(oracleTimestampModDt.timestampValue().getTime()));
|
||||
}
|
||||
|
||||
dto.add(item);
|
||||
}
|
||||
|
||||
jsonResponse.put("data", dto);
|
||||
long count = homeTrainingMapper.callSpCntHomeTrainingReg(params);
|
||||
jsonResponse.put("count", count);
|
||||
return;
|
||||
} catch (SQLException e) {
|
||||
throw new Exception( e.getMessage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getHomeTrainingItemList(HttpServletRequest request, HttpServletResponse response, JSONObject jsonResponse, HashMap<String, Object> params) throws Exception {
|
||||
|
||||
if (!UserInfo.isValidSession(request, response, "admin")) {
|
||||
throw new Exception("로그인이 필요한 서비스입니다.");
|
||||
}
|
||||
|
||||
String userId = (String)request.getSession().getAttribute("admin.userID");
|
||||
params.put("userId", userId);
|
||||
|
||||
params.put("wvtId", null);
|
||||
params.put("companyName", null);
|
||||
params.put("reqName", null);
|
||||
params.put("reqTel", null);
|
||||
params.put("stateCode", null); // 상태 코드
|
||||
params.put("ncount", 100); // 페이지당 한번에 가져올 개수
|
||||
params.put("npage", 0); // 페이지 번호
|
||||
|
||||
try {
|
||||
List<EgovMap> list = homeTrainingMapper.callSpGetHomeTrainingReq(params);
|
||||
|
||||
List<EgovMap> dto = new ArrayList<EgovMap>();
|
||||
for( EgovMap item : list ) {
|
||||
|
||||
if( item.get("crtDt") != null ) {
|
||||
TIMESTAMP oracleTimestampCrtDt = (TIMESTAMP) item.get("crtDt");
|
||||
item.put("crtDt", new Timestamp(oracleTimestampCrtDt.timestampValue().getTime())); // oracle.sql.TIMESTAMP -> java.sql.Timestamp 변환
|
||||
}
|
||||
if( item.get("modDt") != null ) {
|
||||
TIMESTAMP oracleTimestampModDt = (TIMESTAMP) item.get("modDt");
|
||||
item.put("modDt", new Timestamp(oracleTimestampModDt.timestampValue().getTime()));
|
||||
}
|
||||
|
||||
dto.add(item);
|
||||
}
|
||||
|
||||
jsonResponse.put("data", dto);
|
||||
long count = homeTrainingMapper.callSpCntHomeTrainingReq(params);
|
||||
jsonResponse.put("count", count);
|
||||
return;
|
||||
} catch (SQLException e) {
|
||||
throw new Exception( e.getMessage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> deleteHomeTrainingItem(HttpServletRequest request, HttpServletResponse response,
|
||||
HashMap<String, Object> params) throws Exception {
|
||||
|
||||
if (!UserInfo.isValidSession(request, response, "admin")) {
|
||||
throw new Exception("로그인이 필요한 서비스입니다.");
|
||||
}
|
||||
|
||||
String userId = (String)request.getSession().getAttribute("admin.userID");
|
||||
params.put("userId", userId);
|
||||
|
||||
try {
|
||||
homeTrainingMapper.callSpDelHomeTrainingReg(params);
|
||||
return params;
|
||||
} catch (SQLException e) {
|
||||
throw new Exception( e.getMessage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,831 @@
|
|||
/*******************************************************************/
|
||||
/* Class Name : Box */
|
||||
/* Description : HttpRequest 값을 다루기 위한 Class */
|
||||
/*******************************************************************/
|
||||
/* Modification Log */
|
||||
/* No DATE Company Author Description */
|
||||
/*******************************************************************/
|
||||
package geoinfo.util;
|
||||
|
||||
import java.util.Hashtable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.net.MalformedURLException;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* HttpRequest 값과 Entity class와의 간편한 mapping을 도와준다.
|
||||
* Usage :
|
||||
* Box box = HttpUtility.getBox(req);
|
||||
* 또는
|
||||
* Box box = HttpUtility.getBoxFromCookie(req);
|
||||
* box.copyToEntity(c); // c class field 에 해당하는 값을 넣어준다.
|
||||
*
|
||||
* checkbox 와 같이 여러개의 값이 한 key 에 있을 경우 다음 처럼 받을 수 있다.
|
||||
* Vector list = box.getVector("id_list")
|
||||
*
|
||||
* @(#)
|
||||
* Copyright 1999-2000 by LG-EDS Systems, Inc.,
|
||||
* Information Technology Group, Application Architecture Team,
|
||||
* Application Intrastructure Part.
|
||||
* 236-1, Hyosung-2dong, Kyeyang-gu, Inchun, 407-042, KOREA.
|
||||
* All rights reserved.
|
||||
*
|
||||
* NOTICE ! You can copy or redistribute this code freely,
|
||||
* but you should not remove the information about the copyright notice
|
||||
* and the author.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author WonYoung Lee, wyounglee@lgeds.lg.co.kr.
|
||||
*/
|
||||
|
||||
public class Box extends java.util.Hashtable {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(Box.class);
|
||||
|
||||
/**
|
||||
* MultipartParser 파일이 스프링을 통해 넘어왔을 경우 mReq를 셋팅한다.
|
||||
*/
|
||||
private org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest springMPas;
|
||||
|
||||
private String mType = ""; // NORMAL(mPas), SPRING(mReq)
|
||||
|
||||
/**
|
||||
* String format
|
||||
*/
|
||||
public static final int DEF_DATE_FMT = 1; // 년월일
|
||||
public static final int DEF_DATETIME_FMT = 2; // 년월일 시분초
|
||||
public static final int THOUSAND_COMMA = 3; // 천단위 콤마 ( 정수형 )
|
||||
public static final int THOUSAND_COMMA_FLOAT = 4; // 천단위 콤마 ( 소수점 포함 )
|
||||
public static final int ZIP_CODE = 5; // 우편번호
|
||||
public static final int JUMIN_NO = 6; // 주민등록번호
|
||||
public static final int MULTILINE_TEXT = 7; // 여러줄 문자열
|
||||
public static final int DEF_DATETIME_FMT_APM = 8; // 년월일 시분초 (오전 오후)
|
||||
public static final int HTML = 9; // HTML 형태
|
||||
public static final int YES_NO = 10; // 예, 아니오
|
||||
public static final int POSSIBLE_OR_NOT = 11; // 가능, 불가능
|
||||
public static final int JAVASCRIPT = 12; // 자바스크립트 사용
|
||||
public static final int SPECIAL_CHAR = 23; // 특수문자 치환
|
||||
|
||||
private Hashtable colIndex = new Hashtable();
|
||||
|
||||
protected String name = null;
|
||||
|
||||
public Box() {
|
||||
super();
|
||||
this.name = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Constructor
|
||||
* </pre>
|
||||
*
|
||||
* @param name
|
||||
* Box의 이름
|
||||
*/
|
||||
public Box(String name) {
|
||||
super();
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public void setParser(org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest springMPas) {
|
||||
this.springMPas = springMPas;
|
||||
mType = "SPRING";
|
||||
}
|
||||
|
||||
// upload file의 클라이언트가 보낸 파일 이름
|
||||
public String getSourceFileNm(String key) {
|
||||
try {
|
||||
return springMPas.getFile(key).getOriginalFilename();
|
||||
} catch (NumberFormatException e) {
|
||||
return "";
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// upload되어 서버에 저장된 파일의 이름
|
||||
public String getStoredFileNm(String key) {
|
||||
try {
|
||||
return springMPas.getFile(key).getName();
|
||||
} catch (NumberFormatException e) {
|
||||
return "";
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// 저장된 파일의 사이즈
|
||||
public String getStoredFileSize(String key) throws Exception {
|
||||
try {
|
||||
return (new Long(springMPas.getFile(key).getSize())).toString();
|
||||
} catch (NumberFormatException e) {
|
||||
return "0";
|
||||
} catch (Exception e) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 파일이 업로드 되었는지 체크
|
||||
public boolean isUploaded(String key) {
|
||||
return springMPas.getFileMap().get(key) != null ? true : false;
|
||||
}
|
||||
|
||||
// 업로드된 파일이 최대크기를 초과하였는지 체크
|
||||
public boolean isOverLimitSize(String key, int limitSize) throws Exception {
|
||||
return Long.parseLong(getStoredFileSize(key)) / 1000 / 1000 >= limitSize ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box를 복사해 새로운 Box instance를 반환한다.
|
||||
* </pre>
|
||||
*
|
||||
* @return Object 복사된 Box Object
|
||||
*/
|
||||
public Object clone() {
|
||||
|
||||
Box newbox = new Box(name);
|
||||
|
||||
Hashtable src = (Hashtable) this;
|
||||
Hashtable target = (Hashtable) newbox;
|
||||
|
||||
Enumeration e = src.keys();
|
||||
while (e.hasMoreElements()) {
|
||||
String key = (String) e.nextElement();
|
||||
Object value = src.get(key);
|
||||
target.put(key, value);
|
||||
}
|
||||
return newbox;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에 있는 값 중 entity class의 field 에 해당하는 값이 있으면 entity object의 filed 값을 셋팅.
|
||||
* Usage :
|
||||
* Box box = HttpUtility.getBox(req);
|
||||
* box.copyToEntity(c); // c class field 에 해당하는 값을 넣어준다.
|
||||
* </pre>
|
||||
*
|
||||
* @param entity
|
||||
* java.lang.Object
|
||||
*/
|
||||
public Object copyToEntity(Object entity) {
|
||||
if (entity == null)
|
||||
throw new NullPointerException("trying to copy from box to null entity class");
|
||||
|
||||
Class c = entity.getClass();
|
||||
java.lang.reflect.Field[] field = c.getFields();
|
||||
for (int i = 0; i < field.length; i++) {
|
||||
try {
|
||||
String fieldtype = field[i].getType().getName();
|
||||
String fieldname = field[i].getName();
|
||||
|
||||
if (containsKey(fieldname)) {
|
||||
if (fieldtype.equals("java.lang.String")) {
|
||||
field[i].set(entity, getString(fieldname));
|
||||
} else if (fieldtype.equals("int")) {
|
||||
field[i].setInt(entity, getInt(fieldname));
|
||||
} else if (fieldtype.equals("double")) {
|
||||
field[i].setDouble(entity, getDouble(fieldname));
|
||||
} else if (fieldtype.equals("long")) {
|
||||
field[i].setLong(entity, getLong(fieldname));
|
||||
} else if (fieldtype.equals("float")) {
|
||||
field[i].set(entity, new Float(getDouble(fieldname)));
|
||||
} else if (fieldtype.equals("boolean")) {
|
||||
field[i].setBoolean(entity, getBoolean(fieldname));
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
logger.debug("error", e);
|
||||
} catch (Exception e) {
|
||||
logger.debug("error", e);
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Properties getProperty() {
|
||||
Properties pt = new Properties();
|
||||
|
||||
Enumeration e = this.keys();
|
||||
while (e.hasMoreElements()) {
|
||||
String key = (String) e.nextElement();
|
||||
pt.setProperty(key, this.get(key));
|
||||
}
|
||||
return pt;
|
||||
}
|
||||
|
||||
// index에 의해 데이터를 가져올때 사용
|
||||
public String get(int idx) {
|
||||
String key = (String) colIndex.get((new Integer(idx).toString()));
|
||||
return get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 String 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return String 찾은 값
|
||||
*/
|
||||
public String get(String key) {
|
||||
return getString(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* key에 해당하는 값이 없을 경우 target의 값을 리턴한다.
|
||||
*
|
||||
* @param key
|
||||
* @param target
|
||||
* @return
|
||||
*/
|
||||
public String getNvl(String key, String target) {
|
||||
String str = getString(key);
|
||||
if (str == null || str.equals(""))
|
||||
str = target;
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 금액 표시에 맞게 천단위 , 를 붙여 가져온다. 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return String 찾은 값
|
||||
*/
|
||||
public String getThdComma(String key) {
|
||||
return FormatUtil.insertComma(get(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 boolean 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return boolean 찾은 값
|
||||
*/
|
||||
public boolean getBoolean(String key) {
|
||||
String value = getString(key);
|
||||
boolean isTrue = false;
|
||||
try {
|
||||
isTrue = (new Boolean(value)).booleanValue();
|
||||
} catch (NumberFormatException e) {
|
||||
logger.debug("error", e);
|
||||
} catch (Exception e) {
|
||||
logger.debug("error", e);
|
||||
}
|
||||
return isTrue;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 double 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return double 찾은 값
|
||||
*/
|
||||
public double getDouble(String key) {
|
||||
String value = removeComma(getString(key));
|
||||
if (value.equals(""))
|
||||
return 0;
|
||||
double num = 0;
|
||||
try {
|
||||
num = Double.valueOf(value).doubleValue();
|
||||
} catch (NumberFormatException e) {
|
||||
num = 0;
|
||||
} catch (Exception e) {
|
||||
num = 0;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 double 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return double 찾은 값
|
||||
*/
|
||||
public float getFloat(String key) {
|
||||
return (float) getDouble(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 int 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return int 찾은 값
|
||||
*/
|
||||
public int getInt(String key) {
|
||||
double value = getDouble(key);
|
||||
return (int) value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 long 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return long 찾은 값
|
||||
*/
|
||||
public long getLong(String key) {
|
||||
String value = removeComma(getString(key));
|
||||
if (value.equals(""))
|
||||
return 0L;
|
||||
|
||||
long lvalue = 0L;
|
||||
try {
|
||||
lvalue = Long.valueOf(value).longValue();
|
||||
} catch (NumberFormatException e) {
|
||||
lvalue = 0L;
|
||||
} catch (Exception e) {
|
||||
lvalue = 0L;
|
||||
}
|
||||
return lvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 날짜에 해당하는 값을 가져온다.
|
||||
* usage)
|
||||
* box.getDateParams("due_date");
|
||||
* 는 다음과 같다.
|
||||
* box.get("due_date1") + box.get("due_date2") + box.get("due_date3");
|
||||
* request.getParameter("due_date1") + request.getParameter("due_date2") + request.getParameter("due_date3");
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return String 찾은 값
|
||||
*/
|
||||
public String getDateParams(String key) {
|
||||
|
||||
return getString(key + "1") + getString(key + "2") + getString(key + "3");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 String 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return String 찾은 값
|
||||
*/
|
||||
public String getString(String key) {
|
||||
String value = "";
|
||||
try {
|
||||
Object o = (Object) super.get(key);
|
||||
Class c = o.getClass();
|
||||
if (o == null)
|
||||
value = "";
|
||||
else if (c.isArray()) {
|
||||
int length = Array.getLength(o);
|
||||
if (length == 0)
|
||||
value = "";
|
||||
else {
|
||||
for (int i = 0; i < Array.getLength(o); i++) {
|
||||
Object item = Array.get(o, i);
|
||||
if (item != null) {
|
||||
value += item.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
value = o.toString();
|
||||
} catch (NumberFormatException e) {
|
||||
value = "";
|
||||
} catch (Exception e) {
|
||||
value = "";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* check box 와 같이 같은 name에 대해 여러 value들이 String의 Vector로 넘겨준다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getVector(String key) {
|
||||
Vector vector = new Vector();
|
||||
try {
|
||||
Object o = (Object) super.get(key);
|
||||
Class c = o.getClass();
|
||||
if (o != null) {
|
||||
if (c.isArray()) {
|
||||
int length = Array.getLength(o);
|
||||
if (length != 0) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
Object tiem = Array.get(o, i);
|
||||
if (tiem == null)
|
||||
vector.addElement("");
|
||||
else
|
||||
vector.addElement(tiem.toString());
|
||||
}
|
||||
}
|
||||
} else
|
||||
vector.addElement(o.toString());
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
logger.debug("error", e);
|
||||
} catch (Exception e) {
|
||||
logger.debug("error", e);
|
||||
}
|
||||
return vector;
|
||||
}
|
||||
|
||||
public String getVectorValueAt(String key, int i) {
|
||||
Object o = (Object) super.get(key);
|
||||
Class c = o.getClass();
|
||||
if (c.isArray()) {
|
||||
Object tiem = Array.get(o, i);
|
||||
return tiem.toString();
|
||||
} else {
|
||||
return get(key);
|
||||
}
|
||||
}
|
||||
|
||||
public int getVectorSize(String key) {
|
||||
return getVector(key).size();
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* check box 와 같이 같은 name에 대해 여러 value들이 String의 Vector에서 값을 빼내 스트링으로
|
||||
* 붙여서 넘겨준다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @param concat_str
|
||||
* string과 string을 붙일때 사용될 문자열
|
||||
* @param trim_tail
|
||||
* 스트링의 맨뒤의 concat_str을 없앨것인지 여부
|
||||
* @return Vector
|
||||
*/
|
||||
public String getVectorToStr(String key, String concat_str, boolean trim_tail) {
|
||||
Vector vt = getVector(key);
|
||||
String rtn = "";
|
||||
for (int i = 0; i < vt.size(); i++) {
|
||||
rtn += (String) vt.get(i) + concat_str;
|
||||
}
|
||||
if (rtn.length() > 0 && trim_tail) {
|
||||
return rtn.substring(0, rtn.length() - concat_str.length());
|
||||
} else {
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에 새로운 값을 저장한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* 찾을때 쓸 key
|
||||
* @param value
|
||||
* 저장할 값
|
||||
*/
|
||||
public void put(String key, String value) {
|
||||
super.put(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 문자열에서 ","를 제거한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param s
|
||||
* source문자열
|
||||
* @return ","를 제거한 문자열
|
||||
*/
|
||||
private static String removeComma(String s) {
|
||||
if (s == null)
|
||||
return null;
|
||||
if (s.indexOf(",") != -1) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
if (c != ',')
|
||||
buf.append(c);
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 Object 형식으로 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @return Object 찾은 값
|
||||
*/
|
||||
public Object getObject(String key) {
|
||||
try {
|
||||
return (Object) super.get(key);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box의 모든 값을 스트링으로 반환
|
||||
* </pre>
|
||||
*
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public synchronized String toString() {
|
||||
int max = size() - 1;
|
||||
StringBuffer buf = new StringBuffer();
|
||||
Enumeration keys = keys();
|
||||
Enumeration objects = elements();
|
||||
buf.append("{");
|
||||
|
||||
for (int i = 0; i <= max; i++) {
|
||||
String key = keys.nextElement().toString();
|
||||
String value = null;
|
||||
Object o = objects.nextElement();
|
||||
if (o == null)
|
||||
value = "";
|
||||
else {
|
||||
Class c = o.getClass();
|
||||
if (c.isArray()) {
|
||||
int length = Array.getLength(o);
|
||||
if (length == 0)
|
||||
value = "";
|
||||
else if (length == 1) {
|
||||
Object item = Array.get(o, 0);
|
||||
if (item == null)
|
||||
value = "";
|
||||
else
|
||||
value = item.toString();
|
||||
} else {
|
||||
StringBuffer valueBuf = new StringBuffer();
|
||||
valueBuf.append("[");
|
||||
for (int j = 0; j < length; j++) {
|
||||
Object item = Array.get(o, j);
|
||||
if (item != null)
|
||||
valueBuf.append(item.toString());
|
||||
if (j < length - 1)
|
||||
valueBuf.append(",");
|
||||
}
|
||||
valueBuf.append("]");
|
||||
value = valueBuf.toString();
|
||||
}
|
||||
} else
|
||||
value = o.toString();
|
||||
}
|
||||
buf.append(key + "=" + value);
|
||||
if (i < max)
|
||||
buf.append(", ");
|
||||
}
|
||||
buf.append("}");
|
||||
|
||||
return "Box[" + name + "]=" + buf.toString();
|
||||
|
||||
}
|
||||
|
||||
public synchronized String toStringNl() {
|
||||
int max = size() - 1;
|
||||
StringBuffer buf = new StringBuffer();
|
||||
Enumeration keys = keys();
|
||||
Enumeration objects = elements();
|
||||
|
||||
for (int i = 0; i <= max; i++) {
|
||||
String key = keys.nextElement().toString();
|
||||
String value = null;
|
||||
Object o = objects.nextElement();
|
||||
if (o == null)
|
||||
value = "";
|
||||
else {
|
||||
Class c = o.getClass();
|
||||
if (c.isArray()) {
|
||||
int length = Array.getLength(o);
|
||||
if (length == 0)
|
||||
value = "";
|
||||
else if (length == 1) {
|
||||
Object item = Array.get(o, 0);
|
||||
if (item == null)
|
||||
value = "";
|
||||
else
|
||||
value = item.toString();
|
||||
} else {
|
||||
StringBuffer valueBuf = new StringBuffer();
|
||||
valueBuf.append("[");
|
||||
for (int j = 0; j < length; j++) {
|
||||
Object item = Array.get(o, j);
|
||||
if (item != null)
|
||||
valueBuf.append(item.toString());
|
||||
if (j < length - 1)
|
||||
valueBuf.append(",");
|
||||
}
|
||||
valueBuf.append("]");
|
||||
value = valueBuf.toString();
|
||||
}
|
||||
} else
|
||||
value = o.toString();
|
||||
}
|
||||
buf.append(key + "=" + value);
|
||||
if (i < max)
|
||||
buf.append("\n ");
|
||||
}
|
||||
|
||||
return "Box[" + name + "]=" + buf.toString();
|
||||
}
|
||||
|
||||
public Box[] multiJsonBoxArray(String headKey) {
|
||||
|
||||
Enumeration keys = keys();
|
||||
|
||||
int arrSize = 0;
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = keys.nextElement().toString();
|
||||
if (key.startsWith(headKey)) {
|
||||
int idx = Integer.parseInt(key.substring(0, key.indexOf("[")).replaceAll(headKey, ""));
|
||||
if (idx > arrSize) {
|
||||
arrSize = idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keys = keys();
|
||||
Box[] boxArr = new Box[arrSize];
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = keys.nextElement().toString();
|
||||
if (key.startsWith(headKey)) {
|
||||
int idx = Integer.parseInt(key.substring(0, key.indexOf("[")).replaceAll(headKey, "")) - 1;
|
||||
String nKey = key.substring(key.indexOf("[") + 1);
|
||||
if (nKey.indexOf("[") >= 0) {
|
||||
nKey = nKey.substring(0, nKey.indexOf("]")) + nKey.substring(nKey.indexOf("["));
|
||||
} else if (nKey.indexOf("]") >= 0) {
|
||||
nKey = nKey.substring(0, nKey.indexOf("]"));
|
||||
}
|
||||
|
||||
//웹 취약점 때문에 수정 시작
|
||||
if (boxArr[idx] == null) {
|
||||
boxArr[idx] = new Box("");
|
||||
}
|
||||
//웹 취약점 때문에 수정 끝
|
||||
|
||||
// System.out.println(String.format("idx : %s nKey : %s value : %s", idx, nKey,
|
||||
// this.get(key)));
|
||||
boxArr[idx].put(nKey, this.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
return boxArr;
|
||||
}
|
||||
|
||||
public String get(String key, String fmt) {
|
||||
return get(key, Integer.parseInt(fmt));
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 가져와 fmt에 맞게 포맷하여 반환한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @param fmt
|
||||
* 포맷형태 상수
|
||||
* @return String 찾은 값
|
||||
*/
|
||||
public String get(String key, int fmt) {
|
||||
String tmp = "";
|
||||
switch (fmt) {
|
||||
case DEF_DATE_FMT:
|
||||
tmp = DateUtil.defFmtDate(get(key));
|
||||
break;
|
||||
case DEF_DATETIME_FMT:
|
||||
tmp = DateUtil.defFmtDateTime(get(key));
|
||||
break;
|
||||
case THOUSAND_COMMA:
|
||||
tmp = StringUtil.getComma(get(key));
|
||||
break;
|
||||
case THOUSAND_COMMA_FLOAT:
|
||||
tmp = StringUtil.getComma(get(key), false);
|
||||
break;
|
||||
case ZIP_CODE:
|
||||
tmp = StringUtil.getZip(get(key));
|
||||
break;
|
||||
case JUMIN_NO:
|
||||
tmp = StringUtil.getJumin(get(key));
|
||||
break;
|
||||
case MULTILINE_TEXT:
|
||||
tmp = get(key).replaceAll("\n", "<br>");
|
||||
break;
|
||||
case DEF_DATETIME_FMT_APM:
|
||||
tmp = DateUtil.defFmtDateTimeAPM(get(key));
|
||||
break;
|
||||
case HTML:
|
||||
tmp = get(key);
|
||||
break;
|
||||
case YES_NO:
|
||||
tmp = (get(key).equals("Y") ? "예" : "아니오");
|
||||
break;
|
||||
case POSSIBLE_OR_NOT:
|
||||
tmp = (get(key).equals("Y") ? "가능" : "불가능");
|
||||
break;
|
||||
case JAVASCRIPT:
|
||||
tmp = get(key).replaceAll("\n", "@NEWLINE@").replaceAll("\r", "").replaceAll("'", "@SQUOT@");
|
||||
break;
|
||||
case SPECIAL_CHAR:
|
||||
tmp = get(key).replaceAll("\"", """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">",
|
||||
">");
|
||||
break;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Box에서 key에 해당하는 값을 가져와 fmt에 맞게 포맷하여 반환한다.
|
||||
* 만약 값이 공백일 경우 target을 넘겨준다.
|
||||
* </pre>
|
||||
*
|
||||
* @param key
|
||||
* Box에서 찾을 key
|
||||
* @param fmt
|
||||
* 포맷형태 상수
|
||||
* @return String 찾은 값
|
||||
*/
|
||||
public String get(String key, int fmt, String target) {
|
||||
String tmp = get(key, fmt);
|
||||
return tmp.equals("") ? target : tmp;
|
||||
}
|
||||
|
||||
public int getDEF_DATE_FMT() {
|
||||
return DEF_DATE_FMT;
|
||||
}
|
||||
|
||||
public int getDEF_DATETIME_FMT() {
|
||||
return DEF_DATETIME_FMT;
|
||||
}
|
||||
|
||||
public int getTHOUSAND_COMMA() {
|
||||
return THOUSAND_COMMA;
|
||||
}
|
||||
|
||||
public int getTHOUSAND_COMMA_FLOAT() {
|
||||
return THOUSAND_COMMA_FLOAT;
|
||||
}
|
||||
|
||||
public int getZIP_CODE() {
|
||||
return ZIP_CODE;
|
||||
}
|
||||
|
||||
public int getJUMIN_NO() {
|
||||
return JUMIN_NO;
|
||||
}
|
||||
|
||||
public int getMULTILINE_TEXT() {
|
||||
return MULTILINE_TEXT;
|
||||
}
|
||||
|
||||
public int getSPECIAL_CHAR() {
|
||||
return SPECIAL_CHAR;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
public class CrossScriptingFilter implements Filter {
|
||||
|
||||
private FilterConfig filterConfig;
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
this.filterConfig = filterConfig;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.filterConfig = null;
|
||||
}
|
||||
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
System.out.println("CrossScriptingFilter");
|
||||
chain.doFilter(new RequestWrapper((HttpServletRequest) request), response);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import org.apache.catalina.connector.Request;
|
||||
import org.apache.catalina.connector.Response;
|
||||
import org.apache.catalina.valves.ErrorReportValve;
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CustomErrorReportValve extends ErrorReportValve{
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CustomErrorReportValve.class);
|
||||
|
||||
@Override
|
||||
protected void report(Request request, Response response, Throwable t) {
|
||||
try {
|
||||
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(response.getOutputStream(), "UTF8"));
|
||||
out.write("<!DOCTYPE html>");
|
||||
out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\">");
|
||||
out.write("<head>");
|
||||
out.write(" <meta charset=\"utf-8\"/>");
|
||||
out.write(" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/>");
|
||||
out.write(" <meta name=\"description\" content=\"\"/>");
|
||||
out.write("</head>");
|
||||
out.write("<body> ");
|
||||
out.write(" <script type=\"text/javascript\">");
|
||||
out.write(" alert(\"비정상적인 접근입니다.\");");
|
||||
out.write(" history.back();");
|
||||
out.write(" </script>");
|
||||
out.write("</body>");
|
||||
out.write("</html>");
|
||||
out.close();
|
||||
} catch (NumberFormatException e) {
|
||||
logger.debug("error", e);
|
||||
} catch (MalformedURLException e) {
|
||||
logger.debug("error", e);
|
||||
} catch (Exception e) {
|
||||
logger.debug("error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,844 @@
|
|||
/*******************************************************************/
|
||||
/* Class Name : DateUtil */
|
||||
/* Description : 날짜 시간 관련 utility class */
|
||||
/*******************************************************************/
|
||||
/* Modification Log */
|
||||
/* No DATE Company Author Description */
|
||||
/* 01 2002/06/01 IRAM Initial Release */
|
||||
/*******************************************************************/
|
||||
|
||||
package geoinfo.util;
|
||||
|
||||
import java.util.*;
|
||||
import java.text.*;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 시간 관련 utility class
|
||||
* </pre>
|
||||
*
|
||||
* @author IRAM
|
||||
* @version 1.0
|
||||
* @since 2002.01.
|
||||
*
|
||||
*/
|
||||
|
||||
public class DateUtil
|
||||
{
|
||||
/**
|
||||
* 양력 쉬는 날
|
||||
*/
|
||||
private static final String sunOffDays = "0101,0301,0405,0505,0606,0717,0815,1003,1225";
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Constructor
|
||||
* </pre>
|
||||
*/
|
||||
public DateUtil() {}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 날짜/시간을 xFormat에 맞도록 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param xFormat 날짜 format
|
||||
* @return format된 날짜
|
||||
*/
|
||||
private static String fmDate(String xFormat) {
|
||||
Date currentTime = new Date();
|
||||
SimpleDateFormat fmt = new SimpleDateFormat(xFormat);
|
||||
return fmt.format(currentTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 날짜/시간을 "yyyy/MM/dd HH:mm:ss S" 형태로 리턴한다
|
||||
* </pre>
|
||||
*
|
||||
* @return format된 Date 문자열
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return fmDate("yyyy/MM/dd HH:mm:ss S");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 날짜/시간을 xFormat에 맞도록 리턴한다.
|
||||
* ex)
|
||||
* String dt = DateUtil.toString("yyyy/MM/dd");
|
||||
* </pre>
|
||||
*
|
||||
* @param xFormat 포맷 문자열
|
||||
* @return format된 Date 문자열
|
||||
*/
|
||||
public static String toString(String xFormat)
|
||||
{
|
||||
return fmDate(xFormat);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 년도(year)를 yyyy형태로 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @return String 년도
|
||||
*/
|
||||
public static String getYear() {
|
||||
return fmDate("yyyy");
|
||||
}
|
||||
|
||||
public static String nextYear() {
|
||||
return nextYear(1);
|
||||
}
|
||||
|
||||
public static String nextYear(int year) {
|
||||
return String.valueOf(Integer.parseInt(getYear()) + year);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 월(month)을 MM형태로 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @return String 월
|
||||
*/
|
||||
public static String getMonth() {
|
||||
return fmDate("MM");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 일(day)을 dd형태로 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @return String 날짜
|
||||
*/
|
||||
public static String getDay() {
|
||||
return fmDate("dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 시간(hour)를 hh형태로 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @return String 현재시간
|
||||
*/
|
||||
public static String getHour() {
|
||||
return fmDate("hh");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 분(minute)을 mm형태로 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @return String 현재 분
|
||||
*/
|
||||
public static String getMinute() {
|
||||
return fmDate("mm");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 시스템의 초(second)를 ss형태로 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @return String 현재 초
|
||||
*/
|
||||
public static String getSecond() {
|
||||
return fmDate("ss");
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 시스템 날짜를 리턴한다.
|
||||
* 20000621182030형태로 리턴 (2000년6월21일 오후 6시 20분 30초)
|
||||
* </pre>
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getSysDate()
|
||||
{
|
||||
String second, minute, hour;
|
||||
Calendar cal = Calendar.getInstance();
|
||||
|
||||
String year = String.valueOf(cal.get(Calendar.YEAR));
|
||||
String month = String.valueOf(cal.get(Calendar.MONTH)+1);
|
||||
String day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
if((cal.get(Calendar.MONTH)+1) < 10) month = "0" + String.valueOf((cal.get(Calendar.MONTH)+1));
|
||||
else month = String.valueOf((cal.get(Calendar.MONTH)+1));
|
||||
|
||||
if(cal.get(Calendar.DAY_OF_MONTH) < 10) day = "0" + String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||
else day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
if(cal.get(Calendar.HOUR_OF_DAY) < 10) hour = "0" + String.valueOf(cal.get(Calendar.HOUR_OF_DAY));
|
||||
else hour = String.valueOf(cal.get(Calendar.HOUR_OF_DAY));
|
||||
|
||||
if(cal.get(Calendar.MINUTE) < 10) minute = "0" + String.valueOf(cal.get(Calendar.MINUTE));
|
||||
else minute = String.valueOf(cal.get(Calendar.MINUTE));
|
||||
|
||||
if(cal.get(Calendar.SECOND) < 10) second = "0" + String.valueOf(cal.get(Calendar.SECOND));
|
||||
else second = String.valueOf(cal.get(Calendar.SECOND));
|
||||
|
||||
return year + month + day + hour+ minute + second;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* from , to 날짜 사이의 날짜
|
||||
* </pre>
|
||||
*
|
||||
* @param from 기간 부터
|
||||
* @param to 기간 까지
|
||||
* @param format 날짜 포맷
|
||||
* @return int 날짜 형식이 맞고, 존재하는 날짜일 때 2개 일자 사이의 일자 리턴
|
||||
* -999: 형식이 잘못 되었거나 존재하지 않는 날짜 또는 기간의 역전
|
||||
*/
|
||||
public static int getDaysBetween(String from, String to, String format)
|
||||
{
|
||||
java.text.SimpleDateFormat formatter =
|
||||
new java.text.SimpleDateFormat (format, java.util.Locale.KOREA);
|
||||
java.util.Date d1 = null;
|
||||
java.util.Date d2 = null;
|
||||
try {
|
||||
d1 = formatter.parse(from);
|
||||
d2 = formatter.parse(to);
|
||||
} catch(java.text.ParseException e) {
|
||||
return -999;
|
||||
}
|
||||
if ( !formatter.format(d1).equals(from) ) return -999;
|
||||
if ( !formatter.format(d2).equals(to) ) return -999;
|
||||
|
||||
long duration = d2.getTime() - d1.getTime();
|
||||
|
||||
if ( duration < 0 ) return -999;
|
||||
return (int)( duration/(1000 * 60 * 60 * 24) );
|
||||
// seconds in 1 day
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 해당월의 일자수를 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param year 년
|
||||
* @param month 월
|
||||
* @return int 일자수
|
||||
*/
|
||||
public static int getDayCount(int year, int month)
|
||||
{
|
||||
int day[] = {31,28,31,30,31,30,31,31,30,31,30,31};
|
||||
|
||||
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
|
||||
day[1] = 29;
|
||||
}
|
||||
return day[month-1];
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 윤년인지 판단한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param year 년도
|
||||
* @return 윤년 true 아니면 false
|
||||
*/
|
||||
public static boolean isLeafYear(int year)
|
||||
{
|
||||
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜가 유효한 날짜인지를 검사한다.
|
||||
* "02/30/2000" 형태로 검사
|
||||
* </pre>
|
||||
*
|
||||
* @param date 검사할 날짜
|
||||
* @return boolean 유효하면 true 아니면 false
|
||||
*/
|
||||
public static boolean isDate(String date)
|
||||
{
|
||||
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
|
||||
|
||||
format.setLenient(false);
|
||||
return format.parse(date,new ParsePosition(0)) == null ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜문자열이 주어진 포맷으로 변환될 수 있는지 검사한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param date 검사할 문자열
|
||||
* @param xfmt 날짜 포맷
|
||||
* @return 변환가능 true 불가능 false
|
||||
*/
|
||||
public static boolean isDate(String date,String xfmt)
|
||||
{
|
||||
SimpleDateFormat format = new SimpleDateFormat(xfmt);
|
||||
|
||||
format.setLenient(false);
|
||||
return format.parse(date,new ParsePosition(0)) == null ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 요일에 대한 int를 리턴한다.
|
||||
* 0=일요일,1=월요일,2=화요일,3=수요일,4=목요일,5=금요일,6=토요일
|
||||
* </pre>
|
||||
*
|
||||
* @param year 년
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
*
|
||||
* @return String 요일에 대한 int
|
||||
*/
|
||||
public static int getWeekDay(int year,int month,int day)
|
||||
{
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(year,month-1,day);
|
||||
|
||||
return cal.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 요일에 대한 이름을 리턴한다.
|
||||
* 일,월,화,수,목,금,토
|
||||
* </pre>
|
||||
*
|
||||
* @param year 년
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
*
|
||||
* @return String 요일
|
||||
*/
|
||||
public static String getWeekDayNm(int year,int month,int day)
|
||||
{
|
||||
String weekNm="";
|
||||
switch (getWeekDay(year, month, day)) {
|
||||
case 0: weekNm = "일";break;
|
||||
case 1: weekNm = "월";break;
|
||||
case 2: weekNm = "화";break;
|
||||
case 3: weekNm = "수";break;
|
||||
case 4: weekNm = "목";break;
|
||||
case 5: weekNm = "금";break;
|
||||
case 6: weekNm = "토";break;
|
||||
}
|
||||
return weekNm;
|
||||
}
|
||||
|
||||
public static String getWeekDayNm(String ymd)
|
||||
{
|
||||
return getWeekDayNm(Integer.parseInt(ymd.substring(0,4)), Integer.parseInt(ymd.substring(4,6)), Integer.parseInt(ymd.substring(6,8)));
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 년도,월,날짜에 주어진 날짜를 더한 날짜를 만들어준다.
|
||||
* </pre>
|
||||
*
|
||||
* @param year 년
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
* @param add 더할 날짜(년도,월,일)
|
||||
* @param fmt 리턴 포맷
|
||||
* @param ymd 더할 필드('Y' : 년도, 'M' : 월, 'D' : 일 )
|
||||
* @return String 날짜
|
||||
*/
|
||||
public static String addDate(int year, int month, int day, int add, String fmt, String ymd) {
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date _date = null;
|
||||
calendar.set(year,month-1,day);
|
||||
|
||||
if (ymd.equals("Y")) {
|
||||
// 년도 더하기
|
||||
calendar.add(Calendar.YEAR, add);
|
||||
} else if (ymd.equals("M")) {
|
||||
// 월 더하기
|
||||
calendar.add(Calendar.MONTH, add);
|
||||
} else {
|
||||
// 일 더하기
|
||||
calendar.add(Calendar.DATE, add);
|
||||
}
|
||||
|
||||
_date = calendar.getTime();
|
||||
SimpleDateFormat sfmt = new SimpleDateFormat(fmt);
|
||||
return sfmt.format(_date);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 년도,월,날짜에 주어진 날짜를 더한 날짜를 만들어준다.
|
||||
* </pre>
|
||||
*
|
||||
* @param date 년월일
|
||||
* @param add 더할 날짜(년도,월,일)
|
||||
* @param fmt 리턴 포맷
|
||||
* @param ymd 더할 필드('Y' : 년도, 'M' : 월, 'D' : 일 )
|
||||
* @return String 날짜
|
||||
*/
|
||||
public static String addDate(String date, int add, String fmt, String ymd) {
|
||||
int year = Integer.parseInt(date.substring(0,4));
|
||||
int month = Integer.parseInt(date.substring(4,6));
|
||||
int day = Integer.parseInt(date.substring(6,8));
|
||||
|
||||
return addDate(year, month, day, add, fmt, ymd);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* yyyyMMdd 형태의 스트링을 주어진 포맷 형태로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param date 날짜문자열
|
||||
* @param fmt 리턴 포맷
|
||||
* @return String
|
||||
*/
|
||||
public static String strToDateStr(String date, String fmt) {
|
||||
|
||||
int year = Integer.parseInt(date.substring(0,4));
|
||||
int month = Integer.parseInt(date.substring(4,6));
|
||||
int day = Integer.parseInt(date.substring(6,8));
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date _date = null;
|
||||
calendar.set(year,month-1,day);
|
||||
|
||||
_date = calendar.getTime();
|
||||
SimpleDateFormat sfmt = new SimpleDateFormat(fmt);
|
||||
return sfmt.format(_date);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* yyyyMMdd 또는 yyyyMMddHHmmss 형태로 주어진 스트링을 주어진 Date 형식으로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param date 날짜문자열
|
||||
* @return Date
|
||||
*/
|
||||
public static Date strToDate(String date) {
|
||||
int year=0, month=0, day=0, hour=0, min=0, sec=0;
|
||||
if ( date.length() > 14) {
|
||||
year = Integer.parseInt(date.substring(0,4));
|
||||
month = Integer.parseInt(date.substring(4,6));
|
||||
day = Integer.parseInt(date.substring(6,8));
|
||||
hour = Integer.parseInt(date.substring(8,10));
|
||||
min = Integer.parseInt(date.substring(10,12));
|
||||
sec = Integer.parseInt(date.substring(12,14));
|
||||
} else if (date.length() == 8) {
|
||||
year = Integer.parseInt(date.substring(0,4));
|
||||
month = Integer.parseInt(date.substring(4,6));
|
||||
day = Integer.parseInt(date.substring(6,8));
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date _date = null;
|
||||
calendar.set(year,month-1,day,hour,min,sec);
|
||||
|
||||
_date = calendar.getTime();
|
||||
return _date;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* sqlDate 를 문자열로 변환한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param _date java.sql.Date형태의 날짜
|
||||
* @return String 변환된 문자열
|
||||
*/
|
||||
public static String sqlDateToStr(java.sql.Date _date) {
|
||||
// _date.toString();
|
||||
return _date.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 인자로 넘어온 년월이 양력에서 쉬?z 날인지 확인한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
* @return boolean true : 쉬는날 , false : 쉬지 않는 날
|
||||
*/
|
||||
public static boolean isSunOffDay(String month, String day) {
|
||||
String month_day = month + day;
|
||||
if (sunOffDays.indexOf(month_day) >= 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 인자로 넘어온 년월이 양력에서 쉬?z 날인지 확인한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
* @return boolean true : 쉬는날 , false : 쉬지 않는 날
|
||||
*/
|
||||
public static boolean isSunOffDay(int month, int day) {
|
||||
String sMonth = StringUtil.getZeroBaseString(month,2);
|
||||
String sDay = StringUtil.getZeroBaseString(day,2);
|
||||
return isSunOffDay(sMonth, sDay);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 인자로 넘어온 년월이 쉬는 날인지 확인한다.
|
||||
* 음력 쉬는 날 확인 구현 안되어 있음
|
||||
* </pre>
|
||||
*
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
*
|
||||
* @return boolean true : 쉬는날 , false : 쉬지 않는 날
|
||||
*/
|
||||
public static boolean isOffDay(int month, int day) {
|
||||
String sMonth = StringUtil.getZeroBaseString(month,2);
|
||||
String sDay = StringUtil.getZeroBaseString(day,2);
|
||||
return isSunOffDay(sMonth, sDay);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 인자로 넘어온 년월이 쉬는 날인지 확인한다.
|
||||
* 음력 쉬는 날 확인 구현 안되어 있음
|
||||
* </pre>
|
||||
*
|
||||
* @param month 월
|
||||
* @param day 일
|
||||
* @return boolean true : 쉬는날 , false : 쉬지 않는 날
|
||||
*/
|
||||
public static boolean isOffDay(String month, String day) {
|
||||
if (month.length() == 1) month = "0" + month;
|
||||
if (day.length() == 1) day = "0" + day;
|
||||
return isSunOffDay(month, day);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 차이를 int로 반환(검증 필요)
|
||||
* </pre>
|
||||
*
|
||||
* @param from 날짜 부터
|
||||
* @param to 날짜 까지
|
||||
* @return int 차이
|
||||
*/
|
||||
public static int dayDiff(String from, String to) throws Exception {
|
||||
try {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
Date beginDate = formatter.parse(from.substring(0,8));
|
||||
Date endDate = formatter.parse(to.substring(0,8));
|
||||
long diff = endDate.getTime() - beginDate.getTime();
|
||||
long diffDays = diff / (24 * 60 * 60 * 1000);
|
||||
return new Long(diffDays).intValue();
|
||||
} catch (NumberFormatException e) {
|
||||
return -9999;
|
||||
} catch (Exception e) {
|
||||
return -9999;
|
||||
}
|
||||
|
||||
} // dayDiff
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 차이를 int로 반환(년도만 구현)
|
||||
* </pre>
|
||||
*
|
||||
* @param from 날짜 부터
|
||||
* @param to 날짜 까지
|
||||
* @param ymd 차이를 리턴할 구분자 "Y" 년 "M"월 "D" 일
|
||||
* @return int 차이
|
||||
*/
|
||||
public static int dateDiff(String from, String to, String ymd) {
|
||||
if (ymd.equals("Y") && from.length() == 8 && to.length() == 8) {
|
||||
int f_year = Integer.parseInt(from.substring(0,4));
|
||||
int t_year = Integer.parseInt(to.substring(0,4));
|
||||
int f_md = Integer.parseInt(from.substring(4));
|
||||
int t_md = Integer.parseInt(to.substring(4));
|
||||
int diff = 0;
|
||||
|
||||
if (t_year > 0 && f_year > 0) {
|
||||
diff = t_year - f_year;
|
||||
}
|
||||
|
||||
if ( f_md > t_md) {
|
||||
--diff;
|
||||
}
|
||||
return diff;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* sql날짜로 바꾸어서 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @param inDate 변환할 date
|
||||
* @return java.sql.Date
|
||||
*/
|
||||
public static final java.sql.Date toSQLDate(java.util.Date inDate) {
|
||||
// This method returns a sql.Date version of the util.Date arg.
|
||||
// new java.sql.Date(java.util.Calendar.getInstance().getTime().getTime())
|
||||
return new java.sql.Date(inDate.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 문자열을 받아들여 기본 날짜 형태(yyyy-MM-dd)로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param xFormat 날짜 format
|
||||
* @return format된 날짜
|
||||
*/
|
||||
public static String defFmtDate(String inDate) {
|
||||
return defFmtDate(inDate,"-");
|
||||
}
|
||||
|
||||
public static String defFmtDate(String inDate, String dmt) {
|
||||
if (inDate.length() >= 8) {
|
||||
return inDate.substring(0,4) + dmt
|
||||
+ inDate.substring(4,6) + dmt
|
||||
+ inDate.substring(6,8);
|
||||
} else if (inDate.length() >= 6) {
|
||||
return inDate.substring(0,4) + dmt
|
||||
+ inDate.substring(4,6);
|
||||
} else if (inDate.length() >= 4) {
|
||||
return inDate.substring(0,4);
|
||||
} else {
|
||||
return inDate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 문자열을 받아들여 기본 날짜 형태(yyyy-MM-dd HH:mm:ss)로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param xFormat 날짜 format
|
||||
* @return format된 날짜
|
||||
*/
|
||||
public static String defFmtDateTime(String inDate) {
|
||||
if (inDate.length() >= 14) {
|
||||
return inDate.substring(0,4) + "-"
|
||||
+ inDate.substring(4,6) + "-"
|
||||
+ inDate.substring(6,8) + " "
|
||||
+ inDate.substring(8,10) + ":"
|
||||
+ inDate.substring(10,12) + ":"
|
||||
+ inDate.substring(12,14);
|
||||
} else if (inDate.length() >= 12) {
|
||||
return inDate.substring(0,4) + "-"
|
||||
+ inDate.substring(4,6) + "-"
|
||||
+ inDate.substring(6,8) + " "
|
||||
+ inDate.substring(8,10) + ":"
|
||||
+ inDate.substring(10,12);
|
||||
} else if (inDate.length() >= 8) {
|
||||
return inDate.substring(0,4) + "-"
|
||||
+ inDate.substring(4,6) + "-"
|
||||
+ inDate.substring(6,8);
|
||||
} else {
|
||||
return inDate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 문자열을 받아들여 시설안전기술 공단의 기본 날짜 형태로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param xFormat 날짜 format
|
||||
* @return format된 날짜
|
||||
*/
|
||||
public static String defFmtDate2(String inDate) {
|
||||
if (inDate.length() >= 8) {
|
||||
return inDate.substring(0,4) + "년 "
|
||||
+ inDate.substring(4,6) + "월 "
|
||||
+ inDate.substring(6,8) + "일";
|
||||
} else if (inDate.length() == 6) {
|
||||
return inDate.substring(0,4) + "년 "
|
||||
+ inDate.substring(4,6) + "월";
|
||||
} else if (inDate.length() == 4) {
|
||||
return inDate.substring(0,4) + "년";
|
||||
} else {
|
||||
return inDate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 문자열을 받아들여 시설안전기술 공단의 기본 날짜 형태로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param xFormat 날짜 format
|
||||
* @return format된 날짜
|
||||
*/
|
||||
public static String defFmtDateTime2(String inDate) {
|
||||
if (inDate.length() >= 14) {
|
||||
return inDate.substring(0,4) + "년 "
|
||||
+ inDate.substring(4,6) + "월 "
|
||||
+ inDate.substring(6,8) + "일 "
|
||||
+ inDate.substring(8,10) + "시 "
|
||||
+ inDate.substring(10,12) + "분 "
|
||||
+ inDate.substring(12,14) + "초";
|
||||
} else if (inDate.length() >= 12) {
|
||||
return inDate.substring(0,4) + "년 "
|
||||
+ inDate.substring(4,6) + "월 "
|
||||
+ inDate.substring(6,8) + "일 "
|
||||
+ inDate.substring(8,10) + "시 "
|
||||
+ inDate.substring(10,12) + "분 ";
|
||||
} else {
|
||||
return inDate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 날짜 문자열을 받아들여 기본 날짜 형태(yyyy-MM-dd 오전오후 HH:mm)로 만든다.
|
||||
* </pre>
|
||||
*
|
||||
* @param inDate 포맷할 날짜
|
||||
* @return String format된 날짜
|
||||
*/
|
||||
public static String defFmtDateTimeAPM(String inDate) {
|
||||
if (inDate.length() >= 14) {
|
||||
return inDate.substring(0,4) + "-"
|
||||
+ inDate.substring(4,6) + "-"
|
||||
+ inDate.substring(6,8) + " "
|
||||
+ getAmPm(inDate.substring(8,10)) + ":"
|
||||
+ inDate.substring(10,12);
|
||||
} else if (inDate.length() >= 12) {
|
||||
return inDate.substring(0,4) + "-"
|
||||
+ inDate.substring(4,6) + "-"
|
||||
+ inDate.substring(6,8) + " "
|
||||
+ getAmPm(inDate.substring(8,10)) + ":"
|
||||
+ inDate.substring(10,12);
|
||||
} else if (inDate.length() >= 8) {
|
||||
return inDate.substring(0,4) + "-"
|
||||
+ inDate.substring(4,6) + "-"
|
||||
+ inDate.substring(6,8);
|
||||
} else {
|
||||
return inDate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 해당 시간이 오전인지 오후인지 조회
|
||||
* @param hour 시간
|
||||
* @return String 오전, 오후
|
||||
*/
|
||||
public static String getAmPm(String hour) {
|
||||
if (hour == null ) {
|
||||
return "";
|
||||
} else if (hour == "") {
|
||||
return "";
|
||||
} else {
|
||||
if (Integer.parseInt(hour) <= 12 ) {
|
||||
return "오전 " + hour;
|
||||
} else { return "오후 " + StringUtil.lpad(String.valueOf((Integer.parseInt(hour) - 12)),"0",2) ;}
|
||||
}
|
||||
}
|
||||
|
||||
public static String getYearOptionTag(String defYear, String from, String to, String order, String postFix) {
|
||||
String optionStr = "";
|
||||
String selected = "";
|
||||
int ifrom = Integer.parseInt(from);
|
||||
int ito = Integer.parseInt(to);
|
||||
int idefYear = Integer.parseInt(FormatUtil.nvl2(defYear,"0"));
|
||||
if (order.equals("asc")) {
|
||||
for (int i= ifrom; i <= ito; i++) {
|
||||
selected = i == idefYear ? "selected" : "";
|
||||
optionStr += "\n <option value='"+i+"' "+selected+">"+i+postFix+"</option>";
|
||||
}
|
||||
} else {
|
||||
for (int i= ito; i >= ifrom; i--) {
|
||||
selected = i == idefYear ? "selected" : "";
|
||||
optionStr += "\n <option value='"+i+"' "+selected+">"+i+postFix+"</option>";
|
||||
}
|
||||
}
|
||||
return optionStr;
|
||||
|
||||
}
|
||||
|
||||
public static String getYearOptionTag(String defYear, String from, String to, String order) {
|
||||
return getYearOptionTag(defYear, from, to, order, "");
|
||||
}
|
||||
|
||||
public static String getYearOptionTag(String defYear, String from, String to) {
|
||||
return getYearOptionTag(defYear, from, to, "desc");
|
||||
}
|
||||
|
||||
public static String getMonthOptionTag(String defMon, String postFix) {
|
||||
String optionStr = "";
|
||||
String selected = "";
|
||||
int idefMon = Integer.parseInt(FormatUtil.nvl2(defMon,"0"));
|
||||
for (int i= 1; i < 13; i++) {
|
||||
selected = i == idefMon ? "selected" : "";
|
||||
String mon = StringUtil.lpad(String.valueOf(i), "0", 2);
|
||||
optionStr += "\n <option value='"+mon+"' "+selected+">"+mon+postFix+"</option>";
|
||||
}
|
||||
return optionStr;
|
||||
}
|
||||
|
||||
public static String getMonthOptionTag(String defMon) {
|
||||
return getMonthOptionTag(defMon, "");
|
||||
}
|
||||
|
||||
public static String getDayOptionTag(String defDay, String postFix) {
|
||||
String optionStr = "";
|
||||
String selected = "";
|
||||
int idefDay = Integer.parseInt(FormatUtil.nvl2(defDay,"0"));
|
||||
for (int i= 1; i < 32; i++) {
|
||||
selected = i == idefDay ? "selected" : "";
|
||||
String day = StringUtil.lpad(String.valueOf(i), "0", 2);
|
||||
optionStr += "\n <option value='"+day+"' "+selected+">"+day+postFix+"</option>";
|
||||
}
|
||||
return optionStr;
|
||||
}
|
||||
|
||||
public static String getDayOptionTag(String defDay) {
|
||||
return getDayOptionTag(defDay, "");
|
||||
}
|
||||
|
||||
public static String getHourOptionTag(String defHour) {
|
||||
String optionStr = "";
|
||||
String selected = "";
|
||||
int idefHour = Integer.parseInt(FormatUtil.nvl2(defHour,"0"));
|
||||
for (int i= 0; i < 24; i++) {
|
||||
selected = i == idefHour ? "selected" : "";
|
||||
String hour = StringUtil.lpad(String.valueOf(i), "0", 2);
|
||||
optionStr += "\n <option value='"+hour+"' "+selected+">"+hour+"</option>";
|
||||
}
|
||||
return optionStr;
|
||||
}
|
||||
|
||||
public static String getMinOptionTag(String defMin) {
|
||||
String optionStr = "";
|
||||
String selected = "";
|
||||
int idefMin = Integer.parseInt(FormatUtil.nvl2(defMin,"0"));
|
||||
for (int i= 0; i < 61; i++) {
|
||||
selected = i == idefMin ? "selected" : "";
|
||||
String min = StringUtil.lpad(String.valueOf(i), "0", 2);
|
||||
optionStr += "\n <option value='"+min+"' "+selected+">"+min+"</option>";
|
||||
}
|
||||
return optionStr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
|
||||
import geoinfo.util.RsWrapper;
|
||||
public class ExcelUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ExcelUtil.class);
|
||||
|
||||
public static RsWrapper getExcelSheetName(String excelPath) throws Exception {
|
||||
RsWrapper rsWp = new RsWrapper();
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
Workbook wb = Workbook.getWorkbook(new File(excelPath));
|
||||
|
||||
int sheetCnt = wb.getNumberOfSheets();
|
||||
|
||||
for(short i=0; i < sheetCnt; i++) {
|
||||
String sheetName = wb.getSheet(i).getName();
|
||||
Box obox = new Box();
|
||||
obox.put("sheetNo", i);
|
||||
obox.put("sheetNm", sheetName);
|
||||
//System.out.println("sheetName:"+sheetName + ", i:"+i);
|
||||
rsWp.appendRs(obox);
|
||||
}
|
||||
|
||||
return rsWp;
|
||||
} catch(IndexOutOfBoundsException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(IOException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(NumberFormatException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(Exception ex) {
|
||||
logger.debug("error", ex);
|
||||
throw ex;
|
||||
} finally {
|
||||
if (fis != null) { fis.close(); }
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] getExcelSheetNameArray(String excelPath) throws Exception {
|
||||
RsWrapper rsWp = new RsWrapper();
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
Workbook wb = Workbook.getWorkbook(new File(excelPath));
|
||||
|
||||
int sheetCnt = wb.getNumberOfSheets();
|
||||
|
||||
return wb.getSheetNames();
|
||||
} catch(IndexOutOfBoundsException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(IOException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(NumberFormatException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(Exception ex) {
|
||||
logger.debug("error", ex);
|
||||
throw ex;
|
||||
} finally {
|
||||
if (fis != null) { fis.close(); }
|
||||
}
|
||||
}
|
||||
|
||||
public static Sheet getExcelWorkSheet(String excelPath, int sheetNo) throws Exception {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
excelPath.replaceAll("\\.", "").replaceAll("/", "").replaceAll("\\\\", "").replaceAll ("&","");
|
||||
Workbook wb = Workbook.getWorkbook(new File(excelPath));
|
||||
return wb.getSheet(sheetNo);
|
||||
} catch(IndexOutOfBoundsException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(IOException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(NumberFormatException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(Exception ex) {
|
||||
logger.debug("error", ex);
|
||||
throw ex;
|
||||
} finally {
|
||||
if (fis != null) { fis.close(); }
|
||||
}
|
||||
}
|
||||
|
||||
public static Sheet getExcelWorkSheet(String excelPath, String sheetName) throws Exception {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
excelPath.replaceAll("\\.", "").replaceAll("/", "").replaceAll("\\\\", "").replaceAll ("&","");
|
||||
Workbook wb = Workbook.getWorkbook(new File(excelPath));
|
||||
return wb.getSheet(sheetName);
|
||||
} catch(IndexOutOfBoundsException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(IOException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(NumberFormatException ex) {
|
||||
logger.debug("error", ex);
|
||||
return null;
|
||||
} catch(Exception ex) {
|
||||
logger.debug("error", ex);
|
||||
throw ex;
|
||||
} finally {
|
||||
if (fis != null) { fis.close(); }
|
||||
}
|
||||
}
|
||||
//1
|
||||
public static RsWrapper getRsWp(String excelPath, int sheetNo, int colNmRow, int startRow, int maxCol) throws Exception {
|
||||
RsWrapper rsWp = new RsWrapper();
|
||||
Sheet exlSheet = getExcelWorkSheet(excelPath, sheetNo);
|
||||
if(exlSheet == null) { return rsWp; }
|
||||
|
||||
Box hbox = new Box();
|
||||
for(short i=0; i < exlSheet.getColumns() && i < maxCol; i++) {
|
||||
Cell cell = exlSheet.getCell(i,colNmRow);
|
||||
if(cell == null) { break; }
|
||||
hbox.put(i+"", cell.getContents());
|
||||
}
|
||||
|
||||
//System.out.println("exlSheet.getRows():" + exlSheet.getRows());
|
||||
for(int i=startRow; i < exlSheet.getRows(); i++) {
|
||||
Cell[] cells = exlSheet.getRow(i);
|
||||
if(cells == null) { break; }
|
||||
boolean isOk = false;
|
||||
for(short j=0; j < maxCol && j < cells.length; j++) {
|
||||
if(cells[j] != null && cells[j].getContents() != null && !cells[j].getContents().trim().equals("")) { isOk = true; break; }
|
||||
}
|
||||
if(!isOk) { break; }
|
||||
|
||||
Box obox = new Box();
|
||||
for(short j=0; j < hbox.size() && j < cells.length; j++) {
|
||||
if(cells[j] == null || cells[j].getContents().trim().equals("")) { continue; }
|
||||
if(cells[j].getType().toString().equals("Date")) {
|
||||
String val = getDateVal(cells[j]);
|
||||
obox.put("col"+j, val);
|
||||
}else {
|
||||
obox.put("col"+j, cells[j].getContents().trim());
|
||||
}
|
||||
}
|
||||
rsWp.appendRs(obox);
|
||||
}
|
||||
return rsWp;
|
||||
}
|
||||
//2
|
||||
public static RsWrapper getRsWp(String excelPath, String sheetName, int colNmRow, int startRow, int maxCol) throws Exception {
|
||||
RsWrapper rsWp = new RsWrapper();
|
||||
Sheet exlSheet = getExcelWorkSheet(excelPath, sheetName);
|
||||
if(exlSheet == null) { return rsWp; }
|
||||
|
||||
Box hbox = new Box();
|
||||
for(short i=0; i < exlSheet.getColumns() && i < maxCol; i++) {
|
||||
Cell cell = exlSheet.getCell(i,colNmRow);
|
||||
if(cell == null) { break; }
|
||||
hbox.put(i+"", cell.getContents());
|
||||
}
|
||||
|
||||
System.out.println("exlSheet.getRows(): " + exlSheet.getRows());
|
||||
for(int i=startRow; i < exlSheet.getRows(); i++) {
|
||||
Cell[] cells = exlSheet.getRow(i);
|
||||
if(cells == null) { break; }
|
||||
boolean isOk = false;
|
||||
for(short j=0; j < maxCol && j < cells.length; j++) {
|
||||
if(cells[j] != null && cells[j].getContents() != null && !cells[j].getContents().trim().equals("")) { isOk = true; break; }
|
||||
}
|
||||
if(!isOk) { break; }
|
||||
|
||||
Box obox = new Box();
|
||||
for(short j=0; j < hbox.size() && j < cells.length; j++) {
|
||||
if(cells[j] == null || cells[j].getContents().trim().equals("")) { continue; }
|
||||
if(cells[j].getType().toString().equals("Date")) {
|
||||
String val = getDateVal(cells[j]);
|
||||
obox.put("col"+j, val);
|
||||
}else {
|
||||
obox.put("col"+j, cells[j].getContents().trim());
|
||||
}
|
||||
}
|
||||
rsWp.appendRs(obox);
|
||||
}
|
||||
return rsWp;
|
||||
}
|
||||
|
||||
public static RsWrapper getRsWp(String excelPath, int sheetNo, int colNmRow, int startRow) throws Exception {
|
||||
return getRsWp(excelPath, sheetNo, colNmRow, startRow, 10);
|
||||
}
|
||||
public static RsWrapper getRsWp(String excelPath, String sheetName, int colNmRow, int startRow) throws Exception {
|
||||
return getRsWp(excelPath, sheetName, colNmRow, startRow, 10);
|
||||
}
|
||||
|
||||
public static String getDateVal(Cell cell) {
|
||||
String rtn = "";
|
||||
String val = cell.getContents();
|
||||
val = val.replaceAll("/", "");
|
||||
val = val.replaceAll("-", "");
|
||||
if (val.length() == 8) {
|
||||
return val.substring(4, 8) + val.substring(2, 4) + val.substring(0, 2);
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
public class FileUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(FileUtil.class);
|
||||
|
||||
private static final int BUFF_SIZE = 2048;
|
||||
|
||||
/**
|
||||
* 파일 업로드
|
||||
* @param file 업로드 파일
|
||||
* @param newName 파일명
|
||||
* @param stordFilePath 파일경로
|
||||
*/
|
||||
public static void writeUploadedFile(MultipartFile file, String newName, String savePath) throws Exception{
|
||||
InputStream stream = null;
|
||||
OutputStream bos = null;
|
||||
|
||||
stream = file.getInputStream();
|
||||
File cFile = new File(savePath);
|
||||
|
||||
if (!cFile.isDirectory()) {
|
||||
boolean _flag = cFile.mkdir();
|
||||
if(_flag) throw new IOException("Directory creation Failed ");
|
||||
}
|
||||
|
||||
bos = new FileOutputStream(savePath + newName);
|
||||
|
||||
int bytesRead = 0;
|
||||
byte[] buffer = new byte[BUFF_SIZE];
|
||||
|
||||
while ((bytesRead = stream.read(buffer, 0, BUFF_SIZE)) != -1) {
|
||||
bos.write(buffer, 0, bytesRead);
|
||||
}
|
||||
|
||||
if (bos != null) {
|
||||
try {
|
||||
bos.close();
|
||||
} catch (IOException ignore) {
|
||||
logger.debug("error", ignore);
|
||||
} catch (NumberFormatException ignore) {
|
||||
logger.debug("error", ignore);
|
||||
} catch (IndexOutOfBoundsException ignore) {
|
||||
logger.debug("error", ignore);
|
||||
} catch (Exception ignore) {
|
||||
logger.debug("error", ignore);
|
||||
}
|
||||
}
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException ignore) {
|
||||
logger.debug("error", ignore);
|
||||
} catch (NumberFormatException ignore) {
|
||||
logger.debug("error", ignore);
|
||||
} catch (IndexOutOfBoundsException ignore) {
|
||||
logger.debug("error", ignore);
|
||||
} catch (Exception ignore) {
|
||||
logger.debug("error", ignore);
|
||||
}
|
||||
}
|
||||
|
||||
bos.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일 삭제
|
||||
* @param savePath 파일저장경로
|
||||
* @param fileName 파일명
|
||||
*/
|
||||
public static void deleteFile(String savePath, String fileName) throws Exception{
|
||||
File file = new File(savePath + fileName);
|
||||
if(file.exists()) file.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,415 @@
|
|||
/*******************************************************************/
|
||||
/* Class Name : FormatUtil */
|
||||
/* Description : 출력형태 포맷 관련 Class */
|
||||
/*******************************************************************/
|
||||
/* Modification Log */
|
||||
/* No DATE Company Author Description */
|
||||
/* 01 2002/06/01 IRAM Initial Release */
|
||||
/*******************************************************************/
|
||||
|
||||
package geoinfo.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 출력형태 포맷 관련 Class
|
||||
* </pre>
|
||||
*
|
||||
* @author IRAM
|
||||
* @version 1.0
|
||||
* @since 2002.01.
|
||||
*/
|
||||
|
||||
public class FormatUtil
|
||||
{
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FormatUtil.class);
|
||||
/**
|
||||
* <pre>
|
||||
* 10글자로 넘어온 사업자 등록 번호에 "-"를 붙여준다
|
||||
* 예) "1234567890" -> "123-45-67890"
|
||||
* </pre>
|
||||
*
|
||||
* @param bizRegiNo 사업자등록번호
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String bizRegiNoFormat(String bizRegiNo)
|
||||
{
|
||||
String b = bizRegiNo;
|
||||
|
||||
if (b.length() != 10)
|
||||
return b;
|
||||
else
|
||||
return b.substring(0,3) + "-" + b.substring(3,5) + "-" + b.substring(5,10);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* source의 값이 null일경우 target값을 리턴하고 아닐경우 source값을 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param source null인지 판단할 문자열
|
||||
* @param target null일경우 반환할 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String nvl(String source, String target)
|
||||
{
|
||||
return source == null ? target: source;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* source의 값이 null 또는 "" 일경우 target값을 리턴하고 아닐경우 source값을 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param source null 또는 "" 인지 판단할 문자열
|
||||
* @param target null 또는 "" 일경우 반환할 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String nvl2(String source, String target)
|
||||
{
|
||||
return ( source == null || source.equals("") )? target: source;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* source의 값이 null 또는 trim하여 "" 일경우 target값을 리턴하고 아닐경우 source값을 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param source null 또는 "" 인지 판단할 문자열
|
||||
* @param target null 또는 "" 일경우 반환할 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String nvl3(String source, String target)
|
||||
{
|
||||
return ( source == null || source.trim().equals("") )? target: source;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* substring을 할 수 있을 경우 substring 한 결과
|
||||
* substring을 할 수 없을 경우 target 리턴
|
||||
* </pre>
|
||||
*
|
||||
* @param source 원문자열
|
||||
* @param from substring 시작
|
||||
* @param to substring 끝
|
||||
* @param target substring 할 수 없을 경우 target 리턴
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String nvlSubstr(String source, int from, int to, String target)
|
||||
{
|
||||
try {
|
||||
return source.substring(from,to);
|
||||
} catch(IndexOutOfBoundsException e) {
|
||||
LOGGER.debug("error", e);
|
||||
return target;
|
||||
} catch(NumberFormatException e) {
|
||||
LOGGER.debug("error", e);
|
||||
return target;
|
||||
} catch(Exception e) {
|
||||
LOGGER.debug("error", e);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* source의 양쪽 끝에 '를 붙여준다
|
||||
* 예) abcdef -> 'abcdef'
|
||||
* </pre>
|
||||
*
|
||||
* @param source 양쪽에 ''를 붙일 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String makeQuot(String source)
|
||||
{
|
||||
return "'" + nvl2(source,"") + "'";
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 주민등록 번호를 포맷에 맞추어 리턴한다.
|
||||
* 예) '1234561234567' -> '123456-1234567'
|
||||
* 13자리가 아닐경우 그냥 반환
|
||||
* </pre>
|
||||
*
|
||||
* @param juminno 주민등록번호
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String juminNo(String juminno) {
|
||||
int juminno_len = juminno.length();
|
||||
String retValue = "";
|
||||
|
||||
if (juminno_len == 13) {
|
||||
retValue = juminno.substring(0, 6) + "-" + juminno.substring(6, 13);
|
||||
} else {
|
||||
retValue = juminno;
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
public static String juminNo(String juminno, String x) {
|
||||
int juminno_len = juminno.length();
|
||||
String retValue = "";
|
||||
|
||||
if (juminno_len == 13) {
|
||||
retValue = juminno.substring(0, 6) + "-" + juminno.substring(6, 7) + "xxxxxx";
|
||||
} else {
|
||||
retValue = juminno;
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
public static String[] dateArr(String datestr) {
|
||||
String[] tmp = {"","",""};
|
||||
if ( datestr != null && datestr.length() == 8) {
|
||||
tmp[0] = datestr.substring(0,4);
|
||||
tmp[1] = datestr.substring(4,6);
|
||||
tmp[2] = datestr.substring(6,8);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static String[] zipArr(String zipstr) {
|
||||
String[] tmp = {"",""};
|
||||
if ( zipstr != null && zipstr.length() == 6) {
|
||||
tmp[0] = zipstr.substring(0,3);
|
||||
tmp[1] = zipstr.substring(3,6);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 입렫된 숫자를 휴대전화 포맷에 맞게 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param pNumber 휴대전화번호
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static Object pcsFormat(String pNumber) {
|
||||
String pcsNumber = StringUtil.replace(pNumber.trim(), "-", "");
|
||||
String retValue = "";
|
||||
int len = pcsNumber.length();
|
||||
|
||||
if (len >= 10) {
|
||||
retValue = pcsNumber.substring(0, 3) + "-" + pcsNumber.substring(3, len-4) + "-" + pcsNumber.substring(len-4);
|
||||
} else {
|
||||
retValue = pcsNumber;
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 입력된 스트링에 1000 단위 컴마를 삽입하여 리턴한다.
|
||||
* 예) 10000000 -> 10,000,000
|
||||
* </pre>
|
||||
*
|
||||
* @param inputStr 숫자 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String insertComma(String inputStr) {
|
||||
String tmpStr = inputStr;
|
||||
String underComma = "";
|
||||
|
||||
if (inputStr.indexOf(".") >=0) {
|
||||
// 소숫점 아래는 자른다.
|
||||
tmpStr = inputStr.substring(0,tmpStr.indexOf("."));
|
||||
underComma = "."+inputStr.substring(inputStr.indexOf(".")+1);
|
||||
}
|
||||
|
||||
|
||||
int len = tmpStr.length();
|
||||
String resultValue = "";
|
||||
String sign = "";
|
||||
if (inputStr.startsWith("-")) {
|
||||
sign = "-";
|
||||
len = len -1;
|
||||
tmpStr = tmpStr.substring(1);
|
||||
}
|
||||
|
||||
for (int i=0 ; i<len ; i++) {
|
||||
if (i > 0 && (i % 3) == 0 )
|
||||
resultValue = "," + resultValue;
|
||||
|
||||
resultValue = tmpStr.charAt(len - 1 - i) + resultValue;
|
||||
}
|
||||
return sign+resultValue+underComma;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param inputStr 숫자 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String dotPadding(String inputStr, int size) {
|
||||
if (inputStr.indexOf(".") >=0) {
|
||||
String beforeComma = inputStr.substring(0,inputStr.indexOf("."));
|
||||
String underComma = inputStr.substring(inputStr.indexOf(".")+1);
|
||||
return beforeComma + "." + StringUtil.rpad(underComma,"0",size);
|
||||
} else {
|
||||
return inputStr + ".00";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 입력된 스트링에 1000 단위 컴마를 삽입하여 리턴한다.
|
||||
* 만약 resultValue가 0일경우 resultValue는 공백으로 처리
|
||||
* 예) 10000000 -> 10,000,000
|
||||
* </pre>
|
||||
*
|
||||
* @param inputStr 숫자 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String insertComma2(String inputStr) {
|
||||
String resultValue = insertComma(inputStr);
|
||||
resultValue = resultValue.equals("0") ? "":resultValue;
|
||||
return resultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* source의 길이가 length만큼 될 때 까지 source 앞에 0을 붙여 리턴한다.
|
||||
* 예) fillZero('123',5) ==> '00123'
|
||||
* </pre>
|
||||
*
|
||||
* @param source 앞에 0을 붙일 문자열
|
||||
* @param length 0을 붙여 만들 문자열의 전체 길이
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String fillZero(String source, int length){
|
||||
if(source == null) return "";
|
||||
|
||||
if(source.length() >= length) return source;
|
||||
|
||||
while(source.length() < length)
|
||||
source = "0" + source;
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 0을 빈공간으로
|
||||
* 예) zeroToEmpty("0") = ""
|
||||
* </pre>
|
||||
*
|
||||
* @param value 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String zeroToEmpty(String value) {
|
||||
return value.equals("0") ? "":value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 빈공간을 0으로
|
||||
* 예) emptyToZero("") = 0
|
||||
* </pre>
|
||||
*
|
||||
* @param value 문자열
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String emptyToZero(String value) {
|
||||
return value.equals("") ? "0":value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* src1과 src2가 같으면target1을 반환하고 틀리면 target2를 반환
|
||||
* </pre>
|
||||
*
|
||||
* @param src1 비교문자열1
|
||||
* @param src2 비교문자열2
|
||||
* @param target1 반환값1
|
||||
* @param target2 반환값2
|
||||
* @return java.lang.String
|
||||
*/
|
||||
public static String iifEQ(String src1, String src2, String target1, String target2) {
|
||||
try {
|
||||
return src1.equals(src2) ? target1 : target2;
|
||||
} catch(IndexOutOfBoundsException e) {
|
||||
LOGGER.debug("error", e);
|
||||
return target2;
|
||||
} catch(NumberFormatException e) {
|
||||
LOGGER.debug("error", e);
|
||||
return target2;
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug("error", e);
|
||||
return target2;
|
||||
}
|
||||
}
|
||||
|
||||
public static String makeFileSizeStr(String size, String color_yn) {
|
||||
String tmp = "";
|
||||
long lsize = Long.parseLong(size);
|
||||
if (color_yn.equals("N")) {
|
||||
if (lsize > 1024*1024*1024) { tmp = insertComma(String.valueOf((lsize/1024/1024/10) / 100.0)) + "GB"; }
|
||||
else if (lsize > 1024*1024) { tmp = insertComma(String.valueOf((lsize/1024/10) / 100.0)) + "MB"; }
|
||||
else if (lsize > 1024) { tmp = insertComma(String.valueOf((lsize/10) / 100.0)) + "KB"; }
|
||||
else { tmp = size + "B";}
|
||||
} else {
|
||||
if (lsize > 1024*1024*1024) { tmp = insertComma(String.valueOf((lsize/1024/1024/10) / 100.0)) + "<font color='red'>GB</font>"; }
|
||||
else if (lsize > 1024*1024) { tmp = insertComma(String.valueOf((lsize/1024/10) / 100.0)) + "<font color='orange'>MB</font>"; }
|
||||
else if (lsize > 1024) { tmp = insertComma(String.valueOf((lsize/10) / 100.0)) + "<font color='blue'>KB</font>"; }
|
||||
else { tmp = size + "B";}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static String getPercent(int value1, int value2, int cutPoint) {
|
||||
String rtn = "";
|
||||
if(value1 == 0 && value2 == 0) {
|
||||
rtn = "";
|
||||
}else if(value1 == 0) {
|
||||
rtn = cutPoint > 0 ? "0." : "0";
|
||||
for(int i=0; i < cutPoint; i++) { rtn += "0"; }
|
||||
}else if(value1 == value2) {
|
||||
rtn = cutPoint > 0 ? "100." : "100";
|
||||
for(int i=0; i < cutPoint; i++) { rtn += "0"; }
|
||||
}else {
|
||||
rtn = String.valueOf(value1 * 100.0 / value2);
|
||||
if(rtn.indexOf(".") > 0) { rtn += "00000"; }
|
||||
else { rtn += ".00000"; }
|
||||
rtn = rtn.substring(0,rtn.indexOf(".") + cutPoint + 1);
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public static String getPercent(long value1, long value2, int cutPoint) {
|
||||
String rtn = "";
|
||||
if(value1 == 0 && value2 == 0) {
|
||||
rtn = "";
|
||||
}else if(value2 == 0) {
|
||||
rtn = "N/A";
|
||||
}else if(value1 == 0) {
|
||||
rtn = cutPoint > 0 ? "0." : "0";
|
||||
for(int i=0; i < cutPoint; i++) { rtn += "0"; }
|
||||
}else if(value1 == value2) {
|
||||
rtn = cutPoint > 0 ? "100." : "100";
|
||||
for(int i=0; i < cutPoint; i++) { rtn += "0"; }
|
||||
}else {
|
||||
rtn = String.valueOf(value1 * 100.0 / value2);
|
||||
if(rtn.indexOf(".") > 0) { rtn += "00000"; }
|
||||
else { rtn += ".00000"; }
|
||||
rtn = rtn.substring(0,rtn.indexOf(".") + cutPoint + 1);
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MobileCertificationUtil {
|
||||
/**
|
||||
* 모바일 인증 사용자 정보 암호화
|
||||
* @param cpId 회원사ID
|
||||
* @param urlCode URL코드
|
||||
* @param certNum 요청번호
|
||||
* @param date 요청일시
|
||||
* @param certMet 본인인증방법
|
||||
* @param name 성명
|
||||
* @param phoneNo 휴대폰번호
|
||||
* @param phoneCorp 이동통신사
|
||||
* @param birthDay 생년월일
|
||||
* @param gender 성별
|
||||
* @param nation 내외국인 구분
|
||||
* @param plusInfo 추가DATA정보
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String encryptCertData(String cpId, String urlCode, String certNum,
|
||||
String date, String certMet, String name, String phoneNo, String phoneCorp,
|
||||
String birthDay, String gender, String nation, String plusInfo) throws Exception {
|
||||
|
||||
String tr_cert = "";
|
||||
String extendVar = "0000000000000000"; // 확장변수
|
||||
String regex = "";
|
||||
String regex1 = "";
|
||||
|
||||
regex = "[A-Z]*";
|
||||
regex1 = "[0-9]*";
|
||||
if( cpId.length() == 8 ){
|
||||
String engcpId = cpId.substring(0,4);
|
||||
String numcpId = cpId.substring(4,8);
|
||||
if( !paramChk(regex, engcpId) || !paramChk(regex1, numcpId) ){
|
||||
throw new Exception("회원사ID 비정상");
|
||||
}
|
||||
} else {
|
||||
throw new Exception("회원사ID 비정상");
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( urlCode.length() != 6 || !paramChk(regex, urlCode) ){
|
||||
throw new Exception("URL코드 비정상");
|
||||
}
|
||||
|
||||
if( certNum.length() == 0 || certNum.length() > 40){
|
||||
throw new Exception("요청번호 비정상");
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( date.length() != 14 || !paramChk(regex, date) ){
|
||||
throw new Exception("요청일시 비정상");
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( certMet.length() != 1 || !paramChk(regex, certMet) ){
|
||||
throw new Exception("본인인증방법 비정상");
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( phoneNo.length() != 0 ){
|
||||
if( (phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo) ){
|
||||
throw new Exception("휴대폰번호 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( phoneCorp.length() != 0 ){
|
||||
if( phoneCorp.length() != 3 || !paramChk(regex, phoneCorp) ){
|
||||
throw new Exception("이동통신사 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( birthDay.length() != 0 ){
|
||||
if( birthDay.length() != 8 || !paramChk(regex, birthDay) ){
|
||||
throw new Exception("생년월일 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( gender.length() != 0 ){
|
||||
if( gender.length() != 1 || !paramChk(regex, gender) ){
|
||||
throw new Exception("성별 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( nation.length() != 0 ){
|
||||
if( nation.length() != 1 || !paramChk(regex, nation) ){
|
||||
throw new Exception("내/외국인 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-?.,-]*";
|
||||
if( name.length() != 0 ){
|
||||
if( name.length() > 60 || !paramChk(regex, name) ){
|
||||
throw new Exception("성명 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
//01. 한국모바일인증(주) 암호화 모듈 선언
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
//02. 1차 암호화 (tr_cert 데이터변수 조합 후 암호화)
|
||||
String enc_tr_cert = "";
|
||||
tr_cert = cpId +"/"+ urlCode +"/"+ certNum +"/"+ date +"/"+ certMet +"/"+ birthDay +"/"+ gender +"/"+ name +"/"+ phoneNo +"/"+ phoneCorp +"/"+ nation +"/"+ plusInfo +"/"+ extendVar;
|
||||
enc_tr_cert = seed.getEnc(tr_cert, "");
|
||||
|
||||
//03. 1차 암호화 데이터에 대한 위변조 검증값 생성 (HMAC)
|
||||
String hmacMsg = "";
|
||||
hmacMsg = seed.getMsg(enc_tr_cert);
|
||||
|
||||
//04. 2차 암호화 (1차 암호화 데이터, HMAC 데이터, extendVar 조합 후 암호화)
|
||||
tr_cert = seed.getEnc(enc_tr_cert + "/" + hmacMsg + "/" + extendVar, "");
|
||||
|
||||
return tr_cert;
|
||||
}
|
||||
|
||||
/**
|
||||
* 파라미터 유효성 검사
|
||||
* @param patn 정규식 패턴
|
||||
* @param param 검사 대상 데이터
|
||||
* @return
|
||||
*/
|
||||
public static Boolean paramChk(String patn, String param){
|
||||
Pattern pattern = Pattern.compile(patn);
|
||||
Matcher matcher = pattern.matcher(param);
|
||||
return matcher.matches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 모바일 인증 결과 복호화
|
||||
* @param in_recCert
|
||||
* @param in_certNum
|
||||
* @return Map(certNum:요청번호,date:요청일시,phoneNo:휴대폰번호,phoneCorp:이동통신사,birthDay:생년월일,gender:성별,nation:내외국인,name:성명,result:결과값,certMet:인증방법,ip:ip주소,M_name:미성년자성명,M_birthDay:미성년자생년월일,M_Gender:미성년자성별,M_nation:미성년자내외국인,plusInfo:추가DATA정보,CI:연계정보,DI:중복가입확인정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Map<String, String> decryptCertData(String in_recCert, String in_certNum) throws Exception{
|
||||
Map<String, String> resultMap = new HashMap<>();
|
||||
|
||||
//01. 한국모바일인증(주) 암호화 모듈 선언
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
//02. 1차 복호화
|
||||
String rec_cert = seed.getDec(in_recCert, in_certNum);
|
||||
|
||||
//03. 1차 파싱
|
||||
int inf1 = rec_cert.indexOf("/",0);
|
||||
int inf2 = rec_cert.indexOf("/",inf1+1);
|
||||
|
||||
String encPara = rec_cert.substring(0,inf1); //암호화된 통합 파라미터
|
||||
String encMsg1 = rec_cert.substring(inf1+1,inf2); //암호화된 통합 파라미터의 Hash값
|
||||
|
||||
//04. 위변조 검증
|
||||
String encMsg2 = seed.getMsg(encPara);
|
||||
|
||||
String msgChk = "N";
|
||||
if(encMsg2.equals(encMsg1)){
|
||||
msgChk="Y";
|
||||
}
|
||||
|
||||
if(msgChk.equals("N")){
|
||||
throw new Exception("비정상적인 접근입니다.");
|
||||
}
|
||||
|
||||
//05. 2차 복호화
|
||||
rec_cert = seed.getDec(encPara, in_certNum);
|
||||
|
||||
//06. 2차 파싱
|
||||
int info1 = rec_cert.indexOf("/",0);
|
||||
int info2 = rec_cert.indexOf("/",info1+1);
|
||||
int info3 = rec_cert.indexOf("/",info2+1);
|
||||
int info4 = rec_cert.indexOf("/",info3+1);
|
||||
int info5 = rec_cert.indexOf("/",info4+1);
|
||||
int info6 = rec_cert.indexOf("/",info5+1);
|
||||
int info7 = rec_cert.indexOf("/",info6+1);
|
||||
int info8 = rec_cert.indexOf("/",info7+1);
|
||||
int info9 = rec_cert.indexOf("/",info8+1);
|
||||
int info10 = rec_cert.indexOf("/",info9+1);
|
||||
int info11 = rec_cert.indexOf("/",info10+1);
|
||||
int info12 = rec_cert.indexOf("/",info11+1);
|
||||
int info13 = rec_cert.indexOf("/",info12+1);
|
||||
int info14 = rec_cert.indexOf("/",info13+1);
|
||||
int info15 = rec_cert.indexOf("/",info14+1);
|
||||
int info16 = rec_cert.indexOf("/",info15+1);
|
||||
int info17 = rec_cert.indexOf("/",info16+1);
|
||||
int info18 = rec_cert.indexOf("/",info17+1);
|
||||
|
||||
String certNum = rec_cert.substring(0,info1);
|
||||
String date = rec_cert.substring(info1+1,info2);
|
||||
String CI = rec_cert.substring(info2+1,info3);
|
||||
String phoneNo = rec_cert.substring(info3+1,info4);
|
||||
String phoneCorp = rec_cert.substring(info4+1,info5);
|
||||
String birthDay = rec_cert.substring(info5+1,info6);
|
||||
String gender = rec_cert.substring(info6+1,info7);
|
||||
String nation = rec_cert.substring(info7+1,info8);
|
||||
String name = rec_cert.substring(info8+1,info9);
|
||||
String result = rec_cert.substring(info9+1,info10);
|
||||
String certMet = rec_cert.substring(info10+1,info11);
|
||||
String ip = rec_cert.substring(info11+1,info12);
|
||||
String reserve1 = rec_cert.substring(info12+1,info13);
|
||||
String reserve2 = rec_cert.substring(info13+1,info14);
|
||||
String reserve3 = rec_cert.substring(info14+1,info15);
|
||||
String reserve4 = rec_cert.substring(info15+1,info16);
|
||||
String plusInfo = rec_cert.substring(info16+1,info17);
|
||||
String DI = rec_cert.substring(info17+1,info18);
|
||||
|
||||
//07. CI, DI 복호화
|
||||
CI = seed.getDec(CI, in_certNum);
|
||||
DI = seed.getDec(DI, in_certNum);
|
||||
|
||||
resultMap.put("certNum", certNum);
|
||||
resultMap.put("date", date);
|
||||
resultMap.put("CI", CI);
|
||||
resultMap.put("phoneNo", phoneNo);
|
||||
resultMap.put("phoneCorp", phoneCorp);
|
||||
resultMap.put("birthDay", birthDay);
|
||||
resultMap.put("gender", gender);
|
||||
resultMap.put("nation", nation);
|
||||
resultMap.put("name", name);
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("certMet", certMet);
|
||||
resultMap.put("ip", ip);
|
||||
resultMap.put("plusInfo", plusInfo);
|
||||
resultMap.put("DI", DI);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,804 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLDecoder;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||
|
||||
|
||||
public final class MyUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MyUtil.class);
|
||||
|
||||
public static final String VERSION = "20240816_1430";
|
||||
|
||||
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
|
||||
|
||||
// 주석 다는 기준: https://www.oracle.com/technetwork/java/javase/tech/index-137868.html
|
||||
|
||||
/**
|
||||
* 특정 자리수의 랜덤 숫자를 생성한다.
|
||||
* @param nLength 랜덤문자의 길이
|
||||
* @return 생성된 랜덤 문자
|
||||
*/
|
||||
public static String getRandomNumber(int nLength) {
|
||||
Random generator = new Random();
|
||||
String strRandValue = "";
|
||||
|
||||
for (int i = 0; i < nLength; i++) {
|
||||
strRandValue += Integer.toString( generator.nextInt(10) );
|
||||
}
|
||||
|
||||
return strRandValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 현재 Timestamp를 반환한다
|
||||
* @return 현재 Timestamp yyyy-MM-dd hh:mm:ss
|
||||
*/
|
||||
public static String getCurrentDateTime() {
|
||||
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
||||
System.out.println(timestamp);
|
||||
|
||||
return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(timestamp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 현재 date를 반환한다
|
||||
* @return 현재 Timestamp yyyy-MM-dd
|
||||
*/
|
||||
public static String getCurrentDate() {
|
||||
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
||||
System.out.println(timestamp);
|
||||
|
||||
return new SimpleDateFormat("yyyy-MM-dd").format(timestamp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 현재 시각 구하기
|
||||
* @return 현재 Timestamp hh:mm:ss
|
||||
*/
|
||||
public static String getCurrentTime() {
|
||||
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
||||
System.out.println(timestamp);
|
||||
|
||||
return new SimpleDateFormat("hh:mm:ss").format(timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 년 월 일 날짜 더하기
|
||||
*
|
||||
* @param dt(날짜) , y(년) , m(월), d(일)
|
||||
* @Exam addDate("2018-09-10",1,12,1) -->20200911 addDate("2018-09-10",1,-2,1) -->20200711
|
||||
* @return String
|
||||
*/
|
||||
public static String addDate(String dt, int y, int m, int d) throws Exception {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date date = format.parse(dt);
|
||||
cal.setTime(date);
|
||||
cal.add(Calendar.YEAR, y); //년 더하기
|
||||
cal.add(Calendar.MONTH, m); //월 더하기
|
||||
cal.add(Calendar.DATE, d); //일 더하기
|
||||
|
||||
return format.format(cal.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 일 구하기
|
||||
*
|
||||
* @param dt(날짜)
|
||||
* @Exam addDate("2018-09-10",1,12,1) -->20200911 addDate("2018-09-10",1,-2,1) -->20200711
|
||||
* @return int
|
||||
*/
|
||||
public static int getDate(String dt) throws Exception {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date date = format.parse(dt);
|
||||
cal.setTime(date);
|
||||
logger.info("getDate:" + cal.get(cal.DATE));
|
||||
return cal.get(cal.DATE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* UPDATE 문에서 문자열 타입의 필드를 추가한다.
|
||||
*
|
||||
* @param strQuery 쿼리, strColumnName 컬럼명, strTarget
|
||||
* @Exam addUpdateString("UPDATE SET ", "name", "홍길동") --> UPDATE SET name='홍길동',
|
||||
* @return String
|
||||
*/
|
||||
public static String addUpdateString(String strQuery, String strColumnName, String strValue ) {
|
||||
|
||||
if( strValue != null && strValue.isEmpty() == false && strValue.equals("undefined") == false && strValue.equals("null") == false ) {
|
||||
strQuery += strColumnName + "='" + strValue + "',";
|
||||
}
|
||||
return strQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* UPDATE 문에서 Long 타입의 필드를 추가한다.
|
||||
*
|
||||
* @param strQuery 쿼리, strColumnName 컬럼명, longTarget
|
||||
* @Exam addUpdateString("UPDATE SET ", "age", 2l) --> UPDATE SET age=2,
|
||||
* @return String
|
||||
*/
|
||||
public static String addUpdateLong(String strQuery, String strColumnName, Long longTarget ) {
|
||||
|
||||
if( longTarget != null ) {
|
||||
strQuery += strColumnName + "=" + longTarget + ",";
|
||||
}
|
||||
return strQuery;
|
||||
}
|
||||
|
||||
/*
|
||||
public static boolean isJSONValid(String test) {
|
||||
try {
|
||||
new JSONObject(test);
|
||||
} catch (JSONException ex) {
|
||||
// edited, to include @Arthur's comment
|
||||
// e.g. in case JSONArray is valid as well...
|
||||
try {
|
||||
new JSONArray(test);
|
||||
} catch (JSONException ex1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
public static String getQuery(List<NameValuePair> params) throws UnsupportedEncodingException
|
||||
{
|
||||
StringBuilder result = new StringBuilder();
|
||||
boolean first = true;
|
||||
|
||||
for (NameValuePair pair : params)
|
||||
{
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
result.append("&");
|
||||
|
||||
//result.append(URLEncoder.encode(pair.getName(), "UTF-8"));
|
||||
result.append(pair.getName());
|
||||
result.append("=");
|
||||
result.append(pair.getValue());
|
||||
//result.append(URLEncoder.encode(pair.getValue(), "UTF-8"));
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* SHA-256으로 해싱하는 메소드
|
||||
* @param msg
|
||||
* @return
|
||||
* @throws NoSuchAlgorithmException
|
||||
*/
|
||||
public static String sha256(String msg) throws NoSuchAlgorithmException {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
md.update(msg.getBytes());
|
||||
|
||||
return bytesToHex(md.digest());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 바이트를 헥스값으로 변환한다
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
public static String bytesToHex(byte[] bytes) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (byte b: bytes) {
|
||||
builder.append(String.format("%02x", b));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 세틀뱅크 수취인 조회 서비스 HTML문서에서 특정 값 추출하기
|
||||
* @param html_line
|
||||
* @param inputName
|
||||
* @return
|
||||
*/
|
||||
public static String parseInpuValueForSettleBankResponse(String html_line, String inputName) {
|
||||
|
||||
String[] strArrValue = html_line.split("name=\"" + inputName + "\" value=");
|
||||
String strValue = "";
|
||||
|
||||
if( strArrValue.length == 2 ) {
|
||||
strValue = strArrValue[1].replaceAll("[\"|>|\\r\\n|\\n\\r|\\r|\\n|\\s|\\+)]","");
|
||||
try {
|
||||
//logger.info("Encoding EUC-KR:" + URLDecoder.decode(strValue, "EUC-KR"));
|
||||
//logger.info("Encoding UTF-8:" + URLDecoder.decode(strValue, "UTF-8"));
|
||||
strValue = URLDecoder.decode(strValue, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e2) {
|
||||
// TODO Auto-generated catch block
|
||||
e2.printStackTrace();
|
||||
}
|
||||
}
|
||||
return strValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 숫자 외 소수점을 포함한 모든 특수문자를 제거해준다.
|
||||
*
|
||||
*/
|
||||
public static String removeSpecialChractersNumber( String decimalNumber ) {
|
||||
decimalNumber = decimalNumber.replaceAll("[^0-9]", ""); //숫자 외 모두 제거한다.
|
||||
return decimalNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 수수점을 제외한 나머지 특수문자를 제거해준다. 그리고 소수점은 1개만 들어가도록 해준다.
|
||||
*
|
||||
*/
|
||||
public static String removeSpecialChractersDecimalNumber( String decimalNumber ) {
|
||||
decimalNumber = decimalNumber.replaceAll("[^0-9.\\-]", ""); //숫자와 쩜.-말고는 제거한다.
|
||||
// 소수점 1개만 넣도록 하기
|
||||
int nDotIdx = decimalNumber.indexOf(".");
|
||||
if( nDotIdx > -1 ) {
|
||||
String[] arrSplit = decimalNumber.split("\\.");
|
||||
if( arrSplit.length != 0) {
|
||||
decimalNumber = "";
|
||||
}
|
||||
for( int i = 0; i < arrSplit.length ; i++ ) {
|
||||
decimalNumber += arrSplit[i];
|
||||
if( i == 0 ) {
|
||||
decimalNumber += ".";
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("removeSpecialChractersDecimalNumber() decimalNumber:" + decimalNumber);
|
||||
return decimalNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 소수점자리수가 3자리 이상이면 2자리까지만 남기고 나머지는 지운다.
|
||||
* @param decimalNumber 소수점 자리 n개 이상 인 경우, 지울 숫자가 들어있는 문자열
|
||||
* @param nLimitDecimalNumber 허용할 소수점 자
|
||||
* @return
|
||||
*/
|
||||
public static String removeOverDecimalNumber( String decimalNumber, int nLimitDecimalNumber ) {
|
||||
logger.error("decimalNumber:" + decimalNumber);
|
||||
int nDotIdx = decimalNumber.indexOf(".");
|
||||
if( nDotIdx > -1 ) {
|
||||
String[] arrSplit = decimalNumber.split("\\.");
|
||||
if( arrSplit[1].length() > nLimitDecimalNumber ) {
|
||||
return arrSplit[0] + "." + arrSplit[1].substring(0,2);
|
||||
}
|
||||
}
|
||||
logger.error("decimalNumber:" + decimalNumber);
|
||||
return decimalNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,000 단위마다 콤마를 찍는다.
|
||||
* @param bdAmount
|
||||
* @return
|
||||
*/
|
||||
public static String addComma(BigDecimal bdAmount) {
|
||||
return addComma(bdAmount.toPlainString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,000 단위마다 콤마를 찍는다.
|
||||
* @param doubleAmount
|
||||
* @return
|
||||
*/
|
||||
public static String addComma(Double doubleAmount) {
|
||||
return addComma(BigDecimal.valueOf(doubleAmount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,000 단위마다 콤마를 찍는다.
|
||||
* @param longAmount
|
||||
* @return
|
||||
*/
|
||||
public static String addComma(Long longAmount) {
|
||||
return addComma(BigDecimal.valueOf(longAmount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,000 단위마다 콤마를 찍는다.
|
||||
* @param strAmount
|
||||
* @return
|
||||
*/
|
||||
public static String addComma(String strAmount) {
|
||||
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
|
||||
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
|
||||
|
||||
if( isNumeric(strAmount) == false ) {
|
||||
return strAmount;
|
||||
}
|
||||
|
||||
int nDotIndex = strAmount.indexOf(".");
|
||||
|
||||
|
||||
symbols.setGroupingSeparator(',');
|
||||
formatter.setDecimalFormatSymbols(symbols);
|
||||
if( nDotIndex > -1 ) {
|
||||
return formatter.format(Double.parseDouble( strAmount ));
|
||||
} else {
|
||||
return formatter.format(Long.parseLong( strAmount ));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 숫자에서 끝에 0000을 제거한다.
|
||||
*
|
||||
*/
|
||||
public static String trimTrailingZero( String decimalNumber ) {
|
||||
decimalNumber = decimalNumber.replaceAll("[^0-9.\\-]", ""); //숫자와 쩜.-말고는 제거한다.
|
||||
decimalNumber = decimalNumber.indexOf(".") < 0 ? decimalNumber : decimalNumber.replaceAll("0*$", "").replaceAll("\\.$", "");
|
||||
logger.info("trimTrailingZero() decimalNumber:" + decimalNumber);
|
||||
return decimalNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL 인젝션 방어를 위해 특수문자를 제거한다.
|
||||
* @param myString
|
||||
* @return
|
||||
*/
|
||||
public static String removeSQLInjectionSpecialCharacter(String myString) {
|
||||
if( myString == null ) {
|
||||
return myString;
|
||||
}
|
||||
myString = myString.replaceAll( "<|>|\\(|\\)|'|\"|\\|;|=|\\+|\\||&|#|\\.\\.", " ");
|
||||
|
||||
return myString;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* UUID(GUID)를 얻는다.
|
||||
* @return 구한 UUID(GUID) 값.
|
||||
*/
|
||||
public static String getUuid() {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
return uuid;
|
||||
}
|
||||
|
||||
/** 숫자인지 아닌지 확인한다. */
|
||||
public static boolean isNumeric(String strNum) {
|
||||
if (strNum == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
double d = Double.parseDouble(strNum);
|
||||
} catch (NumberFormatException nfe) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isNumeric(Double num) {
|
||||
if (num == null) {
|
||||
return false;
|
||||
}
|
||||
return isNumeric(num.toString());
|
||||
}
|
||||
|
||||
public static boolean isNumeric(Integer num) {
|
||||
if (num == null) {
|
||||
return false;
|
||||
}
|
||||
return isNumeric(num.toString());
|
||||
}
|
||||
|
||||
public static boolean isNumeric(Long num) {
|
||||
if (num == null) {
|
||||
return false;
|
||||
}
|
||||
return isNumeric(num.toString());
|
||||
}
|
||||
|
||||
/** Long형태의 숫자인지 아닌지 확인한다. */
|
||||
public static boolean isNumericForLong(String strNum) {
|
||||
if (strNum == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Long lValue = Long.parseLong(strNum);
|
||||
} catch (NumberFormatException nfe) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static Integer getIntegerFromObject(Object obj) {
|
||||
if (obj instanceof Integer ) {
|
||||
return (Integer) obj;
|
||||
} else if (obj instanceof String ) {
|
||||
return Integer.parseInt((String) obj);
|
||||
} else if (obj instanceof Long) {
|
||||
return ((Long) obj).intValue();
|
||||
} else if (obj instanceof Double) {
|
||||
return ((Long)Math.round((Double)obj)).intValue();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Long getLongFromObject(Object obj) {
|
||||
if (obj instanceof String ) {
|
||||
String strObj = (String) obj;
|
||||
if( isNumeric(strObj) ) {
|
||||
return Long.parseLong((String) obj);
|
||||
}
|
||||
} else if (obj instanceof Integer) {
|
||||
return ((Integer) obj).longValue();
|
||||
} else if (obj instanceof Long) {
|
||||
return (Long) obj;
|
||||
} else if (obj instanceof BigDecimal) {
|
||||
return ((BigDecimal) obj).longValue();
|
||||
} else if (obj instanceof Double) {
|
||||
return ((Long)Math.round((Double)obj));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Double getDoubleFromObject(Object obj) throws Exception {
|
||||
String str = getStringFromObject(obj);
|
||||
str = removeSpecialChractersDecimalNumber(str);
|
||||
return Double.parseDouble((String) str);
|
||||
}
|
||||
|
||||
public static BigDecimal getBigDecimalFromObject(Object obj) throws Exception {
|
||||
return BigDecimal.valueOf(getDoubleFromObject(obj));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getStringFromObject(Object obj) throws Exception {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
} else if (obj instanceof String ) {
|
||||
return (String) obj;
|
||||
} else if (obj instanceof Integer) {
|
||||
return ((Integer)obj).toString();
|
||||
} else if (obj instanceof Long) {
|
||||
return ((Long) obj).toString();
|
||||
} else if (obj instanceof Float) {
|
||||
return ((Float)obj).toString();
|
||||
} else if (obj instanceof Double) {
|
||||
return ((Double)obj).toString();
|
||||
} else if (obj instanceof BigDecimal) {
|
||||
return ((BigDecimal)obj).toPlainString();
|
||||
} else if (obj instanceof Date) {
|
||||
return ((Date)obj).toString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static org.json.simple.JSONObject getJSONObjectFromObject(Object obj) {
|
||||
if (obj instanceof org.json.simple.JSONObject ) {
|
||||
return (org.json.simple.JSONObject) obj;
|
||||
} else if (obj instanceof String ) {
|
||||
JSONParser parser = new JSONParser();
|
||||
try {
|
||||
obj = parser.parse( (String) obj );
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return (org.json.simple.JSONObject) obj;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static org.json.simple.JSONArray getJSONArrayFromObject(Object obj) {
|
||||
if (obj instanceof org.json.simple.JSONArray ) {
|
||||
return (org.json.simple.JSONArray) obj;
|
||||
} else if (obj instanceof String ) {
|
||||
JSONParser parser = new JSONParser();
|
||||
try {
|
||||
obj = parser.parse( (String) obj );
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return (org.json.simple.JSONArray) obj;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Boolean getBooleanFromObject(Object obj) {
|
||||
|
||||
if (obj instanceof String ) {
|
||||
return Boolean.parseBoolean( ((String)obj).trim() );
|
||||
} else if (obj instanceof Boolean) {
|
||||
return (Boolean)obj;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a URI String into Name-Value Collection
|
||||
* 쿼리스트링을 분석해서 Map형태로 return해준다.
|
||||
* @param query
|
||||
* @return query string name-value Map.
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public static Map<String, String> splitQuery(String query, String token) throws UnsupportedEncodingException {
|
||||
Map<String, String> query_pairs = new LinkedHashMap<String, String>();
|
||||
String[] pairs = query.split(token);
|
||||
for (String pair : pairs) {
|
||||
int idx = pair.indexOf("=");
|
||||
query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8"));
|
||||
}
|
||||
return query_pairs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static SortedMap<String,String[]> getParameterMap(HttpServletRequest request) {
|
||||
|
||||
SortedMap<String,String[]> sMap = Collections.synchronizedSortedMap
|
||||
( new TreeMap<String,String[]>(request.getParameterMap()));
|
||||
|
||||
String params = "\n--------------------------------------------------------------\n" +
|
||||
MyUtil.getBASEURL(request) + request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n";
|
||||
synchronized(sMap) {
|
||||
for(String key : sMap.keySet()) {
|
||||
String[] value = sMap.get(key);
|
||||
for(int i=0; i<value.length; i++) {
|
||||
params += key + "[" + value[i] + "]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
params += "--------------------------------------------------------------\n";
|
||||
logger.info(params);
|
||||
|
||||
return sMap;
|
||||
}
|
||||
|
||||
public static String getParametersForLog(HttpServletRequest request) {
|
||||
|
||||
SortedMap<String,String[]> sMap = Collections.synchronizedSortedMap
|
||||
( new TreeMap<String,String[]>(request.getParameterMap()));
|
||||
|
||||
String params = "\n--------------------------------------------------------------\n" +
|
||||
MyUtil.getBASEURL(request) + request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n";
|
||||
synchronized(sMap) {
|
||||
for(String key : sMap.keySet()) {
|
||||
String[] value = sMap.get(key);
|
||||
for(int i=0; i<value.length; i++) {
|
||||
params += key + "[" + value[i] + "]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
params += "--------------------------------------------------------------\n";
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
public static String getBASEURL(HttpServletRequest request) {
|
||||
|
||||
String baseUrl = ServletUriComponentsBuilder.fromRequestUri(request)
|
||||
.replacePath(null)
|
||||
.build()
|
||||
.toUriString();
|
||||
|
||||
//첫번째 글자가 아닌경우,
|
||||
if(
|
||||
(baseUrl.indexOf("http://localhost") == -1 && baseUrl.indexOf("http://127.") == -1) ||
|
||||
(baseUrl.indexOf("http://localhost") != 0 && baseUrl.indexOf("http://127.") != 0) ) {
|
||||
baseUrl = baseUrl.replace("http","https");
|
||||
}
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
public static String getRefererBASEURL(HttpServletRequest request) {
|
||||
|
||||
|
||||
String referer = request.getHeader("Referer");
|
||||
|
||||
if( referer == null ) {
|
||||
return referer;
|
||||
}
|
||||
String baseUrl = ServletUriComponentsBuilder.fromUriString(referer).replacePath(null)
|
||||
.build()
|
||||
.toUriString();
|
||||
|
||||
//첫번째 글자가 아닌경우,
|
||||
if(
|
||||
(baseUrl.indexOf("http://localhost") == -1 && baseUrl.indexOf("http://127.") == -1) ||
|
||||
(baseUrl.indexOf("http://localhost") != 0 && baseUrl.indexOf("http://127.") != 0) ) {
|
||||
baseUrl = baseUrl.replace("http","https");
|
||||
}
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 소수점 첫째 자리가 0인 경우 표시하지 않기.
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public static String noDisplayDecimalPlacesIfZero(double number) {
|
||||
DecimalFormat df=new DecimalFormat("#.##");
|
||||
return df.format(number);
|
||||
}
|
||||
|
||||
/**
|
||||
* strJSON로 부터 JSONObject를 추출한다.
|
||||
* @param strJSON
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static JSONObject getJSONObjectFromStrJSON(String strJSON) throws Exception {
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
Object obj = parser.parse(strJSON);
|
||||
jsonObject = (JSONObject) obj;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (jsonObject == null) {
|
||||
throw new Exception("요청이 잘 못 되었습니다. jsonObject is null");
|
||||
}
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 특정 소수점을 버림 처리한다.
|
||||
* @param strAmount 문자열 형태로 들어간 소수
|
||||
* @param decimalPlace 이 값이 2라면 1.2371234 -> 1.23
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Double floor(String strAmount, int decimalPlace) throws Exception {
|
||||
|
||||
Double dPoint = Double.parseDouble(strAmount);
|
||||
|
||||
String[] arrSplitedDot = strAmount.split("\\.");
|
||||
int nLength = arrSplitedDot.length;
|
||||
if (arrSplitedDot.length == 2) {
|
||||
if (MyUtil.isNumeric(arrSplitedDot[1])) {
|
||||
|
||||
//소수부 끝에 0을 제거해준다.
|
||||
arrSplitedDot[1] = arrSplitedDot[1].replaceAll("0+$", "");
|
||||
|
||||
int nDecimalLength = arrSplitedDot[1].length();
|
||||
if( nDecimalLength >= decimalPlace ) {
|
||||
String strDecimal = "1";
|
||||
for (int i = 0; i < decimalPlace; i++) {
|
||||
strDecimal += "0";
|
||||
}
|
||||
dPoint = Math.floor(dPoint*Long.valueOf(strDecimal)) / Long.valueOf(strDecimal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dPoint;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* days안에는 "월" 또는 "월,수,금" 이런 요일에 대한 한글문자가 들어가고 오늘이 주어진 요일 안에 포함되는지 여부를 알아낸다.
|
||||
*
|
||||
* @param days "월" 또는 "월,수,금'과 같이 요일이 한글로 들어있다.
|
||||
* @return 만약 days에 "월"이 들어가 있고 오늘이 월요일이라면 true를 return한다.
|
||||
*/
|
||||
public static Boolean isContainDayOfWeekToday( String days ) {
|
||||
|
||||
// 1. Date 생성 / 현재 날짜
|
||||
Date currentDate = new Date();
|
||||
System.out.println(currentDate);
|
||||
|
||||
// 2. Calendar 생성
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(currentDate);
|
||||
|
||||
// 3. 텍스트 요일 구하기 (숫자)
|
||||
int dayOfWeekNumber = calendar.get(Calendar.DAY_OF_WEEK);
|
||||
|
||||
if( dayOfWeekNumber == 1 ) {
|
||||
if( days.indexOf("일") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
} else if( dayOfWeekNumber == 2 ) {
|
||||
if( days.indexOf("월") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
} else if( dayOfWeekNumber == 3 ) {
|
||||
if( days.indexOf("화") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
} else if( dayOfWeekNumber == 4 ) {
|
||||
if( days.indexOf("수") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
} else if( dayOfWeekNumber == 5 ) {
|
||||
if( days.indexOf("목") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
} else if( dayOfWeekNumber == 6 ) {
|
||||
if( days.indexOf("금") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
} else if( dayOfWeekNumber == 7 ) {
|
||||
if( days.indexOf("토") > -1 ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 현재 시각이 timeRange에 명시한 시간대 안에 포함되는지 여부를 return 한다.
|
||||
* @param timeRange 01~14 -> 오전 1시부터 오후 2시를 의미하며 ~ 구분자를 사용한다.
|
||||
* @return 현재 시각이 해당 시간대 내에 포함되면 true를 return 한다.
|
||||
* @throws Exception timeRange이 형식에 맞지 않으면 Exception이 발생한다.
|
||||
*/
|
||||
public static Boolean isInTimeRange( String timeRange ) throws Exception {
|
||||
|
||||
String[] arrTimeRange = timeRange.split("~");
|
||||
if( arrTimeRange.length != 2 ) {
|
||||
throw new Exception("timeRange이 형식에 맞지 않습니다.");
|
||||
}
|
||||
|
||||
if( MyUtil.isNumeric(arrTimeRange[0]) == false ) {
|
||||
throw new Exception("timeRange이 형식에 맞지 않습니다 - 1");
|
||||
}
|
||||
|
||||
if( MyUtil.isNumeric(arrTimeRange[1]) == false ) {
|
||||
throw new Exception("timeRange이 형식에 맞지 않습니다 - 1");
|
||||
}
|
||||
|
||||
|
||||
Date currentDate = new Date();
|
||||
// 포맷팅 정의
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH");
|
||||
// 포맷팅 적용
|
||||
String formatedNow = formatter.format(currentDate);
|
||||
|
||||
Integer currentHour = MyUtil.getIntegerFromObject( formatedNow );
|
||||
Integer rangeStart = MyUtil.getIntegerFromObject( arrTimeRange[0] );
|
||||
Integer rangeEnd = MyUtil.getIntegerFromObject( arrTimeRange[0] );
|
||||
|
||||
if( rangeStart <= rangeEnd && rangeEnd <= rangeEnd ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
public final class RequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
public RequestWrapper(HttpServletRequest servletRequest) {
|
||||
super(servletRequest);
|
||||
}
|
||||
|
||||
public String[] getParameterValues(String parameter) {
|
||||
|
||||
String[] values = super.getParameterValues(parameter);
|
||||
|
||||
System.out.println("getParameterValues" + values);
|
||||
|
||||
if (values==null) {
|
||||
return null;
|
||||
}
|
||||
int count = values.length;
|
||||
String[] encodedValues = new String[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
encodedValues[i] = cleanXSS(values[i]);
|
||||
}
|
||||
return encodedValues;
|
||||
}
|
||||
|
||||
public String getParameter(String parameter) {
|
||||
String value = super.getParameter(parameter);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
return cleanXSS(value);
|
||||
}
|
||||
|
||||
public String getHeader(String name) {
|
||||
String value = super.getHeader(name);
|
||||
if (value == null)
|
||||
return null;
|
||||
return cleanXSS(value);
|
||||
|
||||
}
|
||||
|
||||
public static String cleanXSS(String value) {
|
||||
System.out.println("cleanXSS : " + value);
|
||||
//You'll need to remove the spaces from the html entities below
|
||||
value = value.replaceAll("<", "& lt;").replaceAll(">", "& gt;");
|
||||
value = value.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;");
|
||||
value = value.replaceAll("'", "& #39;");
|
||||
value = value.replaceAll("eval\\((.*)\\)", "");
|
||||
value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
|
||||
value = value.replaceAll("script", "");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,275 @@
|
|||
/*********************************************************************************
|
||||
* 파 일 명 : RsWrapper.java
|
||||
* 작 성 일 : 2005.02
|
||||
* 작 성 자 : 최군길
|
||||
*---------------------------------------------------------------------------------
|
||||
* 프로그램명 : RsWrapper
|
||||
* 기능 및 설명 : JDBC Result Set Wrapper
|
||||
*---------------------------------------------------------------------------------
|
||||
* 기 타 :
|
||||
*********************************************************************************/
|
||||
package geoinfo.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.extentech.toolkit.Logger;
|
||||
|
||||
|
||||
public class RsWrapper implements java.io.Serializable {
|
||||
|
||||
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(RsWrapper.class);
|
||||
|
||||
/**
|
||||
* RsBox 를 담기위한 Vector
|
||||
*/
|
||||
private Vector vtRsBox;
|
||||
|
||||
/**
|
||||
* 레코드 갯수
|
||||
*/
|
||||
private int rowCount;
|
||||
|
||||
/**
|
||||
* 레코드의 인덱스 필드에서 가장 큰 것을 갖는다
|
||||
*/
|
||||
private String firstRowID;
|
||||
|
||||
/**
|
||||
* 레코드의 인덱스 필드에서 가장 작은 것을 갖는다
|
||||
*/
|
||||
private String lastRowID;
|
||||
|
||||
private String pageCount = "1"; // 페이징의 페이지 번호
|
||||
private String unitCount = "10"; // 페이징의 페이지 당 아이템 갯수
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public RsWrapper() {
|
||||
vtRsBox = new Vector(10, 10);
|
||||
firstRowID = "";
|
||||
lastRowID = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RsBox 를 RsWrapper 에 추가한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param rsBox
|
||||
* RsBox
|
||||
*/
|
||||
public void appendRs(Box rb) {
|
||||
vtRsBox.addElement(rb);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RsWrapper에 저장된 RsBox의 갯수를 리턴한다.
|
||||
* </pre>
|
||||
*
|
||||
* @return int RsBox의 갯수
|
||||
*/
|
||||
public int getLength() {
|
||||
return vtRsBox.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* index 위치에 있는 RsBox를 가져와 반환한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param index
|
||||
* RsBox를 찾을 위치
|
||||
* @return RsBox
|
||||
*/
|
||||
public Box getRsBoxAt(int index) {
|
||||
return (Box) vtRsBox.get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RsWrapper 를 Iterator 를 이용하여 사용할 수 있도록 RsWrapperIterator 를 반환한다.
|
||||
* </pre>
|
||||
*
|
||||
* @return RsWrapperIterator (Iterator 를 implements 하였음)
|
||||
*/
|
||||
public RsWrapperIterator iterator() {
|
||||
return new RsWrapperIterator(this);
|
||||
}
|
||||
|
||||
public void setRowCount(int cnt) {
|
||||
this.rowCount = cnt;
|
||||
}
|
||||
|
||||
public void setFirstRowID(String firstRowID) {
|
||||
this.firstRowID = firstRowID;
|
||||
}
|
||||
|
||||
public void setLastRowID(String lastRowID) {
|
||||
this.lastRowID = lastRowID;
|
||||
}
|
||||
|
||||
public int getRowCount() {
|
||||
return this.rowCount;
|
||||
}
|
||||
|
||||
public String getPageCount() {
|
||||
return this.pageCount;
|
||||
}
|
||||
|
||||
public String getUnitCount() {
|
||||
return this.unitCount;
|
||||
}
|
||||
|
||||
public void setPageCount(String pageCount) {
|
||||
this.pageCount = pageCount;
|
||||
}
|
||||
|
||||
public void setUnitCount(String unitCount) {
|
||||
this.unitCount = unitCount;
|
||||
}
|
||||
|
||||
public String getSno(int i, int unit, HttpServletRequest request) {
|
||||
int page = Integer.parseInt(FormatUtil.nvl2(request.getParameter("page_count"), "1"));
|
||||
|
||||
return (getRowCount() - (((page - 1) * unit) + i)) + "";
|
||||
}
|
||||
|
||||
public String getSnoAsc(int i, int unit, HttpServletRequest request) {
|
||||
int page = Integer.parseInt(FormatUtil.nvl2(request.getParameter("page_count"), "1"));
|
||||
|
||||
return (((page - 1) * unit) + i + 1) + "";
|
||||
}
|
||||
|
||||
public String getSno(int i) {
|
||||
int page = 10;
|
||||
int unit = 10;
|
||||
|
||||
if (!pageCount.equals("")) {
|
||||
page = Integer.parseInt(pageCount);
|
||||
}
|
||||
if (!unitCount.equals("")) {
|
||||
unit = Integer.parseInt(unitCount);
|
||||
}
|
||||
|
||||
return (((page - 1) * unit) + getLength() - i) + "";
|
||||
}
|
||||
|
||||
public String getMaxRowID() {
|
||||
// bug 수정
|
||||
// firstRowID와 lastRowID의 길이가 다를 경우 compareTo로만 비교하면 안됨
|
||||
if (CheckNumber(firstRowID) && CheckNumber(lastRowID)) {
|
||||
if ((new Double(firstRowID)).compareTo(new Double(lastRowID)) >= 0)
|
||||
return this.firstRowID;
|
||||
else
|
||||
return this.lastRowID;
|
||||
} else {
|
||||
if (firstRowID.compareTo(lastRowID) >= 0)
|
||||
return this.firstRowID;
|
||||
else
|
||||
return this.lastRowID;
|
||||
}
|
||||
}
|
||||
|
||||
public String getMinRowID() {
|
||||
if (CheckNumber(firstRowID) && CheckNumber(lastRowID)) {
|
||||
if ((new Double(firstRowID)).compareTo(new Double(lastRowID)) >= 0)
|
||||
return this.lastRowID;
|
||||
else
|
||||
return this.firstRowID;
|
||||
} else {
|
||||
if (firstRowID.compareTo(lastRowID) >= 0)
|
||||
return this.lastRowID;
|
||||
else
|
||||
return this.firstRowID;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 문자열이 숫자로만 이루어져 있는지 판단한다.
|
||||
* </pre>
|
||||
*
|
||||
* @param Value
|
||||
* 검사할 문자열
|
||||
* @return boolean 숫자만 있을 경우 true 아니면 false
|
||||
*/
|
||||
public static boolean CheckNumber(String Value) {
|
||||
if ((Value == null) || Value.equals("")) {
|
||||
return false;
|
||||
} else {
|
||||
int ilen = Value.length();
|
||||
for (int i = 0; i < ilen; i++) {
|
||||
if (!Character.isDigit(Value.charAt(i)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public String get(String key, int i) {
|
||||
return getRsBoxAt(i).get(key);
|
||||
}
|
||||
|
||||
public String get(String key, int i, int fmt) {
|
||||
return getRsBoxAt(i).get(key, fmt);
|
||||
}
|
||||
|
||||
public String getCutStr(String key, int i, int len) {
|
||||
return StringUtil.fixLength(getRsBoxAt(i).get(key), len);
|
||||
}
|
||||
|
||||
public int getInt(String key, int i) {
|
||||
return getRsBoxAt(i).getInt(key);
|
||||
}
|
||||
|
||||
public double getDouble(String key, int i) {
|
||||
return getRsBoxAt(i).getDouble(key);
|
||||
}
|
||||
|
||||
public boolean getBoolean(String key, int i) {
|
||||
return getRsBoxAt(i).getBoolean(key);
|
||||
}
|
||||
|
||||
public float getFloat(String key, int i) {
|
||||
return getRsBoxAt(i).getFloat(key);
|
||||
}
|
||||
|
||||
public long getLong(String key, int i) {
|
||||
return getRsBoxAt(i).getLong(key);
|
||||
}
|
||||
|
||||
public int dayCnt(String key, int i) {
|
||||
try {
|
||||
String day = getRsBoxAt(i).get(key);
|
||||
return DateUtil.dayDiff(day.substring(0, 8), DateUtil.toString("yyyyMMdd"));
|
||||
} catch (MalformedURLException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
return -1;
|
||||
} catch (ParseException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
return -1;
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
return -1;
|
||||
} catch (IOException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
return -1;
|
||||
} catch (NumberFormatException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
return -1;
|
||||
} catch (Exception ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
/*********************************************************************************
|
||||
* 파 일 명 : RsBox.java
|
||||
* 작 성 일 : 2005.02
|
||||
* 작 성 자 : 최군길
|
||||
*---------------------------------------------------------------------------------
|
||||
* 프로그램명 : RsBox
|
||||
* 기능 및 설명 : JDBC Result Set Box Util
|
||||
*---------------------------------------------------------------------------------
|
||||
* 기 타 :
|
||||
*********************************************************************************/
|
||||
package geoinfo.util;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class RsWrapperIterator implements Iterator, java.io.Serializable {
|
||||
private RsWrapper rsWrapper;
|
||||
private int index;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Constructor.
|
||||
* rsWrapper를 인자로 받아 RsWrapper에 대한 Iterator를 사용할 수 있도록 RsWrapperIterator를 생성
|
||||
* </pre>
|
||||
* @param rsWrapper
|
||||
*/
|
||||
public RsWrapperIterator(RsWrapper rsWrapper) {
|
||||
this.rsWrapper = rsWrapper;
|
||||
this.index = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Iterator 의 hasNext 구현.
|
||||
* 다음 RsBox가 있는지 판단한다.
|
||||
* </pre>
|
||||
*
|
||||
* @return 다음 RsBox가 있을 경우 true 아닐경우 false
|
||||
*/
|
||||
public boolean hasNext() {
|
||||
if (index < rsWrapper.getLength()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Iterator 의 next 구현.
|
||||
* 다음 RsBox를 가져온다.
|
||||
* </pre>
|
||||
*
|
||||
* @return 다음 RsBox
|
||||
*/
|
||||
public Object next() {
|
||||
Box rb = rsWrapper.getRsBoxAt(index);
|
||||
index++;
|
||||
return rb;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 현재 구현하지 않음.
|
||||
* 필요시 구현
|
||||
* </pre>
|
||||
*/
|
||||
public void remove() {
|
||||
// 구현하지 않음 ^^
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.xml.serializer.utils.Utils;
|
||||
import org.jfree.util.Log;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ScriptUtil {
|
||||
|
||||
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ScriptUtil.class);
|
||||
|
||||
private static final String _jsStartTag = "<script language='javascript'>\n<!--\n";
|
||||
private static final String _jsEndTag = "//--></script>";
|
||||
private static final String _contentType = "text/html;charset=utf-8";
|
||||
|
||||
/**
|
||||
* 메시지 창 출력 후 지정한 경로로 이동
|
||||
* @param message 메시지
|
||||
* @param locationHref 이동경로
|
||||
*/
|
||||
public static void doAlertToLocation(HttpServletResponse response , String message , String locationHref) throws Exception{
|
||||
StringBuffer sb = new StringBuffer(1024);
|
||||
sb.append("alert('"+strToAlert(message)+"');");
|
||||
sb.append("location.href = '"+locationHref+"';");
|
||||
pDoPrintWriteFlush(response, sb.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 창 출력 후 팝업 창 종료, 부모창 지정한 경로로 이동
|
||||
* @param message 메시지
|
||||
* @param locationHref 이동경로
|
||||
*/
|
||||
public static void doAlertToOpenerLocation(HttpServletResponse response , String message , String locationHref) throws Exception{
|
||||
StringBuffer sb = new StringBuffer(1024);
|
||||
sb.append("alert('"+strToAlert(message)+"');");
|
||||
sb.append("opener.location.href = '"+locationHref+"';");
|
||||
sb.append("window.close();");
|
||||
pDoPrintWriteFlush(response, sb.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 창 출력 후 팝업 창 종료
|
||||
* @param message 메시지
|
||||
*/
|
||||
public static void doAlertWindowClose(HttpServletResponse response, String message) throws Exception{
|
||||
StringBuffer sb = new StringBuffer(1024);
|
||||
sb.append("alert('"+strToAlert(message)+"');");
|
||||
sb.append("window.close();");
|
||||
pDoPrintWriteFlush(response, sb.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 창 출력 후 전화면으로 이동
|
||||
* @param message 메시지
|
||||
*/
|
||||
public static void doAlertHistoryBack(HttpServletResponse response, String message) throws Exception{
|
||||
StringBuffer sb = new StringBuffer(1024);
|
||||
sb.append("alert('"+strToAlert(message)+"');");
|
||||
sb.append("history.back();");
|
||||
pDoPrintWriteFlush(response, sb.toString());
|
||||
}
|
||||
|
||||
private static void pDoPrintWriteFlush(HttpServletResponse response , String jsMessage) throws Exception{
|
||||
response.setContentType(_contentType);
|
||||
PrintWriter out = response.getWriter();
|
||||
out.println(_jsStartTag);
|
||||
out.println(jsMessage);
|
||||
out.println(_jsEndTag);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
private static String strToAlert(String alertMessage){
|
||||
alertMessage = alertMessage.replaceAll("'", "\\\\'");
|
||||
alertMessage = alertMessage.replaceAll("\n", "\\\\n");
|
||||
return alertMessage;
|
||||
}
|
||||
|
||||
public static String getSha256(String text, String encoding){
|
||||
String sha = "";
|
||||
try {
|
||||
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hash = digest.digest(text.getBytes(encoding));
|
||||
//웹 취약점 때문에 수정
|
||||
digest.reset();
|
||||
digest.update(hash);
|
||||
StringBuffer hexString = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < hash.length; i++) {
|
||||
String hex = Integer.toHexString(0xff & hash[i]);
|
||||
if(hex.length() == 1) hexString.append('0');
|
||||
hexString.append(hex);
|
||||
}
|
||||
|
||||
sha = hexString.toString();
|
||||
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
System.out.println("getSha256");
|
||||
} catch (NumberFormatException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
System.out.println("getSha256");
|
||||
} catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
System.out.println("getSha256");
|
||||
} catch (Exception ex) {
|
||||
LOGGER.debug("error", ex);
|
||||
System.out.println("getSha256");
|
||||
}
|
||||
return sha;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,184 @@
|
|||
package geoinfo.util;
|
||||
|
||||
/*** Eclipse Class Decompiler plugin, copyright (c) 2016 Chen Chao (cnfree2000@hotmail.com) ***/
|
||||
/* */
|
||||
import java.io.PrintStream;
|
||||
/* */
|
||||
import java.util.HashMap;
|
||||
/* */
|
||||
import java.util.Map;
|
||||
|
||||
/* */
|
||||
/* */public class WebCoorUtil
|
||||
/* */{
|
||||
/* */public Map getRealCoordinate(double xPointNorth,
|
||||
double yPointEast, double realStartPointNorth,
|
||||
double realStartPointEast, double realEndPointNorth,
|
||||
double realEndPointEast)
|
||||
/* */{
|
||||
/* 13 */Map result = new HashMap();
|
||||
/* */
|
||||
/* 16 */double bearing = bearingP1toP2(realStartPointNorth,
|
||||
realStartPointEast, realEndPointNorth, realEndPointEast);
|
||||
/* */
|
||||
/* 18 */double distance = getDistance(xPointNorth, yPointEast);
|
||||
/* */
|
||||
/* 20 */System.out.println("_______________bearing: " + bearing);
|
||||
/* 21 */System.out.println("_______________distance:" + distance);
|
||||
/* */
|
||||
/* 24 */double lx = getLx(distance, bearing * 3.141592D / 180.0D);
|
||||
/* */
|
||||
/* 26 */double ly = getLy(distance, bearing * 3.141592D / 180.0D);
|
||||
/* */
|
||||
/* 29 */double resultX = realStartPointNorth + lx;
|
||||
/* 30 */double resultY = realStartPointEast + ly;
|
||||
/* */
|
||||
/* 32 */result.put("bearing", Double.valueOf(bearing));
|
||||
/* 33 */result.put("distance", Double.valueOf(distance));
|
||||
/* 34 */result.put("resultX", Double.valueOf(resultX));
|
||||
/* 35 */result.put("resultY", Double.valueOf(resultY));
|
||||
/* */
|
||||
/* 39 */return result;
|
||||
/* */}
|
||||
|
||||
/* */
|
||||
/* */private double getLx(double distance, double bearing)
|
||||
/* */{
|
||||
/* 45 */double resultLx = 0.0D;
|
||||
/* */
|
||||
/* 47 */resultLx = distance * Math.cos(bearing);
|
||||
/* 48 */return resultLx;
|
||||
/* */}
|
||||
|
||||
/* */
|
||||
/* */private double getLy(double distance, double bearing) {
|
||||
/* 52 */double resultLy = 0.0D;
|
||||
/* 53 */resultLy = distance * Math.sin(bearing);
|
||||
/* */
|
||||
/* 55 */return resultLy;
|
||||
/* */}
|
||||
|
||||
/* */
|
||||
/* */private double getDistance(double latitude, double longitude)
|
||||
/* */{
|
||||
/* 67 */double resultDistance = 0.0D;
|
||||
/* */
|
||||
/* 69 */resultDistance = Math.sqrt(latitude * latitude + longitude
|
||||
* longitude);
|
||||
/* */
|
||||
/* 71 */return resultDistance;
|
||||
/* */}
|
||||
|
||||
/* */
|
||||
/* */private double bearingP1toP2(double P1_latitude,
|
||||
double P1_longitude, double P2_latitude, double P2_longitude)
|
||||
/* */{
|
||||
/* 85 */System.out.println("P1_latitude: " + P1_latitude);
|
||||
/* 86 */System.out.println("P1_longitude: " + P1_longitude);
|
||||
/* 87 */System.out.println("P2_latitude: " + P2_latitude);
|
||||
/* 88 */System.out.println("P2_longitude: " + P2_longitude);
|
||||
/* */
|
||||
/* 91 */double Cur_Lat_radian = P1_latitude * 0.0174532888888889D;
|
||||
/* 92 */double Cur_Lon_radian = P1_longitude * 0.0174532888888889D;
|
||||
/* */
|
||||
/* 96 */double Dest_Lat_radian = P2_latitude * 0.0174532888888889D;
|
||||
/* 97 */double Dest_Lon_radian = P2_longitude * 0.0174532888888889D;
|
||||
/* */
|
||||
/* 101 */double radian_bearing = Math
|
||||
.atan((P2_longitude - P1_longitude)
|
||||
/ (P2_latitude - P1_latitude));
|
||||
/* 102 */double true_bearing = 0.0D;
|
||||
/* */
|
||||
/* 104 */System.out.println("____________radian_bearing : "
|
||||
+ radian_bearing);
|
||||
/* */
|
||||
/* 107 */true_bearing = radian_bearing * 57.29579143313326D;
|
||||
/* 108 */if ((Dest_Lat_radian - Cur_Lat_radian <= 0.0D)
|
||||
|| (Dest_Lon_radian - Cur_Lon_radian <= 0.0D))
|
||||
/* */{
|
||||
/* 111 */if ((Dest_Lat_radian - Cur_Lat_radian < 0.0D)
|
||||
&& (Dest_Lon_radian - Cur_Lon_radian > 0.0D))
|
||||
/* */{
|
||||
/* 113 */true_bearing = 180.0D + true_bearing;
|
||||
/* */}
|
||||
/* 115 */else if ((Dest_Lat_radian - Cur_Lat_radian < 0.0D)
|
||||
&& (Dest_Lon_radian - Cur_Lon_radian < 0.0D))
|
||||
/* */{
|
||||
/* 117 */true_bearing = 180.0D + true_bearing;
|
||||
/* 118 */} else if ((Dest_Lat_radian - Cur_Lat_radian > 0.0D)
|
||||
&& (Dest_Lon_radian - Cur_Lon_radian < 0.0D))
|
||||
/* */{
|
||||
/* 120 */true_bearing = 360.0D + true_bearing;
|
||||
/* */}
|
||||
/* */}
|
||||
/* 123 */return true_bearing;
|
||||
/* */}
|
||||
|
||||
/* */
|
||||
/* */private short __bearingP1toP2(double P1_latitude,
|
||||
double P1_longitude, double P2_latitude, double P2_longitude)
|
||||
/* */{
|
||||
/* 136 */System.out.println("P1_latitude: " + P1_latitude);
|
||||
/* 137 */System.out.println("P1_longitude: " + P1_longitude);
|
||||
/* 138 */System.out.println("P2_latitude: " + P2_latitude);
|
||||
/* 139 */System.out.println("P2_longitude: " + P2_longitude);
|
||||
/* */
|
||||
/* 141 */double Cur_Lat_radian = P1_latitude * 0.0174532888888889D;
|
||||
/* 142 */double Cur_Lon_radian = P1_longitude * 0.0174532888888889D;
|
||||
/* */
|
||||
/* 146 */double Dest_Lat_radian = P2_latitude * 0.0174532888888889D;
|
||||
/* 147 */double Dest_Lon_radian = P2_longitude * 0.0174532888888889D;
|
||||
/* */
|
||||
/* 150 */double radian_distance = 0.0D;
|
||||
/* 151 */radian_distance = Math.acos(Math.sin(Cur_Lat_radian)
|
||||
* Math.sin(Dest_Lat_radian) + Math.cos(Cur_Lat_radian)
|
||||
* Math.cos(Dest_Lat_radian)
|
||||
* Math.cos(Cur_Lon_radian - Dest_Lon_radian));
|
||||
/* */
|
||||
/* 154 */double radian_bearing = Math
|
||||
.acos((Math.sin(Dest_Lat_radian) - (Math.sin(Cur_Lat_radian) * Math
|
||||
.cos(radian_distance)))
|
||||
/ Math.cos(Cur_Lat_radian)
|
||||
* Math.sin(radian_distance));
|
||||
/* */
|
||||
/* 156 */double true_bearing = 0.0D;
|
||||
/* 157 */System.out.println("________________1: "
|
||||
+ (Dest_Lon_radian - Cur_Lon_radian));
|
||||
/* 158 */System.out.println("________________"
|
||||
+ Math.sin(Dest_Lon_radian - Cur_Lon_radian));
|
||||
/* 159 */if (Math.sin(Dest_Lon_radian - Cur_Lon_radian) < 0.0D)
|
||||
/* */{
|
||||
/* 161 */true_bearing = radian_bearing * 57.29579143313326D;
|
||||
/* 162 */true_bearing = 360.0D - true_bearing;
|
||||
/* */}
|
||||
/* */else
|
||||
/* */{
|
||||
/* 166 */true_bearing = radian_bearing * 57.29579143313326D;
|
||||
/* */}
|
||||
/* */
|
||||
/* 169 */return (short) (int) true_bearing;
|
||||
/* */}
|
||||
|
||||
/* */
|
||||
/* */public static void main(String[] args) {
|
||||
/* 173 */System.out.println("______________aaaa");
|
||||
/* 174 */System.out.println("______________bbbb: "
|
||||
+ (Math.acos(0.7072135785007072D) * 57.299999999999997D));
|
||||
/* */
|
||||
/* 176 */WebCoorUtil util = new WebCoorUtil();
|
||||
/* 177 */double P1_latitude = 392837.5638D;
|
||||
/* 178 */double P1_longitude = 330572.78100000002D;
|
||||
/* 179 */double P2_latitude = 393275.59940000001D;
|
||||
/* 180 */double P2_longitude = 330320.05200000003D;
|
||||
/* 181 */double result = util.bearingP1toP2(P1_latitude, P1_longitude,
|
||||
P2_latitude, P2_longitude);
|
||||
/* */
|
||||
/* 183 */System.out.println("_________________result: " + result);
|
||||
/* */
|
||||
/* 185 */double distance = 7.07D;
|
||||
/* 186 */double lx = util.getLx(distance, 0.785398D);
|
||||
/* */
|
||||
/* 188 */System.out.println("_______________lx: " + lx);
|
||||
/* */}
|
||||
/* */
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="geoinfo.admins.user.service.HomeTrainingMapper">
|
||||
|
||||
<resultMap id="spAddHomeTrainingRegResult" type="java.util.HashMap">
|
||||
<result property="wvtRegId" column="p_wvt_reg_id" jdbcType="NUMERIC"/>
|
||||
<result property="resultCode" column="p_result_code" jdbcType="VARCHAR"/>
|
||||
<result property="errMsg" column="p_err_msg" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="callSpAddHomeTrainingReg" parameterType="map" statementType="CALLABLE" resultMap="spAddHomeTrainingRegResult">
|
||||
{ CALL SP_ADD_HOME_TRAINING_REG(
|
||||
#{trainingName},
|
||||
#{trainingDatetime},
|
||||
#{trainingLocation},
|
||||
#{trainingAdmin},
|
||||
#{trainingTel},
|
||||
#{regStartDate},
|
||||
#{regEndDate},
|
||||
#{userId},
|
||||
#{p_wvt_reg_id, mode=OUT, jdbcType=INTEGER},
|
||||
#{p_result_code, mode=OUT, jdbcType=INTEGER},
|
||||
#{p_err_msg, mode=OUT, jdbcType=VARCHAR}
|
||||
) }
|
||||
</select>
|
||||
|
||||
<!--
|
||||
p_wvt_reg_id : 조회할 레코드의 일련번호(숫자)
|
||||
p_training_name : 집합교육명
|
||||
p_start_date : 확정된 날짜의 검색 시작일자
|
||||
p_end_date : 확정된 날짜의 검색 종료일자
|
||||
p_state_code : 상태 코드
|
||||
p_ncount : 페이지당 한번에 가져올 갯수
|
||||
p_npage : 페이지 번호
|
||||
-->
|
||||
<select id="callSpGetHomeTrainingReg" parameterType="map" resultType="egovMap">
|
||||
<![CDATA[
|
||||
select * FROM TABLE(SP_GET_HOME_TRAINING_REG(#{wvtRegId},#{trainingName},#{startDate},#{endDate},#{stateCode},#{ncount},#{npage}))
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="callSpCntHomeTrainingReg" parameterType="map" resultType="long">
|
||||
select SP_CNT_HOME_TRAINING_REG(#{wvtRegId},#{trainingName},#{startDate},#{endDate},#{stateCode}) from DUAL
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="callSpGetHomeTrainingReq" parameterType="map" resultType="egovMap">
|
||||
<![CDATA[
|
||||
select * FROM TABLE(
|
||||
SP_GET_HOME_TRAINING_REQ(
|
||||
#{wvtId},
|
||||
#{wvtRegId},
|
||||
#{companyName},
|
||||
#{reqName},
|
||||
#{reqTel},
|
||||
#{stateCode},
|
||||
#{ncount},
|
||||
#{npage}
|
||||
)
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="callSpCntHomeTrainingReq" parameterType="map" resultType="long">
|
||||
select SP_CNT_HOME_TRAINING_REQ(
|
||||
#{wvtId},
|
||||
#{wvtRegId},
|
||||
#{companyName},
|
||||
#{reqName},
|
||||
#{reqTel},
|
||||
#{stateCode}
|
||||
) from DUAL
|
||||
</select>
|
||||
|
||||
|
||||
<select id="callSpDelHomeTrainingReg" parameterType="map" statementType="CALLABLE">
|
||||
CALL SP_DEL_HOME_TRAINING_REG(
|
||||
#{whtRegId},
|
||||
#{userId},
|
||||
#{p_result_code, mode=OUT, jdbcType=INTEGER},
|
||||
#{p_err_msg, mode=OUT, jdbcType=VARCHAR}
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -14,6 +14,8 @@
|
|||
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
|
||||
</context:component-scan>
|
||||
|
||||
<mvc:annotation-driven />
|
||||
|
||||
<!-- <mvc:default-servlet-handler /> -->
|
||||
|
||||
<!-- <mvc:interceptors> -->
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -12,6 +12,276 @@
|
|||
|
||||
<script>
|
||||
var context = "${pageContext.request.contextPath}";
|
||||
|
||||
let xhr;
|
||||
if(window.XMLHttpRequest) {
|
||||
xhr = new XMLHttpRequest();
|
||||
} else {
|
||||
// IE5, IE6 일때
|
||||
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
|
||||
function unixTimestampToFormattedDate(unixTimestamp) {
|
||||
const date = new Date(unixTimestamp);
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = ('0' + (date.getMonth() + 1)).slice(-2); // 월은 0부터 시작하므로 1을 더하고, 두 자리로 만들기 위해 0을 앞에 붙인 후 마지막 두 자리만 취함
|
||||
const day = ('0' + date.getDate()).slice(-2); // 일도 두 자리로 만들기 위해 0을 앞에 붙인 후 마지막 두 자리만 취함
|
||||
|
||||
const daysOfWeek = ['일', '월', '화', '수', '목', '금', '토'];
|
||||
const dayOfWeek = daysOfWeek[date.getDay()];
|
||||
|
||||
return year + '-' + month + '-' + day + '(' + dayOfWeek + ')';
|
||||
}
|
||||
|
||||
|
||||
function formatUnixTimestamp(unixTimestamp) {
|
||||
const date = new Date(unixTimestamp);
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1; // getMonth()는 0부터 시작하므로 1을 더합니다.
|
||||
const day = date.getDate();
|
||||
let hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
|
||||
let ampm = "오전";
|
||||
if (hours >= 12) {
|
||||
ampm = "오후";
|
||||
hours = hours - 12;
|
||||
}
|
||||
if (hours === 0) {
|
||||
hours = 12; // 자정은 12시로 표시
|
||||
}
|
||||
|
||||
return year+"년 " + month +"월 " + day + "일 " + ampm + " " + hours + "시";
|
||||
}
|
||||
|
||||
function onClickDeleteCourseItem(e) {
|
||||
|
||||
const whtRegIdEle = document.querySelector('input[name="wht-reg-id"]:checked');
|
||||
if( whtRegIdEle == false ) {
|
||||
alert('삭제할 교육을 선택하십시오');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const whtRegId = whtRegIdEle.getAttribute('data-seq');
|
||||
const trainingName = whtRegIdEle.getAttribute('data-training-name');
|
||||
|
||||
if(confirm("아래 집합교육을 삭제 하시겠습니까? \n\n " + trainingName + "[" + whtRegId + "]")) {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
var jsonData = new Array();
|
||||
jsonData.push({whtRegId});
|
||||
|
||||
console.log('%o', jsonData);
|
||||
|
||||
|
||||
xhr.open('POST', 'home-training-index/item/delete.do', true);
|
||||
xhr.setRequestHeader('Content-type', 'application/json');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
// 요청 성공 시 처리
|
||||
console.log(xhr.responseText);
|
||||
const obj = JSON.parse(xhr.responseText);
|
||||
updateList();
|
||||
alert(obj.message);
|
||||
} else if (xhr.readyState === 4) {
|
||||
// 요청 실패 시 처리
|
||||
console.error('요청 실패:', xhr.status);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(JSON.stringify(jsonData));
|
||||
}
|
||||
|
||||
|
||||
function getCurrentTimeFormatted() {
|
||||
const now = new Date();
|
||||
|
||||
const year = now.getFullYear();
|
||||
const month = ('0' + (now.getMonth() + 1)).slice(-2); // 월은 0부터 시작하므로 1을 더하고, 두 자리로 만들기 위해 0을 앞에 붙인 후 마지막 두 자리를 가져옵니다.
|
||||
const day = ('0' + now.getDate()).slice(-2);
|
||||
const hours = ('0' + now.getHours()).slice(-2);
|
||||
const minutes = ('0' + now.getMinutes()).slice(-2);
|
||||
const seconds = ('0' + now.getSeconds()).slice(-2);
|
||||
|
||||
return year + month + day + "_" + hours + minutes + seconds;
|
||||
}
|
||||
|
||||
|
||||
function downloadTableAsCSV(tableId) {
|
||||
|
||||
let filename = getCurrentTimeFormatted() + '_' + String(document.getElementById('home-visit-item-training-name').innerHTML).replace(/ /g, "_") + '.csv';
|
||||
|
||||
|
||||
// 테이블 요소 가져오기
|
||||
var table = document.getElementById(tableId);
|
||||
|
||||
// CSV 문자열 생성
|
||||
var csv = [];
|
||||
var rows = table.querySelectorAll("tr");
|
||||
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var row = [], cols = rows[i].querySelectorAll("td, th");
|
||||
|
||||
for (var j =
|
||||
0; j < cols.length; j++) {
|
||||
// 특수 문자 처리 및 공백 제거
|
||||
var data = cols[j].innerText.replace(/(\r\n|\n|\r)/gm, "").replace(/(\s\s)/gm, " ");
|
||||
data = data.replace(/"/g, '""'); // 큰따옴표 이스케이프
|
||||
row.push('"' + data + '"');
|
||||
}
|
||||
|
||||
csv.push(row.join(","));
|
||||
}
|
||||
|
||||
var csvString = csv.join("\n");
|
||||
|
||||
// CSV 파일 다운로드
|
||||
var link = document.createElement("a");
|
||||
link.style.display = "none";
|
||||
link.setAttribute("target", "_blank");
|
||||
link.setAttribute("href", 'data:text/csv;charset=utf-8,' + encodeURIComponent(
|
||||
csvString));
|
||||
link.setAttribute("download", filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body
|
||||
.removeChild(link);
|
||||
}
|
||||
|
||||
function onClickCourseItem(e) {
|
||||
const wvtRegId = e.getAttribute('data-seq');
|
||||
const trainingName = e.getAttribute('data-training-name');
|
||||
|
||||
xhr.open('GET', 'home-training-index/item/list.do?wvtRegId=' + wvtRegId, true);
|
||||
xhr.setRequestHeader('Content-type', 'application/json');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
// 요청 성공 시 처리
|
||||
const obj = JSON.parse(xhr.responseText);
|
||||
const data = obj.data;
|
||||
|
||||
// 명단 보여주기
|
||||
document.getElementById('home-visit-item').style.display = "block";
|
||||
|
||||
// 교육명 설정
|
||||
document.getElementById('home-visit-item-training-name').innerHTML = trainingName;
|
||||
|
||||
// 목록 생성
|
||||
{
|
||||
const homeVisitItemListEle = document.getElementById('home-visit-item-list');
|
||||
let homeVisitItemListHTML = '';
|
||||
let actualEducationParticipants = 0;
|
||||
for( idx in data ) {
|
||||
|
||||
|
||||
//A:신청함, D:삭제, C:취소, T:출첵 완료
|
||||
if( data[idx].stateCode === 'D' ) {
|
||||
continue;
|
||||
} else if( data[idx].stateCode === 'C' ) {
|
||||
continue;
|
||||
}
|
||||
actualEducationParticipants ++;
|
||||
|
||||
homeVisitItemListHTML +=
|
||||
`
|
||||
<tr onClick="onClickCourseItem(this)" data-seq="` + data[idx].whtRegId +`" data-training-name="` + data[idx].trainingName +`" >
|
||||
<td>` + data[idx].reqName + `</td>
|
||||
<td>` + data[idx].companyName + `</td>
|
||||
<td>` + data[idx].reqDept + `</td>
|
||||
<td>` + data[idx].reqPosition + `</td>
|
||||
<td>` + data[idx].reqTel + `</td>
|
||||
<td>` + data[idx].reqEmail + `</td>
|
||||
<td>` + `` + `</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
//<td>` + formatUnixTimestamp(data[idx].trainingDatetime) + `</td>
|
||||
if( actualEducationParticipants === 0 ) {
|
||||
homeVisitItemListHTML =
|
||||
`
|
||||
<tr>
|
||||
<td colspan="7">참여한 인원이 없습니다.</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
homeVisitItemListEle.innerHTML = homeVisitItemListHTML;
|
||||
}
|
||||
|
||||
} else if (xhr.readyState === 4) {
|
||||
// 요청 실패 시 처리
|
||||
console.error('요청 실패:', xhr.status);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function getNameByStateCodeHomeVisitList(stateCode) {
|
||||
//A:접수중,D:삭제,C:취소,P:예정,F:마감
|
||||
if( stateCode === 'A' ) {
|
||||
return '접수중';
|
||||
} else if( stateCode === 'D' ) {
|
||||
return '삭제됨';
|
||||
} else if( stateCode === 'C' ) {
|
||||
return '취소됨';
|
||||
} else if( stateCode === 'P' ) {
|
||||
return '예정';
|
||||
} else if( stateCode === 'F' ) {
|
||||
return '마감';
|
||||
}
|
||||
}
|
||||
|
||||
function updateList() {
|
||||
xhr.open('GET', 'home-training-index/list.do', true);
|
||||
xhr.setRequestHeader('Content-type', 'application/json');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
// 요청 성공 시 처리
|
||||
const obj = JSON.parse(xhr.responseText);
|
||||
const data = obj.data;
|
||||
|
||||
const homeVisitListEle = document.getElementById('home-visit-list');
|
||||
let homeVisitListHTML = '';
|
||||
for( idx in data ) {
|
||||
|
||||
homeVisitListHTML +=
|
||||
`
|
||||
<tr onClick="onClickCourseItem(this)" data-seq="` + data[idx].whtRegId +`" data-training-name="` + data[idx].trainingName +`" >
|
||||
<td><input type="radio" name="wht-reg-id" value="` + data[idx].whtRegId +`" data-seq="` + data[idx].whtRegId +`" data-training-name="` + data[idx].trainingName +`"></td>
|
||||
<td>` + data[idx].whtRegId + `</td>
|
||||
<td>` + data[idx].trainingName + `</td>
|
||||
<td>` + formatUnixTimestamp(data[idx].trainingDatetime) + `</td>
|
||||
<td>` + data[idx].trainingLocation + `</td>
|
||||
<td>` + unixTimestampToFormattedDate(data[idx].regStartDate) + `~` + unixTimestampToFormattedDate(data[idx].regEndDate) + `</td>
|
||||
<td>` + data[idx].attendance + `명 ` + getNameByStateCodeHomeVisitList(data[idx].stateCode) + `</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
if( data.length === 0 ) {
|
||||
homeVisitListHTML =
|
||||
`
|
||||
<tr>
|
||||
<td colspan="7">등록된 집합교육이 없습니다.</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
homeVisitListEle.innerHTML = homeVisitListHTML;
|
||||
|
||||
} else if (xhr.readyState === 4) {
|
||||
// 요청 실패 시 처리
|
||||
console.error('요청 실패:', xhr.status);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
|
|
@ -28,7 +298,7 @@
|
|||
}
|
||||
|
||||
|
||||
const rows = document.querySelectorAll('#Table_contents tbody tr td:nth-child(7)');
|
||||
const rows = document.querySelectorAll('.table-contents tbody tr td:nth-child(7)');
|
||||
|
||||
rows.forEach(function (cell) {
|
||||
|
||||
|
|
@ -41,27 +311,91 @@
|
|||
cell.style.color = 'blue';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const requestRegistryButtonEle = document.getElementById('request-registry-button');
|
||||
if( requestRegistryButtonEle ) {
|
||||
requestRegistryButtonEle.addEventListener('click', function () {
|
||||
|
||||
var dataIndexValue;
|
||||
|
||||
var jsonData = new Array();
|
||||
for (var i = 0; i < 1 ; i++) { // 여러 개를 한 번에 입력받는다면 입력받는 레코드만큼 loop를 순환하도록 수정되어야 한다.
|
||||
var jsonItem = {};
|
||||
//dataIndexValue = tableDataElements[i].getAttribute('data-index');
|
||||
|
||||
// 집합교육명
|
||||
var trainingNameEle = document.getElementById('training-name');
|
||||
if (trainingNameEle) {
|
||||
jsonItem.trainingName = trainingNameEle.value;
|
||||
}
|
||||
// 교육일시
|
||||
var trainingDatetimeEle = document.getElementById('training-datetime');
|
||||
if (trainingDatetimeEle) {
|
||||
jsonItem.trainingDatetime = trainingDatetimeEle.value;
|
||||
}
|
||||
// 교육장소
|
||||
var trainingLocationEle = document.getElementById('training-location');
|
||||
if (trainingLocationEle) {
|
||||
jsonItem.trainingLocation = trainingLocationEle.value;
|
||||
}
|
||||
// 접수기간 - 시작
|
||||
var regStartDateEle = document.getElementById('reg-start-date');
|
||||
if (regStartDateEle) {
|
||||
jsonItem.regStartDate = regStartDateEle.value;
|
||||
}
|
||||
// 접수기간 - 종료
|
||||
var regEndDateEle = document.getElementById('reg-end-date');
|
||||
if (regEndDateEle) {
|
||||
jsonItem.regEndDate = regEndDateEle.value;
|
||||
}
|
||||
jsonData.push(jsonItem);
|
||||
}
|
||||
|
||||
console.log('%o', jsonData);
|
||||
|
||||
|
||||
|
||||
xhr.open('POST', 'home-training-index/add.do', true);
|
||||
xhr.setRequestHeader('Content-type', 'application/json');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
// 요청 성공 시 처리
|
||||
console.log(xhr.responseText);
|
||||
const obj = JSON.parse(xhr.responseText);
|
||||
updateList();
|
||||
alert(obj.message);
|
||||
} else if (xhr.readyState === 4) {
|
||||
// 요청 실패 시 처리
|
||||
console.error('요청 실패:', xhr.status);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(JSON.stringify(jsonData));
|
||||
});
|
||||
}
|
||||
updateList();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>집합교육</h1>
|
||||
<div class="home-trainning" style="width: 1020px; position: relative;">
|
||||
<div class="home-trainning">
|
||||
<div class="contentBtn">
|
||||
<button class="modify">수정</button>
|
||||
<button class="delete">삭제</button>
|
||||
<button class="modify" onClick="alert('기능 준비중');">수정</button>
|
||||
<button class="delete" onClick="onClickDeleteCourseItem(this);">삭제</button>
|
||||
</div>
|
||||
<table class="Table_Main" id="Table_contents">
|
||||
<table class="Table_Main course-list-table table-contents" id="course-list-table">
|
||||
<colgroup>
|
||||
<col style="width:40px;">
|
||||
<col style="width:40px;">
|
||||
<col style="width:250px;">
|
||||
<col style="width:280px;">
|
||||
<col style="width:200px;">
|
||||
<col style="width:215px;">
|
||||
<col style="width:215px;">
|
||||
<col style="width:230px;">
|
||||
<col style="width:70px;">
|
||||
<col style="width:265px;">
|
||||
<col style="width:90px;">
|
||||
</colgroup>
|
||||
<thead class="Table_List">
|
||||
<tr>
|
||||
|
|
@ -74,51 +408,22 @@
|
|||
<th>신청</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>3</td>
|
||||
<td>`24 제2차 국토지반정보 집합교육</td>
|
||||
<td>2024-10-23(수)</td>
|
||||
<td>한국건설기술연구원</td>
|
||||
<td>2024-09-23(월) ~ 2024-10-18(금)</td>
|
||||
<td>56명 접수중</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>2</td>
|
||||
<td>`24 제2차 국토지반정보 집합교육</td>
|
||||
<td>2024-10-23(수)</td>
|
||||
<td>한국건설기술연구원</td>
|
||||
<td>2024-09-23(월) ~ 2024-10-18(금)</td>
|
||||
<td>123명 (마감)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>1</td>
|
||||
<td>`24 제2차 국토지반정보 집합교육</td>
|
||||
<td>2024-10-23(수)</td>
|
||||
<td>한국건설기술연구원</td>
|
||||
<td>2024-09-23(월) ~ 2024-10-18(금)</td>
|
||||
<td>198명(마감)</td>
|
||||
</tr>
|
||||
<tbody id="home-visit-list">
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="AddBtn" id="add-btn">추가</button>
|
||||
|
||||
<!-- 추가 버튼 눌렸을 경우 -->
|
||||
<table class="Table_Main" id="ContentAdd">
|
||||
<table class="Table_Main new-course-creation-table" id="ContentAdd">
|
||||
<colgroup>
|
||||
<col style="width:40px;">
|
||||
<col style="width:340px;">
|
||||
<col style="width:200px;">
|
||||
<col style="width:250px;">
|
||||
<col style="width:215px;">
|
||||
<col style="width:215px;">
|
||||
<col style="width:230px;">
|
||||
<col style="width:70px;">
|
||||
<col style="width:270px;">
|
||||
<col style="width:100px;">
|
||||
</colgroup>
|
||||
<thead class="Table_List">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<th>집합교육명</th>
|
||||
<th>교육일시</th>
|
||||
<th>교육장소</th>
|
||||
|
|
@ -126,75 +431,49 @@
|
|||
<th>신청</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="new-course-creation-tbody">
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><input type="text" placeholder="`24 제2차 국토지반정보 집합교육"></td>
|
||||
<td>2024-10-23(수)</td>
|
||||
<td>한국건설기술연구원</td>
|
||||
<td>2024-09-23(월) ~ 2024-10-18(금)</td>
|
||||
<td><button class="register">등록</button></td>
|
||||
<td><input type="text" value="2024년 11월 집합교육" id="training-name" name="training-name" class="training-name" placeholder="교육명을 입력하세요" /></td>
|
||||
<td><input type="datetime-local" value="2024-11-04T14:00" id="training-datetime" name="training-datetime" class="training-datetime" placeholder="" /></td>
|
||||
<td><input type="text" value="건설기술연구원 대회의실" id="training-location" name="training-location" class="training-location" placeholder="교육장소를 입력하세요" /></td>
|
||||
<td><input type="date" value="2024-10-24" id="reg-start-date" name="reg-start-date" class="reg-start-date reg-start-end-date" placeholder="" /> ~ <input type="date" value="2024-11-04" id="reg-end-date" name="reg-end-date" class="reg-end-date reg-start-end-date" placeholder="" /></td>
|
||||
<td><button id="request-registry-button" class="register">등록</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- 명단 클릭 했을 경우 -->
|
||||
<h2 class="DateTitle">교육 대상자 명단</h2>
|
||||
<span class="DateText">⁕ 신청 집합교육명 : `24 제2차 국토지반정보 집합교육
|
||||
<button class="" style="float: right; margin-bottom: 10px;">내보내기</button>
|
||||
</span>
|
||||
<table class="Table_Main" id="Table_contents">
|
||||
<colgroup>
|
||||
<col style="width:80px;">
|
||||
<col style="width:230px;">
|
||||
<col style="width:200px;">
|
||||
<col style="width:200px;">
|
||||
<col style="width:150px;">
|
||||
<col style="width:70px;">
|
||||
<col style="width:120px;">
|
||||
</colgroup>
|
||||
<thead class="Table_List">
|
||||
<tr>
|
||||
<th>신청자</th>
|
||||
<th>소속기관</th>
|
||||
<th>부서</th>
|
||||
<th>직급</th>
|
||||
<th>연락처</th>
|
||||
<th>이메일</th>
|
||||
<th>비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>홍길동</td>
|
||||
<td>디비엔텍</td>
|
||||
<td>개발</td>
|
||||
<td>대리</td>
|
||||
<td>010-1234-5678</td>
|
||||
<td>abcdw@naver.com</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>홍길동</td>
|
||||
<td>디비엔텍</td>
|
||||
<td>개발</td>
|
||||
<td>대리</td>
|
||||
<td>010-1234-5678</td>
|
||||
<td>abcdw@naver.com</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>홍길동</td>
|
||||
<td>디비엔텍</td>
|
||||
<td>개발</td>
|
||||
<td>대리</td>
|
||||
<td>010-1234-5678</td>
|
||||
<td>abcdw@naver.com</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="home-visit-item" id="home-visit-item">
|
||||
<h2 class="DateTitle">교육 대상자 명단</h2>
|
||||
<span class="DateText">⁕ 신청 집합교육명 : <span id="home-visit-item-training-name" class="home-visit-item-training-name"></span>
|
||||
<button onClick="downloadTableAsCSV('home-visit-item-table')" id="export-list-of-participants-attending-the-education" class="export-list-of-participants-attending-the-education" style="float: right; margin-bottom: 10px;">교육 대상자 명단 내보내기</button>
|
||||
</span>
|
||||
<table class="Table_Main table-contents" id="home-visit-item-table">
|
||||
<colgroup>
|
||||
<col style="width:80px;">
|
||||
<col style="width:230px;">
|
||||
<col style="width:200px;">
|
||||
<col style="width:200px;">
|
||||
<col style="width:150px;">
|
||||
<col style="width:70px;">
|
||||
<col style="width:120px;">
|
||||
</colgroup>
|
||||
<thead class="Table_List">
|
||||
<tr>
|
||||
<th>신청자</th>
|
||||
<th>소속기관</th>
|
||||
<th>부서</th>
|
||||
<th>직급</th>
|
||||
<th>연락처</th>
|
||||
<th>이메일</th>
|
||||
<th>비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="home-visit-item-list">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ img { border:0; }
|
|||
<span style="cursor:hand" onClick="javascript:goUrl('home-training-index', '${menuId}')"><img src="${pageContext.request.contextPath}/images/renew/arrow-right.png" /> 집합교육 관리</span>
|
||||
<ul class="sub-menu">
|
||||
<li class="sub-menu-item" data-url="home-training-index" id="home-training-index" onClick="javascript:onClickSubMenuItem(event)"><img src="${pageContext.request.contextPath}/images/renew/arrow-right.png" /> 집합교육 개설</li>
|
||||
<li class="sub-menu-item" data-url="home-training-approval-system" id="home-training-approval-system" onClick="onClickSubMenuItem(event)" ><img src="${pageContext.request.contextPath}/images/renew/arrow-right.png" /> 방문교육 신청 승인</li>
|
||||
<!-- <li class="sub-menu-item" data-url="home-training-approval-system" id="home-training-approval-system" onClick="onClickSubMenuItem(event)" ><img src="${pageContext.request.contextPath}/images/renew/arrow-right.png" /> 방문교육 신청 승인</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -209,6 +209,9 @@ a:hover {font-family: "굴림체"; font-size: 9pt; color: #FF8000; text-decora
|
|||
}
|
||||
|
||||
.home-trainning {
|
||||
width: 100%;
|
||||
max-width: 1600px;
|
||||
position: relative;
|
||||
th,
|
||||
tr{
|
||||
height: 36px;
|
||||
|
|
@ -226,10 +229,44 @@ a:hover {font-family: "굴림체"; font-size: 9pt; color: #FF8000; text-decora
|
|||
border: none;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.Table_Main{
|
||||
width: 1020px;
|
||||
.Table_Main{
|
||||
width: 100%;
|
||||
max-width: 1600px;
|
||||
border:1px solid #e9e9e9;
|
||||
text-align: center;
|
||||
&.course-list-table {
|
||||
tbody {
|
||||
tr {
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
td {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.new-course-creation-table {
|
||||
margin-bottom: 50px;
|
||||
.new-course-creation-tbody {
|
||||
tr {
|
||||
td {
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 35px;
|
||||
border: none;
|
||||
padding: 0px 5px;
|
||||
font-size: 14px;
|
||||
&.reg-start-end-date {
|
||||
width: 40%;
|
||||
padding: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.Table_List{
|
||||
background: #e9eff4;
|
||||
|
|
@ -248,6 +285,9 @@ a:hover {font-family: "굴림체"; font-size: 9pt; color: #FF8000; text-decora
|
|||
}
|
||||
/* 신청인정보 */
|
||||
|
||||
.home-visit-item {
|
||||
display: none;
|
||||
}
|
||||
#UserDate{
|
||||
margin: 25px 0;
|
||||
display: none;
|
||||
|
|
@ -259,13 +299,6 @@ a:hover {font-family: "굴림체"; font-size: 9pt; color: #FF8000; text-decora
|
|||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.DateText{
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.AddBtn {
|
||||
display: block;
|
||||
margin: 30px auto;
|
||||
|
|
@ -291,12 +324,17 @@ a:hover {font-family: "굴림체"; font-size: 9pt; color: #FF8000; text-decora
|
|||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.DateText{
|
||||
font-size: 12px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
line-height: 12px;
|
||||
align-items: center;
|
||||
.home-visit-item-training-name {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.visit-trainning {
|
||||
|
|
|
|||
|
|
@ -416,6 +416,9 @@ a:hover {
|
|||
}
|
||||
|
||||
.home-trainning {
|
||||
width: 100%;
|
||||
max-width: 1600px;
|
||||
position: relative;
|
||||
/* 신청인정보 */
|
||||
}
|
||||
.home-trainning th,
|
||||
|
|
@ -436,10 +439,32 @@ a:hover {
|
|||
padding: 5px 10px;
|
||||
}
|
||||
.home-trainning .Table_Main {
|
||||
width: 1020px;
|
||||
width: 100%;
|
||||
max-width: 1600px;
|
||||
border: 1px solid #e9e9e9;
|
||||
text-align: center;
|
||||
}
|
||||
.home-trainning .Table_Main.course-list-table tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
.home-trainning .Table_Main.course-list-table tbody tr:hover {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
.home-trainning .Table_Main.new-course-creation-table {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.home-trainning .Table_Main.new-course-creation-table .new-course-creation-tbody tr td input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 35px;
|
||||
border: none;
|
||||
padding: 0px 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.home-trainning .Table_Main.new-course-creation-table .new-course-creation-tbody tr td input.reg-start-end-date {
|
||||
width: 40%;
|
||||
padding: 0px;
|
||||
}
|
||||
.home-trainning .Table_List {
|
||||
background: #e9eff4;
|
||||
}
|
||||
|
|
@ -455,6 +480,9 @@ a:hover {
|
|||
.home-trainning .applicationEnd {
|
||||
color: red;
|
||||
}
|
||||
.home-trainning .home-visit-item {
|
||||
display: none;
|
||||
}
|
||||
.home-trainning #UserDate {
|
||||
margin: 25px 0;
|
||||
display: none;
|
||||
|
|
@ -466,12 +494,6 @@ a:hover {
|
|||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.home-trainning .DateText {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
.home-trainning .AddBtn {
|
||||
display: block;
|
||||
margin: 30px auto;
|
||||
|
|
@ -496,11 +518,14 @@ a:hover {
|
|||
margin-right: 20px;
|
||||
}
|
||||
.home-trainning .DateText {
|
||||
font-size: 12px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
line-height: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
.home-trainning .DateText .home-visit-item-training-name {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.visit-trainning {
|
||||
/* 기본 레이아웃 설정 */
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"sourceRoot":"","sources":["sass/style.scss"],"names":[],"mappings":";AAAA;AACA;EAAM;;;AACN;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EAAY;EAAoB;EAAiB;EAAgB;EAAkB;;;AACnF;EAAc;EAAoB;EAAiB;EAAgB;EAAuB;;;AAC1F;EAAgB;EAAoB;EAAiB;EAAgB;EAAuB;;;AAC5F;EAAc;EAAoB;EAAiB;EAAgB;EAA4B;;;AAE/F;AACA;EAAe;EAAe;EAAkB;EAAkB;EAAkB;;;AACpF;EAAe;EAAe;EAAkB;EAAkB;EAAkB;;;AACpF;EAAkB;EAAe;EAAkB;EAAkB;EAAkB;;;AACvF;EAAiB;EAAe;EAAkB;EAAkB;;;AAEpE;AACA;EAAY;EAAe;;;AAC3B;EAAY;EAAe;;;AAC3B;EAAe;EAAe;EAAkB;;;AAEhD;AACA;EAAY;;;AACZ;EAAU;;;AACV;EAAY;EAA0B;EAAsB;EAAkB;EAAoB;;;AAClG;EAAW;EAAe;EAA0B;EAAkB;;;AACtE;EAAW;EAAe;;;AAC1B;EAAW;EAAe;EAAyB;EAAqB;EAAoB;EAA2B;EAAc;;;AACrI;EAAW;EAAe;EAAyB;EAAoB;;;AACvE;EAAe;EAA0B;EAAsB;EAAkB;EAAoB;;;AAErG;AACA;EAAU;EAAoB;EAAgB;EAAgB;EAAuB;;;AACrF;EAAY;EAAoB;EAAgB;EAAgB;EAAuB;;;AACvF;EAAW;EAAoB;EAAgB;EAAgB;EAA4B;;;AAE3F;AACA;EAAY;EAAe;EAAkB;EAAe;;;AAC5D;EAAW;EAAe;EAAkB;;;AAG5C;AACA;EAAc;EAAe;EAAkB;EAAkB;EAAkB;;;AACnF;EAAgB;EAAe;EAAkB;EAAkB;EAAe;EAAkB;;;AACpG;EAAiB;EAAe;EAAkB;EAAkB;EAAe;;;AACnF;EAAe;EAAe;EAAkB;EAAkB;EAAe;EAAkB;;;AACnG;EAAkB;EAAe;EAAkB;EAAkB;;;AAErE;AACA;EAAa;EAAa;EAAiC;EAAwE;EAAwB;EAAiB;EAAkB;EAAkB;EAAkB;;;AAClO;EAAY;EAAa;EAAuB;EAAmB;EAAY;;;AAE/E;AACA;EAAa;;;AACb;EAAgB;EAAyB;EAAqB;;;AAE9D;AACA;EACI;EACH;EACG;EACA;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACC;EACA;EACA;EACA;EACA;;;AAEL;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAED;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;AAEJ;EACI;;AACA;EACI;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;;;AAOpB;EACI;;;AAEJ;EACI;EACA;;;AAGJ;AAsCI;;AArCA;AAAA;EAEI;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;;AAIJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;AAEJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;;AAIR;AACI;AAmBA;AA8IA;AAsCA;;AAtMA;EACI;EACA;EACA;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;;AAEJ;EACI;EACA;;AAIJ;EACI;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACK;EACA;EACA;EACA;EACA;;AAEL;EACI;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACI;;AACA;EACI;EACA;EACA;EACA;;AAEJ;EACG;EACA;EACA;;AAEH;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACG;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEH;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;;AAEJ;EACI;;AAEJ;EACI;EACA;EACA;EACA;;AAKR;EACI;EACA;EACA;;AAEJ;EACI;EACC;EACA;EACA;EACA;;AAEL;EACI;;AAEJ;EACI;;AAEJ;EACI;;AAEJ;EACI;;AAEJ;EACI;EACC;;AAGL;EACI;EACC;EACA;EACA;EACA;;AAKL;EACI;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACK;EACD;EACA;EACA;EACA;EACA;;;AAMJ;AAAA;EAEI;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;;AAEJ;EACG;EACC;;AAIJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAEJ;EACG","file":"style.css"}
|
||||
{"version":3,"sourceRoot":"","sources":["sass/style.scss"],"names":[],"mappings":";AAAA;AACA;EAAM;;;AACN;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EAAY;EAAoB;EAAiB;EAAgB;EAAkB;;;AACnF;EAAc;EAAoB;EAAiB;EAAgB;EAAuB;;;AAC1F;EAAgB;EAAoB;EAAiB;EAAgB;EAAuB;;;AAC5F;EAAc;EAAoB;EAAiB;EAAgB;EAA4B;;;AAE/F;AACA;EAAe;EAAe;EAAkB;EAAkB;EAAkB;;;AACpF;EAAe;EAAe;EAAkB;EAAkB;EAAkB;;;AACpF;EAAkB;EAAe;EAAkB;EAAkB;EAAkB;;;AACvF;EAAiB;EAAe;EAAkB;EAAkB;;;AAEpE;AACA;EAAY;EAAe;;;AAC3B;EAAY;EAAe;;;AAC3B;EAAe;EAAe;EAAkB;;;AAEhD;AACA;EAAY;;;AACZ;EAAU;;;AACV;EAAY;EAA0B;EAAsB;EAAkB;EAAoB;;;AAClG;EAAW;EAAe;EAA0B;EAAkB;;;AACtE;EAAW;EAAe;;;AAC1B;EAAW;EAAe;EAAyB;EAAqB;EAAoB;EAA2B;EAAc;;;AACrI;EAAW;EAAe;EAAyB;EAAoB;;;AACvE;EAAe;EAA0B;EAAsB;EAAkB;EAAoB;;;AAErG;AACA;EAAU;EAAoB;EAAgB;EAAgB;EAAuB;;;AACrF;EAAY;EAAoB;EAAgB;EAAgB;EAAuB;;;AACvF;EAAW;EAAoB;EAAgB;EAAgB;EAA4B;;;AAE3F;AACA;EAAY;EAAe;EAAkB;EAAe;;;AAC5D;EAAW;EAAe;EAAkB;;;AAG5C;AACA;EAAc;EAAe;EAAkB;EAAkB;EAAkB;;;AACnF;EAAgB;EAAe;EAAkB;EAAkB;EAAe;EAAkB;;;AACpG;EAAiB;EAAe;EAAkB;EAAkB;EAAe;;;AACnF;EAAe;EAAe;EAAkB;EAAkB;EAAe;EAAkB;;;AACnG;EAAkB;EAAe;EAAkB;EAAkB;;;AAErE;AACA;EAAa;EAAa;EAAiC;EAAwE;EAAwB;EAAiB;EAAkB;EAAkB;EAAkB;;;AAClO;EAAY;EAAa;EAAuB;EAAmB;EAAY;;;AAE/E;AACA;EAAa;;;AACb;EAAgB;EAAyB;EAAqB;;;AAE9D;AACA;EACI;EACH;EACG;EACA;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACC;EACA;EACA;EACA;EACA;;;AAEL;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAED;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;AAEJ;EACI;;AACA;EACI;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;;;AAOpB;EACI;;;AAEJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;AAwEA;;AAvEA;AAAA;EAEI;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAGQ;EACI;;AACA;EACI;;AAOhB;EACI;;AAIY;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;;AAQ5B;EACI;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;;AAIJ;EACI;;AAEJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;AAEJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AACA;EACI;;;AAMZ;AACI;AAmBA;AA8IA;AAsCA;;AAtMA;EACI;EACA;EACA;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;;AAEJ;EACI;EACA;;AAIJ;EACI;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACK;EACA;EACA;EACA;EACA;;AAEL;EACI;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AAEJ;EACI;;AACA;EACI;EACA;EACA;EACA;;AAEJ;EACG;EACA;EACA;;AAEH;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACG;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEH;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;;AAEJ;EACI;;AAEJ;EACI;EACA;EACA;EACA;;AAKR;EACI;EACA;EACA;;AAEJ;EACI;EACC;EACA;EACA;EACA;;AAEL;EACI;;AAEJ;EACI;;AAEJ;EACI;;AAEJ;EACI;;AAEJ;EACI;EACC;;AAGL;EACI;EACC;EACA;EACA;EACA;;AAKL;EACI;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACK;EACD;EACA;EACA;EACA;EACA;;;AAMJ;AAAA;EAEI;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;;AAEJ;EACG;EACC;;AAIJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAEJ;EACG","file":"style.css"}
|
||||
Loading…
Reference in New Issue