|
|
|
@ -1,13 +1,12 @@
|
|
|
|
|
package cokr.xit.fims.cmmn;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.foundation.UserInfo;
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
|
|
|
|
|
public class Print {
|
|
|
|
|
|
|
|
|
@ -22,10 +21,15 @@ public class Print {
|
|
|
|
|
|
|
|
|
|
protected int fileNameIndex = 0;
|
|
|
|
|
|
|
|
|
|
private String formatName;
|
|
|
|
|
protected String extension;
|
|
|
|
|
|
|
|
|
|
private String formatKorName;
|
|
|
|
|
protected String formatName;
|
|
|
|
|
|
|
|
|
|
protected String formatKorName;
|
|
|
|
|
|
|
|
|
|
public String setExtension(String extension) {
|
|
|
|
|
return this.extension = extension;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getFormatName() {
|
|
|
|
|
return this.formatName;
|
|
|
|
@ -68,11 +72,6 @@ public class Print {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getTotalDataCount(List<DataObject> dataObjectList) {
|
|
|
|
|
int totalDataCount = dataObjectList.size();
|
|
|
|
|
return totalDataCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean getPrivateInfoYn(PrintOption printOption) {
|
|
|
|
|
|
|
|
|
|
boolean privateInfoYn = true;
|
|
|
|
@ -91,4 +90,24 @@ public class Print {
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String pathForNewFile(){
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
String currentTime = ymdhmsFormat.format(new Date());
|
|
|
|
|
String year = currentTime.substring(0, 4);
|
|
|
|
|
String month = currentTime.substring(4, 6);
|
|
|
|
|
String day = currentTime.substring(6, 8);
|
|
|
|
|
String formatFileResultRootPath = "files" + File.separator + "result" + File.separator + "print";
|
|
|
|
|
String formatFileResultFolderPath = formatFileResultRootPath
|
|
|
|
|
+ File.separator + year + File.separator + month + File.separator + day;
|
|
|
|
|
File formatFileResultFolder = new File(formatFileResultFolderPath);
|
|
|
|
|
if(!formatFileResultFolder.exists()) {
|
|
|
|
|
formatFileResultFolder.mkdirs();
|
|
|
|
|
}
|
|
|
|
|
String resultPath = formatFileResultFolderPath + File.separator + currentTime +"_"+ this.getFileNameIndex() + "."+this.extension;
|
|
|
|
|
|
|
|
|
|
this.setFileNameIndex(this.getFileNameIndex()+1);
|
|
|
|
|
|
|
|
|
|
return resultPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|