자바 파일명 수정(모자이크표시,동영상캡쳐)

main
이범준 11 months ago
parent e38d37cf93
commit 81b2fe4dd0

@ -37,7 +37,7 @@ import org.xml.sax.SAXException;
import cokr.xit.base.file.dao.FileMapper; import cokr.xit.base.file.dao.FileMapper;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.cmmn.service.bean.MosaicBean; import cokr.xit.fims.sprt.service.bean.MediaBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@Controller @Controller
@ -48,15 +48,15 @@ public class FileController extends cokr.xit.base.file.web.FileController {
@Resource(name="fileBean") @Resource(name="fileBean")
private FileBean fileBean; private FileBean fileBean;
@Resource(name="mosaicBean") @Resource(name="mediaBean")
private MosaicBean mosaicBean; private MediaBean mediaBean;
@Override @Override
public ModelAndView getFileList(FileQuery req) { public ModelAndView getFileList(FileQuery req) {
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
List<DataObject> fileInfoList = fileService().getFileList(req); List<DataObject> fileInfoList = fileService().getFileList(req);
for(DataObject fileInfo : fileInfoList) { for(DataObject fileInfo : fileInfoList) {
List<DataObject> mosaicInfos = mosaicBean.getMosaicList(fileInfo.string("FILE_ID")); List<DataObject> mosaicInfos = mediaBean.getMosaicList(fileInfo.string("FILE_ID"));
if(mosaicInfos != null) { if(mosaicInfos != null) {
String mosaic = ""; String mosaic = "";
for(int i=0; i < mosaicInfos.size(); i++) { for(int i=0; i < mosaicInfos.size(); i++) {

@ -1,14 +1,13 @@
package cokr.xit.fims.cmmn.dao; package cokr.xit.fims.sprt.dao;
import java.util.List; import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@Mapper("mosaicMapper") @Mapper("mediaMapper")
public interface MosaicMapper extends AbstractMapper { public interface MediaMapper {
/** .<br /> /** .<br />
* @param fileId ID * @param fileId ID

@ -1,18 +0,0 @@
package cokr.xit.fims.sprt.service;
import cokr.xit.foundation.data.DataObject;
/** .
* <ul><li>{@link #getVideoInfo(SprtQuery) }</li>
* </ul>
* @author leebj
*/
public interface Sprt03Service {
/** .
* @param crdnId
* @return
*/
DataObject getVideoInfo(String crdnId);
}

@ -1,4 +1,4 @@
package cokr.xit.fims.cmmn.service.bean; package cokr.xit.fims.sprt.service.bean;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
@ -8,25 +8,73 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.dao.MosaicMapper; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.cmmn.pdf.PstnAndSize; import cokr.xit.fims.cmmn.pdf.PstnAndSize;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.sprt.Sprt;
import cokr.xit.fims.sprt.dao.MediaMapper;
import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@Component("mosaicBean") /**
public class MosaicBean extends AbstractComponent { * @author leebj
*/
@Component("mediaBean")
public class MediaBean extends AbstractComponent {
@Resource(name = "crdnInfoMapper")
private CrdnInfoMapper crdnInfoMapper;
@Resource(name = "mediaMapper")
private MediaMapper mediaMapper;
@Resource(name="fileBean")
private FileBean fileBean;
public DataObject getVideoInfo(String crdnId) {
DataObject fileInfo = new DataObject();
DataObject cvlcptInfo = crdnInfoMapper.selectCrdnInfo(crdnId);
String linkTblNm = cvlcptInfo.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
FileQuery fileQuery = new FileQuery();
if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(cvlcptInfo.string("LINK_ID"));
List<DataObject> fileList = fileBean.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(Sprt.VIDEO_MIME_TYPE).contains(mimeType)){
fileInfo = file;
break;
}
}
}
}
@Resource(name = "mosaicMapper") return fileInfo;
private MosaicMapper mosaicMapper; }
/** .<br /> /** .<br />
* @param fileId ID * @param fileId ID
* @return * @return
*/ */
public List<DataObject> getMosaicList(String fileId){ public List<DataObject> getMosaicList(String fileId){
return mosaicMapper.selectMosaicList(fileId); return mediaMapper.selectMosaicList(fileId);
} }
public List<PstnAndSize> getTransformedMosaic(String imageKey, String imagePath, PstnAndSize pstnAndSize_in_print) { public List<PstnAndSize> getTransformedMosaic(String imageKey, String imagePath, PstnAndSize pstnAndSize_in_print) {

@ -47,7 +47,6 @@ import cokr.xit.fims.cmmn.pdf.PstnAndSize;
import cokr.xit.fims.cmmn.pdf.format.Advntce; import cokr.xit.fims.cmmn.pdf.format.Advntce;
import cokr.xit.fims.cmmn.pdf.format.Nht; import cokr.xit.fims.cmmn.pdf.format.Nht;
import cokr.xit.fims.cmmn.service.bean.FactionBean; import cokr.xit.fims.cmmn.service.bean.FactionBean;
import cokr.xit.fims.cmmn.service.bean.MosaicBean;
import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
@ -101,8 +100,8 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
@Resource(name = "otptStngMapper") @Resource(name = "otptStngMapper")
protected OtptStngMapper otptStngMapper; protected OtptStngMapper otptStngMapper;
@Resource(name="mosaicBean") @Resource(name="mediaBean")
private MosaicBean mosaicBean; private MediaBean mediaBean;
@Override @Override
public List<DataObject> getIntegrationDataList(SprtQuery query) { public List<DataObject> getIntegrationDataList(SprtQuery query) {
@ -476,7 +475,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("")) { if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("")) {
String blackImage = "samplefiles/black.png"; String blackImage = "samplefiles/black.png";
List<PstnAndSize> transformedMosaicInfos = mosaicBean.getTransformedMosaic( List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
imageKey, imagePath, new PstnAndSize(pstn[0],pstn[1], size[0], size[1]) imageKey, imagePath, new PstnAndSize(pstn[0],pstn[1], size[0], size[1])
); );
@ -522,7 +521,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
if(otptArtclNm.equals("crdnPhoto") && !imageKeys.isEmpty()) { if(otptArtclNm.equals("crdnPhoto") && !imageKeys.isEmpty()) {
String blackImage = "samplefiles/black.png"; String blackImage = "samplefiles/black.png";
List<PstnAndSize> transformedMosaicInfos = mosaicBean.getTransformedMosaic( List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
imageKeys.get(i), imagePaths.get(i), devideInfo imageKeys.get(i), imagePaths.get(i), devideInfo
); );
@ -615,7 +614,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
} }
for(int j=0; j < fileInfoList.size(); j++){ for(int j=0; j < fileInfoList.size(); j++){
DataObject fileInfo = fileInfoList.get(j); DataObject fileInfo = fileInfoList.get(j);
List<DataObject> mosaicInfos = mosaicBean.getMosaicList(fileInfo.string("FILE_ID")); List<DataObject> mosaicInfos = mediaBean.getMosaicList(fileInfo.string("FILE_ID"));
File orgnFile = new File(fileInfo.string("FILE_PATH")); File orgnFile = new File(fileInfo.string("FILE_PATH"));

@ -1,64 +0,0 @@
package cokr.xit.fims.sprt.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.sprt.Sprt;
import cokr.xit.fims.sprt.service.Sprt03Service;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
/**
* @author leebj
*/
@Service("sprt03Service")
public class Sprt03ServiceBean extends AbstractServiceBean implements Sprt03Service {
@Resource(name = "crdnInfoMapper")
private CrdnInfoMapper crdnInfoMapper;
@Resource(name="fileService")
FileService fileService;
@Override
public DataObject getVideoInfo(String crdnId) {
DataObject fileInfo = new DataObject();
DataObject cvlcptInfo = crdnInfoMapper.selectCrdnInfo(crdnId);
String linkTblNm = cvlcptInfo.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
FileQuery fileQuery = new FileQuery();
if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(cvlcptInfo.string("LINK_ID"));
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(Sprt.VIDEO_MIME_TYPE).contains(mimeType)){
fileInfo = file;
break;
}
}
}
}
return fileInfo;
}
}

@ -7,18 +7,18 @@ import javax.annotation.Resource;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService; import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.sprt.service.Sprt03Service; import cokr.xit.fims.sprt.service.bean.MediaBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
public class Sprt03Controller extends ApplicationController { public class Sprt03Controller extends ApplicationController {
@Resource(name="fileService") @Resource(name="fileBean")
FileService fileService; private FileBean fileBean;
@Resource(name="sprt03Service") @Resource(name="mediaBean")
Sprt03Service sprt03Service; private MediaBean mediaBean;
/** . /** .
* @return fims/sprt/sprt03010-main * @return fims/sprt/sprt03010-main
@ -31,7 +31,7 @@ public class Sprt03Controller extends ApplicationController {
if(crdnId != null && !crdnId.equals("")) { if(crdnId != null && !crdnId.equals("")) {
mav.addObject("crdnId", crdnId); mav.addObject("crdnId", crdnId);
DataObject file = sprt03Service.getVideoInfo(crdnId); DataObject file = mediaBean.getVideoInfo(crdnId);
if(!file.isEmpty()) { if(!file.isEmpty()) {
mav.addObject("fileInfo", toJson(file)); mav.addObject("fileInfo", toJson(file));
} }
@ -54,7 +54,7 @@ public class Sprt03Controller extends ApplicationController {
FileQuery fileQuery = new FileQuery(); FileQuery fileQuery = new FileQuery();
fileQuery.setFileIDs(fileId); fileQuery.setFileIDs(fileId);
List<DataObject> fileList = fileService.getFileList(fileQuery); List<DataObject> fileList = fileBean.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) { if(fileList != null && !fileList.isEmpty()) {
DataObject file = fileList.get(0); DataObject file = fileList.get(0);
mav.addObject("fileInfo", toJson(file)); mav.addObject("fileInfo", toJson(file));

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.cmmn.dao.MosaicMapper"> <mapper namespace="cokr.xit.fims.sprt.dao.MediaMapper">
<select id="selectMosaicList" parameterType="string" resultType="dataobject"> <select id="selectMosaicList" parameterType="string" resultType="dataobject">
/* 이미지파일 모자이크 정보 조회 (mosaicMapper.selectMosaicList) */ /* 이미지파일 모자이크 정보 조회 (mediaMapper.selectMosaicList) */
SELECT MOSC_ID SELECT MOSC_ID
, FILE_ID , FILE_ID
, X_AXS , X_AXS
Loading…
Cancel
Save