|
@@ -131,7 +131,7 @@ public class NoticeService {
|
|
|
paramMap.put("bContent", param.getBcontent());
|
|
|
paramMap.put("bSubject", param.getBsubject());
|
|
|
paramMap.put("webUserId", webUserId);
|
|
|
-
|
|
|
+ log.info("{}",attachFile);
|
|
|
if (attachFile != null && attachFile.size() > 0){
|
|
|
|
|
|
for (MultipartFile file : attachFile) {
|
|
@@ -153,16 +153,23 @@ public class NoticeService {
|
|
|
}
|
|
|
|
|
|
if (success.equals("S")) {
|
|
|
- int fileSize = attachFile.size();
|
|
|
+ if (attachFile != null) {
|
|
|
+ int fileSize = attachFile.size();
|
|
|
|
|
|
- if (fileSize == 1) {
|
|
|
- fileNames = fileNames + "|";
|
|
|
- fileIds = fileIds + "|";
|
|
|
+ if (attachFile != null && fileSize == 1) {
|
|
|
+ fileNames = fileNames + "|";
|
|
|
+ fileIds = fileIds + "|";
|
|
|
+ }
|
|
|
+ else if (fileSize == 3) {
|
|
|
+ fileNames = fileNames.substring(fileNames.length() - 1);
|
|
|
+ fileIds = fileIds.substring(fileIds.length() - 1);
|
|
|
+ }
|
|
|
}
|
|
|
- else if (fileSize == 3) {
|
|
|
- fileNames = fileNames.substring(fileNames.length() - 1);
|
|
|
- fileIds = fileIds.substring(fileIds.length() - 1);
|
|
|
+ else {
|
|
|
+ fileNames = "||";
|
|
|
+ fileIds = "||";
|
|
|
}
|
|
|
+
|
|
|
paramMap.put("attachFile", fileNames);
|
|
|
paramMap.put("attachFileId", fileIds);
|
|
|
int affectedRows = this.mapper.insertNotice(paramMap);
|
|
@@ -188,7 +195,6 @@ public class NoticeService {
|
|
|
String message = "작성하신 게시물이 수정되었습니다.";
|
|
|
|
|
|
NoticeDto dto = this.findNotice(param.getBoardNo());
|
|
|
-
|
|
|
if (dto != null) {
|
|
|
if (!attachFileNames.equals(dto.getAttachFile())) {
|
|
|
String originAttachFile = dto.getAttachFile();
|
|
@@ -251,10 +257,15 @@ public class NoticeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (sameIndex.size() == 3) {
|
|
|
- fileId = sameIndex.get(0) + "|" +sameIndex.get(1) + "|" + sameIndex.get(2);
|
|
|
+ fileId = "";
|
|
|
+ for (int ii = 0; ii < 3; ii++) {
|
|
|
+ if (sameIndex.get(ii) != null) {
|
|
|
+ fileId += sameIndex.get(ii);
|
|
|
+ }
|
|
|
+ if (ii != 2) {
|
|
|
+ fileId += "|";
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
paramMap.put("attachFile", attachFileNames);
|