feat:[대용량솔루션] 조정진행목록 > 조정진행상세 > 사건문서 > 문서등록 적용완료

This commit is contained in:
hylee 2022-11-07 18:25:54 +09:00
parent b5e81cb524
commit 1604e8a2dd
11 changed files with 921 additions and 145 deletions

View File

@ -0,0 +1,47 @@
package kcc.com.cmm.service;
public enum AdrInnorixFileEnumVO {
/** 과거사건문서 > 문서관리 */ adjReqMgrPastFileRegist("PST_", "", "", "")
/** 조정진행목록 > 사건문서 > 문서등록 */ , docRegPop("CHGDATE_", "정진행관리>>조정진행목록>조정진행상세>사건문서>P>문서등록", "A160", "")
;
private final String p_file_nm_prefix;
private final String p_code_desc;
private final String p_stat_cd;
private final String p_adrHstryMgrSeq;
AdrInnorixFileEnumVO(String p_file_nm_prefix, String p_code_desc, String p_stat_cd, String p_adrHstryMgrSeq) {
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;
}
public String getP_file_nm_prefix() {
return p_file_nm_prefix;
}
public String getP_code_desc() {
return p_code_desc;
}
public String getP_stat_cd() {
return p_stat_cd;
}
public String getP_adrHstryMgrSeq() {
return p_adrHstryMgrSeq;
}
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());
return adrInnorixFileListVO;
}
}

View File

