|
|
@@ -23,6 +23,7 @@ import com.style24.core.biz.service.TscKcpService;
|
|
|
import com.style24.core.biz.service.TscNaverPayService;
|
|
|
import com.style24.core.biz.service.TscOrderService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
+import com.style24.front.biz.dao.TsfCartDao;
|
|
|
import com.style24.front.biz.dao.TsfOrderDao;
|
|
|
import com.style24.front.biz.dao.TsfRendererDao;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
@@ -77,6 +78,9 @@ public class TsfOrderService {
|
|
|
|
|
|
@Autowired
|
|
|
private Environment env;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TsfCartDao cartDao;
|
|
|
|
|
|
/**
|
|
|
* 마이페이지 주문 정보 조회
|
|
|
@@ -548,7 +552,7 @@ public class TsfOrderService {
|
|
|
|
|
|
// 장바구니 금액정보 체크
|
|
|
for (Order orderDetail : cartGoodsList) {
|
|
|
- cartCurrPriceSum = cartCurrPriceSum + orderDetail.getCurrPrice();
|
|
|
+ cartCurrPriceSum = cartCurrPriceSum + orderDetail.getOrgCurrPrice();
|
|
|
}
|
|
|
|
|
|
// 판매가비교
|
|
|
@@ -870,7 +874,7 @@ public class TsfOrderService {
|
|
|
param.setIfYn("F"); // 인터페이스 송부 실패
|
|
|
}
|
|
|
|
|
|
- coreOrderDao.createInsurance(param);
|
|
|
+ //coreOrderDao.createInsurance(param);
|
|
|
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
@@ -909,4 +913,115 @@ public class TsfOrderService {
|
|
|
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 장바구니정보 주문번호 이력 등록
|
|
|
+ * @param param
|
|
|
+ * @author xodud1202
|
|
|
+ * @since 2021. 05. 10
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public String insertCartHstOrdNo(Order order) {
|
|
|
+
|
|
|
+ // cartsq
|
|
|
+ for (int i=0 ; i<order.getCartSqArr().length ; i++) {
|
|
|
+ Cart cart = new Cart();
|
|
|
+ cart.setOrdNo(order.getOrdNo());
|
|
|
+ cart.setCartSq(order.getCartSqArr()[i]);
|
|
|
+ cart.setRegNo(order.getCustNo());
|
|
|
+
|
|
|
+ // 장바구니 이력등록
|
|
|
+ cartDao.insertCartHst(cart);
|
|
|
+ }
|
|
|
+
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 장바구니정보 주문번호 삭제
|
|
|
+ * @param param
|
|
|
+ * @author xodud1202
|
|
|
+ * @since 2021. 05. 10
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public String deleteCartOrdNo(Order order) {
|
|
|
+
|
|
|
+ // 주문번호 존재할때만 실행
|
|
|
+ if (order.getOrdNo() > 0) {
|
|
|
+ // 장바구니 이력등록
|
|
|
+ Cart cart = new Cart();
|
|
|
+ cart.setOrdNo(order.getOrdNo());
|
|
|
+
|
|
|
+ // 2021.05.10 주문완료 주문번호로 장바구니정보 삭제
|
|
|
+ cartDao.deleteCartOrdNo(cart);
|
|
|
+
|
|
|
+ // 2021.05.10 주문완료 주문번호로 장바구니상세정보 삭제
|
|
|
+ cartDao.deleteCartDetailOrdNo(cart);
|
|
|
+ }
|
|
|
+
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 보증보험정보 update
|
|
|
+ * @param param
|
|
|
+ * @author xodud1202
|
|
|
+ * @since 2021. 05. 10
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public String updateInsurance(Order order) {
|
|
|
+ // 주문번호 존재할때만 실행
|
|
|
+ if (order.getOrdNo() > 0) {
|
|
|
+ // 보증보험 API 연동위한 정보조회
|
|
|
+ Collection<Order> goodsInfoList = orderDao.getGoodsInfoForInsurance(order);
|
|
|
+
|
|
|
+ if (goodsInfoList.size() > 0) {
|
|
|
+ String[] goodsNameArr = new String[goodsInfoList.size()];
|
|
|
+ String[] goodsPriceArr = new String[goodsInfoList.size()];
|
|
|
+ String[] goodsQuantityArr = new String[goodsInfoList.size()];
|
|
|
+
|
|
|
+ int realOrdAmt = 0;
|
|
|
+ int index = 0;
|
|
|
+
|
|
|
+ for (Order goodsInfo : goodsInfoList) {
|
|
|
+ goodsNameArr[index] = goodsInfo.getGoodsNm();
|
|
|
+ goodsPriceArr[index] = String.valueOf(goodsInfo.getRealOrdAmt());
|
|
|
+ goodsQuantityArr[index] = String.valueOf(goodsInfo.getOrdQty());
|
|
|
+
|
|
|
+ realOrdAmt = realOrdAmt + goodsInfo.getRealOrdAmt();
|
|
|
+
|
|
|
+ if (index == 0) {
|
|
|
+ order.setBirthYmd(goodsInfo.getBirthGen()); // 생년월일 + 성별(남자 : 1, 여자 : 2)
|
|
|
+ order.setPayMeans(goodsInfo.getPayMeans()); // 무통장입금 or 계좌이체
|
|
|
+ order.setBankNm(goodsInfo.getBankNm()); // 은행명 >> PG 송부 후 result에서 값 입력하면됨
|
|
|
+ order.setOrdNm(goodsInfo.getOrdNm()); // 주문자명
|
|
|
+ order.setVaNo(goodsInfo.getVaNo()); // 가상계좌번호
|
|
|
+ order.setOrdPhnno(goodsInfo.getOrdPhnno()); // 주문자전화2 ("-" 포함)
|
|
|
+ order.setOrdEmail(goodsInfo.getOrdEmail()); // 주문자이메일
|
|
|
+ order.setRecipNm(goodsInfo.getRecipNm()); // 수령인명
|
|
|
+ order.setRecipPhnno(goodsInfo.getRecipPhnno()); // 수령인휴대폰번호
|
|
|
+ order.setRecipZipcode(goodsInfo.getRecipZipcode()); // 주문자우편번호
|
|
|
+ order.setRecipAddr(goodsInfo.getRecipBaseAddr() + goodsInfo.getRecipDtlAddr()); // 주문자주소
|
|
|
+ order.setCustNo(order.getCustNo()); // 고객번호
|
|
|
+ }
|
|
|
+
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+ order.setItemNmArr(goodsNameArr); // 상품명 배열
|
|
|
+ order.setGoodsPriceArr(goodsPriceArr); // 상품별 가격 배열
|
|
|
+ order.setItemQtyArr(goodsQuantityArr); // 상품별 수량 배열
|
|
|
+ order.setOrdNo(order.getOrdNo()); // 주문번호
|
|
|
+ order.setRealOrdAmt(realOrdAmt); // 결제금액
|
|
|
+
|
|
|
+ if (TscConstants.PayMeans.ACCOUNT_TRANSFER.value().equals(order.getPayMeans()) || TscConstants.PayMeans.BANK_DEPOSIT.value().equals(order.getPayMeans())) {
|
|
|
+ uSafeGuaranteeInsurance(order);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|