diff --git a/src/main/java/seed/com/gtm/board/CaseBoardController.java b/src/main/java/seed/com/gtm/board/CaseBoardController.java index 1b384606..e88c44d7 100644 --- a/src/main/java/seed/com/gtm/board/CaseBoardController.java +++ b/src/main/java/seed/com/gtm/board/CaseBoardController.java @@ -160,4 +160,22 @@ public class CaseBoardController { return "/_common/jsp/message"; } + + //게시글 등록 시 innorix 적용 + @RequestMapping(value="/board/{boardIdx}/writeWithInnorix.do", method=RequestMethod.POST) + public String formWriteWithInnorix(HttpServletRequest request ,HttpSession session, @RequestParam Map paramMap, Map map, @PathVariable(value="boardIdx") String boardIdx){ + paramMap.put("memberName", session.getAttribute("memberName")); + paramMap.put("memberId", session.getAttribute("memberId")); + paramMap.put("boardIdx", boardIdx); + service.boardInsert(paramMap); + + //현제 등록된 게시글의 시퀀스 불러와 맵에 저장 + paramMap.put("dataIdx", paramMap.get("seq")); + /*fileService.fileInsert(paramMap, request, session);*/ + + map.put("message", "common.message.reg"); + map.put("url", "/gtm/case/board/"+boardIdx+"/list.do"); + + return "/_common/jsp/message"; + } } diff --git a/src/main/java/seed/common/service/AdrInnorixFileVO.java b/src/main/java/seed/common/service/AdrInnorixFileVO.java new file mode 100644 index 00000000..8f4ed7b2 --- /dev/null +++ b/src/main/java/seed/common/service/AdrInnorixFileVO.java @@ -0,0 +1,360 @@ +package seed.common.service; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import kcc.com.cmm.ComDefaultVO; + + +/** + * + * @author : 이호영 + * @fileName : InnorixVO.java + * @date : 2022.11.01 + * @description : 대용량 파일 등록 솔루션 VO + * =========================================================== + * DATE AUTHOR NOTE + * ----------------------------------------------------------- * + * 2022.11.01 이호영 최초 생성 + * + * + * + */ +public class AdrInnorixFileVO extends ComDefaultVO implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 4400281789694196418L; + + // 사용자 ID + public String uniqId = ""; + + // 파일 구분을 위한 타입 + public String fileType = ""; + + // 파일 등록 후 리턴 메세지 jsp에서 넘겨줌 + public String successMsg = ""; + public String eduAplctOrd = ""; + public String eduChasiOrd = ""; + public String prcsAplctPrdOrd = ""; //기반강화 강의계획서용 + + // 컨트롤 엘리먼트 ID - 멀티 업로드 시 jsp에서 사용하는 el 값 + public String controlId = ""; + + // 승인코드 - 저작권 체험교실 결과보고서 임시저장 구분용으로 추가 + public String aprvlCd = ""; + + // 파일 ID + public String atchFileId = ""; + + +// private String frstRegistPnttm; //등록일시 +// private String frstRegisterId; //등록자 +// private String lastUpdtPnttm; //수정일시 +// private String lastUpdusrId; //수정자 + + public List innorixFileListVO = new ArrayList(); + + // 전체 교육인원 - 저작권 체험교실 결과보고서 항목 + public String trgtPrsnlReal = ""; + + //서류요청 기능 + public String docReqNm = ""; //요청 서류명 + public String sbmtId = ""; //제출 강사 ID + public String eduDocReqOrd = "";//서류요청 순번 + + public String cnclCn = "";//기소유예 취소사유 + + public String instrDetailOrd = "";//강사 고유PK + + public String lctrSbjct; //강의주제 + public String lctrPlace; //강의장소 + public String lctrTrgt; //교육대상 + public String nos; //인원 + public String instrNm; //강사명(소속) + + public String lctrDay; + public String lctrStrtH; + public String lctrStrtM; + public String lctrEndH; + public String lctrEndM; + + public String lctrDivCd; + + + + + + + + //강의활동확인서 컬럼 추가 + private String sex = ""; //성별 + private String purpose = ""; //용도 + private String bsnsNmbr = ""; //사업자등록번호 + private String bsnsNm = ""; //사업자명 + private String docuNmbr = ""; //문서번호 + + + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + + public String getSuccessMsg() { + return successMsg; + } + + public void setSuccessMsg(String successMsg) { + this.successMsg = successMsg; + } + + public List getInnorixFileListVO() { + return innorixFileListVO; + } + + public void setInnorixFileListVO(List innorixFileListVO) { + this.innorixFileListVO = innorixFileListVO; + } + + public String getUniqId() { + return uniqId; + } + + public void setUniqId(String uniqId) { + this.uniqId = uniqId; + } + + public String getEduAplctOrd() { + return eduAplctOrd; + } + + public void setEduAplctOrd(String eduAplctOrd) { + this.eduAplctOrd = eduAplctOrd; + } + + public String getControlId() { + return controlId; + } + + public void setControlId(String controlId) { + this.controlId = controlId; + } + + public String getAprvlCd() { + return aprvlCd; + } + + public void setAprvlCd(String aprvlCd) { + this.aprvlCd = aprvlCd; + } + + public String getAtchFileId() { + return atchFileId; + } + + public void setAtchFileId(String atchFileId) { + this.atchFileId = atchFileId; + } + + public String getTrgtPrsnlReal() { + return trgtPrsnlReal; + } + + public void setTrgtPrsnlReal(String trgtPrsnlReal) { + this.trgtPrsnlReal = trgtPrsnlReal; + } + + public String getPrcsAplctPrdOrd() { + return prcsAplctPrdOrd; + } + + public void setPrcsAplctPrdOrd(String prcsAplctPrdOrd) { + this.prcsAplctPrdOrd = prcsAplctPrdOrd; + } + + public String getDocReqNm() { + return docReqNm; + } + + public void setDocReqNm(String docReqNm) { + this.docReqNm = docReqNm; + } + + public String getSbmtId() { + return sbmtId; + } + + public void setSbmtId(String sbmtId) { + this.sbmtId = sbmtId; + } + + public String getEduDocReqOrd() { + return eduDocReqOrd; + } + + public void setEduDocReqOrd(String eduDocReqOrd) { + this.eduDocReqOrd = eduDocReqOrd; + } + + public String getCnclCn() { + return cnclCn; + } + + public void setCnclCn(String cnclCn) { + this.cnclCn = cnclCn; + } + + public String getInstrDetailOrd() { + return instrDetailOrd; + } + + public void setInstrDetailOrd(String instrDetailOrd) { + this.instrDetailOrd = instrDetailOrd; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getBsnsNm() { + return bsnsNm; + } + + public void setBsnsNm(String bsnsNm) { + this.bsnsNm = bsnsNm; + } + + public String getBsnsNmbr() { + return bsnsNmbr; + } + + public void setBsnsNmbr(String bsnsNmbr) { + this.bsnsNmbr = bsnsNmbr; + } + + public String getDocuNmbr() { + return docuNmbr; + } + + public void setDocuNmbr(String docuNmbr) { + this.docuNmbr = docuNmbr; + } + + public String getLctrSbjct() { + return lctrSbjct; + } + + public void setLctrSbjct(String lctrSbjct) { + this.lctrSbjct = lctrSbjct; + } + + public String getLctrPlace() { + return lctrPlace; + } + + public void setLctrPlace(String lctrPlace) { + this.lctrPlace = lctrPlace; + } + + public String getLctrTrgt() { + return lctrTrgt; + } + + public void setLctrTrgt(String lctrTrgt) { + this.lctrTrgt = lctrTrgt; + } + + public String getNos() { + return nos; + } + + public void setNos(String nos) { + this.nos = nos; + } + + public String getInstrNm() { + return instrNm; + } + + public void setInstrNm(String instrNm) { + this.instrNm = instrNm; + } + + public String getLctrDay() { + return lctrDay; + } + + public void setLctrDay(String lctrDay) { + this.lctrDay = lctrDay; + } + + public String getLctrStrtH() { + return lctrStrtH; + } + + public void setLctrStrtH(String lctrStrtH) { + this.lctrStrtH = lctrStrtH; + } + + public String getLctrStrtM() { + return lctrStrtM; + } + + public void setLctrStrtM(String lctrStrtM) { + this.lctrStrtM = lctrStrtM; + } + + public String getLctrEndH() { + return lctrEndH; + } + + public void setLctrEndH(String lctrEndH) { + this.lctrEndH = lctrEndH; + } + + public String getLctrEndM() { + return lctrEndM; + } + + public void setLctrEndM(String lctrEndM) { + this.lctrEndM = lctrEndM; + } + + public String getEduChasiOrd() { + return eduChasiOrd; + } + + public void setEduChasiOrd(String eduChasiOrd) { + this.eduChasiOrd = eduChasiOrd; + } + + public String getLctrDivCd() { + return lctrDivCd; + } + + public void setLctrDivCd(String lctrDivCd) { + this.lctrDivCd = lctrDivCd; + } + + + + + +} \ No newline at end of file diff --git a/src/main/java/seed/common/service/InnorixFileVO.java b/src/main/java/seed/common/service/InnorixFileVO.java new file mode 100644 index 00000000..f73020c2 --- /dev/null +++ b/src/main/java/seed/common/service/InnorixFileVO.java @@ -0,0 +1,180 @@ +package seed.common.service; + +import java.io.Serializable; +import java.util.List; + +import kcc.com.cmm.ComDefaultVO; + + +/** + * + * @author : 이호영 + * @fileName : InnorixVO.java + * @date : 2022.11.01 + * @description : 대용량 파일 등록 솔루션 VO + * =========================================================== + * DATE AUTHOR NOTE + * ----------------------------------------------------------- * + * 2022.11.01 이호영 최초 생성 + * + * + * + */ +public class InnorixFileVO extends ComDefaultVO implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 5641887401063483713L; + + public String rowID = ""; + + public String controlId = ""; + + public String uploadUrl = ""; + + public String clientFilePath = ""; + + public String clientFileName = ""; + + public String rootName = ""; + + public String fileState = ""; + + public Integer fileSize = 0; + + public String serverFilePath = ""; + + public String serverFileName = ""; + + public Boolean isFolder = null; + + public Boolean firstTransferCompleted = null; + + public Integer totalTransferTime = 0; + + public Integer transferTime = 0; + + private String frstRegistPnttm; + + private String frstRegisterId; + + private String lastUpdtPnttm; + + private String lastUpdusrId; + + + + + public String getRowID() { + return rowID; + } + public void setRowID(String rowID) { + this.rowID = rowID; + } + public String getControlId() { + return controlId; + } + public void setControlId(String controlId) { + this.controlId = controlId; + } + public String getUploadUrl() { + return uploadUrl; + } + public void setUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + } + public String getClientFilePath() { + return clientFilePath; + } + public void setClientFilePath(String clientFilePath) { + this.clientFilePath = clientFilePath; + } + public String getClientFileName() { + return clientFileName; + } + public void setClientFileName(String clientFileName) { + this.clientFileName = clientFileName; + } + public String getRootName() { + return rootName; + } + public void setRootName(String rootName) { + this.rootName = rootName; + } + public String getFileState() { + return fileState; + } + public void setFileState(String fileState) { + this.fileState = fileState; + } + public Integer getFileSize() { + return fileSize; + } + public void setFileSize(Integer fileSize) { + this.fileSize = fileSize; + } + public String getServerFilePath() { + return serverFilePath; + } + public void setServerFilePath(String serverFilePath) { + this.serverFilePath = serverFilePath; + } + public String getServerFileName() { + return serverFileName; + } + public void setServerFileName(String serverFileName) { + this.serverFileName = serverFileName; + } + public Boolean getIsFolder() { + return isFolder; + } + public void setIsFolder(Boolean isFolder) { + this.isFolder = isFolder; + } + public Boolean getFirstTransferCompleted() { + return firstTransferCompleted; + } + public void setFirstTransferCompleted(Boolean firstTransferCompleted) { + this.firstTransferCompleted = firstTransferCompleted; + } + public Integer getTotalTransferTime() { + return totalTransferTime; + } + public void setTotalTransferTime(Integer totalTransferTime) { + this.totalTransferTime = totalTransferTime; + } + public Integer getTransferTime() { + return transferTime; + } + public void setTransferTime(Integer transferTime) { + this.transferTime = transferTime; + } + public String getFrstRegistPnttm() { + return frstRegistPnttm; + } + public void setFrstRegistPnttm(String frstRegistPnttm) { + this.frstRegistPnttm = frstRegistPnttm; + } + public String getFrstRegisterId() { + return frstRegisterId; + } + public void setFrstRegisterId(String frstRegisterId) { + this.frstRegisterId = frstRegisterId; + } + public String getLastUpdtPnttm() { + return lastUpdtPnttm; + } + public void setLastUpdtPnttm(String lastUpdtPnttm) { + this.lastUpdtPnttm = lastUpdtPnttm; + } + public String getLastUpdusrId() { + return lastUpdusrId; + } + public void setLastUpdusrId(String lastUpdusrId) { + this.lastUpdusrId = lastUpdusrId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/seed/common/web/InnorixFileController.java b/src/main/java/seed/common/web/InnorixFileController.java new file mode 100644 index 00000000..fa94052d --- /dev/null +++ b/src/main/java/seed/common/web/InnorixFileController.java @@ -0,0 +1,74 @@ +package seed.common.web; + +import java.util.Map; + +import javax.servlet.http.HttpSession; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; + +import seed.utils.SeedUtils; + +/** + * + * @author : 이호영 + * @fileName : InnorixFileController.java + * @date : 2022.11.01 + * @description : innorix 대용량 파일 업로드 솔루션 + * =========================================================== + * DATE AUTHOR NOTE + * ----------------------------------------------------------- * + * 2022.11.01 이호영 최초 생성 + * + * + * + */ +@Controller +public class InnorixFileController { + + //임시 파일 저장 경로 + @Value("#{globalSettings['file.temp.path']}") + private String globalTempPath; + //파일 저장 경로 + @Value("#{globalSettings['file.real.path']}") + private String globalRealPath; + //루트 경로 + @Value("#{globalSettings['root.path']}") + private String globalRootPath; + + @RequestMapping(value="/seed/innorix/getRealFileDirectoryAjax.do") + public ModelAndView getFileDirectoryAjax(@RequestParam Map paramMap, HttpSession session)throws Exception{ + ModelAndView modelAndView = new ModelAndView(); + try { + String siteIdx = SeedUtils.setReplaceNull(session.getAttribute("siteIdx")); + if(siteIdx.equals("")) siteIdx = "case"; + + //파일 사용하는 메뉴 구분 + String fileFuncType = (String)paramMap.get("fileFuncType"); + + String rootPath = null; + if(fileFuncType.equals("trublchargermng")){ + rootPath = globalRootPath; + }else{ + rootPath = globalRealPath; + } + + SeedUtils.setSeedMkDirs(rootPath + "/"+siteIdx+"/"+ fileFuncType); + + modelAndView.setViewName("jsonView"); + modelAndView.addObject("directory", rootPath + "/"+siteIdx+"/"+fileFuncType+"/"); + modelAndView.addObject("result", "success"); + }catch(Exception e) { + modelAndView.addObject("result", "fail"); + } + + return modelAndView; + } + + +} \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/_extra/user/sms/messageList.jsp b/src/main/webapp/WEB-INF/jsp/_extra/user/sms/messageList.jsp new file mode 100644 index 00000000..a04c9b2d --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/_extra/user/sms/messageList.jsp @@ -0,0 +1,826 @@ +<%@ page contentType="text/html;charset=utf-8" %> +<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %> +<%@ taglib uri='http://www.springframework.org/tags/form' prefix='form'%> +<%@ page import="seed.utils.SeedUtils"%> + +<%@ include file="/WEB-INF/jsp/seed/_extra/dao/smsDao.jsp"%> +<%@ include file="/WEB-INF/jsp/seed/_extra/common/seedPaging.jsp"%> +<% + //호환성보기 방지하기 + response.setHeader("X-UA-Compatible", "IE=Edge"); + + //세션 값 + String memberIdx = SeedUtils.setReplaceNull(session.getAttribute("memberIdx")); + String memberName = SeedUtils.setReplaceNull(session.getAttribute("memberName")); + String memberGrant = SeedUtils.setReplaceNull(session.getAttribute("memberGrant"), "N"); + + //사이트 키, 사이트 메뉴 키, 페이지 타입(gtm,gte), 사이트담당자 권한체크("true","false"), 해당메뉴담당자 권한체크("true","false") + String siteIdx = SeedUtils.setReplaceNull((String)request.getAttribute("siteIdx")); + String siteMenuIdx = SeedUtils.setReplaceNull((Integer)request.getAttribute("siteMenuIdx")); + siteMenuIdx = siteMenuIdx == "" ? SeedUtils.setReplaceNull(request.getParameter("siteMenuIdx")) : siteMenuIdx; + String memberAuth = SeedUtils.setReplaceNull(request.getAttribute("memberAuth"), "false"); + String memberAuthM = SeedUtils.setReplaceNull(request.getAttribute("memberAuthM"), "false"); + String siteMenuManager = SeedUtils.setReplaceNull(request.getAttribute("siteMenuManager"), "N"); + + String sPage = SeedUtils.setReplaceNull(request.getParameter("spage"), "1"); + String sRow = SeedUtils.setReplaceNull(request.getParameter("srow"), "10"); + String autoType = SeedUtils.setReplaceNull(request.getParameter("autoType"), "0"); + String caseNo = SeedUtils.setReplaceNull(request.getParameter("caseNo"), "0"); + + //페이지 URL + String pageLinkUrl = "/user/extra/"+siteIdx+"/sms/messageList/jsp/Page.do?siteMenuIdx="+siteMenuIdx; + + int total = 0; + + List> messangeDataList = null; + List> smsDataList = null; + Map smsDataListCnt = null; + Map smsAutoData = null; + List> smsAutoPhoneList = null; + + SeedSqlCon seedSqlCon = null; + SeedDbUtilsSupport seedDbUtilsSupport = new SeedDbUtilsSupport(); + boolean success = false; + int phoneSize = 1; + + try{ + seedSqlCon = new SeedSqlCon(""); + + // 조사관 배정 SMS, 출석조사 SMS, 종료통지 SMS + if(!autoType.equals("0")) { + smsAutoData = getSmsAutoDataSet(seedSqlCon, autoType, caseNo); +// Object[] objData = { +// memberIdx, "LMS", +// smsAutoData.get("AUTO_SMS_TEXT").toString() +// }; +// +// seedSqlCon.setAutoCommit(false); +// success = setMessageRegProc(seedSqlCon, objData); +// seedSqlCon.commit(); + + smsAutoPhoneList = getSmsAutoPhoneList(seedSqlCon, autoType, caseNo); + + if(smsAutoPhoneList != null && smsAutoPhoneList.size() > 0) { + phoneSize = smsAutoPhoneList.size(); + } + } + + messangeDataList = getMessageDataList(seedSqlCon, memberIdx); + + smsDataList = getSmsDataList(seedSqlCon, memberIdx, Integer.parseInt(sPage), Integer.parseInt(sRow)); + smsDataListCnt = getSmsDataListCnt(seedSqlCon, memberIdx); + + if(smsDataListCnt != null){ + total = seedDbUtilsSupport.countDataToInt(smsDataListCnt.get("DATA_CNT")); + } + + }catch(NumberFormatException e){ + System.out.println("/WEB-INF/views/_extra/user/sms/smsList.jsp 파일에서 에러 발생 NumberFormatException "+e.getMessage()); + }catch(IllegalArgumentException e){ + System.out.println("/WEB-INF/views/_extra/user/sms/smsList.jsp 파일에서 에러 발생 IllegalArgumentException "+e.getMessage()); + }catch(Exception e){ + System.out.println("/WEB-INF/views/_extra/user/sms/smsList.jsp 파일에서 에러 발생 Exception "+e.getMessage()); + }finally{ + if(seedSqlCon != null){ + seedSqlCon.setSeedSqlDispose(); + } + } + +%> + + + + + 메시지 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + +
+ +
+
+ +
0/90byte
+
+
SMS는 90byte만 가능합니다.
초과시 LMS발송을 이용하세요.
+
+ +
+
+ +
0/2000byte
+
+
LMS는 2000byte만 가능합니다.
 
