|
|
|
@ -472,14 +472,13 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputStream is = null;
|
|
|
|
|
if(imagePath.startsWith("files")) {
|
|
|
|
|
File imageFile = new File(imagePath);
|
|
|
|
|
is = new FileInputStream(imageFile);
|
|
|
|
|
} else {
|
|
|
|
|
is = new ClassPathResource(imagePath).getInputStream();
|
|
|
|
|
if(!imagePath.startsWith("files")) {
|
|
|
|
|
imagePath = CmmnUtil.copyStaticResource(imagePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
File imageFile = new File(imagePath);
|
|
|
|
|
InputStream is = new FileInputStream(imageFile);
|
|
|
|
|
|
|
|
|
|
String imageKey = "";
|
|
|
|
|
if(otptArtclNm.equals("rprsCrdnPhoto")) {
|
|
|
|
|
imageKey = pdfFormat.getMappingValue(otptArtclNm+"Key",defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
|
|
|
|
@ -488,13 +487,8 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("")) {
|
|
|
|
|
|
|
|
|
|
InputStream is0 = null;
|
|
|
|
|
if(imagePath.startsWith("files")) {
|
|
|
|
|
File imageFile0 = new File(imagePath);
|
|
|
|
|
is0 = new FileInputStream(imageFile0);
|
|
|
|
|
} else {
|
|
|
|
|
is0 = new ClassPathResource(imagePath).getInputStream();
|
|
|
|
|
}
|
|
|
|
|
InputStream is0 = new FileInputStream(imageFile0);
|
|
|
|
|
|
|
|
|
|
List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
|
|
|
|
|
imageKey, is0, new PstnAndSize(pstn[0],pstn[1], size[0], size[1])
|
|
|
|
@ -537,34 +531,30 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
|
|
|
|
|
|
for (int i=0; i< devideInfos.size(); i++){
|
|
|
|
|
PstnAndSize devideInfo = devideInfos.get(i);
|
|
|
|
|
String imagePath = imagePaths.get(i);
|
|
|
|
|
|
|
|
|
|
if(ifEmpty(imagePath, ()-> "").equals("")) {
|
|
|
|
|
if(ifEmpty(imagePaths.get(i), ()-> "").equals("")) {
|
|
|
|
|
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();
|
|
|
|
|
if(!imagePaths.get(i).startsWith("files")) {
|
|
|
|
|
imagePaths.set(i, CmmnUtil.copyStaticResource(imagePaths.get(i)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String imagePath = imagePaths.get(i);
|
|
|
|
|
|
|
|
|
|
File imageFile = new File(imagePath);
|
|
|
|
|
InputStream is = new FileInputStream(imageFile);
|
|
|
|
|
|
|
|
|
|
pdfPrintUtil.insertImage(doc, contentStream, is,
|
|
|
|
|
devideInfo.getPstn().to2Float(), devideInfo.getSize().to2Float());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm.equals("crdnPhoto") && !imageKeys.isEmpty()) {
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
InputStream is0 = new FileInputStream(imageFile0);
|
|
|
|
|
|
|
|
|
|
List<PstnAndSize> transformedMosaicInfos = mediaBean.getTransformedMosaic(
|
|
|
|
|
imageKeys.get(i), is0, devideInfo
|
|
|
|
@ -670,17 +660,15 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputStream orgnFileInputStream = null;
|
|
|
|
|
if(!orgnFilePath.startsWith("files")) {
|
|
|
|
|
orgnFilePath = CmmnUtil.copyStaticResource(orgnFilePath);;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(orgnFilePath.startsWith("files")) {
|
|
|
|
|
File orgnFile = new File(orgnFilePath);
|
|
|
|
|
if(!orgnFile.exists() || !orgnFile.canRead()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
orgnFileInputStream = new FileInputStream(orgnFile);
|
|
|
|
|
} else {
|
|
|
|
|
orgnFileInputStream = new ClassPathResource(orgnFilePath).getInputStream();
|
|
|
|
|
}
|
|
|
|
|
InputStream orgnFileInputStream = new FileInputStream(orgnFile);
|
|
|
|
|
|
|
|
|
|
String modifiedFileName = "P"+fileInfo.string("INF_KEY")+CmmnUtil.indexToAlphabet(j, true, true)+"."+"JPG";
|
|
|
|
|
|
|
|
|
|