|
@@ -88,27 +88,28 @@ public class TsaPlanService {
|
|
|
}
|
|
}
|
|
|
newFile.renameTo(uniqueFile);
|
|
newFile.renameTo(uniqueFile);
|
|
|
param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
|
|
param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
|
|
|
- }
|
|
|
|
|
- if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
|
|
|
|
|
- String imgInd = String.valueOf(ind);
|
|
|
|
|
- if (ind < 10) {
|
|
|
|
|
- imgInd = "0" + imgInd;
|
|
|
|
|
- }
|
|
|
|
|
- String planUploadPath = env.getProperty("upload.default.target.path");
|
|
|
|
|
- String yearMonth = GagaDateUtil.getToday().substring(0, 6);
|
|
|
|
|
- planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
|
|
|
|
|
- File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
|
|
|
|
|
- planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
|
|
|
|
|
- String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
|
|
|
|
|
- File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
|
|
|
|
|
- // Rename a file
|
|
|
|
|
- File path = new File(planUploadPath);
|
|
|
|
|
- if (!path.exists()) {
|
|
|
|
|
- path.mkdir();
|
|
|
|
|
- }
|
|
|
|
|
- newFile.renameTo(uniqueFile);
|
|
|
|
|
param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
|
|
param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
|
|
|
}
|
|
}
|
|
|
|
|
+// if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
|
|
|
|
|
+// String imgInd = String.valueOf(ind);
|
|
|
|
|
+// if (ind < 10) {
|
|
|
|
|
+// imgInd = "0" + imgInd;
|
|
|
|
|
+// }
|
|
|
|
|
+// String planUploadPath = env.getProperty("upload.default.target.path");
|
|
|
|
|
+// String yearMonth = GagaDateUtil.getToday().substring(0, 6);
|
|
|
|
|
+// planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
|
|
|
|
|
+// File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
|
|
|
|
|
+// planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
|
|
|
|
|
+// String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
|
|
|
|
|
+// File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
|
|
|
|
|
+// // Rename a file
|
|
|
|
|
+// File path = new File(planUploadPath);
|
|
|
|
|
+// if (!path.exists()) {
|
|
|
|
|
+// path.mkdir();
|
|
|
|
|
+// }
|
|
|
|
|
+// newFile.renameTo(uniqueFile);
|
|
|
|
|
+// param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
|
|
|
|
|
+// }
|
|
|
planDao.createPlanInfo(param);
|
|
planDao.createPlanInfo(param);
|
|
|
|
|
|
|
|
String[] brand = param.getMultiBrand();
|
|
String[] brand = param.getMultiBrand();
|
|
@@ -953,6 +954,8 @@ public class TsaPlanService {
|
|
|
|
|
|
|
|
//파일아이템 등록
|
|
//파일아이템 등록
|
|
|
String[] fileItemVal = param.getMultiPlanFile();
|
|
String[] fileItemVal = param.getMultiPlanFile();
|
|
|
|
|
+ String[] fileItemVal2 = param.getMultiPlanFile2();
|
|
|
|
|
+ String[] fileItemVal3 = param.getMultiPlanFile3();
|
|
|
int ind = 1;
|
|
int ind = 1;
|
|
|
for (int j = 0; j < fileItemVal.length; j++) {
|
|
for (int j = 0; j < fileItemVal.length; j++) {
|
|
|
String imgInd = String.valueOf(ind);
|
|
String imgInd = String.valueOf(ind);
|
|
@@ -973,6 +976,8 @@ public class TsaPlanService {
|
|
|
}
|
|
}
|
|
|
newFile.renameTo(uniqueFile);
|
|
newFile.renameTo(uniqueFile);
|
|
|
filePlan.setItemVal("/planning/" + yearMonth + "/" + newFilename);
|
|
filePlan.setItemVal("/planning/" + yearMonth + "/" + newFilename);
|
|
|
|
|
+ filePlan.setLinkUrl(fileItemVal2[j]);
|
|
|
|
|
+ filePlan.setLinkOpenGb((fileItemVal3[j]));
|
|
|
planDao.createPlanContentsItem(filePlan);
|
|
planDao.createPlanContentsItem(filePlan);
|
|
|
ind++;
|
|
ind++;
|
|
|
}
|
|
}
|