|
@@ -59,41 +59,37 @@ public class TsfCounselService {
|
|
|
String[] sysItem = counsel.getSysFileNmArr();
|
|
String[] sysItem = counsel.getSysFileNmArr();
|
|
|
|
|
|
|
|
for (int i = 0; i < orgItem.length; i++) {
|
|
for (int i = 0; i < orgItem.length; i++) {
|
|
|
- String imgInd = String.valueOf(ind);
|
|
|
|
|
- if (ind < 10) {
|
|
|
|
|
- imgInd = "0" + imgInd;
|
|
|
|
|
|
|
+ if (orgItem[i] != "") {
|
|
|
|
|
+ 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, "/counsel");
|
|
|
|
|
+ File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, sysItem[i]));
|
|
|
|
|
+ planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
|
|
|
|
|
+ String newFilename = "COUNSEL_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + org.springframework.util.StringUtils.getFilenameExtension(sysItem[i]);
|
|
|
|
|
+ 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);
|
|
|
|
|
+
|
|
|
|
|
+ if (i == 0) {
|
|
|
|
|
+ counsel.setOrgFileNm1(orgItem[i]);
|
|
|
|
|
+ counsel.setSysFileNm1("/counsel/" + yearMonth + "/" + newFilename);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ counsel.setOrgFileNm2(orgItem[i]);
|
|
|
|
|
+ counsel.setSysFileNm2("/counsel/" + yearMonth + "/" + newFilename);
|
|
|
|
|
+ }
|
|
|
|
|
+ ind++;
|
|
|
}
|
|
}
|
|
|
- String planUploadPath = env.getProperty("upload.default.target.path");
|
|
|
|
|
- String yearMonth = GagaDateUtil.getToday().substring(0, 6);
|
|
|
|
|
- planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/counsel");
|
|
|
|
|
- File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, sysItem[i]));
|
|
|
|
|
- planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
|
|
|
|
|
- String newFilename = "COUNSEL_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + org.springframework.util.StringUtils.getFilenameExtension(sysItem[i]);
|
|
|
|
|
- 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);
|
|
|
|
|
-
|
|
|
|
|
- if (i == 0) {
|
|
|
|
|
- counsel.setOrgFileNm1(orgItem[i]);
|
|
|
|
|
- counsel.setSysFileNm1("/counsel/" + yearMonth + "/" + newFilename);
|
|
|
|
|
- }else {
|
|
|
|
|
- counsel.setOrgFileNm2(orgItem[i]);
|
|
|
|
|
- counsel.setSysFileNm2("/counsel/" + yearMonth + "/" + newFilename);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- ind++;
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
counselDao.updateOneToOneQna(counsel);
|
|
counselDao.updateOneToOneQna(counsel);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|