浏览代码

다다익선 오류 수정

jsh77b@naver.com 4 年之前
父节点
当前提交
d9c99e7519

+ 46 - 19
src/main/java/com/style24/front/biz/service/TsfCartService.java

@@ -942,24 +942,55 @@ public class TsfCartService {
 							cart.setQtyGoodsGb(apply.getQtyGoodsGb());
 							cart.setAmtGoodsGb(apply.getAmtGoodsGb());
 						}
-					} else if (TscConstants.GoodsGb.BASE.value().equals(apply.getQtyGoodsGb()) || TscConstants.GoodsGb.BASE.value().equals(apply.getAmtGoodsGb())) {
-						if (cart.getCartSq().equals(apply.getCartSq())) {
-							// 2021.02.24 jsh77b
-							if ("N".equals(apply.getApplyQtySectionYn())) {
-								cart.setApplyQtySectionYn(apply.getApplyQtySectionYn());
-								cart.setQtyTmtbNm(apply.getQtyTmtbNm());
-								cart.setQtyTmtbSq(apply.getQtyTmtbSq());
+					} 
+					else if (TscConstants.GoodsGb.BASE.value().equals(apply.getQtyGoodsGb()) || TscConstants.GoodsGb.BASE.value().equals(apply.getAmtGoodsGb())) {
+						
+						// 2022.01.05 적용상품에 있으면 기본상품이 적용되는 정보를 적용하지 않음 
+						Boolean temp1 = true;
+						Boolean temp2 = true;
+						
+						for (Order applyTemp : tmtbApplyList) {
+							if (TscConstants.GoodsGb.APPLY.value().equals(applyTemp.getQtyGoodsGb()) || TscConstants.GoodsGb.APPLY.value().equals(applyTemp.getAmtGoodsGb())) {
+								if (apply.getCartSq().equals(applyTemp.getCartSq())) {
+									
+									// 2021.11.11 추가 
+									if ("Y".equals(applyTemp.getApplyQtySectionYn())) {
+										temp1 = false;
+									}
+									
+									// 2021.11.11 추가 
+									if ("Y".equals(applyTemp.getApplyAmtSectionYn())) {
+										temp2 = false;
+									}
+								}
 							}
-							// 2021.11.11 추가 
-							if ("N".equals(apply.getApplyAmtSectionYn())) {
-								cart.setApplyAmtSectionYn(apply.getApplyAmtSectionYn());
-								cart.setAmtTmtbNm(apply.getAmtTmtbNm());
-								cart.setAmtTmtbSq(apply.getAmtTmtbSq());
+						}
+							
+						if (cart.getCartSq().equals(apply.getCartSq())) {
+							
+							// 수량 기본상품의 정보만 유일하게 존재
+							if (temp1) {
+								// 2021.02.24 jsh77b
+								if ("N".equals(apply.getApplyQtySectionYn())) {
+									cart.setApplyQtySectionYn(apply.getApplyQtySectionYn());
+									cart.setQtyTmtbNm(apply.getQtyTmtbNm());
+									cart.setQtyTmtbSq(apply.getQtyTmtbSq());
+								}
+								cart.setQtyGoodsGb(apply.getQtyGoodsGb());
 							}
 							
-							cart.setQtyGoodsGb(apply.getQtyGoodsGb());
-							cart.setAmtGoodsGb(apply.getAmtGoodsGb());
+							// 금액 기본상품의 정보만 유일하게 존재
+							if (temp2) {
+								// 2021.11.11 추가 
+								if ("N".equals(apply.getApplyAmtSectionYn())) {
+									cart.setApplyAmtSectionYn(apply.getApplyAmtSectionYn());
+									cart.setAmtTmtbNm(apply.getAmtTmtbNm());
+									cart.setAmtTmtbSq(apply.getAmtTmtbSq());
+								}
+								cart.setAmtGoodsGb(apply.getAmtGoodsGb());
+							}
 						}
+						
 					}
 				}
 			}
@@ -967,11 +998,7 @@ public class TsfCartService {
 			// 2021.11.11 다다익선 할인 적용된 상품 상품보기 숨김 처리 로직 추가
 			if (tmtbSqList != null && tmtbSqList.size() > 0) {
 				// 장바구니상품목록수정
-				for (Order cart : cartGoodsList) {
-					
-					log.info("cart.getQtyGoodsGb() ::: {}", cart.getQtyGoodsGb());
-					log.info("cart.getAmtGoodsGb() ::: {}", cart.getAmtGoodsGb());
-					
+				for (Order cart : cartGoodsList) {					
 					// 기본상품일때 
 					if (TscConstants.GoodsGb.BASE.value().equals(cart.getQtyGoodsGb()) || TscConstants.GoodsGb.BASE.value().equals(cart.getAmtGoodsGb())) {
 						for (Order tmtbSq : tmtbSqList) {

+ 1 - 1
src/main/webapp/WEB-INF/views/web/order/OrderFormWeb.html

@@ -617,7 +617,7 @@ $(document).ready( function() {
 	custemerInfoSet();
 	
 	// 999. 개발화면정보설정
-	var devTemp = false;
+	var devTemp = true;
 	var arr = []
 	arr[0] = "orderInfo";
 	arr[1] = "freegiftInfo";