Ver Fonte

이태영 - 20210507 장바구니 적립 예정 포인트 수정

xodud lee há 5 anos atrás
pai
commit
728b477345

+ 2 - 0
src/main/java/com/style24/front/biz/service/TsfCartService.java

@@ -460,6 +460,8 @@ public class TsfCartService {
 			if ("N".equals(goods.getSoldoutYn()) && "Y".equals(goods.getOrdCanYn()) && goods.getGoodsQty() >= goods.getMinOrdQty() && goods.getGoodsQty() <= goods.getMaxOrdQty()) {
 				cartSqs.add(goods.getCartSq());
 			}
+
+			goods.setOrgSavePntAmt((int) (goods.getCurrPrice() * goods.getPntRate() / 100.0));
 		}
 
 		order.setCartSqArr(cartSqs.stream().mapToInt(Integer::intValue).toArray());

+ 11 - 3
src/main/webapp/WEB-INF/views/mob/cart/CartListAjaxFormMob.html

@@ -106,6 +106,7 @@
 						<input type="hidden" name="ordCanYn"  th:value="${cart.ordCanYn}" />
 						<input type="hidden" name="goodsCd"   th:value="${cart.goodsCd}" />
 						<input type="hidden" name="cartSq"    th:value="${cart.cartSq}" />
+						<input type="hidden" name="orgSavePntAmt" th:value="${cart.orgSavePntAmt}" />
 
 						<button type="button" class="btn_delete" th:onclick="|deleteCart(${cart.cartSq}, 'cart')|"><span><em class="sr-only">상품삭제</em></span></button>
 						<div class="goods_detail">
@@ -142,7 +143,7 @@
 									</th:block>
 								</div>
 								<div class="od_point">
-									<p class="point"><span th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>P 적립예정</p>
+									<p class="point"><span th:class="|point${cart.cartSq}|" th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>P 적립예정</p>
 								</div>
 								<div class="od_exinfo">
 									<span th:style="${(cart.qtyTmtbSq > 0 and cart.applyQtySectionYn == 'Y') or (cart.amtTmtbSq > 0 and cart.applyAmtSectionYn == 'Y') ? 'display:inline-block' : 'display:none'}" class="applyTmtb btn_moresale order_badge order_bullet_badge">다다익선 할인 적용</span>
@@ -208,6 +209,7 @@
 						<input type="hidden" name="ordCanYn"  th:value="${cart.ordCanYn}" />
 						<input type="hidden" name="goodsCd"   th:value="${cart.goodsCd}" />
 						<input type="hidden" name="cartSq"    th:value="${cart.cartSq}" />
+						<input type="hidden" name="orgSavePntAmt" th:value="${cart.orgSavePntAmt}" />
 
 						<button type="button" class="btn_delete" th:onclick="|deleteCart(${cart.cartSq}, 'cart')|"><span><em class="sr-only">상품삭제</em></span></button>
 						<div class="goods_detail">
@@ -244,7 +246,7 @@
 									</th:block>
 								</div>
 								<div class="od_point">
-									<p class="point"><span th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>P 적립예정</p>
+									<p class="point"><span th:class="|point${cart.cartSq}|" th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>P 적립예정</p>
 								</div>
 								<div class="od_exinfo">
 									<span th:style="${(cart.qtyTmtbSq > 0 and cart.applyQtySectionYn == 'Y') or (cart.amtTmtbSq > 0 and cart.applyAmtSectionYn == 'Y') ? 'display:inline-block' : 'display:none'}" class="applyTmtb btn_moresale order_badge order_bullet_badge">다다익선 할인 적용</span>
@@ -330,6 +332,7 @@
 						<input type="hidden" name="tmtbDcAmt" th:value="${cart.tmtbDcAmt}" />
 						<input type="hidden" name="goodsCd"   th:value="${cart.goodsCd}" />
 						<input type="hidden" name="cartSq"    th:value="${cart.cartSq}" />