+
+
+ + + <%--

수신번호

+ --%> + + <%-- + 새로쓰기--%> +
+
+ +
+

수신번호

+ 번호추가 +
    + <% + if(smsAutoPhoneList != null && smsAutoPhoneList.size() > 0) { + for(int k=0; k phoneList = smsAutoPhoneList.get(k); + %> +
  • <%= (k+1) %>" placeholder="'-'빼고 숫자만 입력해 주세요." onkeypress="return checkValue();">
  • + <% + } + } else { + %> +
  • 1
  • + <% + } + %> +
+ + 새로쓰기 +
+
+ + +
+ + +
+ +
    +
  • + 순번 + 메시지 + 등록일 + 구분 + 선택 +
  • +<% + if(messangeDataList != null && messangeDataList.size() > 0){ + + int cnt = messangeDataList.size(); + + for(int i=0; i massageMap = messangeDataList.get(i); + + String listMessIdx = SeedUtils.setReplaceNull(massageMap.get("SNO")); + String listMessContents = SeedUtils.setReplaceNull(massageMap.get("CONTENTS")); + String listMessRegDate = SeedUtils.setReplaceNull(massageMap.get("REG_DT")); + String listMessGubun = SeedUtils.setReplaceNull(massageMap.get("GUBUN")); + %> +
  • + <%=cnt%> + <%=listMessContents%> + <%=listMessRegDate%> + <%=listMessGubun%> + + +
  • + <% + cnt--; + } + }else{ %> +
  • +

    검색된 데이터가 없습니다.

    +
  • + <% } %> + + +
