refactor:과거사건관리 > 사건관련문서등록 화면 디테일 기능 수정

This commit is contained in:
hylee 2022-11-03 15:52:35 +09:00
parent eb1e9b7320
commit 786b2400af
5 changed files with 128 additions and 53 deletions

View File

@ -7,7 +7,8 @@ import kcc.kccadr.adjPgrMgr.cmm.service.PgrCmmVO;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class FileVO extends PgrCmmVO implements Serializable { public class FileVO extends PgrCmmVO implements Serializable {
private String adrSeq; private String adrSeq;
private String adrDocTy; /* 파일유형 */ private String adrDocTy; /* 파일유형 code */
private String adrDocTyTx; /* 파일유형 text */
private String atchFileId; /* 첨부파일ID */ private String atchFileId; /* 첨부파일ID */
private String fileSn; /* 파일순번 */ private String fileSn; /* 파일순번 */
private String fileStreCours; /* 파일저장경로 */ private String fileStreCours; /* 파일저장경로 */
@ -140,6 +141,12 @@ public class FileVO extends PgrCmmVO implements Serializable {
public void setApplyNum2(String applyNum2) { public void setApplyNum2(String applyNum2) {
this.applyNum2 = applyNum2; this.applyNum2 = applyNum2;
} }
public String getAdrDocTyTx() {
return adrDocTyTx;
}
public void setAdrDocTyTx(String adrDocTyTx) {
this.adrDocTyTx = adrDocTyTx;
}

View File

@ -19,6 +19,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute; 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.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@ -276,24 +277,26 @@ public class AdjReqMgrPastController {
*/ */
@RequestMapping("/kccadr/adjReqMgOff/popup/adjReqMgrPastFileRegist.do") @RequestMapping("/kccadr/adjReqMgOff/popup/adjReqMgrPastFileRegist.do")
public String adjReqMgrPastFileRegist(@ModelAttribute("adjReqMgrPastVO") AdjReqMgrPastVO adjReqMgrPastVO, ModelMap model) throws Exception { public String adjReqMgrPastFileRegist(@ModelAttribute("adjReqMgrPastVO") AdjReqMgrPastVO adjReqMgrPastVO, ModelMap model) throws Exception {
try {
List<FileVO> fileListVO = adjReqMgrPastService.fileFindById(adjReqMgrPastVO);
logger.info("fileListVO :: [{}]", fileListVO.get(0).getFrstRegistPnttm());
model.addAttribute("fileListVO", fileListVO);
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
}
// rpplList = adjReqMgrPastService.selectAdrRpplPastList(adjReqMgrPastVO);
return "kccadr/adjReqMgrPast/adjReqMgrPastFileRegist"; return "kccadr/adjReqMgrPast/adjReqMgrPastFileRegist";
} }
/**
* @methodName : selectAdjReqMgrPastFileListAjax
* @author : 이호영
* @date : 2022.11.03
* @description : 파일 조회
* @param adjReqMgrPastVO
* @return
* @throws Exception
*/
@RequestMapping("/kccadr/adjReqMgOff/popup/selectAdjReqMgrPastFileListAjax.do")
public ResponseEntity<RestResponse> selectAdjReqMgrPastFileListAjax(@RequestBody AdjReqMgrPastVO adjReqMgrPastVO) throws Exception {
logger.info("adjReqMgrPastVO :: [{}]", adjReqMgrPastVO.getAdrSeq());
List<FileVO> fileListVO = adjReqMgrPastService.fileFindById(adjReqMgrPastVO);
return ResponseEntity.ok(new RestResponse(HttpStatus.OK, fileListVO, LocalDateTime.now()));
}
/** /**
* @methodName : adjReqMgrPastProgPop * @methodName : adjReqMgrPastProgPop
* @author : 이호영 * @author : 이호영
@ -644,6 +647,8 @@ public class AdjReqMgrPastController {
private PgrCmmVO getDntInfo(PgrCmmVO cmmVO) throws Exception { private PgrCmmVO getDntInfo(PgrCmmVO cmmVO) throws Exception {
PgrCmmVO dntVO = cmmService.selectPgrCmm(cmmVO); PgrCmmVO dntVO = cmmService.selectPgrCmm(cmmVO);
if (!StringUtil.isEmpty(dntVO.getMemNames())) { if (!StringUtil.isEmpty(dntVO.getMemNames())) {

View File

@ -67,6 +67,12 @@ public class RestResponse {
this.timestamp = timestamp; this.timestamp = timestamp;
} }
public RestResponse(HttpStatus status, List<?> dataList, LocalDateTime timestamp) {
this.status = status;
this.dataList = dataList;
this.timestamp = timestamp;
}
public HttpStatus getStatus() { public HttpStatus getStatus() {
return status; return status;
} }

View File

@ -1177,6 +1177,13 @@
, lfd.FILE_SN as fileSn , lfd.FILE_SN as fileSn
, ard.ADR_DOC_TY as adrDocTy , ard.ADR_DOC_TY as adrDocTy
, lfd.ORIGNL_FILE_NM as orignlFileNm , lfd.ORIGNL_FILE_NM as orignlFileNm
, (
select
le.code_nm
from lettccmmndetailcode le
where le.code_id = 'CC044'
and le.code=ard.adr_doc_ty
) as adrDocTyTx
,TO_CHAR(ard.FRST_REGIST_PNTTM,'YYYY-MM-DD') AS frstRegistPnttm ,TO_CHAR(ard.FRST_REGIST_PNTTM,'YYYY-MM-DD') AS frstRegistPnttm
FROM ADR_RPPL_DOC ard FROM ADR_RPPL_DOC ard
LEFT JOIN LETTNFILEDETAIL lfd LEFT JOIN LETTNFILEDETAIL lfd

View File

@ -35,20 +35,67 @@
$(document).ready(function(){ $(document).ready(function(){
$('#allUploadBtn').click(function(){ fn_selectFileList();
console.log($('.uploadBtn').length)
$('.uploadBtn').leanth();
$('.uploadBtn').click();
})
}); });
/*
* list 만들기위한 데이터 가져오기
* */
function fn_selectFileList(){
var resultData = {"adrSeq": $('#adrSeq').val()}
$.ajax({
type: "POST",
url: "<c:url value='/kccadr/adjReqMgOff/popup/selectAdjReqMgrPastFileListAjax.do' />",
data: JSON.stringify(resultData),
dataType:'json',
async: false,
processData: false,
contentType: "application/json",
cache: false,
success: function (returnData) {
fn_makeList(returnData.dataList);
},
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
});
}
/*
* 데이터 list 만들기
* */
function fn_makeList(data){
$('#tbodyId').empty();
var contsStr = "";
$.each(data, function (index, data) {
contsStr +='\t\t\t<tr>'
+'\t\t\t\t<td>'
+'\t\t\t\t\t<p>'+data.frstRegistPnttm+'</p>'
+'\t\t\t\t</td>'
+'\t\t\t\t<td>\n'
+'\t\t\t\t\t'+ data.adrDocTyTx +'\n'
+'\t\t\t\t</td>\n'
+'\t\t\t\t<td>\n'
+'\t\t\t\t\t<a href="/cmm/fms/FileDown.do?atchFileId='+data.atchFileId+'&&fileSn='+data.fileSn+'" title="첨부파일 다운로드" targe="_blank">\n'
+'\t\t\t\t\t\t<p>'+data.orignlFileNm +'\n'
+'\t\t\t\t\t</a>\n'
+'\t\t\t\t</td>\n'
+'\t\t\t</tr>\n';
});
if(data.length == 0)
contsStr='\t\t\t<tr><td colspan="3">문서를 등록해 주세요</td></tr>';
$('#tbodyId').append(contsStr);
}
/*
* 파일 정보 DB insert Ajax
* */
function fn_insertFile(data){ function fn_insertFile(data){
var resultData = { var resultData = {
@ -69,7 +116,6 @@ function fn_insertFile(data){
cache: false, cache: false,
success: function (returnData) { success: function (returnData) {
if(data.status == "OK"){ if(data.status == "OK"){
// saveProcess();
alert(returnData.data); alert(returnData.data);
}else{ }else{
alert(returnData.data); alert(returnData.data);
@ -97,23 +143,45 @@ window.onload = function() {
// 업로드 완료 이벤트 // 업로드 완료 이벤트
control.on('uploadComplete', function (p) { control.on('uploadComplete', function (p) {
console.log(p.files); // console.log(p.files);
fn_insertFile(p.files); fn_insertFile(p.files); // 파일 정보 DB isnert function
var f = p.files; fn_selectFileList(); // 파일 정보 list select function
control.removeAllFiles(); // control 초기화
// var f = p.files;
// var r = "Upload complete\n\n"; // var r = "Upload complete\n\n";
// for (var i = 0; i < f.length; i++ ) { // for (var i = 0; i < f.length; i++ ) {
// r += f[i].controlId + " " + f[i].clientFileName + " " + f[i].fileSize + "\n"; // r += f[i].controlId + " " + f[i].clientFileName + " " + f[i].fileSize + "\n";
// } // }
// alert(r); // alert(r);
var files = JSON.stringify(f); // var files = JSON.stringify(f);
console.log(files); // console.log(files);
var innoJquery = innorix._load("innoJquery"); // var innoJquery = innorix._load("innoJquery");
innoJquery('form#f_write').append('<input type="hidden" name="files" id="files" value=\'' + files + '\' />'); // innoJquery('form#f_write').append('<input type="hidden" name="files" id="files" value=\'' + files + '\' />');
// innoJquery('form#f_write').submit(); // innoJquery('form#f_write').submit();
}); });
}; };
function fn_upload() {
if(!$('#frstRegistPnttm').val())
{
alert("일자를 입력해 주세요.");
return false;
}
if(control.getUploadFiles().length > 0){
control.upload(); // 업로드 시작
}else{
alert("등록된 첨부파일이 없습니다.");
return false;
}
}
</script> </script>
<style type="text/css"> <style type="text/css">
/* .calendarPop {left:-165px;} */ /* .calendarPop {left:-165px;} */
@ -155,14 +223,12 @@ window.onload = function() {
<col style="width:15%"> <col style="width:15%">
<col style="width:20%"> <col style="width:20%">
<col style="width:auto"> <col style="width:auto">
<col style="width:10%">
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th>일자</th> <th>일자</th>
<th>유형</th> <th>유형</th>
<th>문서</th> <th>문서</th>
<th>삭제</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -184,7 +250,6 @@ window.onload = function() {
<td> <td>
<div id="fileControl"></div><br/> <div id="fileControl"></div><br/>
</td> </td>
<td><button type="button" class="btnType04 btn_del reqPerDel">삭제</button></td>
</tr> </tr>
</tbody> </tbody>
@ -198,7 +263,7 @@ window.onload = function() {
<button class="btnType06" type="button" onclick="control.openFileDialogSingle();">단일 파일 추가</button> <button class="btnType06" type="button" onclick="control.openFileDialogSingle();">단일 파일 추가</button>
</div> </div>
<div class="area_right"> <div class="area_right">
<button class="btnType06" type="button" onclick="control.upload();">등록</button> <button class="btnType06" type="button" onclick="fn_upload();">등록</button>
</div> </div>
</div> </div>
<!-- //하단 버튼 --> <!-- //하단 버튼 -->
@ -220,22 +285,7 @@ window.onload = function() {
<th>문건명</th> <th>문건명</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody id="tbodyId">
<c:forEach var="list" items="${fileListVO }">
<tr>
<td>
<p><c:out value="${list.frstRegistPnttm }" /></p>
</td>
<td>
<kc:code codeId="CC044" code="${list.adrDocTy }"/>
</td>
<td>
<a href="<c:url value='/cmm/fms/FileDown.do?atchFileId=${list.atchFileId}&&fileSn=${list.fileSn}'/>" title="첨부파일 다운로드" targe="_blank">
<p><c:out value="${list.orignlFileNm }" /></p>
</a>
</td>
</tr>
</c:forEach>
</tbody> </tbody>
</table> </table>
</div> </div>