|
|
@ -2,6 +2,7 @@ package cokr.xit.fims.sprt.service.bean;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.io.FileWriter;
|
|
|
|
import java.io.FileWriter;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.InputStream;
|
|
|
@ -466,27 +467,50 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
} else if(prototypeStng.getComponentType().equals("image")) {
|
|
|
|
} else if(prototypeStng.getComponentType().equals("image")) {
|
|
|
|
|
|
|
|
|
|
|
|
String imagePath = pdfFormat.getMappingValue(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
|
String imagePath = pdfFormat.getMappingValue(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ifEmpty(imagePath, ()->"").equals("")) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InputStream is = null;
|
|
|
|
|
|
|
|
if(imagePath.startsWith("files")) {
|
|
|
|
|
|
|
|
File imageFile = new File(imagePath);
|
|
|
|
|
|
|
|
is = new FileInputStream(imageFile);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
is = new ClassPathResource(imagePath).getInputStream();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String imageKey = "";
|
|
|
|
String imageKey = "";
|
|
|
|
if(otptArtclNm.equals("rprsCrdnPhoto")) {
|
|
|
|
if(otptArtclNm.equals("rprsCrdnPhoto")) {
|
|
|
|
imageKey = pdfFormat.getMappingValue(otptArtclNm+"Key",defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
|
imageKey = pdfFormat.getMappingValue(otptArtclNm+"Key",defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, imagePath, pstn, size);
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, is, pstn, size);
|
|
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("")) {
|
|
|
|
if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("")) {
|
|
|
|
String blackImage = "samplefiles/black.png";
|
|
|
|
|
|
|
|
|
|
|
|
InputStream is0 = null;
|
|
|
|
|
|
|
|
if(imagePath.startsWith("files")) {
|
|
|
|
|
|
|
|
File imageFile0 = new File(imagePath);
|
|
|
|
|
|
|
|
is0 = new FileInputStream(imageFile0);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
is0 = new ClassPathResource(imagePath).getInputStream();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
|
|
|
|
List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
|
|
|
|
imageKey, imagePath, new PstnAndSize(pstn[0],pstn[1], size[0], size[1])
|
|
|
|
imageKey, is0, new PstnAndSize(pstn[0],pstn[1], size[0], size[1])
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
for(int k=0; k < transformedMosaicInfos.size(); k++) {
|
|
|
|
for(int k=0; k < transformedMosaicInfos.size(); k++) {
|
|
|
|
PstnAndSize mosaicInfo = transformedMosaicInfos.get(k);
|
|
|
|
PstnAndSize mosaicInfo = transformedMosaicInfos.get(k);
|
|
|
|
|
|
|
|
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, blackImage,
|
|
|
|
InputStream blackImageStream = new ClassPathResource("samplefiles/black.png").getInputStream();
|
|
|
|
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, blackImageStream,
|
|
|
|
mosaicInfo.getPstn().to2Float(), mosaicInfo.getSize().to2Float());
|
|
|
|
mosaicInfo.getPstn().to2Float(), mosaicInfo.getSize().to2Float());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if(prototypeStng.getComponentType().equals("images")) {
|
|
|
|
} else if(prototypeStng.getComponentType().equals("images")) {
|
|
|
|
|
|
|
|
|
|
|
|
List<String> imagePaths = pdfFormat.getMappingValues(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
|
List<String> imagePaths = pdfFormat.getMappingValues(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
@ -513,22 +537,43 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i< devideInfos.size(); i++){
|
|
|
|
for (int i=0; i< devideInfos.size(); i++){
|
|
|
|
PstnAndSize devideInfo = devideInfos.get(i);
|
|
|
|
PstnAndSize devideInfo = devideInfos.get(i);
|
|
|
|
|
|
|
|
String imagePath = imagePaths.get(i);
|
|
|
|
|
|
|
|
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream,
|
|
|
|
if(ifEmpty(imagePath, ()-> "").equals("")) {
|
|
|
|
imagePaths.get(i), devideInfo.getPstn().to2Float(), devideInfo.getSize().to2Float());
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InputStream is = null;
|
|
|
|
|
|
|
|
if(imagePaths.get(i).startsWith("files")) {
|
|
|
|
|
|
|
|
File imageFile = new File(imagePath);
|
|
|
|
|
|
|
|
is = new FileInputStream(imageFile);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
is = new ClassPathResource(imagePath).getInputStream();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, is,
|
|
|
|
|
|
|
|
devideInfo.getPstn().to2Float(), devideInfo.getSize().to2Float());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm.equals("crdnPhoto") && !imageKeys.isEmpty()) {
|
|
|
|
if(otptArtclNm.equals("crdnPhoto") && !imageKeys.isEmpty()) {
|
|
|
|
String blackImage = "samplefiles/black.png";
|
|
|
|
|
|
|
|
|
|
|
|
InputStream is0 = null;
|
|
|
|
|
|
|
|
String imagePath0 = imagePaths.get(i);
|
|
|
|
|
|
|
|
if(imagePath0.startsWith("files")) {
|
|
|
|
|
|
|
|
File imageFile0 = new File(imagePath0);
|
|
|
|
|
|
|
|
is0 = new FileInputStream(imageFile0);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
is0 = new ClassPathResource(imagePath0).getInputStream();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
|
|
|
|
List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
|
|
|
|
imageKeys.get(i), imagePaths.get(i), devideInfo
|
|
|
|
imageKeys.get(i), is0, devideInfo
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
for(int k=0; k < transformedMosaicInfos.size(); k++) {
|
|
|
|
for(int k=0; k < transformedMosaicInfos.size(); k++) {
|
|
|
|
PstnAndSize mosaicInfo = transformedMosaicInfos.get(k);
|
|
|
|
PstnAndSize mosaicInfo = transformedMosaicInfos.get(k);
|
|
|
|
|
|
|
|
InputStream blackImageStream = new ClassPathResource("samplefiles/black.png").getInputStream();
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, blackImage,
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, blackImageStream,
|
|
|
|
mosaicInfo.getPstn().to2Float(), mosaicInfo.getSize().to2Float());
|
|
|
|
mosaicInfo.getPstn().to2Float(), mosaicInfo.getSize().to2Float());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -540,7 +585,7 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}//출력항목 loop 끝
|
|
|
|
|
|
|
|
|
|
|
|
if(!completeFoldLine) {
|
|
|
|
if(!completeFoldLine) {
|
|
|
|
if(!otptBscStng.string("FOLD_LINE_PSTN_SE_CD").equals("")) {
|
|
|
|
if(!otptBscStng.string("FOLD_LINE_PSTN_SE_CD").equals("")) {
|
|
|
@ -549,7 +594,8 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
contentStream.close();
|
|
|
|
contentStream.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} //출력자료건수 loop 끝
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doc.save(resultFilePath);
|
|
|
|
doc.save(resultFilePath);
|
|
|
@ -619,12 +665,22 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
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 = mediaBean.getMosaicList(fileInfo.string("FILE_ID"));
|
|
|
|
List<DataObject> mosaicInfos = mediaBean.getMosaicList(fileInfo.string("FILE_ID"));
|
|
|
|
|
|
|
|
String orgnFilePath = fileInfo.string("FILE_PATH");
|
|
|
|
|
|
|
|
if(ifEmpty(orgnFilePath, ()->"").equals("")) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
File orgnFile = new File(fileInfo.string("FILE_PATH"));
|
|
|
|
InputStream orgnFileInputStream = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(orgnFilePath.startsWith("files")) {
|
|
|
|
|
|
|
|
File orgnFile = new File(orgnFilePath);
|
|
|
|
if(!orgnFile.exists() || !orgnFile.canRead()) {
|
|
|
|
if(!orgnFile.exists() || !orgnFile.canRead()) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
orgnFileInputStream = new FileInputStream(orgnFile);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
orgnFileInputStream = new ClassPathResource(orgnFilePath).getInputStream();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String modifiedFileName = "P"+fileInfo.string("INF_KEY")+CmmnUtil.indexToAlphabet(j, true)+"."+"JPG";
|
|
|
|
String modifiedFileName = "P"+fileInfo.string("INF_KEY")+CmmnUtil.indexToAlphabet(j, true)+"."+"JPG";
|
|
|
|
|
|
|
|
|
|
|
@ -633,9 +689,9 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
File modifiedFile = new File(modifiedFilePath);
|
|
|
|
File modifiedFile = new File(modifiedFilePath);
|
|
|
|
|
|
|
|
|
|
|
|
if(mosaicInfos != null) {
|
|
|
|
if(mosaicInfos != null) {
|
|
|
|
CmmnUtil.createMaskedImage(orgnFile, modifiedFile, mosaicInfos);
|
|
|
|
CmmnUtil.createMaskedImage(orgnFileInputStream, modifiedFile, mosaicInfos);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Files.copy(orgnFile.toPath(), modifiedFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
Files.copy(orgnFileInputStream, modifiedFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dataObject.set("CRDN_PHOTO"+(j+1), modifiedFilePath);
|
|
|
|
dataObject.set("CRDN_PHOTO"+(j+1), modifiedFilePath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|