+ +
+ + + + + + +

+ + +
+
+ +
+
+

특수문자

+
0/2000byte
+
+ +
+ + +
+ + + + +
+
    +
  • + 순번 + 발송내용 + 수신번호 + 구분 + 발송일 +
  • + + <% + if(smsDataList != null && smsDataList.size() > 0){ + + int cnt2 = total - ((Integer.parseInt(sPage) - 1) * Integer.parseInt(sRow)); + + for(int i=0; i smsMap = smsDataList.get(i); + + String listSmsIdx = SeedUtils.setReplaceNull(smsMap.get("SNO")); + String listSmsContents = SeedUtils.setReplaceNull(smsMap.get("CONTENTS")); + String listSmsRegDate = SeedUtils.setReplaceNull(smsMap.get("REG_DT")); + String listSmsGubun = SeedUtils.setReplaceNull(smsMap.get("GUBUN")); + String listSmsNum = SeedUtils.setReplaceNull(smsMap.get("HPNUMBER")); + + %> +
  • + <%=cnt2%> + <%=listSmsContents%> + <%=listSmsNum%> + <%=listSmsGubun%> + <%=listSmsRegDate%> +
  • + <% + cnt2--; + } + }else{ %> +
  • +

    검색된 데이터가 없습니다.

    +
  • + <% } %> + + +
