이지우 - 관리자 > 분쟁조정관련서식 등록 시 이노릭스 적용 완료. 수정화면 작업 중

This commit is contained in:
JIWOO 2024-11-08 15:35:11 +09:00
parent 314b8b0dd1
commit f1c88cbbf5
8 changed files with 180 additions and 42 deletions

View File

@ -14,14 +14,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import seed.com.gtm.seedfile.SeedFileService; import seed.com.gtm.seedfile.SeedFileService;
import seed.com.gtm.util.Criteria; import seed.com.gtm.util.Criteria;
import seed.com.gtm.util.PageMaker; import seed.com.gtm.util.PageMaker;
import seed.common.service.InnorixFileService; import seed.common.service.InnorixFileService;
import seed.common.service.InnorixFileVO;
@Controller @Controller
@RequestMapping("/gtm/case") @RequestMapping("/gtm/case")
@ -62,18 +58,26 @@ public class CaseBoardController {
fileService.fileInsert(paramMap, request, session); fileService.fileInsert(paramMap, request, session);
//이노릭스 대용량 업로드 //이노릭스 대용량 업로드
String innorixFileListVO = (String) paramMap.get("innorixFileListVO"); String innorixFileListStr = (String) paramMap.get("innorixFileListVO");
if("".equals(innorixFileListVO)) { if(!"".equals(innorixFileListStr)) {
try {
innorixFileService.innorixExtraFileInsert(innorixFileListStr, paramMap);
}catch(Exception e) {
System.out.println("이노릭스에러");
e.printStackTrace();
}
}
/* if(!"".equals(innorixFileListVO)) {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
try { try {
List<InnorixFileVO> innorixFileList = objectMapper.readValue(innorixFileListVO, new TypeReference<List<InnorixFileVO>>() {}); List<InnorixFileVO> innorixFileList = objectMapper.readValue(innorixFileListVO, new TypeReference<List<InnorixFileVO>>() {});
innorixFileService.innorixFileInsert(innorixFileList); innorixFileService.innorixExtraFileInsert(innorixFileList, paramMap);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
*/
map.put("message", "common.message.reg"); map.put("message", "common.message.reg");
map.put("url", "/gtm/case/board/"+boardIdx+"/list.do"); map.put("url", "/gtm/case/board/"+boardIdx+"/list.do");

View File

@ -1,9 +1,11 @@
package seed.common.service; package seed.common.service;
import java.util.List; import java.util.Map;
import org.springframework.web.bind.annotation.RequestParam;
public interface InnorixFileService { public interface InnorixFileService {
public void innorixFileInsert(List<InnorixFileVO> innorixFileList) throws Exception; public void innorixExtraFileInsert(String innorixFileListStr, @RequestParam Map<String,Object> paramMap) throws Exception;
} }

View File

@ -1,10 +1,15 @@
package seed.common.service; package seed.common.service;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
import seed.dao.InnorixFileDAO; import seed.dao.InnorixFileDAO;
@ -15,10 +20,20 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
@Resource(name="innorixFileDAO") @Resource(name="innorixFileDAO")
public InnorixFileDAO innorixFileDAO; public InnorixFileDAO innorixFileDAO;
public void innorixFileInsert(List<InnorixFileVO> innorixFileList) throws Exception { @Override
public void innorixExtraFileInsert(String innorixFileListStr, @RequestParam Map<String,Object> paramMap) throws Exception {
ObjectMapper objectMapper = new ObjectMapper();
List<InnorixFileVO> innorixFileList = objectMapper.readValue(innorixFileListStr, new TypeReference<List<InnorixFileVO>>() {});
for(InnorixFileVO innorixFileVO : innorixFileList) { for(InnorixFileVO innorixFileVO : innorixFileList) {
innorixFileDAO.innorixFileInsert(innorixFileVO); innorixFileVO.setDataIdx((Integer) paramMap.get("dataIdx"));
innorixFileVO.setFileFuncType((String)paramMap.get("fileFuncType"));
String fileName = innorixFileVO.getClientFileName();
String fileType = fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
innorixFileVO.setFileType(fileType);
innorixFileDAO.innorixExtraFileInsert(innorixFileVO);
} }
} }

View File

@ -69,6 +69,11 @@ public class InnorixFileVO extends ComDefaultVO implements Serializable {
private String lastUpdusrId; private String lastUpdusrId;
private int dataIdx;
private String fileFuncType;
private String fileType;
public List<InnorixFileVO> getInnorixFileListVO() { public List<InnorixFileVO> getInnorixFileListVO() {
@ -185,6 +190,24 @@ public class InnorixFileVO extends ComDefaultVO implements Serializable {
public void setLastUpdusrId(String lastUpdusrId) { public void setLastUpdusrId(String lastUpdusrId) {
this.lastUpdusrId = lastUpdusrId; this.lastUpdusrId = lastUpdusrId;
} }
public int getDataIdx() {
return dataIdx;
}
public void setDataIdx(int dataIdx) {
this.dataIdx = dataIdx;
}
public String getFileFuncType() {
return fileFuncType;
}
public void setFileFuncType(String fileFuncType) {
this.fileFuncType = fileFuncType;
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}

View File

@ -1,5 +1,7 @@
package seed.dao; package seed.dao;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import egovframework.rte.psl.dataaccess.EgovAbstractDAO; import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
@ -8,7 +10,10 @@ import seed.common.service.InnorixFileVO;
@Repository("innorixFileDAO") @Repository("innorixFileDAO")
public class InnorixFileDAO extends EgovAbstractDAO { public class InnorixFileDAO extends EgovAbstractDAO {
public void innorixFileInsert(InnorixFileVO innorixFileVO) throws Exception { @Autowired
insert("com.seed.innorixFile.extraInsert", innorixFileVO); private SqlSession sqlSession;
public void innorixExtraFileInsert(InnorixFileVO innorixFileVO) throws Exception {
sqlSession.insert("com.seed.innorixFile.extraInsert", innorixFileVO);
} }
} }

View File

@ -18,8 +18,8 @@
) VALUES ( ) VALUES (
SEQ_EXTRA_FILE.NEXTVAL, SEQ_EXTRA_FILE.NEXTVAL,
'N', 'N',
#{uploadFileNameData}, #{clientFileName},
#{reFileName}, #{serverFileName},
SYSDATE, SYSDATE,
#{fileSize}, #{fileSize},
'', '',

View File

@ -1,6 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!doctype html> <!doctype html>
<html lang="ko"> <html lang="ko">
<head> <head>
@ -8,7 +9,13 @@
<link href='/css/space.css' rel='stylesheet' type='text/css'/> <link href='/css/space.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.contents.css' rel='stylesheet' type='text/css'/> <link href='/css/seed.contents.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.mediaquery.css' rel='styleGsheet' type='text/css'/> <link href='/css/seed.mediaquery.css' rel='styleGsheet' type='text/css'/>
<link href='/site/ntcc/css/gtmCustom.css' rel='stylesheet' type='text/css'/> <!-- <link href='/site/ntcc/css/gtmCustom.css' rel='stylesheet' type='text/css'/> -->
<!-- 대용량 파일 업로드 솔루션 -->
<spring:eval expression="@property['Globals.Innorix.License']" var="license"/>
<script src="<c:url value='/js/kccadr/innorixCommon.js' />"></script>
<script src="<c:url value='/innorix/innorix_${license}.js' />"></script>
<link rel="stylesheet" href="<c:url value='/innorix/innorix.css'/>" type="text/css">
<script src="/editor/webnote.js"></script> <script src="/editor/webnote.js"></script>
@ -56,6 +63,21 @@
<div class="bbs-view-item"> <div class="bbs-view-item">
<p class="item-title">첨부자료</p> <p class="item-title">첨부자료</p>
<div class="item-box"> <div class="item-box">
<div class="temp-file-area">
<!-- 단일 파일 업로드 -->
<input type="button" value="첨부파일" class="btn btn_text btn_36 blue_border temp-file-button" onclick="control.openFileDialogSingle();"/>
<!-- 멀티 파일 업로드 -->
<!-- <input type="button" value="첨부파일" class="btn btn_text btn_36 blue_border temp-file-button" onclick="control.openFileDialog();"/> -->
</div>
<!-- 첨부파일 업로드 목록 및 드래그&드랍 영역 -->
<div id="fileControl"></div><br/>
<input type="hidden" name="fileFuncType" value="form_notice" />
<input type="hidden" name="innorixFileListVO" value="" />
<input type="hidden" name="uploadFileCnt" value="${fileListSize}" id="uploadFileCntId" />
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
</div>
<%-- <div class="item-box">
<div class="temp-file-area"> <div class="temp-file-area">
<label for="upFile" class="btn btn_text btn_36 blue_border temp-file-button" style="display:flex;justify-content:center;align-items:center;">첨부파일</label> <label for="upFile" class="btn btn_text btn_36 blue_border temp-file-button" style="display:flex;justify-content:center;align-items:center;">첨부파일</label>
</div> </div>
@ -71,7 +93,7 @@
<input type="hidden" name="fileFuncType" value="form_notice" /> <input type="hidden" name="fileFuncType" value="form_notice" />
<input type="hidden" name="uploadFileCnt" value="${fileListSize}" id="uploadFileCntId" /> <input type="hidden" name="uploadFileCnt" value="${fileListSize}" id="uploadFileCntId" />
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" /> <input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
</div> </div> --%>
</div> </div>
<div class="bbs-view-item"> <div class="bbs-view-item">
<p class="item-title">내용</p> <p class="item-title">내용</p>
@ -124,6 +146,12 @@
}); });
/* innorix-1
첨부파일 업로드 경로 전역 변수 선언
*/
var directory = "";
var fileList = "";
$(window).load(function(){ $(window).load(function(){
$("#idx_toolbar_webnote_content_imagecenter").hide(); $("#idx_toolbar_webnote_content_imagecenter").hide();
@ -156,6 +184,61 @@
return false; return false;
} */ } */
}); });
/* 이노릭스 대용량 업로드 솔루션 */
/* innorix-2
첨부파일 업로드 경로 설정
fileFuncType와 세션의 siteId등의 정보를 이용해 업로드 경로 설정
*/
var fileFuncType = $("#fileTempUpFrm").find("input[name='fileFuncType']").val();
var url = "<c:url value='/seed/innorix/getRealFileDirectoryAjax.do'/>"
getFileDirectory(fileFuncType, url, function(result){
directory = result;
});
fileList = '${fileList}'
fileList = JSON.stringify(fileList);
/* innorix-3
이노릭스 업로드 컨트롤 생성
control 객체는 innorixCommon.js에서 생성
*/
control = innorix.create({
el: '#fileControl', // 컨트롤 출력 HTML 객체 ID
transferMode: 'both', // 업로드, 다운로드 혼합사용
agent : false,
installUrl: "<c:url value='/innorix/install/install.html'/>", // Agent 설치 페이지
uploadUrl: "<c:url value='/innorix/exam/seedUpload.jsp'/>", // 업로드 URL
allowExtension : ["txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz"]
});
// 파일전송 컨트롤 로딩 완료
control.on('loadComplete', function (p) {
alert("1234");
// 다운로드 목록
downFileArr =
[{
printFileName: "INNORIX WP 브로셔.pdf",
fileSize: 1433885,
},
{
printFileName: "INNORIX WP Brochure.pdf",
fileSize: 1433885,
},
{
printFileName: "INNORIX WP パンフレット.pdf",
fileSize: 1433885,
}];
resetFileArr = downFileArr; // 다운로드 정보 초기화 정보 생성
resetFileArr = resetFileArr.slice(0); // 배열 깊은 복사
control.presetDownloadFiles(resetFileArr); // 다운로드 파일 추가
});
}); });
function goList(){ function goList(){

View File

@ -64,7 +64,6 @@
<div class="temp-file-area"> <div class="temp-file-area">
<!-- 단일 파일 업로드 --> <!-- 단일 파일 업로드 -->
<input type="button" value="첨부파일" class="btn btn_text btn_36 blue_border temp-file-button" onclick="control.openFileDialogSingle();"/> <input type="button" value="첨부파일" class="btn btn_text btn_36 blue_border temp-file-button" onclick="control.openFileDialogSingle();"/>
<!-- <label for="upFile" class="btn btn_text btn_36 blue_border temp-file-button" style="display:flex;justify-content:center;align-items:center;">첨부파일</label> -->
<!-- 멀티 파일 업로드 --> <!-- 멀티 파일 업로드 -->
<!-- <input type="button" value="첨부파일" class="btn btn_text btn_36 blue_border temp-file-button" onclick="control.openFileDialog();"/> --> <!-- <input type="button" value="첨부파일" class="btn btn_text btn_36 blue_border temp-file-button" onclick="control.openFileDialog();"/> -->
</div> </div>
@ -73,27 +72,8 @@
<input type="hidden" name="fileFuncType" value="form_notice" /> <input type="hidden" name="fileFuncType" value="form_notice" />
<input type="hidden" name="innorixFileListVO" value="" /> <input type="hidden" name="innorixFileListVO" value="" />
<!-- <ul class="upFileHtml" id="upFileHtml">
</ul>
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" /> -->
</div> </div>
</div> </div>
<!-- <div class="bbs-view-item">
<p class="item-title">첨부자료</p>
<div class="item-box">
<div class="temp-file-area">
<label for="upFile" class="btn btn_text btn_36 blue_border temp-file-button" style="display:flex;justify-content:center;align-items:center;">첨부파일</label>
</div>
<ul class="upFileHtml" id="upFileHtml">
</ul>
<input type="hidden" name="fileFuncType" value="form_notice" />
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
</div>
</div> -->
<div class="bbs-view-item"> <div class="bbs-view-item">
<p class="item-title">내용</p> <p class="item-title">내용</p>
<div class="item-box"> <div class="item-box">
@ -184,6 +164,33 @@
/* 이노릭스 대용량 업로드 솔루션 */ /* 이노릭스 대용량 업로드 솔루션 */
/*
선언 항목
1. spring 태그
2. 개발or운영 구분을 위한 global 상수 받아오기 - license
3. js, css
html
1. 첨부파일 업로드 버튼(단일 -openFileDialogSingle / 멀티 - openFileDialog)
2. 첨부파일 목록 및 드래그앤 드랍 영역 선언 - div fileControl
javascript
1. 첨부파일 업로드 경로 변수 - var directory
2. 첨부파일 경로 설정 - getFileDirectory 함수
3. 컨트롤(업로드 및 드래그앤 드랍 영역 생성) - innorix.create
4. 이벤트 생성(업로드 후, 파일 삭제 버튼 클릭 등등) - control.on('uploadComplete', function (p) {}
게시글 등록 처리과정
1. 첨부파일 O
1-1. 파일 업로드 후 파일들 정보를 innorixFileListVO에 담기
1-2. 게시글 등록 폼에 업로드 한 파일들 정보를 담아서 submit 후 첨부파일 DB insert 처리
2. 첨부파일 X
2-1. 게시글 등록 폼 submit, 첨부파일 DB insert 생략
*/
/* innorix-2 /* innorix-2
첨부파일 업로드 경로 설정 첨부파일 업로드 경로 설정
fileFuncType와 세션의 siteId등의 정보를 이용해 업로드 경로 설정 fileFuncType와 세션의 siteId등의 정보를 이용해 업로드 경로 설정
@ -207,7 +214,7 @@
allowExtension : ["txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz"] allowExtension : ["txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz"]
}); });
// 업로드 완료 후 temp 파일 저장 // 업로드 완료 후 temp 파일 저장 - 사용X
//control.on('afterAddFiles', function (p) { //control.on('afterAddFiles', function (p) {
//console.log('afterAddFiles : ', p); //console.log('afterAddFiles : ', p);
//var postObj = new Object(); //var postObj = new Object();
@ -250,7 +257,6 @@
*/ */
function fn_callBackInnorix(data){ function fn_callBackInnorix(data){
$("input[name='innorixFileListVO']").val(JSON.stringify(data)); $("input[name='innorixFileListVO']").val(JSON.stringify(data));
/* $("input[name='innorixFileListVO']").val(data); */
$("button[type='submit']").click(); $("button[type='submit']").click();
} }