Merge branch 'hylee'

This commit is contained in:
hylee 2022-11-22 16:24:48 +09:00
commit 3a143353c9
11 changed files with 697 additions and 96 deletions

View File

@ -1,23 +1,40 @@
package kcc.com.cmm.service;
public enum AdrInnorixFileEnumVO {
/** 과거사건문서 > 문서관리 */ adjReqMgrPastFileRegist("PST_", "", "", "", "")
/** 조정진행목록 > 사건문서 > 문서등록 */ , docRegPop("CHGDATE_", "정진행관리>>조정진행목록>조정진행상세>사건문서>P>문서등록", "A160", "", "")
/** 과거사건문서 > 문서관리 */ adjReqMgrPastFileRegist("INSERT", "PST_", "", "", "", "", true)
/** 조정진행목록 > 사건문서 > 문서등록 */ , docRegPop("INSERT", "CHGDATE_", "정진행관리>>조정진행목록>조정진행상세>사건문서>P>문서등록", "A160", "", "", true)
/** 조정진행목록 > 조정진행상세 > 대리인 수정 */ , updtRpplPop("UPDATE", "CHGDATE_", "", "", "", "", true)
;
// INSERT UPDATE 구분
private final String mode;
// save 파일명
private final String p_file_nm_prefix;
// history
private final String p_code_desc;
// history
private final String p_stat_cd;
private final String p_adrHstryMgrSeq;
private final String p_updateQuery;
//AdrRpplDoc 메소드를 사용할지 말지 여부
private final boolean isAdrRpplDoc;
AdrInnorixFileEnumVO(String p_file_nm_prefix, String p_code_desc, String p_stat_cd, String p_adrHstryMgrSeq, String p_updateQuery) {
AdrInnorixFileEnumVO(String mode, String p_file_nm_prefix, String p_code_desc, String p_stat_cd, String p_adrHstryMgrSeq, String p_updateQuery, boolean isAdrRpplDoc) {
this.mode = mode;
this.p_file_nm_prefix = p_file_nm_prefix;
this.p_code_desc = p_code_desc;
this.p_stat_cd = p_stat_cd;
this.p_adrHstryMgrSeq = p_adrHstryMgrSeq;
this.p_updateQuery = p_updateQuery;
this.isAdrRpplDoc = isAdrRpplDoc;
}
public String getMode() {
return mode;
}
public String getP_file_nm_prefix() {
@ -40,12 +57,18 @@ public enum AdrInnorixFileEnumVO {
return p_updateQuery;
}
public boolean isAdrRpplDoc() {
return isAdrRpplDoc;
}
public AdrInnorixFileVO conversion(AdrInnorixFileEnumVO enumVO, AdrInnorixFileVO adrInnorixFileListVO) {
adrInnorixFileListVO.setP_file_nm_prefix(enumVO.getP_file_nm_prefix());
adrInnorixFileListVO.setP_code_desc(enumVO.getP_code_desc());
adrInnorixFileListVO.setP_stat_cd(enumVO.getP_stat_cd());
adrInnorixFileListVO.setP_adrHstryMgrSeq(enumVO.getP_adrHstryMgrSeq());
adrInnorixFileListVO.setMode(enumVO.getMode());
adrInnorixFileListVO.setAdrRpplDoc(enumVO.isAdrRpplDoc());
return adrInnorixFileListVO;
}

View File

@ -42,7 +42,8 @@ public class AdrInnorixFileVO extends ComDefaultVO implements Serializable {
public String adrDocCn1 = "";
public String openYn = "";
public String atchFileId = "";
public String mode = "";
public boolean isAdrRpplDoc;
/*
* jsp file name
@ -208,6 +209,22 @@ public class AdrInnorixFileVO extends ComDefaultVO implements Serializable {
public void setRpplDocSeq(String rpplDocSeq) {
this.rpplDocSeq = rpplDocSeq;
}
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public boolean isAdrRpplDoc() {
return isAdrRpplDoc;
}
public void setAdrRpplDoc(boolean isAdrRpplDoc) {
this.isAdrRpplDoc = isAdrRpplDoc;
}

View File

@ -17,11 +17,14 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import com.dreamsecurity.magicline.util.Log;
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kcc.com.cmm.service.AdrInnorixFileEnumVO;
import kcc.com.cmm.service.AdrInnorixFileVO;
import kcc.com.cmm.service.EgovFileMngService;
import kcc.com.cmm.service.FileVO;
import kcc.com.cmm.service.InnorixFileService;
import kcc.com.cmm.service.InnorixFileVO;
@ -50,7 +53,7 @@ import kcc.let.utl.fcc.service.EgovStringUtil;
@Service("InnorixFileService")
public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements InnorixFileService {
private static final Logger logger = LoggerFactory.getLogger(InnorixFileServiceImpl.class);
private static final Logger log = LoggerFactory.getLogger(InnorixFileServiceImpl.class);
@Resource(name = "InnorixFileDAO")
private InnorixFileDAO innorixDAO;
@ -59,7 +62,7 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
private FileManageDAO fileManageDAO;
@Value("#{globalSettings['Globals.Innorix.FilePath']}")
private String innoFilePath;
private String INNO_FILE_PATH;
@Resource(name = "ansDAO")
private AnsDAO ansDAO;
@ -74,6 +77,10 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
//답변서 idgen 서비스
@Resource(name = "egovRldMgrManageGnrService")
private EgovIdGnrService egovRldMgrManageGnrService;
// 첨부파일 정보
@Resource(name="EgovFileMngService")
private EgovFileMngService fileMngService;
@Override
public RestResponse insertInnorixFileAjax(AdrInnorixFileVO adrInnorixFileListVO) throws FdlException, Exception {
@ -81,11 +88,17 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
try {
AdrInnorixFileEnumVO innorixEnumVO = AdrInnorixFileEnumVO.valueOf(adrInnorixFileListVO.getJspFileName());
adrInnorixFileListVO = innorixEnumVO.conversion(innorixEnumVO, adrInnorixFileListVO);
// 파일 저장 atchFileId 받아옴
adrInnorixFileListVO.setAtchFileId(this.updateFileData(adrInnorixFileListVO));
if("INSERT".equals(adrInnorixFileListVO.getMode()))
adrInnorixFileListVO.setAtchFileId(this.insertFileData(adrInnorixFileListVO));
if("UPDATE".equals(adrInnorixFileListVO.getMode()))
adrInnorixFileListVO.setAtchFileId(this.updateFileData(adrInnorixFileListVO));
adrInnorixFileListVO.setRpplDocSeq(this.insertAdrRpplDoc(adrInnorixFileListVO));
log.info("adrInnorixFileListVO.isAdrRpplDoc() :: [{}]", adrInnorixFileListVO.isAdrRpplDoc());
if(adrInnorixFileListVO.isAdrRpplDoc())
adrInnorixFileListVO.setRpplDocSeq(this.insertAdrRpplDoc(adrInnorixFileListVO));
// P_code_desc가 없으면 이력을 넣지 않음.
if(StringUtils.isNotEmpty(adrInnorixFileListVO.getP_code_desc()))
@ -108,38 +121,69 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
* @return
* @throws Exception
*/
public String insertFileData(AdrInnorixFileVO innorixVO) throws Exception {
String atchFileId = idgenService.getNextStringId();
List<FileVO> result = this.fileChange(innorixVO, atchFileId, 0);
log.info(" // file data 반복문 끝 ");
// 파일 업로드
fileManageDAO.insertFileInfs(result);
return atchFileId;
}
public String updateFileData(AdrInnorixFileVO innorixVO) throws Exception {
String atchFileId = innorixVO.getAtchFileId();
FileVO fvo = new FileVO();
fvo.setAtchFileId(atchFileId);
int fileSn = fileMngService.getMaxFileSN(fvo);
List<FileVO> result = this.fileChange(innorixVO, atchFileId, fileSn);
// 파일 업로드
fileManageDAO.updateFileInfs(result);
return atchFileId;
}
private List<FileVO> fileChange(AdrInnorixFileVO innorixVO, String atchFileId, int fileSn) {
List<FileVO> result = new ArrayList<FileVO>();
String fileNextId = idgenService.getNextStringId();
int fileSn = 0;
logger.info(" file data 반복문 시작 :: [{}]", innorixVO.getInnorixFileListVO().size());
log.info(" file data 반복문 시작 :: [{}]", innorixVO.getInnorixFileListVO().size());
for(InnorixFileVO innorixFileVO : innorixVO.getInnorixFileListVO())
{
FileVO fileVO = new FileVO();
// new 파일명
String newName = innorixVO.getP_file_nm_prefix() + EgovStringUtil.getTimeStamp();
logger.info("[{}]번쨰 newName :: [{}]", fileSn, newName);
log.info("[{}]번쨰 newName :: [{}]", fileSn, newName);
String oriFullPath = innoFilePath + innorixFileVO.getServerFileName();
String newFullPath = innoFilePath + newName;
String oriFullPath = INNO_FILE_PATH + innorixFileVO.getServerFileName();
String newFullPath = INNO_FILE_PATH + newName;
try {
File orifile = FileUtils.getFile(oriFullPath);
File newfile = FileUtils.getFile(newFullPath);
FileUtils.moveFile(orifile, newfile);
} catch (IOException e) {
logger.info("파일명 수정 실패 :: [{}] ==> [{}]", oriFullPath, newFullPath );
log.info("파일명 수정 실패 :: [{}] ==> [{}]", oriFullPath, newFullPath );
e.printStackTrace();
}
fileVO.setAtchFileId(fileNextId);
fileVO.setAtchFileId(atchFileId);
fileVO.setFileSn(Integer.toString(fileSn));
fileVO.setFileStreCours(innoFilePath);
fileVO.setFileStreCours(INNO_FILE_PATH);
fileVO.setStreFileNm(newName);
fileVO.setOrignlFileNm(innorixFileVO.getServerFileName());
fileVO.setFileExtsn(FilenameUtils.getExtension(oriFullPath));
@ -150,16 +194,10 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
fileSn++;
}
logger.info(" // file data 반복문 끝 ");
// 파일 업로드
fileManageDAO.insertFileInfs(result);
return fileNextId;
log.info(" // file data 반복문 끝 ");
return result;
}
/**
* @methodName : updateAdrRpplDoc
* @author : 이호영
@ -172,7 +210,7 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
*/
private String insertAdrRpplDoc(AdrInnorixFileVO adrInnorixFileListVO) throws Exception {
// RpplDoc Insert
logger.info("RpplDoc Insert ");
log.info("RpplDoc Insert ");
AnsVO ansVO = new AnsVO();
ansVO.setAdrSeq(adrInnorixFileListVO.getAdrSeq());
// adrSn이 비여있으면 과거사건등록문서라 "1" 고정으로 들어감
@ -187,7 +225,7 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
ansVO.setLastUpdusrId(adrInnorixFileListVO.getLastUpdusrId());
ansDAO.ansSubmitAjax_setp1(ansVO);
logger.info(" + ansVO.getRpplDocSeq() :: [{}]", ansVO.getRpplDocSeq());
log.info(" + ansVO.getRpplDocSeq() :: [{}]", ansVO.getRpplDocSeq());
return ansVO.getRpplDocSeq();
}

View File

@ -1,6 +1,7 @@
package kcc.kccadr.adjPgrMgr.apm.service;
import java.util.List;
import java.util.Map;
import kcc.kccadr.accdnt.adr.service.AdjstDeputyReqVO;
import kcc.kccadr.accdnt.arc.service.CorReqVO;
@ -118,6 +119,6 @@ public interface ApmService {
void updtRpplPopPastAjax(RpplVO rpplVO);
RpplVO findByResPonDentDId(RpplVO rpplVO);
Map<String, Object> findByResPonDentDIdAndFileList(RpplVO rpplVO);
}

View File

@ -2,11 +2,16 @@ package kcc.kccadr.adjPgrMgr.apm.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import com.dreamsecurity.magice2e.util.Log;
import kcc.com.cmm.service.impl.FileManageDAO;
import kcc.com.cmm.util.StringUtil;
import kcc.kccadr.accdnt.adr.service.AdjstDeputyReqVO;
import kcc.kccadr.accdnt.arc.service.CorReqVO;
@ -38,7 +43,9 @@ public class ApmServiceImpl implements ApmService {
// 조정사건이력관리 DAO
@Resource(name = "adrHstryMgrDAO")
private AdrHstryMgrDAO adrHstryMgrDAO;
@Resource(name = "FileManageDAO")
private FileManageDAO fileMngDAO;
@Override
public List<ApmCorrectVO> selectApmCorrectionList(ApmCorrectVO apmCorrectVO) throws Exception {
@ -597,23 +604,33 @@ public class ApmServiceImpl implements ApmService {
@Override
public void updtRpplPopPastAjax(RpplVO rpplVO) {
System.out.println("rpplVO.getRpplNm() :: "+ rpplVO.getRpplNm());
RpplVO returnVO = this.rpplDataEncrypt(rpplVO);
apmDAO.updtRpplPopPastAjax(returnVO);
}
@Override
public RpplVO findByResPonDentDId(RpplVO rpplVO) {
public Map<String, Object> findByResPonDentDIdAndFileList(RpplVO rpplVO) {
System.out.println(" ;::::: "+ rpplVO.getRpplRespddSeq());
try {
return this.rpplDataDecrypt(apmDAO.findByResPonDentDId(rpplVO));
Map<String, Object> map = new HashMap<String, Object>();
RpplVO rpplInfoVO = this.rpplDataDecrypt(apmDAO.findByResPonDentDId(rpplVO));
if(StringUtils.isNotBlank(rpplInfoVO.getAtchFileId())){
kcc.com.cmm.service.FileVO fileVO = new kcc.com.cmm.service.FileVO();
fileVO.setAtchFileId(rpplInfoVO.getAtchFileId());
List<kcc.com.cmm.service.FileVO> fileList = fileMngDAO.selectFileInfs(fileVO);
map.put("fileList", fileList);
}
map.put("rpplInfoVO", rpplInfoVO);
return map;
} catch (Exception e) {
e.printStackTrace();
}
// RpplVO resultVO = apmDAO.findByResPonDentDId(rpplVO);
return null;
}

View File

@ -3,8 +3,10 @@ package kcc.kccadr.adjPgrMgr.apm.web;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
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.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@ -722,9 +725,13 @@ public class ApmController {
@RequestMapping(value = "popup/updtRpplPop.do")
public String updtRpplPop(@ModelAttribute("info") RpplVO rpplVO, ModelMap model) throws Exception {
RpplVO resultVO = apmService.findByResPonDentDId(rpplVO);
model.addAttribute("resultVO", resultVO);
Map<String, Object> resultMap = apmService.findByResPonDentDIdAndFileList(rpplVO);
model.addAttribute("resultVO", resultMap.get("rpplInfoVO"));
model.addAttribute("fileList", resultMap.get("fileList"));
return "/kccadr/adjPgrMgr/apm/popup/updtRpplPop";
}
@ -1319,7 +1326,7 @@ public class ApmController {
//String atchFileId = this.fileValCheckNdbInsert(multiRequest, modelAndView, checkFileUtil.getS_exts(), i_limit_size, i_file_limit); //EXT, MB size and ea
String atchFileId = checkFileUtil.fileValCheckNdbInsert(multiRequest, modelAndView, "CHGDATE_", checkFileUtil.getS_exts(), i_limit_size, i_file_limit); //EXT, MB size and ea
log.debug(">>>>>>>>>>>>>>>>>>>>>>>atchFileId:"+atchFileId);
log.debug(">>>>>>>>>>>>>>>>>>>>>>>atchFileId: [{}]"+atchFileId);
if ("ERROR".equals(atchFileId)) return modelAndView;
@ -1406,11 +1413,15 @@ public class ApmController {
modelAndView.addObject("message", "로그인 해주세요.");
return modelAndView;
}
rpplVO.setLastUpdusrId(userId);
try {
apmService.updtRpplPopPastAjax(rpplVO);
/*파일등록 */
//String atchFileId = ""; // 조정신청 첨부파일 아이디
//String FratchFileId = ""; //대리인 첨부파일 아이디
rpplVO.setLastUpdusrId(userId);
try {
log.info(" === apmService.updtRpplPopPastAjax() === ");
apmService.updtRpplPopPastAjax(rpplVO);
} catch (Exception e) {
e.printStackTrace();

View File

@ -597,12 +597,13 @@
, RPPL_GRADE = #rpplGrade#
, RPPL_EMAIL_YN = #rpplEmailYn#
, RPPL_SMS_YN = #rpplSmsYn#
<isNotEmpty property="atchFileId">
, ATCH_FILE_ID = #atchFileId#
</isNotEmpty>
, LAST_UPDT_PNTTM = SYS_DATETIME
, LAST_UPDUSR_ID = #lastUpdusrId#
, RPPL_RELATION = #rpplRelation#
, RPPL_RELATION_ETC = #rpplRelationEtc#
, RPPL_CONN_NO = #rpplConnNo#
WHERE ADR_SEQ = #adrSeq#
AND RPPL_SEQ = #rpplSeq#
</update>

View File

@ -25,12 +25,14 @@
%>
<html lang="ko">
<head>
<title>대리인등록</title>
<title>대리인수정</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="<c:url value='/js/EgovMultiFileItn.js'/>"></script> <!-- 파일첨부, 썸네일이미지 있으면 미리보기 -->
<!-- <script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script> -->
<script src="/kccadrPb/adm/script/postcode.js"></script>
<script src="<c:url value='/js/kccadr/kccadrCom.js' />"></script>
<script src="<c:url value='/innorix/innorix.js' />"></script>
<link rel="stylesheet" href="<c:url value='/innorix/innorix.css'/>" type="text/css">
<%-- 원자력 --%>
<script type="text/javascript">
@ -58,14 +60,11 @@
var f = document.getElementById("p");
var data = new FormData(f);
_fileForm2.forEach(function(obj, idx) {
if (obj) data.append("file"+idx, obj.fileObj);
});
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url : "/kccadr/adjPgrMgr/apm/addRpplPopAjax.do",
url : "/kccadr/adjPgrMgr/apm/updtRpplPopPastAjax.do",
data: data,
dataType:'json',
async: false,
@ -74,16 +73,16 @@
cache: false,
success : function(returnData, status) {
if (returnData.result == 'success') {
alert("대리인 등록이 완료되었습니다.");
alert("대리인 수정 되었습니다.");
window.opener.location.reload();
window.close();
window.close();
} else {
alert(returnData.message);
}
},
error : function(e) {
alert("대리인등록을 실패하였습니다.");
alert("대리인수정을 실패하였습니다.");
console.log("ERROR : ", e);
}
});
@ -108,20 +107,192 @@
function phoneSelect (){
}
var innoJquery = innorix._load("innoJquery");
var urlBase = location.href.substring(0, location.href.lastIndexOf("/") + 1);
var control = new Object(); // 파일전송 컨트롤 객체선언
var downFileArr = new Array(); // 다운로드 목록 정보
var resetFileArr = new Array(); // 다운로드 목록 초기화 정보
var delFileArr = new Array(); // 삭제된 파일 정보
var removeFlag = true; // 삭제 이벤트 조건 플래그
// 키값에 해당하는 인덱스 삭제
function deleteArr(array, key, value) {
for (var i = 0; i < array.length; i++) {
if (array[i][key] == value) {
array.splice(i, 1);
}
}
}
window.onload = function() {
// 파일전송 컨트롤 생성
control = innorix.create({
el: '#fileControl', // 컨트롤 출력 HTML 객체 ID
transferMode: 'both', // 업로드, 다운로드 혼합사용
installUrl: '/innorix/install/install.html', // Agent 설치 페이지
uploadUrl: '/innorix/exam/upload.jsp' // 업로드 URL
});
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
fn_insertFile(p.files); // 파일 정보 DB isnert function
});
// 파일전송 컨트롤 로딩 완료
control.on('loadComplete', function (p) {
// 다운로드 목록
//
<c:forEach items="${fileList}" var="file">
var fileObj = new Object();
fileObj.printFileName = "${file.orignlFileNm}";
fileObj.fileSize = "${file.fileSize}";
// fileObj.downloadUrl = "/innorix/exam/download.jsp?fileName=" + "${file.streFileNm}&innoDirPath="+$('#innoDirPath').val();
fileObj.downloadUrl = "/innorix/exam/download.jsp?fileName=" + "${file.streFileNm}";
fileObj.fileSn = "${file.fileSn}";
downFileArr.push(fileObj);
</c:forEach>
// downFileArr =
// [{
// printFileName: "INNORIX WP 브로셔.pdf",
// fileSize: 1433885,
// downloadUrl: urlBase + "download.jsp?fileID=1"
// },
// {
// printFileName: "INNORIX WP Brochure.pdf",
// fileSize: 1433885,
// downloadUrl: urlBase + "download.jsp?fileID=2"
// },
// {
// printFileName: "INNORIX WP パンフレット.pdf",
// fileSize: 1433885,
// downloadUrl: urlBase + "download.jsp?fileID=3"
// }];
resetFileArr = downFileArr; // 다운로드 정보 초기화 정보 생성
resetFileArr = resetFileArr.slice(0); // 배열 깊은 복사
control.presetDownloadFiles(resetFileArr); // 다운로드 파일 추가
});
// 파일 삭제 이벤트
control.on('removeFiles', function (p) {
if (removeFlag == true) {
// 삭제된 파일정보 배열에 담기
for (var i = 0; i < p.length; i++ ) {
var fileObj = new Object();
if (p[i].transferType == "download")
{
fileObj.downloadUrl = p[i].downloadUrl;
fileObj.printFileName = p[i].printFileName;
fileObj.fileSize = p[i].fileSize;
fileObj.fileSn = p[i].fileSn;
delFileArr.push(fileObj);
delAtchFile( $('#atchFileId').val(), p[i].fileSn);
deleteArr(downFileArr, "printFileName", p[i].printFileName);
console.log('delFileArr :: ', delFileArr);
console.log('deleteArr :: ', deleteArr);
}
}
}
removeFlag = true;
});
};
function save() {
if(confirm("대리인 정보를 수정 하시겠습니까?")){
if (control.getUploadFiles().length > 0) {
control.upload();
} else if (delFileArr.length > 0) {
submit(null, delFileArr, '/innorix/exam/result.jsp');
} else {
fncReg();
}
}
}
// 업로드, 삭제된 파일정보 submit
function submit(uploadFileArr, delFileArr, url) {
innoJquery.post(url, { uploadFiles: uploadFileArr, deleteFiles: delFileArr})
.done(function(data) {
delFileArr = new Array(); // 삭제정보 초기화
alert(data);
});
}
/*
* 파일 정보 DB insert Ajax
* */
function fn_insertFile(data){
var filePath = location.pathname;
var jspFileName = filePath.substring(filePath.lastIndexOf("/")+1, filePath.lastIndexOf("."));
var resultData = {
"adrSeq": $('#adrSeq').val()
, "atchFileId": $('#atchFileId').val()
, "jspFileName": jspFileName
, "innorixFileListVO": data
}
console.log('resultData :: ', resultData);
$.ajax({
type: "POST",
url: "<c:url value='/kccadr/common/insertInnorixFileAjax.do' />",
data: JSON.stringify(resultData),
dataType:'json',
async: false,
processData: false,
contentType: "application/json",
cache: false,
success: function (returnData) {
if(returnData.status == "OK"){
fncReg();
}else{
alert(returnData.data);
return false;
}
},
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
});
}
</script>
</head>
<body>
<form:form id="p" name="p" method="post" onsubmit="return false;" enctype="multipart/form-data">
<input type="hidden" id="adrSeq" name="adrSeq" value="<c:out value="${info.adrSeq}" />" />
<input type="hidden" id="rpplTy" name="rpplTy" value="<c:out value="${info.rpplTy}" />" />
<input type="hidden" id="rpplSeq" name="rpplSeq" value="<c:out value="${info.rpplSeq}" />" />
<input type="hidden" id="rpplSeq" name="rpplSeq" value="<c:out value="${resultVO.rpplSeq}" />" />
<input type="hidden" id="atchFileId" name="atchFileId" value="<c:out value="${resultVO.atchFileId}" />" />
<input type="hidden" id="innoDirPath" value="<spring:eval expression="@globalSettings['Globals.Innorix.FilePath']"/>" />
<input type="hidden" name="limitcount" value="10" />
<div class="area_popup supm_popup" style="width: 750px;">
<div class="cont_popup">
<!-- 대리인 등록 -->
<p class="tb_tit">대리인 등록</p>
<!-- 대리인 수정 -->
<p class="tb_tit">대리인 수정</p>
<table class="pop_tbType01">
<colgroup>
<col style="width: 20%;">
@ -248,40 +419,15 @@
<tr>
<th class="req_text">대리신청서</th>
<td class="upload_area">
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> -->
<!-- <button type="button" class="btnType01 btn_add_file">파일 첨부하기</button> -->
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display: none" />
<button type="button" id="filebutton" class="btnType01 btn_add_file">파일 첨부하기</button>
<div class="file_wrap file_upload_box no_img_box">
<table class="tbType02">
<colgroup>
<col style="width: 60%;">
<col style="width: auto;">
<col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th>파일 명</th>
<th>종류</th>
<th>크기</th>
<th>삭제</th>
</thead>
<tbody class="tb_file_before">
<tr>
<td colspan="4">
<p>
첨부하실 파일을
<span>마우스로 끌어서</span>
넣어주세요.
</p>
</td>
</tr>
</tbody>
</table>
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display: none" />
<button type="button" onclick="control.openFileDialog();" class="btnType01 btn_add_file">파일찾기</button>
<!-- <button type="button" id="filebutton" class="btnType01 btn_add_file">파일찾기</button> -->
<p style="font-size: 16px; float: right; margin-top: 16px; color: #666;">* 첨부파일을 등록해 주세요. (최대3개)</p>
<!-- <div class="file_wrap file_upload_box no_img_box"> -->
<!-- -->
<div id="fileControl"></div><br/>
</div>
<%--
<div class="file_wrap fileAfter file_list_div">
<table class="tbType02">
<colgroup>
@ -327,13 +473,15 @@
</tbody>
</table>
</div>
--%>
</td>
</tr>
</tbody>
</table>
<!-- //대리인 등록 -->
<div class="btn_wrap btn_layout04">
<button type="button" class="btnType06" onclick="fncReg()">수정</button>
<!-- <button type="button" class="btnType06" onclick="fncReg()">수정</button> -->
<button type="button" class="btnType06" onclick="save()">수정</button>
<button type="button" class="btnType03" onclick="self.close()">취소</button>
</div>
</div>

View File

@ -0,0 +1,341 @@
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%>
<%@ taglib prefix="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%>
<%
/**
* @Class Name : srcAdmNoPop.jsp
* @Description : 조정접수
* @Modification Information
* @
* @ 수정일 수정자 수정내용
* @ ------- -------- ---------------------------
* @ 2021.08.16 김봉호 최초 생성
* @author 김봉호
* @since 2021.08.16
* @version 1.0
* @see
*
*/
%>
<html lang="ko">
<head>
<title>대리인수정</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="<c:url value='/js/EgovMultiFileItn.js'/>"></script> <!-- 파일첨부, 썸네일이미지 있으면 미리보기 -->
<!-- <script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script> -->
<script src="/kccadrPb/adm/script/postcode.js"></script>
<script src="<c:url value='/js/kccadr/kccadrCom.js' />"></script>
<%-- 원자력 --%>
<script type="text/javascript">
$(document).ready(function() {
$(function() {
$('#filebutton').click(function(e) {
e.preventDefault();
$('#file_temp').click();
});
});
});
function setAdrNoTxt() {
$('#adrNoTxt').text($('#adrNo').val());
}
function fncReg() {
if (validation()) {
var f = document.getElementById("p");
var data = new FormData(f);
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url : "/kccadr/adjPgrMgr/apm/updtRpplPopPastAjax.do",
data: data,
dataType:'json',
async: false,
processData: false,
contentType: false,
cache: false,
success : function(returnData, status) {
if (returnData.result == 'success') {
alert("대리인 수정 되었습니다.");
window.opener.location.reload();
window.close();
} else {
alert(returnData.message);
}
},
error : function(e) {
alert("대리인수정을 실패하였습니다.");
console.log("ERROR : ", e);
}
});
}
}
function validation() {
$('#rpplEmail').val( $('#rpplEmail01').val()+'@'+$('#rpplEmail02').val() );
$('#rpplPhone').val( $('#rpplPhone01').val()+'-'+$('#rpplPhone02').val()+'-'+$('#rpplPhone03').val() );
return true;
}
function fncRelationCheck() {
}
function phoneSelect (){
}
</script>
</head>
<body>
<form:form id="p" name="p" method="post" onsubmit="return false;" enctype="multipart/form-data">
<input type="hidden" id="adrSeq" name="adrSeq" value="<c:out value="${info.adrSeq}" />" />
<input type="hidden" id="rpplTy" name="rpplTy" value="<c:out value="${info.rpplTy}" />" />
<input type="hidden" id="rpplSeq" name="rpplSeq" value="<c:out value="${resultVO.rpplSeq}" />" />
<input type="hidden" id="atchFileId" name="atchFileId" value="<c:out value="${resultVO.atchFileId}" />" />
<input type="hidden" name="limitcount" value="10" />
<div class="area_popup supm_popup" style="width: 750px;">
<div class="cont_popup">
<!-- 대리인 수정 -->
<p class="tb_tit">대리인 수정</p>
<table class="pop_tbType01">
<colgroup>
<col style="width: 20%;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>대리인 이름</th>
<td>
<input type="text" id="rpplNm" name="rpplNm" value="<c:out value='${resultVO.rpplNm }' />" />
</td>
</tr>
<tr>
<th>본인과의 관계</th>
<td>
<div class="radio_wrap">
<span>
<input type="radio" id="1btn" name="rpplRelation" value="01" ${resultVO.rpplRelation == 01 ? 'checked' : '' } />
<label for="1btn">법률대리인</label>
</span>
<span>
<input type="radio" id="2btn" name="rpplRelation" value="02" ${resultVO.rpplRelation == 02 ? 'checked' : '' } />
<label for="2btn">신청인의 직원</label>
</span>
<span>
<input type="radio" id="3btn" name="rpplRelation" value="03" ${resultVO.rpplRelation == 03 ? 'checked' : '' } />
<label for="3btn">신청인의 가족</label>
</span>
<span>
<input type="radio" id="4btn" name="rpplRelation" value="04" ${resultVO.rpplRelation == 04 ? 'checked' : '' } />
<label for="4btn">기타</label>
<input type="text" size="10" name="rpplRelationEtc" id="rpplRelationEtc" value="<c:out value='${resultVO.rpplRelationEtc }' />">
</span>
</div>
</td>
</tr>
<tr>
<th>직책</th>
<td>
<input type="text" id="rpplGrade" name="rpplGrade" value="<c:out value='${resultVO.rpplGrade }' />">
</td>
</tr>
<tr>
<th>대리인 주소</th>
<td>
<input type="text" class="adr_input" name="rpplPost" id="rpplPost" value="<c:out value='${resultVO.rpplPost }' />">
<button type="button" class="btnType01" onclick="fn_postCode(this);">우편번호검색</button>
<div class="detail_adr">
<input type="text" class="adr_detail_input searchResultAddr" name="rpplAddr" id="rpplAddr" value="<c:out value='${resultVO.rpplAddr }' />" >
<input type="text" class="etc_detail_input dir_input" name="rpplAddrDtl" id="rpplAddrDtl" value="<c:out value='${resultVO.rpplAddrDtl }' />" >
</div>
</td>
</tr>
<tr>
<th>이메일</th>
<td>
<input type="hidden" id="rpplEmail" name="rpplEmail">
<c:set var="emailResult" value="${fn:split(resultVO.rpplEmail,'@')}" />
<input type="text" id="rpplEmail01" class="email_input" value="<c:out value="${emailResult[0] }" />">
@
<input type="text" id="rpplEmail02" class="email_input"value="<c:out value="${emailResult[1] }" />">
<!-- <select id="rpplEmail03" onchange="emailSelect(this);" class="email_select">
<option value="">직접입력</option>
<option value="naver.com">naver.com</option>
<option value="hanmail.net">hanmail.net</option>
<option value="nate.com">nate.com</option>
<option value="gmail.com">gmail.com</option>
<option value="hotmail.com">hotmail.com</option>
<option value="empal.com">empal.com</option>
<option value="chol.com">chol.com</option>
<option value="dreamwiz.com">dreamwiz.com</option>
<option value="freechal.com">freechal.com</option>
<option value="hanafos.com">hanafos.com</option>
<option value="paran.com">paran.com</option>
<option value="yahoo.co.kr">yahoo.co.kr</option>
<option value="korea.com">korea.com</option>
</select> -->
<kc:select codeId="ADR030" defaultText="직접입력" id="rpplEmail03" defaultValue="" onChange="emailSelect(this)" styleClass="email_select" />
</td>
</tr>
<tr>
<th>연락처</th>
<td>
<input type="text" class="phone_input" id="rpplPhone01" maxlength="3" value="${fn:substring(resultVO.rpplPhone,0,3) }">
-
<input type="text" class="phone_input" id="rpplPhone02" maxlength="4" value="${fn:substring(resultVO.rpplPhone,4,8) }">
-
<input type="text" class="phone_input" id="rpplPhone03" maxlength="4" value="${fn:substring(resultVO.rpplPhone,9,13) }">
<input type="hidden" id="rpplPhone" name="rpplPhone">
</td>
</tr>
<tr>
<th>이메일 수신여부</th>
<td>
<div class="radio_wrap">
<span>
<input type="radio" id="rpplEmailYnY" name="rpplEmailYn" value="Y" checked="checked">
<label for="rpplEmailYnY">수신</label>
</span>
<span>
<input type="radio" id="rpplEmailYnN" name="rpplEmailYn" value="N">
<label for="rpplEmailYnN">수신하지 않음</label>
</span>
</div>
</td>
</tr>
<tr>
<th>SMS 수신여부</th>
<td>
<div class="radio_wrap">
<span>
<input type="radio" id="rpplSmsYnY" name="rpplSmsYn" value="Y" ${resultVO.rpplSmsYn == 'Y' ? 'checked' : '' } />
<label for="rpplEmailYnY">수신</label>
</span>
<span>
<input type="radio" id="rpplSmsYnN" name="rpplSmsYn" value="N" ${resultVO.rpplSmsYn == 'N' ? 'checked' : '' } />
<label for="rpplEmailYnN">수신하지 않음</label>
</span>
</div>
</td>
</tr>
<tr>
<th class="req_text">대리신청서</th>
<td class="upload_area">
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> -->
<!-- <button type="button" class="btnType01 btn_add_file">파일 첨부하기</button> -->
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display: none" />
<button type="button" id="filebutton" class="btnType01 btn_add_file">파일 첨부하기</button>
<div class="file_wrap file_upload_box no_img_box">
<table class="tbType02">
<colgroup>
<col style="width: 60%;">
<col style="width: auto;">
<col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th>파일 명</th>
<th>종류</th>
<th>크기</th>
<th>삭제</th>
</thead>
<tbody class="tb_file_before">
<tr>
<td colspan="4">
<p>
첨부하실 파일을
<span>마우스로 끌어서</span>
넣어주세요.
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="file_wrap fileAfter file_list_div">
<table class="tbType02">
<colgroup>
<col style="width: 60%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 10%">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th>파일 명</th>
<th>종류</th>
<th>크기</th>
<th>삭제</th>
</thead>
<tbody id="tbody_fiielist" class="tb_file_after">
<c:forEach var="fileList" items="${fileList}" varStatus="status">
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
<td class="td_filename">
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
</td>
<td class="td_filesort">
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>">
<c:out value="${fileList.fileExtsn}" />
</span>
</td>
<td class="td_filesize">
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>">
<c:out value="${fileList.fileMg}" />
</span>
</td>
<td>
<button type="button" class="btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;">
<i></i>
</button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<!-- //대리인 등록 -->
<div class="btn_wrap btn_layout04">
<button type="button" class="btnType06" onclick="fncReg()">수정</button>
<button type="button" class="btnType03" onclick="self.close()">취소</button>
</div>
</div>
</div>
</form:form>
</body>
</html>

View File

@ -14,6 +14,8 @@ String filePath = saveDir.substring(0, saveDir.lastIndexOf("/") + 1);
유닉스 - /storage/path1/path2/data
*/
// filePath = request.getParameter("innoDirPath");
filePath = "D:/usr/local/tomcat/file/sht/";
// downloadType : "stream" 설정시 자동 전달되는 GET Param 값
String szStartOffset = request.getParameter("_StartOffset");
String szEndOffset = request.getParameter("_EndOffset");
@ -42,8 +44,10 @@ if (fileID != null) {
}
if (fileName != null) {
sysFileName = "data/" + fileName;
orgFileName = "data/" + fileName;
sysFileName = "" + fileName;
sysFileName = "" + fileName;
// orgFileName = "data/" + fileName;
// orgFileName = "data/" + fileName;
}
// 파일명 깨짐대응 문자열 인코딩 처리

File diff suppressed because one or more lines are too long