@ -30,9 +30,25 @@ public class AdrInnorixFileVO extends ComDefaultVO implements Serializable {
public String adrSeq = "";
public String adrSn = "";
public String adrDocTy = "";
public String p_file_nm_prefix = ""; // 파일 저장명 prefix
public String p_code_desc = ""; // dest
public String p_stat_cd = ""; // 상태 코드
public String p_adrHstryMgrSeq = "";
public String rpplDocSeq = "";
public String rpplSeq = "";
public String adrDocCn1 = "";
public String openYn = "";
public String atchFileId = "";
/*
* jsp file name
* AdrInnorixFileEnumVO 구분값
* */
public String jspFileName = "";
private String frstRegistPnttm; //등록일시
private String frstRegisterId; //등록자
private String lastUpdtPnttm; //수정일시
@ -40,50 +56,149 @@ public class AdrInnorixFileVO extends ComDefaultVO implements Serializable {
public List<InnorixFileVO> innorixFileListVO = new ArrayList<InnorixFileVO>();
public String getAdrSeq() {
return adrSeq;
}
public void setAdrSeq(String adrSeq) {
this.adrSeq = adrSeq;
}
public String getAdrSn() {
return adrSn;
}
public void setAdrSn(String adrSn) {
this.adrSn = adrSn;
}
public String getAdrDocTy() {
return adrDocTy;
}
public void setAdrDocTy(String adrDocTy) {
this.adrDocTy = adrDocTy;
}
public String getP_file_nm_prefix() {
return p_file_nm_prefix;
}
public void setP_file_nm_prefix(String p_file_nm_prefix) {
this.p_file_nm_prefix = p_file_nm_prefix;
}
public String getP_code_desc() {
return p_code_desc;
}
public void setP_code_desc(String p_code_desc) {
this.p_code_desc = p_code_desc;
}
public String getP_stat_cd() {
return p_stat_cd;
}
public void setP_stat_cd(String p_stat_cd) {
this.p_stat_cd = p_stat_cd;
}
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;
}
public List<InnorixFileVO> getInnorixFileListVO() {
return innorixFileListVO;
}
public void setInnorixFileListVO(List<InnorixFileVO> innorixFileListVO) {
this.innorixFileListVO = innorixFileListVO;
}
public String getJspFileName() {
return jspFileName;
}
public void setJspFileName(String jspFileName) {
this.jspFileName = jspFileName;
}
public String getRpplSeq() {
return rpplSeq;
}
public void setRpplSeq(String rpplSeq) {
this.rpplSeq = rpplSeq;
}
public String getAdrDocCn1() {
return adrDocCn1;
}
public void setAdrDocCn1(String adrDocCn1) {
this.adrDocCn1 = adrDocCn1;
}
public String getOpenYn() {
return openYn;
}
public void setOpenYn(String openYn) {
this.openYn = openYn;
}
public String getAtchFileId() {
return atchFileId;
}
public void setAtchFileId(String atchFileId) {
this.atchFileId = atchFileId;
}
public String getP_adrHstryMgrSeq() {
return p_adrHstryMgrSeq;
}
public void setP_adrHstryMgrSeq(String p_adrHstryMgrSeq) {
this.p_adrHstryMgrSeq = p_adrHstryMgrSeq;
}
public String getRpplDocSeq() {
return rpplDocSeq;
}
public void setRpplDocSeq(String rpplDocSeq) {
this.rpplDocSeq = rpplDocSeq;
}

View File

@ -10,6 +10,7 @@ import javax.annotation.Resource;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
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.FileVO;
import kcc.com.cmm.service.InnorixFileService;
@ -26,6 +28,7 @@ import kcc.com.cmm.service.InnorixFileVO;
import kcc.com.cmm.web.InnorixFileController;
import kcc.kccadr.accdnt.ans.service.AnsVO;
import kcc.kccadr.accdnt.ans.service.impl.AnsDAO;
import kcc.kccadr.advc.service.impl.AdrHstryMgrDAO;
import kcc.kccadr.cmm.RestResponse;
import kcc.let.utl.fcc.service.EgovStringUtil;
@ -55,21 +58,56 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
@Resource(name = "FileManageDAO")
private FileManageDAO fileManageDAO;
@Value("#{globalSettings['Globals.Innorix.FilePath']}")
private String innoFilePath;
@Value("#{globalSettings['Globals.Innorix.FilePath']}")
private String innoFilePath;
@Resource(name = "ansDAO")
private AnsDAO ansDAO;
@Resource(name = "ansDAO")
private AnsDAO ansDAO;
// 조정사건이력관리 DAO
@Resource(name = "adrHstryMgrDAO")
private AdrHstryMgrDAO adrHstryMgrDAO;
@Resource(name = "egovFileIdGnrService")
private EgovIdGnrService idgenService;
//답변서 idgen 서비스
@Resource(name = "egovRldMgrManageGnrService")
private EgovIdGnrService egovRldMgrManageGnrService;
private EgovIdGnrService egovRldMgrManageGnrService;
@Override
public RestResponse insertInnorixFileAjax(AdrInnorixFileVO adrInnorixFileListVO) throws FdlException, Exception {
try {
AdrInnorixFileEnumVO innorixEnumVO = AdrInnorixFileEnumVO.valueOf(adrInnorixFileListVO.getJspFileName());
adrInnorixFileListVO = innorixEnumVO.conversion(innorixEnumVO, adrInnorixFileListVO);
// 파일 저장 atchFileId 받아옴
adrInnorixFileListVO.setAtchFileId(this.updateFileData(adrInnorixFileListVO));
adrInnorixFileListVO.setRpplDocSeq(this.insertAdrRpplDoc(adrInnorixFileListVO));
if(StringUtils.isNotEmpty(adrInnorixFileListVO.getP_code_desc()))
this.ansSubmitAjax(adrInnorixFileListVO);
} catch (Exception e) {
e.printStackTrace();
return new RestResponse(HttpStatus.BAD_REQUEST, "등록에 실패하였습니다.", LocalDateTime.now());
}
return new RestResponse(HttpStatus.OK, "등록 되었습니다.", LocalDateTime.now());
}
/**
* @methodName : fileDataUpload
* @author : 이호영
* @date : 2022.11.04
* @description : 파일정보 업로드
* @param innorixVO
* @return
* @throws Exception
*/
public String updateFileData(AdrInnorixFileVO innorixVO) throws Exception {
List<FileVO> result = new ArrayList<FileVO>();
@ -77,26 +115,24 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
int fileSn = 0;
logger.info(" file data 반복문 시작 :: [{}]", adrInnorixFileListVO.getInnorixFileListVO().size());
for(InnorixFileVO innorixFileVO : adrInnorixFileListVO.getInnorixFileListVO())
logger.info(" file data 반복문 시작 :: [{}]", innorixVO.getInnorixFileListVO().size());
for(InnorixFileVO innorixFileVO : innorixVO.getInnorixFileListVO())
{
FileVO fileVO = new FileVO();
// new 파일명
String newName = "PST_" + EgovStringUtil.getTimeStamp();
String newName = innorixVO.getP_file_nm_prefix() + EgovStringUtil.getTimeStamp();
logger.info("[{}]번쨰 newName :: [{}]", fileSn, newName);
String oriFullPath = innoFilePath + innorixFileVO.getServerFileName();
String newFullPath = innoFilePath + newName;
logger.info("oriFullPath :: [{}]", oriFullPath);
logger.info("newFullPath :: [{}]", newFullPath);
try {
File orifile = FileUtils.getFile(oriFullPath);
File newfile = FileUtils.getFile(newFullPath);
FileUtils.moveFile(orifile, newfile);
} catch (IOException e) {
logger.info("파일명 수정 실패 :: [{}] ==> [{}]", oriFullPath, newFullPath );
e.printStackTrace();
}
@ -106,7 +142,7 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
fileVO.setStreFileNm(newName);
fileVO.setOrignlFileNm(innorixFileVO.getServerFileName());
fileVO.setFileExtsn(FilenameUtils.getExtension(oriFullPath));
fileVO.setFileSize(Integer.toString(innorixFileVO.getFileSize()));
fileVO.setFileMg(Integer.toString(innorixFileVO.getFileSize()));
result.add(fileVO);
@ -118,19 +154,105 @@ public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements I
// 파일 업로드
fileManageDAO.insertFileInfs(result);
// RpplDoc
return fileNextId;
}
/**
* @methodName : updateAdrRpplDoc
* @author : 이호영
* @date : 2022.11.04
* @description : ADR_RPPL_DOC 테이블에 데이터 업로드
* @param adrInnorixFileListVO
* @param fileNextId
* @return
* @throws Exception
*/
private String insertAdrRpplDoc(AdrInnorixFileVO adrInnorixFileListVO) throws Exception {
// RpplDoc Insert
logger.info("RpplDoc Insert ");
AnsVO ansVO = new AnsVO();
ansVO.setAdrSeq(adrInnorixFileListVO.getAdrSeq());
ansVO.setAdrSn("1");
// adrSn이 비여있으면 과거사건등록문서라 "1" 고정으로 들어감
ansVO.setAdrSn(StringUtils.isEmpty(adrInnorixFileListVO.getAdrSn()) ? "1" : adrInnorixFileListVO.getAdrSn());
ansVO.setRpplDocSeq(egovRldMgrManageGnrService.getNextStringId());
ansVO.setAdrDocTy(adrInnorixFileListVO.getAdrDocTy());
ansVO.setAtchFileId(fileNextId);
ansVO.setAtchFileId(adrInnorixFileListVO.atchFileId);
ansVO.setRpplSeq(adrInnorixFileListVO.getRpplSeq());
ansVO.setFrstRegistPnttm(adrInnorixFileListVO.getFrstRegistPnttm());
ansVO.setFrstRegisterId(adrInnorixFileListVO.getFrstRegisterId());
ansVO.setLastUpdtPnttm(adrInnorixFileListVO.getFrstRegistPnttm());
ansVO.setLastUpdusrId(adrInnorixFileListVO.getLastUpdusrId());
ansDAO.ansSubmitAjax_setp1(ansVO);
return new RestResponse(HttpStatus.OK, "등록 되었습니다.", LocalDateTime.now());
logger.info(" + ansVO.getRpplDocSeq() :: [{}]", ansVO.getRpplDocSeq());
return ansVO.getRpplDocSeq();
}
private void ansSubmitAjax(AdrInnorixFileVO adrInnorixFileListVO) throws Exception {
AnsVO ansVO = new AnsVO();
// ansDAO.ansSubmitAjax_setp2() 위한 VO 생성
// 기존 메소드를 타기위해 생성
ansVO.setAdrSeq(adrInnorixFileListVO.getAdrSeq());
ansVO.setAdrSn(adrInnorixFileListVO.getAdrSn());
ansVO.setAdrDocTy(adrInnorixFileListVO.getAdrDocTy());
ansVO.setRpplSeq(adrInnorixFileListVO.getRpplSeq());
ansVO.setAdrDocCn1(adrInnorixFileListVO.getAdrDocCn1());
ansVO.setOpenYn(adrInnorixFileListVO.getOpenYn());
ansVO.setAtchFileId(adrInnorixFileListVO.getAtchFileId());
ansVO.setFrstRegisterId(adrInnorixFileListVO.getFrstRegisterId());
ansVO.setLastUpdusrId(adrInnorixFileListVO.getLastUpdusrId());
// ansDAO.ansSubmitAjax_setp2() 위한 VO 생성
ansVO.setRpplDocSeq(adrInnorixFileListVO.getRpplDocSeq());
adrHstryMgrDAO.insert4Func(adrInnorixFileListVO.getAdrSeq()
//, "상태코드수정"
, adrInnorixFileListVO.getP_code_desc() //, "조정진행관리>>조정진행목록>조정진행상세>사건문서>P>문서등록" //String p_code_desc - CC199
//, adjReqMgrVO.getStatCd()
, adrInnorixFileListVO.getP_stat_cd() // , "A160" //String p_stat_cd
, adrInnorixFileListVO.getFrstRegisterId()
, adrInnorixFileListVO.getLastUpdusrId()
, adrInnorixFileListVO.getP_adrHstryMgrSeq() //, String p_adrHstryMgrSeq , ""
, "I" //, String p_useCd I/U/UI/II/RE
, "ADR_RPPL_DOC" //, String p_tableName
, " WHERE 1=1 AND adr_seq='"+adrInnorixFileListVO.getAdrSeq()
+"' AND adr_sn='"+adrInnorixFileListVO.getAdrSn()
+"' AND rppl_doc_seq='"+adrInnorixFileListVO.getRpplDocSeq()
+"' " //, String p_updateQuery
);
ansDAO.ansSubmitAjax_setp2(ansVO); //ADR_RPPL_DOC_OPEN // 공계여부
//adr_hstry_mgr에 넣기 - 시작
adrHstryMgrDAO.insert4Func(adrInnorixFileListVO.getAdrSeq()
//, "상태코드수정"
, adrInnorixFileListVO.getP_code_desc()
//, adjReqMgrVO.getStatCd()
, adrInnorixFileListVO.getP_stat_cd()
, adrInnorixFileListVO.getFrstRegisterId()
, adrInnorixFileListVO.getLastUpdusrId()
, adrInnorixFileListVO.getP_adrHstryMgrSeq() //, String p_adrHstryMgrSeq
, "I" //, String p_useCd I/U/UI/II/RE
, "ADR_RPPL_DOC_OPEN" //, String p_tableName
, " WHERE 1=1 AND adr_seq='"+adrInnorixFileListVO.getAdrSeq()
+"' AND adr_sn='"+adrInnorixFileListVO.getAdrSn()
+"' AND rppl_doc_seq='"+adrInnorixFileListVO.getRpplDocSeq()
+"' AND rppl_seq='"+adrInnorixFileListVO.getRpplSeq()
+"' " //, String p_updateQuery
);
}
}

View File

@ -1,7 +1,6 @@
package kcc.com.cmm.web;
import java.time.LocalDateTime;
import java.util.List;
import javax.annotation.Resource;
@ -19,6 +18,7 @@ import kcc.com.cmm.LoginVO;
import kcc.com.cmm.service.AdrInnorixFileVO;
import kcc.com.cmm.service.InnorixFileService;
import kcc.com.utl.fcc.service.EgovStringUtil;
import kcc.kccadr.accdnt.ans.service.AnsVO;
import kcc.kccadr.cmm.RestResponse;
/**
@ -60,7 +60,6 @@ public class InnorixFileController {
adrInnorixFileVO.setFrstRegisterId(userId);
adrInnorixFileVO.setLastUpdusrId(userId);
return ResponseEntity.ok(innorixService.insertInnorixFileAjax(adrInnorixFileVO));
}

View File

@ -1,7 +1,10 @@
package kcc.kccadr.accdnt.ans.service;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import kcc.com.cmm.service.InnorixFileVO;
import kcc.kccadr.adjPgrMgr.cmm.service.PgrCmmVO;
@SuppressWarnings("serial")
@ -15,6 +18,7 @@ public class AnsVO extends PgrCmmVO implements Serializable {
private String appliCantSeq;
private String adrDocTy;
private String usrCi;
public List<InnorixFileVO> innorixFileListVO = new ArrayList<InnorixFileVO>();
public String getAdrDocCn1() {
return adrDocCn1;
@ -88,4 +92,14 @@ public class AnsVO extends PgrCmmVO implements Serializable {
this.usrCi = usrCi;
}
public List<InnorixFileVO> getInnorixFileListVO() {
return innorixFileListVO;
}
public void setInnorixFileListVO(List<InnorixFileVO> innorixFileListVO) {
this.innorixFileListVO = innorixFileListVO;
}
}

View File

@ -84,27 +84,27 @@ public class AnsServiceImpl implements AnsService {
//이력관리를 위한 adr_hstry_mgr 데이터 관리 추가 - 2022-08-09
//adr_hstry_mgr에 넣기 - 시작
adrHstryMgrDAO.insert4Func(ansVO.getAdrSeq()
//, "상태코드수정"
, p_code_desc
//, adjReqMgrVO.getStatCd()
, p_stat_cd
//, "상태코드수정"
, p_code_desc //, "조정진행관리>>조정진행목록>조정진행상세>사건문서>P>문서등록" //String p_code_desc - CC199
//, adjReqMgrVO.getStatCd()
, p_stat_cd // , "A160" //String p_stat_cd
, ansVO.getFrstRegisterId()
, ansVO.getLastUpdusrId()
, p_adrHstryMgrSeq //, String p_adrHstryMgrSeq
, "I" //, String p_useCd I/U/UI/II/RE
, "ADR_RPPL_DOC" //, String p_tableName
, p_adrHstryMgrSeq //, String p_adrHstryMgrSeq , ""
, "I" //, String p_useCd I/U/UI/II/RE
, "ADR_RPPL_DOC" //, String p_tableName
, " WHERE 1=1 AND adr_seq='"+ansVO.getAdrSeq()
+"' AND adr_sn='"+ansVO.getAdrSn()
+"' AND rppl_doc_seq='"+ansVO.getRpplDocSeq()
+"' " //, String p_updateQuery
+"' AND adr_sn='"+ansVO.getAdrSn()
+"' AND rppl_doc_seq='"+ansVO.getRpplDocSeq()
+"' " //, String p_updateQuery
);
//adr_hstry_mgr에 넣기 -
ansDAO.ansSubmitAjax_setp2(ansVO); //ADR_RPPL_DOC_OPEN
ansDAO.ansSubmitAjax_setp2(ansVO); //ADR_RPPL_DOC_OPEN // 공계여부
//이력관리를 위한 adr_hstry_mgr 데이터 관리 추가 - 2022-08-09
//adr_hstry_mgr에 넣기 - 시작

View File

@ -1691,7 +1691,7 @@ public class ApmController {
ansVO.setFrstRegisterId(userId);
ansVO.setLastUpdusrId(userId);
//이력관리를 위한 adr_hstry_mgr 데이터 관리 추가 - 2022-08-09
//되돌리기용 이력관리를 위한 adr_hstry_mgr 데이터 관리 추가 - 2022-08-09
ansService.ansSubmitAjax(ansVO
, "조정진행관리>>조정진행목록>조정진행상세>사건문서>P>문서등록" //String p_code_desc - CC199
, "A160" //String p_stat_cd

View File

@ -25,6 +25,8 @@
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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">
</script>
<title>사건문서 등록</title>
@ -32,7 +34,25 @@
$(document).ready(function(){
docTypeDiv('10');
});
$('.openYn').click(function(){
console.log($(this).val());
var openYn = $(this).val();
if(openYn == 'N'){
if (confirm('제한공개는 영업비밀 등에 해당하는 경우만 선택해 주십시요.' + '\n공정한 진행을 위해 위원회 판단으로 공개로 전환될 수 있습니다.' + '\n제한공개로 선택 하시겠습니까?')) {
$("#openYn_N").prop('checked', true);
$("#openYn").val("N");
}
}else{
$("#openYn_Y").prop('checked', true);
$("#openYn").val("Y");
}
});
});
//단일 첨부파일 버튼
$(function() {
@ -51,48 +71,6 @@
self.close();
}
//등록 버튼
function fncReg() {
var f = document.getElementById("listForm");
var data = new FormData(f);
_fileForm2.forEach(function(obj, idx) {
if (obj)
data.append("file" + idx, obj.fileObj);
});
if (validation()) {
if(confirm("사건문서를 등록 하시겠습니까?")){
$.ajax({
type : "POST",
enctype : 'multipart/form-data',
url : "/kccadr/adjPgrMgr/apm/docRegPopAjax.do",
data : data,
dataType : 'json',
async : false,
processData : false,
contentType : false,
cache : false,
success : function(returnData, status) {
if (returnData.result == 'success') {
alert("사건문서 제출이 완료되었습니다.");
opener.location.reload(true);
self.close();
} else {
alert(returnData.message);
}
},
error : function(e) {
alert("사건문서 제출에 실패하였습니다.");
console.log("ERROR : ", e);
}
});
}
}
}
function validation() {
@ -101,22 +79,14 @@
return false;
}
if ($('#tbody_fiielist tr').length * 1 <= 0) {
alert("첨부서류를 등록해 주세요");
return false;
// if ($('#tbody_fiielist tr').length * 1 <= 0) {
// alert("첨부서류를 등록해 주세요");
// return false;
}
// }
return true;
}
function notiOpenYn() {
if (confirm('제한공개는 영업비밀 등에 해당하는 경우만 선택해 주십시요.' + '\n공정한 진행을 위해 위원회 판단으로 공개로 전환될 수 있습니다.' + '\n제한공개로 선택 하시겠습니까?')) {
$("#openYn_N").prop('checked', true);
} else {
$("#openYn_Y").prop('checked', true);
}
}
//문서구분에 따른 신청인 피신청인 선택값 show/hide
function docTypeDiv(divVal){
@ -244,6 +214,130 @@
}
}
//등록 버튼
function fncReg() {
var f = document.getElementById("listForm");
var data = new FormData(f);
_fileForm2.forEach(function(obj, idx) {
if (obj)
data.append("file" + idx, obj.fileObj);
});
if (validation()) {
if(confirm("사건문서를 등록 하시겠습니까?")){
if(control.getUploadFiles().length > 0){
control.upload(); // 업로드 시작
}else{
alert("등록된 첨부파일이 없습니다.");
return false;
}
// $.ajax({
// type : "POST",
// enctype : 'multipart/form-data',
// url : "/kccadr/adjPgrMgr/apm/docRegPopAjax.do",
// data : data,
// dataType : 'json',
// async : false,
// processData : false,
// contentType : false,
// cache : false,
// success : function(returnData, status) {
// if (returnData.result == 'success') {
// alert("사건문서 제출이 완료되었습니다.");
// opener.location.reload(true);
// self.close();
// } else {
// alert(returnData.message);
// }
// },
// error : function(e) {
// alert("사건문서 제출에 실패하였습니다.");
// console.log("ERROR : ", e);
// }
// });
}
}
}
// 파일 업로드 솔루션 init 셋팅
var control = new Object();
window.onload = function() {
// 파일전송 컨트롤 생성
control = innorix.create({
el: '#fileControl' // 컨트롤 출력 HTML 객체 ID
, transferMode: 'both' // 업로드, 다운로드 혼합사용
, installUrl: '/innorix/install/install.html' // Agent 설치 페이지
, uploadUrl: '/innorix/exam/upload_test_220916.jsp' // 업로드 URL
, height:80
, width: 635
});
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
fn_insertFile(p.files); // 파일 정보 DB isnert function
control.removeAllFiles(); // control 초기화
});
};
/*
* 파일 정보 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()
, "adrSn": $('#adrSn').val()
, "adrDocTy": $('#adrDocTy').val()
, "rpplSeq": $('#rpplSeq').val()
, "adrDocCn1": $('#adrDocCn1').val()
, "openYn": $('#openYn').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"){
alert("사건문서 제출이 완료되었습니다.");
opener.location.reload(true);
self.close();
}else{
alert(returnData.data);
return false;
}
},
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
});
}
</script>
<style>
.file_wrap .tbType02{border-bottom: 0}
@ -252,8 +346,8 @@
<body>
<form id="listForm" name="listForm" method="post" onsubmit="return false;" enctype="multipart/form-data">
<input type="hidden" name="adrSeq" value="<c:out value='${AnsVO.adrSeq}'/>" />
<input type="hidden" name="adrSn" value="<c:out value='${AnsVO.adrSn}'/>" />
<input type="hidden" name="adrSeq" id="adrSeq" value="<c:out value='${AnsVO.adrSeq}'/>" />
<input type="hidden" name="adrSn" id="adrSn" value="<c:out value='${AnsVO.adrSn}'/>" />
<!-- <input type="hidden" name="adrDocTy" value="10" /> -->
<input type="hidden" name="limitcount" value="3" />
@ -306,38 +400,15 @@
<p>첨부서류</p>
</th>
<td class="upload_area">
<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>
<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">
<table class="tbType02">
<caption>첨부파일 추가 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%;">
<col style="width: auto;">
<col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</th>
</thead>
<tbody class="tb_file_before">
<tr>
<td colspan="4">
<p>
첨부하실 파일을
<span>마우스로 끌어서</span>
넣어주세요.
</p>
</td>
</tr>
</tbody>
</table>
</div>
<!-- <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">
<caption>첨부파일 추가 리스트 : 파일명, 종류, 크기, 삭제</caption>
@ -389,12 +460,13 @@
</th>
<td>
<div class="radio_wrap">
<input type="hidden" id="openYn" value="Y">
<span>
<input value="Y" type="radio" name="openYn" id="openYn_Y" checked="checked">
<input value="Y" class="openYn" name="openYn" type="radio" id="openYn_Y" checked="checked">
<label for="openYn_Y">공개</label>
</span>
<span>
<input value="N" type="radio" name="openYn" id="openYn_N" onclick="notiOpenYn()">
<input value="N" class="openYn" name="openYn" type="radio" id="openYn_N">
<label for="openYn_N">제한공개</label>
</span>
</div>

View File

@ -0,0 +1,416 @@
<!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="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%>
<%
/**
* @Class Name : docRegPop.jsp
* @Description : 사건문서 첨부파일 팝업
* @Modification Information
* @
* @ 수정일 수정자 수정내용
* @ ------- -------- ---------------------------
* @ 2022.02.25 이준호 최초 생성
* @author 이준호
* @since 2022.02.25
* @version 1.0
* @see
*
*/
%>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
</script>
<title>사건문서 등록</title>
<script type="text/javaScript" language="javascript">
$(document).ready(function(){
docTypeDiv('10');
});
//단일 첨부파일 버튼
$(function() {
$('#filebutton').click(function(e) {
e.preventDefault();
$('#file_temp').click();
});
});
//닫기 버튼
function fncClose(){
self.close();
}
//등록 버튼
function fncReg() {
var f = document.getElementById("listForm");
var data = new FormData(f);
_fileForm2.forEach(function(obj, idx) {
if (obj)
data.append("file" + idx, obj.fileObj);
});
if (validation()) {
if(confirm("사건문서를 등록 하시겠습니까?")){
$.ajax({
type : "POST",
enctype : 'multipart/form-data',
url : "/kccadr/adjPgrMgr/apm/docRegPopAjax.do",
data : data,
dataType : 'json',
async : false,
processData : false,
contentType : false,
cache : false,
success : function(returnData, status) {
if (returnData.result == 'success') {
alert("사건문서 제출이 완료되었습니다.");
opener.location.reload(true);
self.close();
} else {
alert(returnData.message);
}
},
error : function(e) {
alert("사건문서 제출에 실패하였습니다.");
console.log("ERROR : ", e);
}
});
}
}
}
function validation() {
if (isEmpty($('#adrDocCn1').val())) {
alert('답변내용을 입력해 주세요.');
return false;
}
if ($('#tbody_fiielist tr').length * 1 <= 0) {
alert("첨부서류를 등록해 주세요");
return false;
}
return true;
}
function notiOpenYn() {
if (confirm('제한공개는 영업비밀 등에 해당하는 경우만 선택해 주십시요.' + '\n공정한 진행을 위해 위원회 판단으로 공개로 전환될 수 있습니다.' + '\n제한공개로 선택 하시겠습니까?')) {
$("#openYn_N").prop('checked', true);
} else {
$("#openYn_Y").prop('checked', true);
}
}
//문서구분에 따른 신청인 피신청인 선택값 show/hide
function docTypeDiv(divVal){
//답변서
if(divVal == '10'){
//신청인
$('#rpplSeq').find('option[name=10]').prop('disabled', true);
$('#rpplSeq').find('option[name=10]').prop('selected', false);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', false);
$(this).eq(0).prop('selected', true);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//준비서면
else if(divVal == '20'){
//신청인
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', true);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//취하신청서
else if(divVal == '30'){
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', true);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//피신청인 경정신청서
else if(divVal == '40'){
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', true);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//조정기일 연장동의서
else if(divVal == '50'){
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', false);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//우편발송 배달증명서
else if(divVal == '60'){
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', false);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//관련 문서 전체
else if(divVal == '70'){
//신청인
$('#rpplSeq').find('option[name=10]').prop('disabled', true);
$('#rpplSeq').find('option[name=10]').prop('selected', false);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', true);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', false);
$('#rpplSeq').find('option[name=30]').prop('selected', true);
}
//조정기일변경신청서
else if(divVal == '80'){
//신청인
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', false);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
//직권조정 이의신청서
else if(divVal == '90'){
//신청인
$('#rpplSeq').find('option[name=10]').prop('disabled', false);
$('#rpplSeq').find('option[name=10]').prop('selected', true);
//피신청인
$('#rpplSeq').find('option[name=20]').each(function(){
$(this).prop('disabled', false);
$(this).prop('selected', false);
});
//조정조사관
$('#rpplSeq').find('option[name=30]').prop('disabled', true);
$('#rpplSeq').find('option[name=30]').prop('selected', false);
}
}
</script>
<style>
.file_wrap .tbType02{border-bottom: 0}
</style>
</head>
<body>
<form id="listForm" name="listForm" method="post" onsubmit="return false;" enctype="multipart/form-data">
<input type="hidden" name="adrSeq" value="<c:out value='${AnsVO.adrSeq}'/>" />
<input type="hidden" name="adrSn" value="<c:out value='${AnsVO.adrSn}'/>" />
<!-- <input type="hidden" name="adrDocTy" value="10" /> -->
<input type="hidden" name="limitcount" value="3" />
<div class="area_popup supm_popup" id="sub">
<div class="cont_popup">
<table class="pop_tbType01">
<caption>사건문서 등록 : 신청인, 피신청인, 관리자가 사건에 관련된 첨부파일을 등록한다.</caption>
<colgroup>
<col style="width: 200px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th scope="row">
<p>문서 구분</p>
</th>
<td>
<p>
<kc:select codeId="CC044" id="adrDocTy" name="adrDocTy" onChange="docTypeDiv(this.value);"/>
</p>
</td>
</tr>
<tr>
<th scope="row">
<p>사건문서 등록인 구분</p>
</th>
<td>
<p>
<select name="rpplSeq" id="rpplSeq" class="subSearch">
<c:forEach var="info" items="${rpplInfo}" varStatus="status">
<option name="${info.rpplTy}" value="${info.rpplSeq}" <c:if test="${status.count==2}">selected="selected"</c:if>>${info.rpplNm} (<kc:code codeId="CC005" code="${info.rpplTy}"/>)</option>
</c:forEach>
<option name="30" value="${adrAdminInfo.adrAdmId}">${adrAdminInfo.adrAdmNm} (조정조사관)</option>
</select>
</p>
</td>
</tr>
<tr>
<th scope="row" class="req_text">
<p>내용</p>
</th>
<td>
<label for="adrDocCn1" class="label">답변내용 입력</label>
<textarea name="adrDocCn1" id="adrDocCn1" cols="30" rows="5" cssClass="purpose_text" cssStyle="resize: none;"><c:out value='${info.adrDocCn1}' /></textarea>
</td>
</tr>
<tr>
<th scope="row" class="req_text">
<p>첨부서류</p>
</th>
<td class="upload_area">
<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>
<p style="font-size: 16px; float: right; margin-top: 16px; color: #666;">* 첨부파일을 등록해 주세요. (최대3개)</p>
<div class="file_wrap file_upload_box no_img_box">
<table class="tbType02">
<caption>첨부파일 추가 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%;">
<col style="width: auto;">
<col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</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">
<caption>첨부파일 추가 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 10%">
</colgroup>
<thead>
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</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="<c:out value='${fileList.fileSize}' />">
<input type="hidden" name="limitcount" value="3" />
<td class="td_filename">
<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;" title="파일${status.count} 삭제">
<i></i>
</button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<th>
<p>상대방공개여부</p>
</th>
<td>
<div class="radio_wrap">
<span>
<input value="Y" type="radio" name="openYn" id="openYn_Y" checked="checked">
<label for="openYn_Y">공개</label>
</span>
<span>
<input value="N" type="radio" name="openYn" id="openYn_N" onclick="notiOpenYn()">
<label for="openYn_N">제한공개</label>
</span>
</div>
</td>
</tr>
</tbody>
</table>
<!-- 하단 버튼 -->
<div class="btn_wrap btn_layout04">
<button class="btnType06 btn_edit" onclick="fncReg();">등록</button>
<button class="btnType06 btn_list" onclick="fncClose();">취소</button>
</div>
<!-- //하단 버튼 -->
</div>
</div>
<!-- //cont -->
</form>
</body>
</html>

View File

@ -31,10 +31,7 @@
<script src="<c:url value='/innorix/innorix.js' />"></script>
<script type="text/javascript">
$(document).ready(function(){
fn_selectFileList();
});
@ -97,11 +94,14 @@ function fn_makeList(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()
, "adrDocTy": $('#adrDocTy').val()
, "frstRegistPnttm": $('#frstRegistPnttm').val()
, "jspFileName": jspFileName
, "innorixFileListVO": data
}
@ -128,7 +128,7 @@ function fn_insertFile(data){
}
// 파일 업로드 솔루션 init 셋팅
var control = new Object();
window.onload = function() {
// 파일전송 컨트롤 생성
@ -143,25 +143,14 @@ window.onload = function() {
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
// console.log(p.files);
fn_insertFile(p.files); // 파일 정보 DB isnert function
fn_selectFileList(); // 파일 정보 list select function
control.removeAllFiles(); // control 초기화
// var f = p.files;
// var r = "Upload complete\n\n";
// for (var i = 0; i < f.length; i++ ) {
// r += f[i].controlId + " " + f[i].clientFileName + " " + f[i].fileSize + "\n";
// }
// alert(r);
// var files = JSON.stringify(f);
// console.log(files);
// var innoJquery = innorix._load("innoJquery");
// innoJquery('form#f_write').append('<input type="hidden" name="files" id="files" value=\'' + files + '\' />');
// innoJquery('form#f_write').submit();
});
};
// 등록 버튼 클릭파일 업로드 솔루션 init 셋팅
function fn_upload() {
if(!$('#frstRegistPnttm').val())
@ -199,6 +188,7 @@ function fn_upload() {
</head>
<body>
<input type="hidden" id="adrSeq" name="adrSeq" value="${adjReqMgrPastVO.adrSeq }">
<input type="hidden" id="p_file_nm_prefix" name="p_file_nm_prefix" value="PST_">
<div class="cont_wrap">
<!-- cont_tit -->
<div class="cont_tit">

View File

@ -16,6 +16,7 @@
control.on('loadComplete', function (p) { // 다운로드 파일 추가
var urlBase = location.href.substring(0, location.href.lastIndexOf("/") + 1);
console.log('urlBase :: ', urlBase);
control.presetDownloadFiles(
[{
printFileName: "INNORIX WP 브로셔.pdf",