diff --git a/src/main/java/cokr/xit/fims/base/FileController.java b/src/main/java/cokr/xit/fims/base/FileController.java index 5531a2c3..d99906b1 100644 --- a/src/main/java/cokr/xit/fims/base/FileController.java +++ b/src/main/java/cokr/xit/fims/base/FileController.java @@ -7,6 +7,7 @@ import java.io.OutputStream; import java.io.StringWriter; import java.net.URISyntaxException; import java.net.URLDecoder; +import java.util.List; import java.util.regex.Matcher; import javax.annotation.Resource; @@ -36,6 +37,8 @@ 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.foundation.data.DataObject; @Controller public class FileController extends cokr.xit.base.file.web.FileController { @@ -45,13 +48,35 @@ public class FileController extends cokr.xit.base.file.web.FileController { @Resource(name="fileBean") private FileBean fileBean; + @Resource(name="mosaicBean") + private MosaicBean mosaicBean; + @Override public ModelAndView getFileList(FileQuery req) { - return setCollectionInfo( - new ModelAndView("jsonView"), - fileService().getFileList(req), - "file" - ); + ModelAndView mav = new ModelAndView("jsonView"); + List fileInfoList = fileService().getFileList(req); + for(DataObject fileInfo : fileInfoList) { + List mosaicInfos = mosaicBean.getMosaicList(fileInfo.string("FILE_ID")); + if(mosaicInfos != null) { + String mosaic = ""; + for(int i=0; i < mosaicInfos.size(); i++) { + DataObject mosaicInfo = mosaicInfos.get(i); + if(i != 0) { + mosaic += "|"; + } + mosaic += mosaicInfo.string("X_AXS") + + "," + mosaicInfo.string("Y_AXS") + + "," + mosaicInfo.string("MOSC_LT") + + "," + mosaicInfo.string("MOSC_HG"); + } + fileInfo.set("MOSAIC", mosaic); + } else { + fileInfo.set("MOSAIC", ""); + } + + } + mav = setCollectionInfo(mav,fileInfoList,"file"); + return mav; } /** 메뉴얼을 다운로드한다. diff --git a/src/main/java/cokr/xit/fims/cmmn/dao/MosaicMapper.java b/src/main/java/cokr/xit/fims/cmmn/dao/MosaicMapper.java new file mode 100644 index 00000000..f9c3f09f --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/dao/MosaicMapper.java @@ -0,0 +1,19 @@ +package cokr.xit.fims.cmmn.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 { + + /**파일의 모자이크 정보를 조회한다.
+ * @param fileId 파일ID + * @return 모자이크 정보 + */ + List selectMosaicList(String fileId); + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/MosaicBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/MosaicBean.java new file mode 100644 index 00000000..20e17a4a --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/MosaicBean.java @@ -0,0 +1,26 @@ +package cokr.xit.fims.cmmn.service.bean; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.fims.cmmn.dao.MosaicMapper; +import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.data.DataObject; + +@Component("mosaicBean") +public class MosaicBean extends AbstractComponent { + + @Resource(name = "mosaicMapper") + private MosaicMapper mosaicMapper; + + /**파일의 모자이크 정보를 조회한다.
+ * @param fileId 파일ID + * @return 모자이크 정보 + */ + public List getMosaicList(String fileId){ + return mosaicMapper.selectMosaicList(fileId); + } +} diff --git a/src/main/resources/sql/mapper/fims/cmmn/mosaic-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/mosaic-mapper.xml new file mode 100644 index 00000000..e768b98c --- /dev/null +++ b/src/main/resources/sql/mapper/fims/cmmn/mosaic-mapper.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp index f40ba449..76e09288 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp @@ -701,14 +701,14 @@ $(document).ready(function(){ $("#nextDataFiles--${pageName}").html(""); currentDataFileList.forEach(function(item, index, array){ - var output = fnMakeImgTag(item.URL, item.FILE_NM); + var output = fnMakeImgTag(item.URL, item.FILE_NM,"cur"+item.FILE_ID+'${pageName}',item.MOSAIC); $("#curDataFiles--${pageName}").append(output); }); nextDataFileList.forEach(function(item, index, array){ - var output = fnMakeImgTag(item.URL, item.FILE_NM); + var output = fnMakeImgTag(item.URL, item.FILE_NM,"next"+item.FILE_ID+'${pageName}',item.MOSAIC); $("#nextDataFiles--${pageName}").append(output); }); - + } }); diff --git a/src/main/webapp/WEB-INF/jsp/include/top.jsp b/src/main/webapp/WEB-INF/jsp/include/top.jsp index ba7d6da5..76745c8e 100644 --- a/src/main/webapp/WEB-INF/jsp/include/top.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/top.jsp @@ -33,13 +33,13 @@
-
+
-
+