+
+ <%=getUserPage3(total, Integer.parseInt(sPage), Integer.parseInt(sRow), pageLinkUrl)%> +
+
+ + + + + +
+
+ + +
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/_extra/user/sms/process.jsp b/src/main/webapp/WEB-INF/jsp/_extra/user/sms/process.jsp new file mode 100644 index 00000000..ba0d5624 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/_extra/user/sms/process.jsp @@ -0,0 +1,191 @@ +<%@ page contentType="text/html;charset=utf-8" %> +<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ page import="java.util.Date"%> +<%@ page import="java.io.File"%> +<%@ include file="/WEB-INF/views/_extra/dao/smsDao.jsp"%> +<%@ include file="/WEB-INF/views/_extra/dao/commonFileDao.jsp"%> +<%@ include file="/WEB-INF/views/_extra/common/commonFileUtil.jsp"%> + +<% + + //호환성보기 방지하기 + response.setHeader("X-UA-Compatible", "IE=Edge"); + + //세션 값 + String memberIdx = SeedUtils.setReplaceNull(session.getAttribute("memberIdx")); + String memberName = SeedUtils.setReplaceNull(session.getAttribute("memberName")); + String memberGrant = SeedUtils.setReplaceNull(session.getAttribute("memberGrant"), "N"); + + //사이트 키, 사이트 메뉴 키, 페이지 타입(gtm,gte), 사이트담당자 권한체크("true","false"), 해당메뉴담당자 권한체크("true","false") + String siteIdx = SeedUtils.setReplaceNull((String)request.getAttribute("siteIdx")); + String siteMenuIdx = SeedUtils.setReplaceNull((Integer)request.getAttribute("siteMenuIdx")); + siteMenuIdx = siteMenuIdx == "" ? SeedUtils.setReplaceNull(request.getParameter("siteMenuIdx")) : siteMenuIdx; + String memberAuth = SeedUtils.setReplaceNull(request.getAttribute("memberAuth"), "false"); + String memberAuthM = SeedUtils.setReplaceNull(request.getAttribute("memberAuthM"), "false"); + String siteMenuManager = SeedUtils.setReplaceNull(request.getAttribute("siteMenuManager"), "N"); + + String sPage = SeedUtils.setReplaceNull(request.getParameter("spage"),"1"); + String sRow = SeedUtils.setReplaceNull(request.getParameter("srow"),"10"); + + String command = SeedUtils.setReplaceNull(request.getParameter("command")); + + boolean success = false; + + SeedSqlCon seedSqlCon = null; + + SeedDbUtilsSupport seedDbUtilsSupport = new SeedDbUtilsSupport(); + + String href = "/user/extra/"+siteIdx+"/sms/messageList/jsp/Page.do?spage="+sPage+"&srow="+sRow; + + String message = ""; + String opener = ""; + String self = ""; + + try{ + + seedSqlCon = new SeedSqlCon(""); + seedSqlCon.setAutoCommit(false); + + SeedDateUtil seedDateUtil = new SeedDateUtil(); + + if(command.equals("send")){ + + String type = SeedUtils.setReplaceNull(request.getParameter("type")); + String smsContents = SeedUtils.setReplaceNull(request.getParameter("smsContents")); + String lmsContents = SeedUtils.setReplaceNull(request.getParameter("lmsContents")); + String phone = SeedUtils.setReplaceNull(request.getParameter("phoneNums")); + + if((smsContents.equals("") && lmsContents.equals("")) || phone.equals("")){ + message = "정상적인 요청이 아닙니다."; + + }else{ + + if(type.equals("LMS")){ + smsContents = lmsContents; + } + + Object[] objData = { + memberIdx, type, + smsContents, phone + }; + + success = setSmsRegProc(seedSqlCon, objData); + + System.out.println("type:" + type); + System.out.println("phone:" + phone); + System.out.println("smsContents:" + smsContents); + System.out.println("lmsContents:" + lmsContents); + //실제 전송 DB에 저장 + if(success){ + if(type.equals("SMS")){ + Object[] objData2 = { + smsContents, phone + }; + success = setSmsRealRegProc(seedSqlCon, objData2); + }else if(type.equals("LMS")){ + Object[] objData2 = { + smsContents, phone + }; + success = setLmsRealRegProc(seedSqlCon, objData2); + } + } + + + if(success){ + message = "SMS이 발송 되었습니다."; + }else{ + message = "SMS이 실패 되었습니다."; + } + } + + }else if(command.equals("message")){ + + String messageContents = SeedUtils.setReplaceNull(request.getParameter("messageContents")); + String type = ""; + int conLeng = 0; + + if(messageContents.equals("")){ + message = "정상적인 요청이 아닙니다."; + }else{ + conLeng = messageContents.getBytes().length; + if(conLeng > 90){ + type = "LMS"; + }else{ + type = "SMS"; + } + Object[] objData = { + memberIdx, type, + messageContents + }; + + success = setMessageRegProc(seedSqlCon, objData); + + if(success){ + message = "메세지가 등록 되었습니다."; + }else{ + message = "메세지 등록이 실패 되었습니다."; + } + + } + + }else if(command.equals("messageDel")){ + + String messageIdx = SeedUtils.setReplaceNull(request.getParameter("messageIdx")); + + Object[] objData = { + messageIdx, + memberIdx + }; + + success = setMessageDataDelete(seedSqlCon, objData); + + if(success){ + message = "메세지함이 삭제 되었습니다."; + }else{ + message = "메세함 삭제가 실패 되었습니다."; + } + + + } + + + }catch(SQLException e){ + if(seedSqlCon != null){seedSqlCon.rollback();} + System.out.println("/WEB-INF/views/_extra/user/sms/process.jsp 파일에서 에러 발생 Exception "+e.getMessage()); + }catch(Exception e){ + if(seedSqlCon != null){seedSqlCon.rollback();} + System.out.println("/WEB-INF/views/_extra/user/sms/process.jsp 파일에서 에러 발생 Exception "+e.getMessage()); + }finally{ + if(seedSqlCon != null){ + seedSqlCon.commit(); + seedSqlCon.setSeedSqlDispose(); + } + } + + session.setAttribute("siteIdx", siteIdx); + session.setAttribute("message", "(message)"+message); + session.setAttribute("opener", opener); + session.setAttribute("url", href); + session.setAttribute("self", self); + +%> + + + + + + + + + + + 페이지 이동 + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write.jsp b/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write.jsp index 7966de3e..c5edb857 100644 --- a/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write.jsp +++ b/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write.jsp @@ -57,28 +57,7 @@ ${memberName} -
-

