|
@@ -2187,32 +2187,115 @@ public class TsfOrderService {
|
|
|
* @author jsh77b
|
|
* @author jsh77b
|
|
|
* @since 2021. 07. 23
|
|
* @since 2021. 07. 23
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
public String orderAmtValidationCheck(Order order) {
|
|
public String orderAmtValidationCheck(Order order) {
|
|
|
String result = "";
|
|
String result = "";
|
|
|
|
|
|
|
|
Order po = new Order();
|
|
Order po = new Order();
|
|
|
|
|
|
|
|
- // 장바구니정보 및 상품쿠폰정보, 장바구니쿠폰정보, 선포인트정보, 포인트정보, 상품권정보
|
|
|
|
|
|
|
+ // 1. 장바구니정보 및 상품쿠폰정보, 장바구니쿠폰정보, 선포인트정보, 포인트정보, 상품권정보
|
|
|
Collection<Order> orderDetailList = order.getOrderDetailList();
|
|
Collection<Order> orderDetailList = order.getOrderDetailList();
|
|
|
int [] cartSqArr = new int[orderDetailList.size()];
|
|
int [] cartSqArr = new int[orderDetailList.size()];
|
|
|
int idx = 0;
|
|
int idx = 0;
|
|
|
for (Order vo : orderDetailList) {
|
|
for (Order vo : orderDetailList) {
|
|
|
cartSqArr[idx] = vo.getCartSq();
|
|
cartSqArr[idx] = vo.getCartSq();
|
|
|
|
|
+ idx++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
po.setCartSqArr(cartSqArr);
|
|
po.setCartSqArr(cartSqArr);
|
|
|
|
|
+ po.setCustNo(order.getCustNo());
|
|
|
|
|
|
|
|
- // 판매가정보, 즉시할인금액, 옵션금액, 다다익선적용금액 정보 조회
|
|
|
|
|
|
|
+ // 2. 판매가정보, 즉시할인금액, 옵션금액, 다다익선적용금액 정보 조회
|
|
|
Collection<Order> tmtbGoodsApplyList = cartService.getMoreBetterAmtList(po);
|
|
Collection<Order> tmtbGoodsApplyList = cartService.getMoreBetterAmtList(po);
|
|
|
|
|
|
|
|
|
|
+ // 5 상품쿠폰, 장바구니쿠폰 목록 조회
|
|
|
|
|
+ GagaMap goodsCartCpnMap = coreOrderService.getGoodsCartCpnApplyGoodsList(order);
|
|
|
|
|
|
|
|
|
|
+ Collection<Order> goodsCpnList = (Collection<Order>) goodsCartCpnMap.get("goodsCpnList");
|
|
|
|
|
+ Collection<Order> cartCpnList = (Collection<Order>) goodsCartCpnMap.get("cartCpnList");
|
|
|
|
|
+ Collection<Order> cartCpnIdList = (Collection<Order>) goodsCartCpnMap.get("cartCpnIdList");
|
|
|
|
|
+
|
|
|
|
|
+ // 6 상품쿠폰 적용된 상품 목록(상품기준)
|
|
|
|
|
+ Collection<Order> goodsApplyCpnList = coreOrderService.getGoodsCpnApplyList(tmtbGoodsApplyList, goodsCpnList);
|
|
|
|
|
|
|
|
|
|
+ // 7. 장바구니쿠폰(장바구니기준 상품목록)
|
|
|
|
|
+ cartCpnList = coreOrderService.getCartCpnApplyList(tmtbGoodsApplyList, cartCpnList, cartCpnIdList);
|
|
|
|
|
|
|
|
|
|
+ int ordAmt = 0;
|
|
|
|
|
|
|
|
|
|
+ for (Order od : tmtbGoodsApplyList) {
|
|
|
|
|
+ log.info("----------------------------------------------------------------------------");
|
|
|
|
|
+
|
|
|
|
|
+ // 주문금액설정
|
|
|
|
|
+ ordAmt = (od.getCurrPrice() + od.getOptAddPrice()) * od.getGoodsQty();
|
|
|
|
|
+ od.setOrdAmt(ordAmt);
|
|
|
|
|
+
|
|
|
|
|
+ log.info("cartSq ::: {}" , od.getCartSq());
|
|
|
|
|
+ log.info("orgCurrPrice ::: {}" , od.getOrgCurrPrice());
|
|
|
|
|
+ log.info("cpn1DcAmt ::: {}" , od.getOrgCurrPrice() - od.getCurrPrice());
|
|
|
|
|
+ log.info("optAddPrice ::: {}" , od.getOptAddPrice());
|
|
|
|
|
+ log.info("goodsQty ::: {}" , od.getGoodsQty());
|
|
|
|
|
+ log.info("ordAmt ::: {}" , od.getOrdAmt());
|
|
|
|
|
+ log.info("tmtb1DcAmt ::: {}" , od.getTmtb1DcAmt());
|
|
|
|
|
+ log.info("tmtb2DcAmt ::: {}" , od.getTmtb2DcAmt());
|
|
|
|
|
+ log.info("prePntDcAmt ::: {}" , od.getPrePntDcAmt());
|
|
|
|
|
+ log.info("pntPrate ::: {}" , od.getPntPrate());
|
|
|
|
|
+ log.info("pntMrate ::: {}" , od.getPntMrate());
|
|
|
|
|
+
|
|
|
|
|
+ // 상품쿠폰, 장바구니쿠폰 적용
|
|
|
|
|
+ for (Order vo : orderDetailList) {
|
|
|
|
|
+ if (od.getCartSq().equals(vo.getCartSq())) {
|
|
|
|
|
+ log.info("vo.getCartSq() ----> {}", vo.getCartSq());
|
|
|
|
|
+ log.info("vo.getGoodsCpnSq() ----> {}", vo.getGoodsCpnSq());
|
|
|
|
|
+ log.info("vo.getCartCpnSq() ----> {}", vo.getCartCpnSq());
|
|
|
|
|
+ log.info("vo.getPntDcAmt() ----> {}", vo.getPntDcAmt());
|
|
|
|
|
+ log.info("vo.getGfcdUseAmt() ----> {}", vo.getGfcdUseAmt());
|
|
|
|
|
+
|
|
|
|
|
+ od.setGoodsCpnSq(vo.getGoodsCpnSq());
|
|
|
|
|
+ od.setCartCpnSq(vo.getCartCpnSq());
|
|
|
|
|
+ od.setPntDcAmt(vo.getPntDcAmt());
|
|
|
|
|
+ od.setGfcdUseAmt(vo.getGfcdUseAmt());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ log.info("pntDcAmt ::: {}" , od.getPntDcAmt());
|
|
|
|
|
+ log.info("gfcdUseAmt ::: {}" , od.getGfcdUseAmt());
|
|
|
|
|
+ log.info("----------------------------------------------------------------------------");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 상품쿠폰, 장바구니쿠폰 적용 금액
|
|
|
|
|
+ for (Order od : tmtbGoodsApplyList) {
|
|
|
|
|
+ log.info("----------------------------------------------------------------------------");
|
|
|
|
|
+ for (Order tmtbGoods : goodsApplyCpnList) {
|
|
|
|
|
+ if (od.getCartSq().equals(tmtbGoods.getCartSq())) {
|
|
|
|
|
+ log.info("vo.getCartSq() ::: {}", od.getCartSq());
|
|
|
|
|
+ for (Order goodsCpn : tmtbGoods.getGoodsCpnList()) {
|
|
|
|
|
+ if (od.getGoodsCpnSq() == goodsCpn.getCustCpnSq()) {
|
|
|
|
|
+ log.info("vo.getGoodsCpnSq() ::: {}", od.getGoodsCpnSq());
|
|
|
|
|
+ log.info("goodsCpn.getCpnDcAmt() ::: {}", goodsCpn.getCpnDcAmt());
|
|
|
|
|
+
|
|
|
|
|
+ od.setGoodsCpnDcAmt(goodsCpn.getCpnDcAmt());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (Order cartCpn : cartCpnList) {
|
|
|
|
|
+ if (od.getCartCpnSq() == cartCpn.getCustCpnSq()) {
|
|
|
|
|
+ for (int i=0 ; i<cartCpn.getCartCpnCartSqArr().length ; i++) {
|
|
|
|
|
+ if (od.getCartSq().equals(cartCpn.getCartCpnCartSqArr()[i])) {
|
|
|
|
|
+ log.info("vo.getCartSq() ::: {}", od.getCartSq());
|
|
|
|
|
+ log.info("cartCpn.getCpnSq() ::: {}", cartCpn.getCpnSq());
|
|
|
|
|
+ log.info("cartCpn.getDcWay() ::: {}", cartCpn.getDcWay());
|
|
|
|
|
+ log.info("cartCpn.getDcVal() ::: {}", cartCpn.getDcVal());
|
|
|
|
|
+ log.info("cartCpn.getMaxDcAmt() ::: {}", cartCpn.getMaxDcAmt());
|
|
|
|
|
+ log.info("cartCpn.getBuyLimitAmt() ::: {}", cartCpn.getBuyLimitAmt());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("----------------------------------------------------------------------------");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|