Bladeren bron

모바일 주문서수정

jsh77b 5 jaren geleden
bovenliggende
commit
88dccba5cb

+ 11 - 0
src/main/java/com/style24/front/biz/web/TsfOrderController.java

@@ -444,6 +444,9 @@ public class TsfOrderController extends TsfBaseController {
 
 		// 3.2 배송정보조회(장바구니상품목록)
 		GagaMap delvOrderMap = coreOrderService.getCartDelvGoodsCntList(tmtbGoodsApplyList, order);
+		
+		// 3.3 할인정보조회(상품금액, 선포인트, 다다익선할인금액)
+		GagaMap goodsDcAmtMap = coreOrderService.getGoodsDcAmt(tmtbGoodsApplyList);
 				
 		ModelAndView mav = new ModelAndView();
 		mav.addObject("goodsTotCnt" 		, delvOrderMap.get("goodsTotCnt"));			// 총상품건수
@@ -453,6 +456,14 @@ public class TsfOrderController extends TsfBaseController {
 		mav.addObject("wmsCnt" 				, delvOrderMap.get("wmsCnt"));				// 자사일반상품건수
 		mav.addObject("isLogin"				, TsfSession.isLogin());					// 로그인여부
 		mav.addObject("IMG_PATH"			, env.getProperty("upload.goods.view"));	// 이미지경로
+		mav.addObject("isLogin"				, TsfSession.isLogin());					// 로그인여부
+		
+		// 4.2 할인정보(상품금액, 즉시할인, 다다익선, 선포인트, 적립예정포인트) 
+		mav.addObject("orgGoodsSumAmt"		, goodsDcAmtMap.get("orgGoodsSumAmt"));		// 상품금액합계
+		mav.addObject("cpn1DcSumAmt"		, goodsDcAmtMap.get("cpn1DcSumAmt"));		// 즉시할인금액합계
+		mav.addObject("tmtbDcSumAmt"		, goodsDcAmtMap.get("tmtbDcSumAmt"));		// 다다익선할인금액합계
+		mav.addObject("prePntDcAmt"			, goodsDcAmtMap.get("prePntDcAmt"));		// 선포인트사용가능금액
+		mav.addObject("savePntSumAmt"		, goodsDcAmtMap.get("savePntSumAmt"));		// 적립예정포인트합계
 		mav.setViewName(super.getDeviceViewName("order/OrderListInfo"));
 		
 		return mav;

+ 14 - 9
src/main/webapp/WEB-INF/views/mob/order/OrderFormMob.html

@@ -294,16 +294,21 @@
 										<dl>
 											<div>
 												<dt>주문금액</dt>
-												<dd><div><span class="orgGoodsSumAmt"></span>원</div></dd>
+												<dd><div><span class="orgGoodsSumAmt" th:text="${#numbers.formatInteger(orgGoodsSumAmt, 1, 'COMMA')}"></span>원</div></dd>
 											</div>
 											<div>
-												<dt>할인금액</dt>
-												<dd><div><span class="dcSumAmt"></span>원</div>
-												</dd>
+												<dt>배송비</dt>
+												<dd><div><span class="delvSumAmt" th:text="${#numbers.formatInteger(sumDelvFee, 1, 'COMMA')}"></span>원</div></dd>
 											</div>
 											<div>
-												<dt>배송비</dt>
-												<dd><div><span class="delvSumAmt"></span>원</div></dd>
+												<dt>할인금액</dt>
+													<th:block th:if="${cpn1DcSumAmt} > 0">
+														<dd><div><span class="dcSumAmt disc_amount" id="cpn1DcSumAmt" th:text="|-${#numbers.formatInteger(cpn1DcSumAmt, 1, 'COMMA')}|"></span>원</div></dd>
+													</th:block>
+													<th:block th:if="${cpn1DcSumAmt} < 1">
+														<dd><div><span class="dcSumAmt disc_amount" id="cpn1DcSumAmt" th:text="|${#numbers.formatInteger(cpn1DcSumAmt, 1, 'COMMA')}|"></span>원</div></dd>
+													</th:block>
+												</dd>
 											</div>
 										</dl>
 									</td>
@@ -1755,9 +1760,9 @@ var prePntDcAmtReset = function() {
 			
 			// 선포인트적용
 			if ($(this).val() == "Y") {
-				$("#prePntDcAmt").text("-"+rmPrePntAmt.addComma());
+				$("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+"원");
 			} else {
-				$("#prePntDcAmt").text("0");
+				$("#prePntDcAmt").text("0");
 			}
 			
 			// 쿠폰할인금액 SUM
@@ -1765,7 +1770,7 @@ var prePntDcAmtReset = function() {
 		});
 	});
 
-	$("#prePntDcAmt").text("-"+rmPrePntAmt.addComma());
+	$("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+"원");
 	
 	// 포인트기능 리렛
 	pntDcAmtReset();

+ 57 - 37
src/main/webapp/WEB-INF/views/mob/order/OrderListInfoMob.html

@@ -117,56 +117,76 @@
 					<dl>
 						<div>
 							<dt>상품금액</dt>
-							<dd><em id="orgGoodsSumAmt"></em>원</dd>
+							<dd><em id="orgGoodsSumAmt" th:text="${#numbers.formatInteger(orgGoodsSumAmt, 1, 'COMMA')}"></em>원</dd>
 						</div>
 						<div>
 							<dt>배송비</dt>
-							<dd><em id="delvSumAmt"></em>원</dd>
+							<dd><em id="delvSumAmt" th:text="${#numbers.formatInteger(sumDelvFee, 1, 'COMMA')}"></em>원</dd>
 						</div>
 						<div>
 							<dt>상품할인(즉시할인)</dt>
-							<dd>
-								<span class="disc_amount"><em id="cpn1DcSumAmt"></em>원</span>
-							</dd>
-						</div>
-						<div>
-							<dt>다다익선할인</dt>
-							<dd>
-								<span class="disc_amount"><em id="tmtbDcSumAmt"></em>원</span>
-							</dd>
-						</div>
-						<div>
-							<dt>쿠폰할인</dt>
-							<dd>
-								<span class="disc_amount"><em id="couponDcSumAmt"></em>원</span>
-							</dd>
-						</div>
-						<div>
-							<dt>선포인트 사용</dt>
-							<dd>
-								<span class="disc_amount"><em id="prePntDcAmt"></em>P</span>
-							</dd>
-						</div>
-						<div>
-							<dt>포인트 사용</dt>
-							<dd>
-								<span class="disc_amount"><em id="pntDcAmt"></em>P</span>
-							</dd>
-						</div>
-						<div>
-							<dt>상품권 사용</dt>
-							<dd>
-								<span class="disc_amount"><em id="gfcdUseAmt"></em>원</span>
-							</dd>
+							<th:block th:if="${cpn1DcSumAmt} > 0">
+								<dd><span class="disc_amount" id="cpn1DcSumAmt" th:text="|-${#numbers.formatInteger(cpn1DcSumAmt, 1, 'COMMA')} 원|"></span></dd>
+							</th:block>
+							<th:block th:if="${cpn1DcSumAmt} < 1">
+								<dd><span class="disc_amount" id="cpn1DcSumAmt" th:text="|${#numbers.formatInteger(cpn1DcSumAmt, 1, 'COMMA')} 원|"></span></dd>
+							</th:block>
 						</div>
+						
+						<!-- 회원인경우 노출 -->
+						<th:block th:if="${isLogin}">
+							<div>
+								<dt>다다익선할인</dt>
+								<th:block th:if="${tmtbDcSumAmt} > 0">
+									<dd><span class="disc_amount" id="tmtbDcSumAmt" th:text="|-${#numbers.formatInteger(tmtbDcSumAmt, 1, 'COMMA')} 원|"></span></dd>
+								</th:block>
+								<th:block th:if="${tmtbDcSumAmt} < 1">
+									<dd><span class="disc_amount" id="tmtbDcSumAmt" th:text="|${#numbers.formatInteger(tmtbDcSumAmt, 1, 'COMMA')} 원|"></span></dd>
+								</th:block>
+							</div>
+							<div>
+								<dt>쿠폰할인</dt>
+								<dd>
+									<span class="disc_amount"><em id="couponDcSumAmt"></em>원</span>
+								</dd>
+							</div>
+							<div>
+								<dt>선포인트 사용</dt>
+								<th:block th:if="${prePntDcAmt} > 0">
+									<dd><span class="disc_amount" id="prePntDcAmt" th:text="|-${#numbers.formatInteger(prePntDcAmt, 1, 'COMMA')} 원|"></span></dd>
+								</th:block>
+								<th:block th:if="${prePntDcAmt} < 1">
+									<dd><span class="disc_amount" id="prePntDcAmt" th:text="|${#numbers.formatInteger(prePntDcAmt, 1, 'COMMA')} 원|"></span></dd>
+								</th:block>
+							</div>
+							<div>
+								<dt>포인트 사용</dt>
+								<dd>
+									<span class="disc_amount"><em id="pntDcAmt"></em>P</span>
+								</dd>
+							</div>
+							<div>
+								<dt>상품권 사용</dt>
+								<dd>
+									<span class="disc_amount"><em id="gfcdUseAmt"></em>원</span>
+								</dd>
+							</div>
+						</th:block>
+						<!-- //회원인경우 노출 -->
 					</dl>
 				</div>
 				<div class="totalprice_box">
 					<dl>
 						<dt>총 결제 예정 금액</dt>
-						<dd data-weight="price" data-font="lato"><span id="savePntSumAmt"></span>원</dd>
+						<dd data-weight="price" data-font="lato"><span id="realOrdAmt"></span>원</dd>
 					</dl>
-					<p class="info_point"><span class="save_point" id="savePntSumAmt">P</span> 적립예정
+					<p class="info_point">
+						<th:blcok th:if="${isLogin}">
+							<span span class="save_point" id="savePntSumAmt" th:text="|${#numbers.formatInteger(savePntSumAmt, 1, 'COMMA')} P|"></span> 적립예정
+						</th:blcok>
+						<th:blcok th:if="!${isLogin}">
+							회원가입 후 구매하면&nbsp;&nbsp;<span span class="save_point" id="savePntSumAmt" th:text="|${#numbers.formatInteger(savePntSumAmt, 1, 'COMMA')} P|"></span> 적립예정
+						</th:blcok>
 					</p>
 					<p class="info_delivery">총 <span id="delvFeeCdCnt" th:text="${delvFeeCdCnt}"></span>건으로 나뉘어 배송 예정</p>
 				</div>