|
|
@@ -4,11 +4,11 @@ import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Collection;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.StringUtils;
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
@@ -233,7 +233,7 @@ public class TsaGoodsService {
|
|
|
throw new IllegalStateException(message.getMessage("FAIL_1001"));
|
|
|
|
|
|
for (NotiInfo notiInfo : notiInfoList) {
|
|
|
- if (!StringUtils.isEmpty(notiInfo.getNiContent())) {
|
|
|
+ if (!StringUtils.isBlank(notiInfo.getNiContent())) {
|
|
|
notiInfo.setNiContent(GagaStringUtil.replace(GagaStringUtil.replace(notiInfo.getNiContent(),"<", "<"),">", ">"));
|
|
|
}
|
|
|
notiInfo.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
@@ -398,7 +398,7 @@ public class TsaGoodsService {
|
|
|
Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch); // map형식으로 조회
|
|
|
if (dataList != null && !dataList.isEmpty()) {
|
|
|
for (GagaMap gagaMap : dataList) {
|
|
|
- if (!StringUtils.isEmpty(gagaMap.get("SYS_IMG_NM").toString()) ) {
|
|
|
+ if (!StringUtils.isBlank(gagaMap.get("SYS_IMG_NM").toString()) ) {
|
|
|
gagaMap.set("SYS_IMG_NM", targetPath + '/' + gagaMap.get("SYS_IMG_NM").toString());
|
|
|
}
|
|
|
}
|
|
|
@@ -704,8 +704,8 @@ public class TsaGoodsService {
|
|
|
brand.setBrandCd(originGoods.getBrandCd());
|
|
|
Collection<Brand> brandList = businessService.getBrandList(brand);
|
|
|
if (brandList != null && !brandList.isEmpty()) {
|
|
|
- float pntPrate = 0;
|
|
|
- float pntMrate = 0;
|
|
|
+ float pntPrate = 0f;
|
|
|
+ float pntMrate = 0f;
|
|
|
for (Brand tmpBrand : brandList) {
|
|
|
if ("G009_10".equals(goods.getFormalGb())) {
|
|
|
pntPrate = tmpBrand.getPntPrate10();
|
|
|
@@ -745,8 +745,8 @@ public class TsaGoodsService {
|
|
|
brand.setBrandCd(originGoods.getBrandCd());
|
|
|
Collection<Brand> brandList = businessService.getBrandList(brand);
|
|
|
if (brandList != null && !brandList.isEmpty()) {
|
|
|
- float pntPrate = 0;
|
|
|
- float pntMrate = 0;
|
|
|
+ float pntPrate = 0f;
|
|
|
+ float pntMrate = 0f;
|
|
|
for (Brand tmpBrand : brandList) {
|
|
|
if ("G009_10".equals(goods.getFormalGb())) {
|
|
|
pntPrate = tmpBrand.getPntPrate10();
|
|
|
@@ -788,11 +788,11 @@ public class TsaGoodsService {
|
|
|
String goodsNumFlag = "";
|
|
|
for (Goods goods : goodsList) {
|
|
|
|
|
|
- if (!StringUtils.isEmpty(goodsCdFlag) && !StringUtils.isEmpty(goodsNumFlag)) {
|
|
|
+ if (!StringUtils.isBlank(goodsCdFlag) && !StringUtils.isBlank(goodsNumFlag)) {
|
|
|
throw new IllegalStateException("상품코드와 원코드 중 한 개의 셀에만 값을 입력해서 조회하세요.");
|
|
|
}
|
|
|
|
|
|
- if (!StringUtils.isEmpty(goods.getSupplyCompCd())) {
|
|
|
+ if (!StringUtils.isBlank(goods.getSupplyCompCd())) {
|
|
|
goods.setGoodsCd(goods.getSupplyCompCd());
|
|
|
}
|
|
|
|
|
|
@@ -857,7 +857,7 @@ public class TsaGoodsService {
|
|
|
// 검색어 변경
|
|
|
String goodsSnm = goodsDao.getGoodsSnm(goods.getGoodsCd());
|
|
|
Goods tmpGoods = goodsDao.getGoods(goods);
|
|
|
- if (tmpGoods != null && !StringUtils.isEmpty(tmpGoods.getGoodsSnm1())) {
|
|
|
+ if (tmpGoods != null && !StringUtils.isBlank(tmpGoods.getGoodsSnm1())) {
|
|
|
String[] arrGoodsSnm = tmpGoods.getGoodsSnm1().split(";");
|
|
|
StringBuilder tempGoodsSnm = new StringBuilder();
|
|
|
for (String loopGoodsSnm : arrGoodsSnm) {
|
|
|
@@ -1007,7 +1007,7 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
// 사용자 검색어를 검색어에 적용
|
|
|
String goodsSnm = goodsDao.getGoodsSnm(goods.getGoodsCd());
|
|
|
- if (!StringUtils.isEmpty(goods.getGoodsSnm1())) {
|
|
|
+ if (!StringUtils.isBlank(goods.getGoodsSnm1())) {
|
|
|
goods.setGoodsSnm1(GagaStringUtil.replace(goods.getGoodsSnm1(), " ", "")); // 빈값 삭제
|
|
|
String[] arrGoodsSnm = goods.getGoodsSnm1().split(";");
|
|
|
StringBuilder tempGoodsSnm = new StringBuilder();
|
|
|
@@ -1030,8 +1030,8 @@ public class TsaGoodsService {
|
|
|
brand.setBrandCd(goods.getBrandCd());
|
|
|
Collection<Brand> brandList = businessService.getBrandList(brand);
|
|
|
if (brandList != null && !brandList.isEmpty()) {
|
|
|
- float pntPrate = 0.0f;
|
|
|
- float pntMrate = 0.0f;
|
|
|
+ float pntPrate = 0f;
|
|
|
+ float pntMrate = 0f;
|
|
|
for (Brand tmpBrand : brandList) {
|
|
|
if ("G009_10".equals(goods.getFormalGb())) {
|
|
|
pntPrate = tmpBrand.getPntPrate10();
|
|
|
@@ -1386,7 +1386,7 @@ public class TsaGoodsService {
|
|
|
Goods extendGoods = new Goods();
|
|
|
extendGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
|
|
|
extendGoods = goodsDao.getGoods(extendGoods);
|
|
|
- if (StringUtils.isEmpty(extendGoods.getBrandCd())) {
|
|
|
+ if (StringUtils.isBlank(extendGoods.getBrandCd())) {
|
|
|
throw new IllegalStateException(message.getMessage("구성상품 중 " + goodsCompose.getCompsGoodsCd() + " 상품 정보를 확인해 주세요."));
|
|
|
}
|
|
|
|
|
|
@@ -1459,7 +1459,7 @@ public class TsaGoodsService {
|
|
|
Goods extendGoods = new Goods();
|
|
|
extendGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
|
|
|
extendGoods = goodsDao.getGoods(extendGoods);
|
|
|
- if (StringUtils.isEmpty(extendGoods.getBrandCd())) {
|
|
|
+ if (StringUtils.isBlank(extendGoods.getBrandCd())) {
|
|
|
throw new IllegalStateException(message.getMessage("구성상품 중 " + goodsCompose.getCompsGoodsCd() + " 상품 정보를 확인해 주세요."));
|
|
|
}
|
|
|
listPriceSum += extendGoods.getListPrice() * goodsCompose.getQty() ;
|
|
|
@@ -1500,9 +1500,9 @@ public class TsaGoodsService {
|
|
|
throw new IllegalStateException(message.getMessage("구성상품 중 기준 상품의 브랜드를 확인해 주세요."));
|
|
|
}
|
|
|
|
|
|
- float pntPrate = 0.0f;
|
|
|
- float pntMrate = 0.0f;
|
|
|
- float sellFeeRate = 0.0f;
|
|
|
+ float pntPrate = 0f;
|
|
|
+ float pntMrate = 0f;
|
|
|
+ float sellFeeRate = 0f;
|
|
|
String delvFeeCd = "";
|
|
|
for (Brand tmpBrand : brandList) {
|
|
|
|
|
|
@@ -1682,7 +1682,7 @@ public class TsaGoodsService {
|
|
|
goods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goods.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
- if (!StringUtils.isEmpty(goods.getGoodsTnm()) && !goods.getGoodsTnm().equals(goods.getGoodTnmInit())) {
|
|
|
+ if (!StringUtils.isBlank(goods.getGoodsTnm()) && !goods.getGoodsTnm().equals(goods.getGoodTnmInit())) {
|
|
|
|
|
|
// 상품이력 먼저 쌓기
|
|
|
goodsDao.createGoodsHst(goods);
|
|
|
@@ -1901,7 +1901,7 @@ public class TsaGoodsService {
|
|
|
noticeService.updateNotice(notice);
|
|
|
}
|
|
|
|
|
|
- if (!StringUtils.isEmpty(notice.getGoodsList())) {
|
|
|
+ if (!StringUtils.isBlank(notice.getGoodsList())) {
|
|
|
Collection<NoticeGoods> noticeGoodsList = null;
|
|
|
try {
|
|
|
noticeGoodsList = mapper.readValue(notice.getGoodsList(), new TypeReference<Collection<NoticeGoods>>() {
|
|
|
@@ -2086,10 +2086,10 @@ public class TsaGoodsService {
|
|
|
int cnt = 0;
|
|
|
for (GoodsPriceRes goodsPriceRes : goodsPriceList) {
|
|
|
|
|
|
- if (StringUtils.isEmpty(goodsPriceRes.getGoodsCd())) {
|
|
|
+ if (StringUtils.isBlank(goodsPriceRes.getGoodsCd())) {
|
|
|
return (cnt + 2) + "행의 상품코드를 확인해주세요";
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(goodsPriceRes.getResGoodsPrice())) {
|
|
|
+ if (StringUtils.isBlank(Integer.toString(goodsPriceRes.getResGoodsPrice()))) {
|
|
|
return (cnt + 2) + "행의 예약가격을 확인해주세요.";
|
|
|
}
|
|
|
if (goodsPriceRes.getResGoodsPrice() <= 0) {
|
|
|
@@ -2189,7 +2189,7 @@ public class TsaGoodsService {
|
|
|
if (video.getVideoSq() == null || video.getVideoSq() == 0) {
|
|
|
|
|
|
String videoSeq = goodsDao.getVideoSeq(video);
|
|
|
- if (StringUtils.isEmpty(videoSeq)) {
|
|
|
+ if (StringUtils.isBlank(videoSeq)) {
|
|
|
goodsDao.createVideo(video);
|
|
|
}else {
|
|
|
//video.setVideoSq(Integer.parseInt(videoSeq)); //why?
|
|
|
@@ -2200,7 +2200,7 @@ public class TsaGoodsService {
|
|
|
if (video.getVideoSq() == null || video.getVideoSq() == 0) {
|
|
|
String videoSeq = goodsDao.getVideoSeq(video);
|
|
|
|
|
|
- if (!StringUtils.isEmpty(videoSeq)) {
|
|
|
+ if (!StringUtils.isBlank(videoSeq)) {
|
|
|
video.setVideoSq(Integer.parseInt(videoSeq));
|
|
|
}
|
|
|
}
|
|
|
@@ -2240,12 +2240,12 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
String videoSeq = goodsDao.getVideoSeq(video);
|
|
|
|
|
|
- if (StringUtils.isEmpty(videoSeq)) {
|
|
|
+ if (StringUtils.isBlank(videoSeq)) {
|
|
|
goodsDao.createVideo(video);
|
|
|
}
|
|
|
|
|
|
videoSeq = goodsDao.getVideoSeq(video);
|
|
|
- if (!StringUtils.isEmpty(videoSeq)) {
|
|
|
+ if (!StringUtils.isBlank(videoSeq)) {
|
|
|
video.setVideoSq(Integer.parseInt(videoSeq));
|
|
|
}
|
|
|
goodsDao.saveVideoDispLoc(video);
|
|
|
@@ -2363,7 +2363,7 @@ public class TsaGoodsService {
|
|
|
|
|
|
// 2. 일 최초 조회이면 테이블 삭제
|
|
|
String regYmd = goodsDao.getGoodsNaverLowestPriceReqYmd();
|
|
|
- if (!StringUtils.isEmpty(regYmd) && !regYmd.equals(GagaDateUtil.getToday())) {
|
|
|
+ if (!StringUtils.isBlank(regYmd) && !regYmd.equals(GagaDateUtil.getToday())) {
|
|
|
goodsDao.deleteGoodsNaverLowestPrice();
|
|
|
}
|
|
|
|
|
|
@@ -2483,7 +2483,7 @@ public class TsaGoodsService {
|
|
|
goodsDao.saveAdKeyword(adKeyword);
|
|
|
}
|
|
|
|
|
|
- if (!StringUtils.isEmpty(adKeyword.getGoodsList())) {
|
|
|
+ if (!StringUtils.isBlank(adKeyword.getGoodsList())) {
|
|
|
Collection<AdKeywordGoods> adKeywordGoodsList = null;
|
|
|
try {
|
|
|
adKeywordGoodsList = mapper.readValue(adKeyword.getGoodsList(), new TypeReference<Collection<AdKeywordGoods>>() {
|