|
|
|
|
@ -1,19 +1,14 @@
|
|
|
|
|
package cokr.xit.adds.cmmn.hwp.format;
|
|
|
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.IntStream;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.applib.AppCmmnUtil;
|
|
|
|
|
import cokr.xit.applib.Print;
|
|
|
|
|
import cokr.xit.applib.PrintOption;
|
|
|
|
|
import cokr.xit.applib.hwp.format.HWPFormat;
|
|
|
|
|
import cokr.xit.base.docs.hwp.HWPWriter;
|
|
|
|
|
import cokr.xit.base.docs.hwp.Image;
|
|
|
|
|
import cokr.xit.foundation.data.DataFormat;
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
import kr.dogfoot.hwplib.object.HWPFile;
|
|
|
|
|
@ -170,18 +165,17 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if(this.formatFilePath.equals("template/hwp/photo_before_dispose.hwp")){
|
|
|
|
|
String userId = print.getPrintRequestUserInfo().getId();
|
|
|
|
|
String reqDt = print.getPrintRequestDt();
|
|
|
|
|
|
|
|
|
|
DataObject one = data2.get(currentRunCount-1);
|
|
|
|
|
DataObject newObj = new DataObject();
|
|
|
|
|
if(!one.string("폐기전사진1경로").equals("")) {
|
|
|
|
|
newObj.set("폐기전사진1제목", one.string("폐기전사진1제목"));
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기전사진1경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기전사진1경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기전사진1", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기전사진1경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기전사진1", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
@ -189,12 +183,9 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
if(!one.string("폐기전사진2경로").equals("")) {
|
|
|
|
|
newObj.set("폐기전사진2제목", one.string("폐기전사진2제목"));
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기전사진2경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기전사진2경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기전사진2", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기전사진2경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기전사진2", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
@ -202,12 +193,9 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
if(!one.string("폐기전사진3경로").equals("")) {
|
|
|
|
|
newObj.set("폐기전사진3제목", one.string("폐기전사진3제목"));
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기전사진3경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기전사진3경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기전사진3", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기전사진3경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기전사진3", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
@ -215,12 +203,9 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
if(!one.string("폐기전사진4경로").equals("")) {
|
|
|
|
|
newObj.set("폐기전사진4제목", one.string("폐기전사진4제목"));
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기전사진4경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기전사진4경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기전사진4", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기전사진4경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기전사진4", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
@ -228,12 +213,9 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
if(!one.string("폐기전사진5경로").equals("")) {
|
|
|
|
|
newObj.set("폐기전사진5제목", one.string("폐기전사진5제목"));
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기전사진5경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기전사진5경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기전사진5", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기전사진5경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기전사진5", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
@ -241,12 +223,9 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
if(!one.string("폐기전사진6경로").equals("")) {
|
|
|
|
|
newObj.set("폐기전사진6제목", one.string("폐기전사진6제목"));
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기전사진6경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기전사진6경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기전사진6", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기전사진6경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기전사진6", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
@ -254,78 +233,63 @@ public class DisposeProcessDetails extends HWPFormat {
|
|
|
|
|
writer.table(0, 1, 4).setValues(List.of(newObj));
|
|
|
|
|
|
|
|
|
|
} else if(this.formatFilePath.equals("template/hwp/photo_after_dispose.hwp")){
|
|
|
|
|
String userId = print.getPrintRequestUserInfo().getId();
|
|
|
|
|
String reqDt = print.getPrintRequestDt();
|
|
|
|
|
|
|
|
|
|
DataObject one = data3.get(currentRunCount-1-data2.size());
|
|
|
|
|
DataObject newObj = new DataObject();
|
|
|
|
|
newObj.set("폐기증거제목", one.string("폐기증거제목"));
|
|
|
|
|
|
|
|
|
|
if(!one.string("폐기증거사진1경로").equals("")) {
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기증거사진1경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기증거사진1경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기증거사진1", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기증거사진1경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기증거사진1", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!one.string("폐기증거사진2경로").equals("")) {
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기증거사진2경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기증거사진2경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기증거사진2", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기증거사진2경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기증거사진2", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!one.string("폐기증거사진3경로").equals("")) {
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기증거사진3경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기증거사진3경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기증거사진3", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기증거사진3경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기증거사진3", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!one.string("폐기증거사진4경로").equals("")) {
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기증거사진4경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기증거사진4경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기증거사진4", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기증거사진4경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기증거사진4", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!one.string("폐기증거사진5경로").equals("")) {
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기증거사진5경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기증거사진5경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기증거사진5", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기증거사진5경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기증거사진5", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!one.string("폐기증거사진6경로").equals("")) {
|
|
|
|
|
try {
|
|
|
|
|
String filename = FilenameUtils.getName(one.string("폐기증거사진6경로"));
|
|
|
|
|
byte[] baos = AppCmmnUtil.resizeImage(one.string("폐기증거사진6경로"));
|
|
|
|
|
InputStream is = new ByteArrayInputStream(baos);
|
|
|
|
|
Image img = writer.image().add(filename, is, null);
|
|
|
|
|
is.close();
|
|
|
|
|
newObj.set("폐기증거사진6", img);
|
|
|
|
|
String tempPath = AppCmmnUtil.getResizeImageTempPath(one.string("폐기증거사진6경로"), userId+"_"+reqDt);
|
|
|
|
|
this.tempFilesPath.add(tempPath);
|
|
|
|
|
newObj.set("폐기증거사진6", writer.image().add(tempPath));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|