Преглед изворни кода

Merge remote-tracking branch 'origin/xodud1202' into develop

card007 пре 5 година
родитељ
комит
bd117bdbc4

+ 16 - 2
src/main/java/com/style24/front/biz/web/TsfCartController.java

@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.ui.Model;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -183,9 +184,22 @@ public class TsfCartController extends TsfBaseController {
 		}
 		}
 
 
 		// 수량 및 금액 다다익선 최소 조건 조회
 		// 수량 및 금액 다다익선 최소 조건 조회
-		List<Order> result = (ArrayList<Order>) cartService.selectTmtbSalesValueList(param);
+		List<Order> tmtbSalesValueList = (ArrayList<Order>) cartService.selectTmtbSalesValueList(param);
 		// 조건 멘트 적용
 		// 조건 멘트 적용
-
+		StringBuilder tmtbDcDesc = new StringBuilder();
+		for(Order tmtbDcValue : tmtbSalesValueList) {
+			if(!StringUtils.isEmpty(tmtbDcValue.getDefaultYn()) && "Y".equals(tmtbDcValue.getDefaultYn())) {
+				if(TscConstants.ApplyGb.QTY.value().equals(tmtbDcValue.getSectionGb())) {
+					tmtbDcDesc.append(tmtbDcValue.getSectionVal()).append("개 이상 구매시 ");
+				} else if (TscConstants.ApplyGb.AMT.value().equals(tmtbDcValue.getSectionGb())) {
+					tmtbDcDesc.append(tmtbDcValue.getSectionVal()).append("원 이상 구매시 ");
+				}
+
+				if(TscConstants.DcWay.AMT.value().equals(tmtbDcValue.getDcWay())) {
+					tmtbDcDesc.append(tmtbDcValue.getDcVal()).append("원 할인");
+				}
+			}
+		}
 
 
 		// 다다익선 상품 조회 (수량, 금액 섞어서)
 		// 다다익선 상품 조회 (수량, 금액 섞어서)
 		mav.addObject("goodsList", goodsService.getTmtbGoodsList(param));
 		mav.addObject("goodsList", goodsService.getTmtbGoodsList(param));

+ 0 - 2
src/main/webapp/WEB-INF/views/web/cart/CartDelvFeeSaveGoodsPopupWeb.html

@@ -27,8 +27,6 @@
 													</th:block>
 													</th:block>
 												</p>
 												</p>
 											</a>
 											</a>
-											<input type="text" th:value="${goods.goodsCd}">
-											<input type="text" th:value="${goods.optCd}">
 											<button type="button" class="btn btn_default btn_sm" th:onclick="fnAddCartDelvFeeSaveGoods([[${goods.goodsCd}]], [[${goods.optCd}]])"><span>쇼핑백 담기</span></button>
 											<button type="button" class="btn btn_default btn_sm" th:onclick="fnAddCartDelvFeeSaveGoods([[${goods.goodsCd}]], [[${goods.optCd}]])"><span>쇼핑백 담기</span></button>
 										</div>
 										</div>
 									</div>
 									</div>

+ 1 - 1
src/main/webapp/WEB-INF/views/web/cart/CartTmtbSalesGoodsPopupWeb.html

@@ -3,7 +3,7 @@
 <!-- 배송비 SAVE 상품보기, 다다익선 할인 상품 보기 -->
 <!-- 배송비 SAVE 상품보기, 다다익선 할인 상품 보기 -->
 <div class="modal-dialog" role="document">
 <div class="modal-dialog" role="document">
 	<div class="modal-content"><div class="modal-header">
 	<div class="modal-content"><div class="modal-header">
-		<h5 class="modal-title" id="moresaleLabel">다다익선 상품</h5><input type="text" th:value="${goodsList.size()}" />
+		<h5 class="modal-title" id="moresaleLabel">다다익선 상품</h5>
 	</div>
 	</div>
 		<div class="modal-body">
 		<div class="modal-body">
 			<div class="pop_cont">
 			<div class="pop_cont">

+ 7 - 0
src/main/webapp/ux/style24_link.js

@@ -252,6 +252,7 @@ var cfnOpenIpinCertify = function (redirectUrl, custParams) {
  * @author : xodud1202
  * @author : xodud1202
  */
  */
 function cfnAddCart(cartList) {
 function cfnAddCart(cartList) {
+	gagajf.showProgressbar(true);
 	let jsonData = JSON.stringify(cartList);
 	let jsonData = JSON.stringify(cartList);
 	
 	
 	$.ajax( {
 	$.ajax( {
@@ -260,6 +261,10 @@ function cfnAddCart(cartList) {
 		data : jsonData,
 		data : jsonData,
 		contentType: 'application/json',
 		contentType: 'application/json',
 		dataType : 'json',
 		dataType : 'json',
+		error : function(e) {
+			mcxDialog.alert("장바구니 등록이 실패했습니다.");
+			gagajf.showProgressbar(false);
+		},
 		success : function(result) {
 		success : function(result) {
 			if(result.message == "SUCCESS") {
 			if(result.message == "SUCCESS") {
 				if(result.cartGb == "C") {
 				if(result.cartGb == "C") {
@@ -317,6 +322,8 @@ function cfnAddCart(cartList) {
 			} else {
 			} else {
 				mcxDialog.alert(result.message);
 				mcxDialog.alert(result.message);
 			}
 			}
+			
+			gagajf.showProgressbar(false);
 		}
 		}
 	});
 	});
 }
 }