+						<input type="hidden" name="orgSavePntAmt" th:value="${cart.orgSavePntAmt}" />
 
 						<button type="button" class="btn_delete"><span><em class="sr-only">상품삭제</em></span></button>
 						<div class="goods_detail">
@@ -366,7 +369,7 @@
 									</th:block>
 								</div>
 								<div class="od_point">
-									<p class="point"><span th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>P 적립예정</p>
+									<p class="point"><span th:class="|point${cart.cartSq}|" th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>P 적립예정</p>
 								</div>
 								<div class="od_exinfo">
 									<span th:style="${(cart.qtyTmtbSq > 0 and cart.applyQtySectionYn == 'Y') or (cart.amtTmtbSq > 0 and cart.applyAmtSectionYn == 'Y') ? 'display:inline-block' : 'display:none'}" class="applyTmtb btn_moresale order_badge order_bullet_badge">다다익선 할인 적용</span>
@@ -877,6 +880,8 @@
 						$(this).parent().find(".od_calc .selling_price>em").text($(this).parent().find(".od_calc .sale_price>del>em").text());
 						$(this).parent().find(".od_calc .sale_price").hide();
 					}
+
+					$(this).parent().find(".info_box .point" + $(this).val()).text(Number($(this).parent().find("input[name=orgSavePntAmt]").val()).toLocaleString());
 				});
 
 				for(let i = 0 ; i < shotList.length ; i++) {
@@ -886,6 +891,7 @@
 							let shot = shotList[i];
 							$(this).parent().find("input[name=applyQtySectionYn]").val(shot.applyQtySectionYn);
 							$(this).parent().find("input[name=applyAmtSectionYn]").val(shot.applyQtySectionYn);
+							$(this).parent().find(".info_box .point>span").text(Number(shot.savePntAmt).toLocaleString());
 
 							// 다다익선 적용 정보 생성성
 							if((shot.qtyTmtbSq > 0 && shot.applyQtySectionYn == "Y") || (shot.amtTmtbSq > 0 && shot.applyAmtSectionYn == "Y")) {
@@ -915,6 +921,7 @@
 							let wms = wmsList[i];
 							$(this).parent().find("input[name=applyQtySectionYn]").val(wms.applyQtySectionYn);
 							$(this).parent().find("input[name=applyAmtSectionYn]").val(wms.applyQtySectionYn);
+							$(this).parent().find(".info_box .point>span").text(Number(wms.savePntAmt).toLocaleString());
 
 							// 다다익선 적용 정보 생성성
 							if((wms.qtyTmtbSq > 0 && wms.applyQtySectionYn == "Y") || (wms.amtTmtbSq > 0 && wms.applyAmtSectionYn == "Y")) {
@@ -954,6 +961,7 @@
 							let delv = delvList[i];
 							$(this).parent().find("input[name=applyQtySectionYn]").val(delv.applyQtySectionYn);
 							$(this).parent().find("input[name=applyAmtSectionYn]").val(delv.applyQtySectionYn);
+							$(this).parent().find(".info_box .point>span").text(Number(delv.savePntAmt).toLocaleString());
 
 							// 다다익선 적용 정보 생성성
 							if((delv.qtyTmtbSq > 0 && delv.applyQtySectionYn == "Y") || (delv.amtTmtbSq > 0 && delv.applyAmtSectionYn == "Y")) {

+ 11 - 3
src/main/webapp/WEB-INF/views/web/cart/CartListAjaxFormWeb.html

@@ -95,6 +95,7 @@
 										<input type="hidden" name="ordCanYn" th:value="${cart.ordCanYn}" />
 										<input type="hidden" name="cartSq" th:value="${cart.cartSq}" />
 										<input type="hidden" name="goodsCd" th:value="${cart.goodsCd}" />
+										<input type="hidden" name="orgSavePntAmt" th:value="${cart.orgSavePntAmt}" />
 
 										<div class="order_desc">
 											<div class="form_box">
@@ -160,7 +161,7 @@
 												</th:block>
 												<p>
 													<span class="point">
-														<em th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정
+														<em th:class="|point${cart.cartSq}|" th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정
 													</span>
 												</p>
 											</div>
@@ -211,6 +212,7 @@
 										<input type="hidden" name="ordCanYn" th:value="${cart.ordCanYn}" />
 										<input type="hidden" name="cartSq" th:value="${cart.cartSq}" />
 										<input type="hidden" name="goodsCd" th:value="${cart.goodsCd}" />
+										<input type="hidden" name="orgSavePntAmt" th:value="${cart.orgSavePntAmt}" />
 
 										<div class="order_desc">
 											<div class="form_box">
@@ -270,7 +272,7 @@
 												</th:block>
 												<p>
 													<span class="point">
-														<em th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정
+														<em th:class="|point${cart.cartSq}|" th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정
 													</span>
 												</p>
 											</div>
@@ -331,6 +333,7 @@
 										<input type="hidden" name="tmtbDcAmt" th:value="${cart.tmtbDcAmt}" />
 										<input type="hidden" name="cartSq" th:value="${cart.cartSq}" />
 										<input type="hidden" name="goodsCd" th:value="${cart.goodsCd}" />
+										<input type="hidden" name="orgSavePntAmt" th:value="${cart.orgSavePntAmt}" />
 
 										<div class="order_desc">
 											<div class="form_box">
@@ -388,7 +391,7 @@
 												</th:block>
 												<p>
 													<span class="point">
-														<em th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정
+														<em th:class="|point${cart.cartSq}|" th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정
 													</span>
 												</p>
 											</div>
@@ -868,6 +871,8 @@
 					$(this).parent().find(".calc_box .price_sale").text($(this).parent().find(".calc_box .price_org").text());
 					$(this).parent().find(".calc_box .price_org").remove();
 				}
+
+				$(this).parent().find(".calc_box .point" + $(this).val()).text(Number($(this).parent().find("input[name=orgSavePntAmt]").val()).toLocaleString());
 			});
 
 			// $("#cartListForm").find(".delvFeeArea").html("<div class='info_dlvr'><span class='dlvr_fee'>배송비 무료</span></div>");
@@ -877,6 +882,7 @@
 						let shot = shotList[i];
 						$(this).parent().find("input[name=applyQtySectionYn]").val(shot.applyQtySectionYn);
 						$(this).parent().find("input[name=applyAmtSectionYn]").val(shot.applyQtySectionYn);
+						$(this).parent().find(".calc_box .point>em").text(Number(shot.savePntAmt).toLocaleString());
 
 						// 다다익선 적용 정보 생성성
 						if((shot.qtyTmtbSq > 0 && shot.applyQtySectionYn == "Y") || shot.amtTmtbSq > 0 && shot.applyAmtSectionYn == "Y") {
@@ -912,6 +918,7 @@
 						let wms = wmsList[i];
 						$(this).parent().find("input[name=applyQtySectionYn]").val(wms.applyQtySectionYn);
 						$(this).parent().find("input[name=applyAmtSectionYn]").val(wms.applyQtySectionYn);
+						$(this).parent().find(".calc_box .point>em").text(Number(wms.savePntAmt).toLocaleString());
 
 						// 다다익선 적용 정보 생성성
 						if((wms.qtyTmtbSq > 0 && wms.applyQtySectionYn == "Y") || (wms.amtTmtbSq > 0 && wms.applyAmtSectionYn == "Y")) {
@@ -937,6 +944,7 @@
 						let delv = delvList[i];
 						$(this).parent().find("input[name=applyQtySectionYn]").val(delv.applyQtySectionYn);
 						$(this).parent().find("input[name=applyAmtSectionYn]").val(delv.applyQtySectionYn);
+						$(this).parent().find(".calc_box .point>em").text(Number(delv.savePntAmt).toLocaleString());
 
 						// 다다익선 적용 정보 생성성
 						if((delv.qtyTmtbSq > 0 && delv.applyQtySectionYn == "Y") || (delv.amtTmtbSq > 0 && delv.applyAmtSectionYn == "Y")) {