|
|
@@ -314,6 +314,7 @@ public class TsfCartService {
|
|
|
if(cartSqs.size() > 0) {
|
|
|
// 다다익선 할인 상품 조회 (품절 상품 제외)
|
|
|
Collection<Order> moreBetterAmtList = new ArrayList<Order>();
|
|
|
+ log.info("CHECK CUST_NO :::: {}", order.getCustNo());
|
|
|
if(order.getCustNo() > 0) {
|
|
|
moreBetterAmtList = getMoreBetterAmtList(order);
|
|
|
}
|
|
|
@@ -321,7 +322,7 @@ public class TsfCartService {
|
|
|
// 다다익선 할인 정보 및 상품 정보 장바구니에 등록
|
|
|
for (Order cart : cartGoodsList) {
|
|
|
for (Order info : moreBetterAmtList) {
|
|
|
- if (cart.getCartSq() == info.getCartSq()) {
|
|
|
+ if (cart.getCartSq().equals(info.getCartSq())) {
|
|
|
cart.setTmtbDcAmt(info.getTmtbDcAmt());
|
|
|
cart.setApplyAmtSectionYn(info.getApplyAmtSectionYn());
|
|
|
cart.setApplyQtySectionYn(info.getApplyQtySectionYn());
|
|
|
@@ -335,6 +336,9 @@ public class TsfCartService {
|
|
|
if (cart.getTmtbDcAmt() == 0) {
|
|
|
cart.setTmtbDcAmt(cart.getCurrPrice());
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK TMTB_DC_AMT :::: {} / {}", cart.getCartSq(), cart.getTmtbDcAmt());
|
|
|
+ log.info("CHECK TMTB_INFO :::: {} / {}", cart.getApplyQtySectionYn(), cart.getApplyAmtSectionYn());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -396,10 +400,14 @@ public class TsfCartService {
|
|
|
applyInfo.setQtyDcWay(section.getDcWay());
|
|
|
applyInfo.setQtyDcVal(section.getDcVal());
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK getQtyTmtbSq, getApplyQtySectionYn ::::: 1 / {} / {}", applyInfo.getQtyTmtbSq(), applyInfo.getApplyQtySectionYn());
|
|
|
} else {
|
|
|
if (applyInfo.getQtySectionVal() < 1 && applyInfo.getQtyGoodsGb().equals(TscConstants.GoodsGb.BASE.value())) {
|
|
|
applyInfo.setApplyQtySectionYn("N");
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK getQtyTmtbSq, getApplyQtySectionYn ::::: 2 / {} / {}", applyInfo.getQtyTmtbSq(), applyInfo.getApplyQtySectionYn());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -412,10 +420,14 @@ public class TsfCartService {
|
|
|
applyInfo.setAmtDcWay(section.getDcWay());
|
|
|
applyInfo.setAmtDcVal(section.getDcVal());
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK getAmtTmtbSq, getApplyAmtSectionYn ::::: 1 / {} / {}", applyInfo.getAmtTmtbSq(), applyInfo.getApplyAmtSectionYn());
|
|
|
} else {
|
|
|
if(applyInfo.getAmtSectionVal() < 1 && applyInfo.getAmtGoodsGb().equals(TscConstants.GoodsGb.BASE.value())) {
|
|
|
applyInfo.setApplyAmtSectionYn("N");
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK getAmtTmtbSq, getApplyAmtSectionYn ::::: 2 / {} / {}", applyInfo.getAmtTmtbSq(), applyInfo.getApplyAmtSectionYn());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -457,6 +469,8 @@ public class TsfCartService {
|
|
|
|
|
|
resultAmt.setTmtb1DcAmt(tempAmt - resultAmt.getTmtbDcAmt()); // tmtb1 할인금액
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK !!!!!!!!!!!!!!!!!! ::::: 1 {} / {}", resultAmt.getCartSq(), resultAmt.getTmtbDcAmt());
|
|
|
} else { // 할인 방식 할인율일 경우
|
|
|
tempAmt = resultAmt.getCurrPrice();
|
|
|
|
|
|
@@ -464,6 +478,8 @@ public class TsfCartService {
|
|
|
resultAmt.setTmtbDcAmt(tempAmt);
|
|
|
|
|
|
resultAmt.setTmtb1DcAmt((int) (tempAmt * (resultAmt.getQtyDcVal() / 100.0))); // tmtb1 할인금액
|
|
|
+
|
|
|
+ log.info("CHECK !!!!!!!!!!!!!!!!!! ::::: 2 {} / {}", resultAmt.getCartSq(), resultAmt.getTmtbDcAmt());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -507,12 +523,16 @@ public class TsfCartService {
|
|
|
|
|
|
resultAmt.setTmtb2DcAmt(tempAmt - resultAmt.getTmtbDcAmt()); // tmtb1 할인금액
|
|
|
}
|
|
|
+
|
|
|
+ log.info("CHECK !!!!!!!!!!!!!!!!!! ::::: 3 {} / {}", resultAmt.getCartSq(), resultAmt.getTmtbDcAmt());
|
|
|
} else { // 할인 방식 할인율일 경우
|
|
|
tempAmt = resultAmt.getCurrPrice();
|
|
|
tempAmt = (int) (tempAmt - (tempAmt * (resultAmt.getAmtDcVal() / 100.0)));
|
|
|
resultAmt.setTmtbDcAmt(tempAmt);
|
|
|
|
|
|
resultAmt.setTmtb2DcAmt((int) (resultAmt.getCurrPrice() * (resultAmt.getAmtDcVal() / 100.0))); // tmtb1 할인금액
|
|
|
+
|
|
|
+ log.info("CHECK !!!!!!!!!!!!!!!!!! ::::: 4 {} / {}", resultAmt.getCartSq(), resultAmt.getTmtbDcAmt());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -520,7 +540,7 @@ public class TsfCartService {
|
|
|
// 장바구니 정보에 수량 다다익선 정보 입력
|
|
|
for (Order cart : cartGoodsList) {
|
|
|
for (Order apply : tmtbApplyList) {
|
|
|
- if (cart.getCartSq() == apply.getCartSq()) {
|
|
|
+ if (cart.getCartSq().equals(apply.getCartSq())) {
|
|
|
// 2021.02.24 jsh77b
|
|
|
cart.setTmtb1DcAmt(apply.getTmtb1DcAmt());
|
|
|
cart.setTmtb2DcAmt(apply.getTmtb2DcAmt());
|
|
|
@@ -534,6 +554,8 @@ public class TsfCartService {
|
|
|
cart.setAmtTmtbSq(apply.getAmtTmtbSq());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ log.info("FINAL AMT CHECK :::: {} / {} / {} / {}", cart.getCartSq(), cart.getApplyQtySectionYn(), cart.getApplyAmtSectionYn(), cart.getTmtbDcAmt());
|
|
|
}
|
|
|
|
|
|
//return result;
|
|
|
@@ -627,7 +649,8 @@ public class TsfCartService {
|
|
|
if (param.getDelvFeeCd().equals(delv.getDelvFeeCd())) {
|
|
|
compCnt++;
|
|
|
if("N".equals(param.getSoldoutYn())) {
|
|
|
- delv.setCompSumPrice(delv.getCompSumPrice() + param.getTmtbDcAmt());
|
|
|
+ delv.setCompSumPrice(delv.getCompSumPrice() + param.getCurrPrice());
|
|
|
+ log.info("CHECK CURR_PRICE :::: {} / {}", param.getCartSq(), param.getCurrPrice());
|
|
|
}
|
|
|
if (compCnt == 1) {
|
|
|
param.setFirstCompYn("Y");
|
|
|
@@ -648,10 +671,13 @@ public class TsfCartService {
|
|
|
param.setCompCnt(delv.getCompCnt());
|
|
|
if (TscConstants.DelvFeeCrite.FREE.value().equals(delv.getDelvFeeCrite())) {
|
|
|
param.setDelvFee(0);
|
|
|
+ delv.setFormalGb("TEST1");
|
|
|
} else if (TscConstants.DelvFeeCrite.NORMAL.value().equals(delv.getDelvFeeCrite()) && delv.getCompSumPrice() > delv.getMinOrdAmt()) {
|
|
|
param.setDelvFee(0);
|
|
|
+ delv.setFormalGb("TEST2");
|
|
|
} else {
|
|
|
param.setDelvFee(delv.getDelvFee());
|
|
|
+ delv.setFormalGb("TEST3");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -700,6 +726,7 @@ public class TsfCartService {
|
|
|
// 상품 금액 합계
|
|
|
order.setSumOrdAmt(order.getSumOrdAmt() + cart.getCurrPrice());
|
|
|
order.setSumRealPayAmt(order.getSumRealPayAmt() + cart.getTmtbDcAmt());
|
|
|
+ order.setSumListPrice(order.getSumListPrice() + cart.getListPrice());
|
|
|
|
|
|
// 배송비 합계
|
|
|
if ("Y".equals(cart.getFirstCompYn())) {
|
|
|
@@ -712,7 +739,8 @@ public class TsfCartService {
|
|
|
order.setTotDelvFee(order.getTotDelvFee() + order.getWmsDelvFee());
|
|
|
|
|
|
// 상품 할인금액 총계
|
|
|
- order.setTotDcAmt(order.getSumRealPayAmt() - order.getSumOrdAmt());
|
|
|
+ // order.setTotDcAmt(order.getSumRealPayAmt() - order.getSumOrdAmt()); /* 다다익선 금액이 상품금액일 경우 해당 주석 제거 */
|
|
|
+ order.setTotDcAmt(order.getSumRealPayAmt() - order.getSumListPrice());
|
|
|
|
|
|
// 장바구니 총액 계산 상품 총 수량
|
|
|
order.setTotCartCnt(notSoldoutCnt);
|