동영상 캡쳐 수정(서버에 등록된 동영상 캡쳐)

main
이범준 1 year ago
parent 8e17ad60b9
commit 5a0674464b

@ -16,7 +16,6 @@ import cokr.xit.base.file.service.FileService;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn01Mapper;
import cokr.xit.fims.crdn.service.CrdnService;
@ -115,9 +114,20 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
HWPFile resultFile = HWPReader.fromFile(resultPath);
String linkTblNm = dataObject.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoKeys(crdnQuery.getCrdnId());
if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
return new ModelAndView("errorView");
}
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
List<DataObject> fileInfoList = fileService.getFileList(fileQuery);
if(fileInfoList != null && fileInfoList.size() > 0) {
@ -138,13 +148,14 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
HWPWriter.toFile(resultFile, resultPath);
}
}
String downlaodFileName = "민원내역원본_" + currentTime + ".hwp";
ModelAndView mav = new ModelAndView("jsonView");
mav.addObject("filePath", resultPath);
mav.addObject("fileName", downlaodFileName);
return mav;
} catch (Exception e) {
return new ModelAndView("errorView");
@ -157,7 +168,18 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
}
public DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req) {
return crdn01Mapper.selectCivilComplaintReceiptInitialDataInfo(req);
DataObject dataObject = crdn01Mapper.selectCivilComplaintReceiptInitialDataInfo(req);
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoKeys(dataObject.string("CRDN_ID"));
fileQuery.setInfoType("190");
List<DataObject> fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
dataObject.set("videoExist", "Y");
} else {
dataObject.set("videoExist", "N");
}
return dataObject;
}

@ -1,16 +1,55 @@
package cokr.xit.fims.sprt.web;
import java.util.List;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.web.servlet.ModelAndView;
public class Sprt03Controller {
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.foundation.data.DataObject;
public class Sprt03Controller extends ApplicationController {
@Resource(name="fileService")
FileService fileService;
public String VIDEO_INF_TYPE = "190";
public String[] VIDEO_MIME_TYPE = {
"video/mp4", "video/webm", "video/ogg"
};
/** .
* @return fims/sprt/sprt03010-main
*/
public ModelAndView videoMain(String openerPageName) {
public ModelAndView videoMain(String openerPageName, String crdnId) {
ModelAndView mav = new ModelAndView();
mav.setViewName("fims/sprt/sprt03010-main");
mav.addObject("openerPageName", openerPageName);
if(crdnId != null && !crdnId.equals("")) {
mav.addObject("crdnId", crdnId);
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoKeys(crdnId);
fileQuery.setInfoType(VIDEO_INF_TYPE);
List<DataObject> fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
for(int i=0; i < fileList.size() ;i++) {
DataObject file = fileList.get(i);
String mimeType = file.string("MIME_TYPE");
if(Arrays.asList(VIDEO_MIME_TYPE).contains(mimeType)){
mav.addObject("fileInfo", toJson(file));
break;
}
}
}
}
return mav;
}
}

@ -127,8 +127,8 @@ public class CmnController {
*/
@Override
@RequestMapping(name="동영상 재생 메인", value="/010/main.do")
public ModelAndView videoMain(String openerPageName) {
return super.videoMain(openerPageName);
public ModelAndView videoMain(String openerPageName, String crdnId) {
return super.videoMain(openerPageName, crdnId);
}
}

@ -300,6 +300,8 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, CC.CVLCPT_RCPT_YMD <!-- 민원 접수 일자 -->
, CC.CVLCPT_PRCS_PRNMNT_DT <!-- 민원 처리 예정 일시 -->
, CC.CVLCPT_APLY_CN <!-- 민원 신청 내용 -->
, C.LINK_TBL_NM <!-- 연계 테이블 명 -->
, C.LINK_ID <!-- 연계 ID -->
FROM TB_CRDN C
INNER JOIN TB_CRDN_CVLCPT CC ON (C.CRDN_ID = CC.CRDN_ID)
WHERE C.DEL_YN = 'N' AND CC.DEL_YN = 'N'

@ -4,7 +4,7 @@
<div class="d-flex flex-row justify-content-evenly">
<div class="card" style="max-width:1100px;" title="민원접수 초기자료 편집">
<form id="frmEdit--${pageName}">
<input name="crdnId" type="hidden" data-map="CRDN_ID" />
<input id="crdnId--${pageName}" name="crdnId" type="hidden" data-map="CRDN_ID" />
<input id="taskSeCd--${pageName}" name="taskSeCd" type="hidden" value="${taskSeCd}" />
<div class="row g-1">
<div class="col-md-12" slot="edit">
@ -271,6 +271,7 @@
<div id="display--${pageName}" style="overflow-y: scroll;height: 340px;border-style: solid;">
</div>
<div class="col-md-12">
<button type="button" id="btnOpenVideoCapture--${pageName}" class="btn btn-blue">동영상 캡쳐</button>
</div>
@ -418,7 +419,9 @@ $(document).ready(function(){
$("#btnInst--${pageName}").on('click', () => $P.fnSave());
$("#btnAddFile--${pageName}").on('click', () => { $("#uploadFileList--${pageName}").trigger("click"); });
$("#btnOpenVideoCapture--${pageName}").on('click', () => {
window.open(wctx.url("/sprt/sprt03/010/main.do?openerPageName=${pageName}")
var crdnId = $("#crdnId--${pageName}").val();
window.open(wctx.url("/sprt/sprt03/010/main.do?openerPageName=${pageName}&crdnId="+crdnId)
,"newVideoCapture"
,"width=1800,height=950"
);
@ -466,6 +469,11 @@ $(document).ready(function(){
var crdnInfo = ${crdnInfo};
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.crdnControl.setData([crdnInfo]);
if(crdnInfo.videoExist == "N"){
$("#btnOpenVideoCapture--${pageName}").hide();
$("#display2--${pageName}").hide();
}
});

@ -114,14 +114,6 @@ document.getElementById("video").addEventListener('play', function () {
document.getElementById("btnCapture").focus();
});
$(document).ready(function(){
if(openerPageName == "crdn01020-info"){
$("#btnLoad").removeClass("d-block");
$("#btnLoad").addClass("d-none");
}
});
function capture(video, scaleFactor) {
if(scaleFactor == null){
@ -192,6 +184,28 @@ $("#btnSave").on("click",function(){
window.close();
}
});
$(document).ready(function(){
if(openerPageName == "crdn01020-info"){
$("#btnLoad").removeClass("d-block");
$("#btnLoad").addClass("d-none");
var fileInfo = [${fileInfo}];
if(fileInfo.length > 0){
var fileUrl = fileInfo[0].URL;
$("#video").removeAttr("hidden");
$("#video").html("<source src='" + location.origin + "${pageContext.request.contextPath}" + "/" + fileUrl +"'>");
} else {
alert("동영상 파일이 없습니다.");
}
}
});
</script>
</body>
</html>
Loading…
Cancel
Save