첨부자료

-
-
- - - - -
- -

- - - -
-
- +

내용

@@ -174,43 +153,6 @@ return false; } */ }); - - - // 파일전송 컨트롤 생성 - - /* 첨부파일 컨트롤 옵션 주요 옵션 종류 - 1. allowExtension(String Array) : 허용 확장자 종류 - 2. limitExtension(String Array) : 제외 확장자 종류 - 3. maxFileSize(Number) : 첨부가능한 개별 파일 사이즈 - 4. maxTotalSize(Number) : 첨부가능한 전체 파일 사이즈 - 5. maxFileCount(NUmber) : 첨부가능 파일 전체 개수 - 4. installUrl(String) : Agent 설치 안내 URL */ - - - /* 첨부파일 동작 관련 이벤트 종류 - 1. 파일 추가 완료 : afterAddFiles - 2. 파일 업로드 완료 : uploadComplete - 3. 파일 삭제 완료 : removeFiles */ - - - - - /* control 객체는 innorixCommon.js에서 생성 */ - control = innorix.create({ - el: '#fileControl', // 컨트롤 출력 HTML 객체 ID - transferMode: 'both', // 업로드, 다운로드 혼합사용 - installUrl: '/innorix/install/install.html', // Agent 설치 페이지 - uploadUrl: '/innorix/exam/upload.jsp', // 업로드 URL - allowExtension : ["txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz"] - }); - - // 업로드 완료 후 이벤트 - control.on('afterAddFiles', function (p) { - console.log('afterAddFiles : ', p); - $("#fileTempUpFrm").submit(); - /* fn_callBackInnorix(p.files); // 파일 정보 DB isnert function */ - }); - }); function goList(){ diff --git a/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write_back_beforeInnorix.jsp b/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write_testing.jsp similarity index 68% rename from src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write_back_beforeInnorix.jsp rename to src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write_testing.jsp index c5edb857..8f4bf45f 100644 --- a/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write_back_beforeInnorix.jsp +++ b/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/board/write_testing.jsp @@ -57,7 +57,29 @@ ${memberName}
+
+

