Prechádzať zdrojové kódy

상품 StringUtils 변경

eskim 5 rokov pred
rodič
commit
75d81f359b

+ 28 - 28
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -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(),"&lt;", "<"),"&gt;", ">"));
 			}
 			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>>() {

+ 12 - 12
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -7,12 +7,12 @@ import java.util.Collection;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.core.io.InputStreamResource;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
-import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -498,7 +498,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -539,7 +539,7 @@ public class TsaGoodsController extends TsaBaseController {
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -624,7 +624,7 @@ public class TsaGoodsController extends TsaBaseController {
 					} else {
 						for (GoodsNotiInfo tmpGoodsNotiInfo : goodsNotiInfoList) {
 							if ("Y".equals(tmpGoodsNotiInfo.getReqYn()) || "Y".equals(tmpGoodsNotiInfo.getDispYn())) {
-								if (StringUtils.isEmpty(tmpGoodsNotiInfo.getNiContent())) {
+								if (StringUtils.isBlank(tmpGoodsNotiInfo.getNiContent())) {
 									returnGoods += tmpGoods.getGoodsCd() + ",";
 									break;
 								}
@@ -1475,7 +1475,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -1676,7 +1676,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -1948,7 +1948,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -2071,7 +2071,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -2282,7 +2282,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -2307,7 +2307,7 @@ public class TsaGoodsController extends TsaBaseController {
 	public Collection<GoodsNaverLowestPrice> saveGoodsNaverPrice(@RequestBody GoodsSearch goodsSearch) {
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -2458,7 +2458,7 @@ public class TsaGoodsController extends TsaBaseController {
 	public Collection<FreeGoods> getFreeGoodsList(@RequestBody GoodsSearch goodsSearch) {
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 		log.info("[getFreeGoodsList] goodsSearch={}", goodsSearch);
@@ -2478,7 +2478,7 @@ public class TsaGoodsController extends TsaBaseController {
 	public GagaResponse updateFreeGoods(@RequestBody FreeGoods freeGoods) {
 
 		if (freeGoods.getNewSysImgNm() != null && !"".equals(freeGoods.getNewSysImgNm())) {
-			String sysImgNm =  freeGoods.getProductNo() + "_" + GagaDateUtil.getTodayDateTime() + "." + StringUtils.getFilenameExtension(freeGoods.getNewSysImgNm());
+			String sysImgNm =  freeGoods.getProductNo() + "_" + GagaDateUtil.getTodayDateTime() + "." + org.springframework.util.StringUtils.getFilenameExtension(freeGoods.getNewSysImgNm());
 
 			String imgUploadPath = env.getProperty("upload.default.target.path");
 			imgUploadPath = GagaFileUtil.getConcatenationPath(imgUploadPath, "display", "freegoods");

+ 1 - 1
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -272,7 +272,7 @@
 											<label class="rdoBtn"><input type="radio" name="changeableYn" id="changeableYnN" value="N"/>N</label>
 											<input type="hidden" id="changeableYnOrg" name="changeableYnOrg"/>
 										</td>
-										<th>신규가입구매가여부<em class="required" title="필수"></em></th>
+										<th>신규가입구매가여부<em class="required" title="필수"></em></th>
 										<td>
 											<label class="rdoBtn"><input type="radio" name="newCustOrdYn" id="newCustOrdYnY" value="Y" />Y</label>
 											<label class="rdoBtn"><input type="radio" name="newCustOrdYn" id="newCustOrdYnN" value="N"/>N</label>