|
|
@@ -1029,6 +1029,7 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
|
|
|
strBrandNo = String.valueOf(goodsInfo.getBrandNo());
|
|
|
}
|
|
|
+ String brandDir = GagaStringUtil.getLPadding(strBrandNo, 10, "0");
|
|
|
|
|
|
if (goodsImg.getMode().equals("C")) { // 업로드 된 파일 rename 처리
|
|
|
// String newFilename = goodsImg.getGoodsCd()
|
|
|
@@ -1038,22 +1039,29 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
// + "." + StringUtils.getFilenameExtension(goodsImg.getSysImgNm());
|
|
|
String newFilename = goodsImg.getSysImgNm();
|
|
|
|
|
|
- String brandDir = GagaFileUtil.getConcatenationPath(GagaStringUtil.getLPadding(strBrandNo, 10, "0"),GagaDateUtil.getToday()); // 브랜드/UPLOAD 일 YYYYMMDD
|
|
|
- String goodsUploadPath = GagaFileUtil.getConcatenationPath(goodsTargetPath, brandDir); //저장경로 생성
|
|
|
+ //브랜드 폴더 확인
|
|
|
+ String goodsUploadPath = GagaFileUtil.getConcatenationPath(goodsTargetPath, brandDir); // 브랜드 폴더
|
|
|
+ File brandPath = new File(goodsUploadPath);
|
|
|
+ if (!brandPath.exists()) {
|
|
|
+ brandPath.mkdir();
|
|
|
+ }
|
|
|
+
|
|
|
+ goodsUploadPath = GagaFileUtil.getConcatenationPath(goodsUploadPath, GagaDateUtil.getToday()); //브랜드+/+YYYYMMDD(UPLOAD 일 )
|
|
|
+ String brandYmdDir = GagaFileUtil.getConcatenationPath(brandDir, GagaDateUtil.getToday()); //디비 저장용
|
|
|
|
|
|
File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(goodsUploadPath, newFilename)));
|
|
|
File newFile = new File(GagaFileUtil.getConcatenationPath(goodsUploadPath, uniqueFile.getName()));
|
|
|
- //log.info("newFile.getPath(): {}", newFile.getPath());
|
|
|
+ log.info("newFile.getPath(): {}", newFile.getPath());
|
|
|
|
|
|
// resizing 처리 시 오류가 발생할 경우 삭제하기 위해 설정
|
|
|
errorFileList.add(newFile);
|
|
|
|
|
|
File oldFile = new File(GagaFileUtil.getConcatenationPath(dextUploadPath, goodsImg.getSysImgNm()));
|
|
|
- //log.info("oldFile.getPath(): {}", oldFile.getPath());
|
|
|
+ log.info("oldFile.getPath(): {}", oldFile.getPath());
|
|
|
|
|
|
File path = new File(goodsUploadPath);
|
|
|
if (!path.exists()) {
|
|
|
- //log.info("mkdir ={}", goodsUploadPath);
|
|
|
+ log.info("mkdir ={}", goodsUploadPath);
|
|
|
path.mkdir();
|
|
|
}
|
|
|
|
|
|
@@ -1064,8 +1072,8 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
}
|
|
|
|
|
|
goodsImg.setDispOrd(index++);
|
|
|
- goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(brandDir,newFile.getName()));
|
|
|
- goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(brandDir,newFile.getName()));
|
|
|
+ goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(brandYmdDir,newFile.getName()));
|
|
|
+ goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(brandYmdDir,newFile.getName()));
|
|
|
} else {
|
|
|
goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl() ,goodsImg.getSysImgNm()));
|
|
|
goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl() ,goodsImg.getSysImgNm()));
|