첨부자료

+
+
+ + + + + +
+ +

+ + + + +
+
+

내용

@@ -79,7 +101,8 @@
- + +
@@ -120,7 +143,11 @@ attach_list_view: false }); - + /* innorix-1 + 첨부파일 업로드 경로 전역 변수 선언 + */ + var directory = ""; + $(window).load(function(){ $("#idx_toolbar_webnote_content_imagecenter").hide(); @@ -153,11 +180,64 @@ return false; } */ }); + + /* 이노릭스 대용량 업로드 솔루션 */ + + /* innorix-2 + 첨부파일 업로드 경로 설정 + fileFuncType와 세션의 siteId등의 정보를 이용해 업로드 경로 설정 + */ + var fileFuncType = $("#fileTempUpFrm").find("input[name='fileFuncType']").val(); + var url = "" + getFileDirectory(fileFuncType, url, function(result){ + directory = result; + }); + + /* innorix-3 + 이노릭스 업로드 컨트롤 생성 + control 객체는 innorixCommon.js에서 생성 + */ + control = innorix.create({ + el: '#fileControl', // 컨트롤 출력 HTML 객체 ID + transferMode: 'both', // 업로드, 다운로드 혼합사용 + agent : false, + installUrl: "", // Agent 설치 페이지 + uploadUrl: "", // 업로드 URL + allowExtension : ["txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz"] + }); + + // 업로드 완료 후 temp 파일 저장 + //control.on('afterAddFiles', function (p) { + //console.log('afterAddFiles : ', p); + //var postObj = new Object(); + //postObj.directory = directory; + //control.setPostData(postObj); + //control.upload(); // 업로드 시작 + /* $("#fileTempUpFrm").submit(); */ + /* fn_callBackInnorix(p.files); // 파일 정보 DB isnert function */ + //}); + }); function goList(){ $("#paramFrm").submit(); } + + /* innorix-4 + 이노릭스 업로드 시작 + 첨부파일이 있을 시 업로드 후 게시글 작성 + 첨부파일이 없을 시 바로 게시글 작성 + */ + function innorixUpload(){ + if(control.getUploadFiles().length > 0){ + var postObj = new Object(); + postObj.directory = directory; + control.setPostData(postObj); + control.upload(); // 업로드 시작 */ + }else{ + $("button[type='submit']").click(); + } + } diff --git a/src/main/webapp/WEB-INF/views/_common/_js/kccadr/innorixCommon.js b/src/main/webapp/WEB-INF/views/_common/_js/kccadr/innorixCommon.js index 0a3d0808..27abbd56 100644 --- a/src/main/webapp/WEB-INF/views/_common/_js/kccadr/innorixCommon.js +++ b/src/main/webapp/WEB-INF/views/_common/_js/kccadr/innorixCommon.js @@ -108,3 +108,25 @@ function fileListReset() { control.presetDownloadFiles(resetFileArr); // 다운로드 목록 초기화 } +/* +* 파일 업로드 전 파일 업로드 위치 구하기 +* 상황에 따라 임시 or 정식 폴더 및 기능 or 메뉴별 업로드 위치가 다름 +* +*/ +function getFileDirectory(fileFuncType, url, callback){ + $.ajax({ + type : "POST", + url : url, + data : {fileFuncType : fileFuncType }, + dataType : 'json', + async: false, + success : function(returnData, status){ + if(status == 'success'){ + callback(returnData.directory); + } else{ + alert("파일 경로 조회 실패"); + } + }, + error: function (e) { alert("파일 경로 조회 실패."); console.log("ERROR : ", e); } + }); +} diff --git a/src/main/webapp/innorix/exam/seedUpload.jsp b/src/main/webapp/innorix/exam/seedUpload.jsp new file mode 100644 index 00000000..93f6f0f2 --- /dev/null +++ b/src/main/webapp/innorix/exam/seedUpload.jsp @@ -0,0 +1,85 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.innorix.transfer.InnorixUpload" %> +<%@ page import="java.util.UUID" %> + +<% +// CORS체크를 위한 OPTIONS 메소드가 들어오므로 POST 일 경우에만 동작하도록 조건 추가 +if (request.getMethod().equals("POST")) +{ + String directory = InnorixUpload.getServletAbsolutePath(request); + /* directory = directory.substring(0, directory.lastIndexOf("/") + 1) + "data"; */ + directory = "/usr/local/file/sht/"; + int maxPostSize = 2147482624; // bytes + + InnorixUpload uploader = new InnorixUpload(request, response, maxPostSize, directory); + + /* + 전달되는 _action Param 정보 + speedCheck : 전송속도 측정 + getServerInfo : 서버정보 확인 + getFileInfo : 파일정보 확인 + attachFile : 파일전송 진행 + attachFileCompleted : 파일전송 완료 + */ + + String _action = uploader.getParameter("_action"); // 동작 플래그 + String _orig_filename = uploader.getParameter("_orig_filename"); // 원본 파일명 + String _new_filename = uploader.getParameter("_new_filename"); // 저장 파일명 + String _filesize = uploader.getParameter("_filesize"); // 파일 사이즈 + String _start_offset = uploader.getParameter("_start_offset"); // 파일저장 시작지점 + String _end_offset = uploader.getParameter("_end_offset"); // 파일저장 종료지점 + String _filepath = uploader.getParameter("_filepath"); // 파일 저장경로 + String _el = uploader.getParameter("el"); // 컨트롤 엘리먼트 ID + String _type = uploader.getParameter("type"); // 커스텀 정의 POST Param 1 + String _part = uploader.getParameter("part"); // 커스텀 정의 POST Param 2 + String _transferId = uploader.getParameter("_transferId"); // TransferId + String _directory = uploader.getParameter("directory"); // 커스텀 정의 POST Param 3 업로드 경로 + + // 파일정보 확인 + if("getFileInfo".equals(_action)) { + /* + 업로드 시 서버에 저장되는 파일 명 변경 (해당 예제는 랜덥값으로 서버에 저장되는 파일명을 설정) + - uploader.setFileName(파일명+확장자); + - 확장자 변경 시 파일은 열리지 않게 됩니다. + - upload.run()전에 위치 + */ + /* String saveNm = UUID.randomUUID()+".jpg"; + uploader.setFileName(saveNm); */ + } + + uploader.setDirectory(_directory); + + String _run_retval = uploader.run(); + + // 개별파일 업로드 완료 + if (uploader.isUploadDone()) { + /* + System.out.println("========== uploader.isUploadDone() " + System.currentTimeMillis() + " =========="); + System.out.println("_orig_filename \t = " + _orig_filename); + System.out.println("_new_filename \t = " + _new_filename); + System.out.println("_filesize \t = " + _filesize); + System.out.println("_filepath \t = " + _filepath); + System.out.println("_el \t = " + _el); + */ + } + + System.out.println("========== innorix transfer " + System.currentTimeMillis() + " =========="); + System.out.println("_action \t = " + _action); + System.out.println("_run_retval \t = " + _run_retval); + System.out.println("_orig_filename \t = " + _orig_filename); + System.out.println("_new_filename \t = " + _new_filename); + System.out.println("_filesize \t = " + _filesize); + System.out.println("_start_offset \t = " + _start_offset); + System.out.println("_end_offset \t = " + _end_offset); + System.out.println("_filepath \t = " + _filepath); + System.out.println("_el \t = " + _el); + System.out.println("_type \t = " + _type); + System.out.println("_part \t = " + _part); +} + +// CORS 관련 헤더 추가 +response.setHeader("Access-Control-Allow-Origin", "*"); +response.setHeader("Access-Control-Allow-Credentials", "true"); +response.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS"); +response.setHeader("Access-Control-Allow-Headers", "Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"); +%> \ No newline at end of file diff --git a/src/main/webapp/innorix/exam/upload.jsp b/src/main/webapp/innorix/exam/upload.jsp index 2ed19c34..27f66bbd 100644 --- a/src/main/webapp/innorix/exam/upload.jsp +++ b/src/main/webapp/innorix/exam/upload.jsp @@ -6,7 +6,8 @@ if (request.getMethod().equals("POST")) { String directory = InnorixUpload.getServletAbsolutePath(request); - directory = directory.substring(0, directory.lastIndexOf("/") + 1) + "data"; + /* directory = directory.substring(0, directory.lastIndexOf("/") + 1) + "data"; */ + directory = "/usr/local/file/sht/"; int maxPostSize = 2147482624; // bytes InnorixUpload uploader = new InnorixUpload(request, response, maxPostSize, directory); diff --git a/src/main/webapp/innorix/gnexam/changeFileName.jsp b/src/main/webapp/innorix/gnexam/changeFileName.jsp index 8caa9a77..e462b2c7 100644 --- a/src/main/webapp/innorix/gnexam/changeFileName.jsp +++ b/src/main/webapp/innorix/gnexam/changeFileName.jsp @@ -59,6 +59,19 @@ if ("POST".equals(request.getMethod())) */ } + System.out.println("========== innorix transfer " + System.currentTimeMillis() + " =========="); + System.out.println("_action \t = " + _action); + System.out.println("_run_retval \t = " + _run_retval); + System.out.println("_orig_filename \t = " + _orig_filename); + System.out.println("_new_filename \t = " + _new_filename); + System.out.println("_filesize \t = " + _filesize); + System.out.println("_start_offset \t = " + _start_offset); + System.out.println("_end_offset \t = " + _end_offset); + System.out.println("_filepath \t = " + _filepath); + System.out.println("_el \t = " + _el); + System.out.println("_type \t = " + _type); + System.out.println("_part \t = " + _part); + } // CORS 관련 헤더 추가