From 81b2fe4dd0685827380342f4b5b701ddd85ff92a Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 29 Dec 2023 17:21:22 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EB=B0=94=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95(=EB=AA=A8=EC=9E=90=EC=9D=B4?= =?UTF-8?q?=ED=81=AC=ED=91=9C=EC=8B=9C,=EB=8F=99=EC=98=81=EC=83=81?= =?UTF-8?q?=EC=BA=A1=EC=B3=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/base/FileController.java | 8 +-- .../dao/MediaMapper.java} | 7 +- .../xit/fims/sprt/service/Sprt03Service.java | 18 ------ .../service/bean/MediaBean.java} | 62 ++++++++++++++++-- .../sprt/service/bean/Sprt01ServiceBean.java | 11 ++-- .../sprt/service/bean/Sprt03ServiceBean.java | 64 ------------------- .../xit/fims/sprt/web/Sprt03Controller.java | 16 ++--- .../media-mapper.xml} | 4 +- 8 files changed, 77 insertions(+), 113 deletions(-) rename src/main/java/cokr/xit/fims/{cmmn/dao/MosaicMapper.java => sprt/dao/MediaMapper.java} (64%) delete mode 100644 src/main/java/cokr/xit/fims/sprt/service/Sprt03Service.java rename src/main/java/cokr/xit/fims/{cmmn/service/bean/MosaicBean.java => sprt/service/bean/MediaBean.java} (51%) delete mode 100644 src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java rename src/main/resources/sql/mapper/fims/{cmmn/mosaic-mapper.xml => sprt/media-mapper.xml} (72%) diff --git a/src/main/java/cokr/xit/fims/base/FileController.java b/src/main/java/cokr/xit/fims/base/FileController.java index d99906b1..ec0b4599 100644 --- a/src/main/java/cokr/xit/fims/base/FileController.java +++ b/src/main/java/cokr/xit/fims/base/FileController.java @@ -37,7 +37,7 @@ import org.xml.sax.SAXException; import cokr.xit.base.file.dao.FileMapper; import cokr.xit.base.file.service.FileQuery; 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; @Controller @@ -48,15 +48,15 @@ public class FileController extends cokr.xit.base.file.web.FileController { @Resource(name="fileBean") private FileBean fileBean; - @Resource(name="mosaicBean") - private MosaicBean mosaicBean; + @Resource(name="mediaBean") + private MediaBean mediaBean; @Override public ModelAndView getFileList(FileQuery req) { ModelAndView mav = new ModelAndView("jsonView"); List fileInfoList = fileService().getFileList(req); for(DataObject fileInfo : fileInfoList) { - List mosaicInfos = mosaicBean.getMosaicList(fileInfo.string("FILE_ID")); + List mosaicInfos = mediaBean.getMosaicList(fileInfo.string("FILE_ID")); if(mosaicInfos != null) { String mosaic = ""; for(int i=0; i < mosaicInfos.size(); i++) { diff --git a/src/main/java/cokr/xit/fims/cmmn/dao/MosaicMapper.java b/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java similarity index 64% rename from src/main/java/cokr/xit/fims/cmmn/dao/MosaicMapper.java rename to src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java index f9c3f09f..7536ca0a 100644 --- a/src/main/java/cokr/xit/fims/cmmn/dao/MosaicMapper.java +++ b/src/main/java/cokr/xit/fims/sprt/dao/MediaMapper.java @@ -1,14 +1,13 @@ -package cokr.xit.fims.cmmn.dao; +package cokr.xit.fims.sprt.dao; import java.util.List; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; -import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; -@Mapper("mosaicMapper") -public interface MosaicMapper extends AbstractMapper { +@Mapper("mediaMapper") +public interface MediaMapper { /**파일의 모자이크 정보를 조회한다.
* @param fileId 파일ID diff --git a/src/main/java/cokr/xit/fims/sprt/service/Sprt03Service.java b/src/main/java/cokr/xit/fims/sprt/service/Sprt03Service.java deleted file mode 100644 index d870f173..00000000 --- a/src/main/java/cokr/xit/fims/sprt/service/Sprt03Service.java +++ /dev/null @@ -1,18 +0,0 @@ -package cokr.xit.fims.sprt.service; - -import cokr.xit.foundation.data.DataObject; - -/**미디어 업무지원 서비스를 제공한다. - *
  • {@link #getVideoInfo(SprtQuery) 동영상 정보 조회}
  • - *
- * @author leebj - */ -public interface Sprt03Service { - - /**지정하는 단속아이디의 동영상 정보를 반환한다. - * @param crdnId 단속 아이디 - * @return 동영상 정보 - */ - DataObject getVideoInfo(String crdnId); - -} diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/MosaicBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java similarity index 51% rename from src/main/java/cokr/xit/fims/cmmn/service/bean/MosaicBean.java rename to src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java index a7f3f821..6b86a96f 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/MosaicBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/MediaBean.java @@ -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.io.File; @@ -8,25 +8,73 @@ import java.util.List; import javax.annotation.Resource; import javax.imageio.ImageIO; +import org.assertj.core.util.Arrays; 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.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.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 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") - private MosaicMapper mosaicMapper; + return fileInfo; + } /**파일의 모자이크 정보를 조회한다.
* @param fileId 파일ID * @return 모자이크 정보 */ public List getMosaicList(String fileId){ - return mosaicMapper.selectMosaicList(fileId); + return mediaMapper.selectMosaicList(fileId); } public List getTransformedMosaic(String imageKey, String imagePath, PstnAndSize pstnAndSize_in_print) { diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java index 32d1816d..ad58f98b 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java @@ -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.Nht; 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.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; @@ -101,8 +100,8 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv @Resource(name = "otptStngMapper") protected OtptStngMapper otptStngMapper; - @Resource(name="mosaicBean") - private MosaicBean mosaicBean; + @Resource(name="mediaBean") + private MediaBean mediaBean; @Override public List getIntegrationDataList(SprtQuery query) { @@ -476,7 +475,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("")) { String blackImage = "samplefiles/black.png"; - List transformedMosaicInfos = mosaicBean.getTransformedMosaic( + List transformedMosaicInfos = mediaBean.getTransformedMosaic( 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()) { String blackImage = "samplefiles/black.png"; - List transformedMosaicInfos = mosaicBean.getTransformedMosaic( + List transformedMosaicInfos = mediaBean.getTransformedMosaic( 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++){ DataObject fileInfo = fileInfoList.get(j); - List mosaicInfos = mosaicBean.getMosaicList(fileInfo.string("FILE_ID")); + List mosaicInfos = mediaBean.getMosaicList(fileInfo.string("FILE_ID")); File orgnFile = new File(fileInfo.string("FILE_PATH")); diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java deleted file mode 100644 index 277dc346..00000000 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java +++ /dev/null @@ -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 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; - } - -} diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt03Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt03Controller.java index 025cfc15..324280e3 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt03Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt03Controller.java @@ -7,18 +7,18 @@ import javax.annotation.Resource; import org.springframework.web.servlet.ModelAndView; 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.fims.sprt.service.Sprt03Service; +import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.foundation.data.DataObject; public class Sprt03Controller extends ApplicationController { - @Resource(name="fileService") - FileService fileService; + @Resource(name="fileBean") + private FileBean fileBean; - @Resource(name="sprt03Service") - Sprt03Service sprt03Service; + @Resource(name="mediaBean") + private MediaBean mediaBean; /** 동영상 재생 메인화면을 연다. * @return fims/sprt/sprt03010-main @@ -31,7 +31,7 @@ public class Sprt03Controller extends ApplicationController { if(crdnId != null && !crdnId.equals("")) { mav.addObject("crdnId", crdnId); - DataObject file = sprt03Service.getVideoInfo(crdnId); + DataObject file = mediaBean.getVideoInfo(crdnId); if(!file.isEmpty()) { mav.addObject("fileInfo", toJson(file)); } @@ -54,7 +54,7 @@ public class Sprt03Controller extends ApplicationController { FileQuery fileQuery = new FileQuery(); fileQuery.setFileIDs(fileId); - List fileList = fileService.getFileList(fileQuery); + List fileList = fileBean.getFileList(fileQuery); if(fileList != null && !fileList.isEmpty()) { DataObject file = fileList.get(0); mav.addObject("fileInfo", toJson(file)); diff --git a/src/main/resources/sql/mapper/fims/cmmn/mosaic-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml similarity index 72% rename from src/main/resources/sql/mapper/fims/cmmn/mosaic-mapper.xml rename to src/main/resources/sql/mapper/fims/sprt/media-mapper.xml index cc2b9107..a7e76984 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/mosaic-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/media-mapper.xml @@ -1,9 +1,9 @@ - +