|
|
@@ -84,6 +84,9 @@ public class TsbDeliveryService {
|
|
|
|
|
|
@Autowired
|
|
|
private HansaeErp hansaeErp;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TsbWmsDeliveryService wmsDeliveryService;
|
|
|
|
|
|
/**
|
|
|
* 총알배송 권역정보 갱신
|
|
|
@@ -358,10 +361,10 @@ public class TsbDeliveryService {
|
|
|
}
|
|
|
|
|
|
// TB_ORDER_CHANGE
|
|
|
- deliveryDao.updateTbOrderChange(data);
|
|
|
+ deliveryDao.updateTbOrderChange(data); // 주문변경번호 단위
|
|
|
|
|
|
// TB_ORDER_CHANGE_DETAIL
|
|
|
- deliveryDao.updateTbOrderChangeDetail(data);
|
|
|
+ deliveryDao.updateTbOrderChangeDetail(data); // 주문상세번호 단위
|
|
|
|
|
|
// 주문상세변경 이력
|
|
|
OrderChange ordChg = new OrderChange();
|
|
|
@@ -371,13 +374,14 @@ public class TsbDeliveryService {
|
|
|
ordChg.setOrdDtlNo(data.getOrderdtlno());
|
|
|
ordChg.setChgStat(data.getChgStat());
|
|
|
orderChangeDao.createOrderChangeDetailHst(ordChg);
|
|
|
+
|
|
|
|
|
|
// TB_WITHDRAW 입력
|
|
|
- deliveryDao.insertTbWithdraw(data);
|
|
|
+ deliveryDao.insertTbWithdraw(data); // 주문변경번호단위
|
|
|
// TB_WITHDRAW_DETAIL 입력
|
|
|
- deliveryDao.insertTbWithdrawDetail(data);
|
|
|
+ deliveryDao.insertTbWithdrawDetail(data); // 주문변경번호 ITEM단위
|
|
|
|
|
|
- // 교환일 경우 주문상세 상태값 처리
|
|
|
+ // 교환일 경우 주문상세 상태값 처리 ->
|
|
|
if(OrderChangeGb.EXCHANGE.value().equals(ordInfo.getChgGb()) && "N".equals(ordInfo.getWdBfSendYn())) {
|
|
|
|
|
|
OrderChange orderChange = new OrderChange();
|
|
|
@@ -641,6 +645,362 @@ public class TsbDeliveryService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 회수결과 주문변경 처리
|
|
|
+ * @param Delivery
|
|
|
+ * @return
|
|
|
+ * @author moon
|
|
|
+ * @since 2021. 07. 12
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public void saveWithdraw2(Delivery data) {
|
|
|
+
|
|
|
+
|
|
|
+ Delivery chgSqInfo = deliveryDao.getOrdchgSqInfo(data);
|
|
|
+
|
|
|
+ data.setChgGb(chgSqInfo.getChgGb());
|
|
|
+ data.setWdBfSendYn(chgSqInfo.getWdBfSendYn());
|
|
|
+ data.setWdInvoiceSendYn("Y");
|
|
|
+ data.setRtnLocCd("DL001");
|
|
|
+
|
|
|
+ // TB_ORDER_CHANGE
|
|
|
+ deliveryDao.updateTbOrderChange(data); // 주문변경번호 단위
|
|
|
+
|
|
|
+
|
|
|
+ // 교환일경우 자동 완료처리
|
|
|
+ data.setRegNo(TsbConstants.REG_NO);
|
|
|
+ if (OrderChangeGb.EXCHANGE.value().equals(data.getChgGb())) { // 교환
|
|
|
+ data.setChgStat(OrderChangeStat.EXCHANGE_COMPLETE.value()); // 교환완료 G685_40
|
|
|
+ } else {
|
|
|
+ data.setChgStat(OrderChangeStat.RETURN_ING.value()); // 반품진행중 G685_33
|
|
|
+ }
|
|
|
+
|
|
|
+ Collection<Delivery> ordDtlNoList = wmsDeliveryService.getWmsOrdDtlNoList(data);
|
|
|
+
|
|
|
+ for(Delivery dtlNo : ordDtlNoList) {
|
|
|
+
|
|
|
+ if (999999999 == dtlNo.getOrderdtlno()) {
|
|
|
+ dtlNo.setOrderno(data.getOrderno());
|
|
|
+ Delivery ordDtlNo = deliveryDao.getOrdDtlno2(dtlNo);
|
|
|
+ dtlNo.setOrdDtlNo(ordDtlNo.getOrdDtlNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ dtlNo.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ dtlNo.setRegNo(TsbConstants.REG_NO);
|
|
|
+ dtlNo.setWmsmemo(data.getWmsmemo());
|
|
|
+ dtlNo.setChgGb(data.getChgGb());
|
|
|
+ dtlNo.setChgStat(data.getChgStat());
|
|
|
+ dtlNo.setOrdChgSq(data.getOrdChgSq());
|
|
|
+ dtlNo.setOrderdtlno(dtlNo.getOrdDtlNo());
|
|
|
+
|
|
|
+ // TB_ORDER_CHANGE_DETAIL
|
|
|
+ deliveryDao.updateTbOrderChangeDetail(data); // 주문상세번호 단위
|
|
|
+
|
|
|
+ // 주문상세변경 이력
|
|
|
+ OrderChange ordChg = new OrderChange();
|
|
|
+ ordChg.setRegNo(TsbConstants.REG_NO);
|
|
|
+ ordChg.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ ordChg.setOrdChgSq(dtlNo.getOrdChgSq());
|
|
|
+ ordChg.setOrdDtlNo(dtlNo.getOrderdtlno());
|
|
|
+ ordChg.setChgStat(dtlNo.getChgStat());
|
|
|
+ orderChangeDao.createOrderChangeDetailHst(ordChg);
|
|
|
+
|
|
|
+ Delivery ordInfo = deliveryDao.getOrderInfoList2(dtlNo);
|
|
|
+
|
|
|
+ data.setCustNo(ordInfo.getCustNo());
|
|
|
+ dtlNo.setChgOrdDtlNo(ordInfo.getChgOrdDtlNo()); // getChgOrdDtlNo
|
|
|
+ // 교환일 경우 주문상세 상태값 처리 ->
|
|
|
+ if(OrderChangeGb.EXCHANGE.value().equals(data.getChgGb()) && "N".equals(data.getWdBfSendYn())) {
|
|
|
+
|
|
|
+ OrderChange orderChange = new OrderChange();
|
|
|
+ orderChange.setOrdChgSq(data.getOrdChgSq());
|
|
|
+ orderChange.setCustNo(data.getCustNo());
|
|
|
+
|
|
|
+ // 주문변경상세정보 조회
|
|
|
+ Collection<OrderChange> orderChangeList = deliveryDao.getOrderChangeDetailInfo(orderChange);
|
|
|
+
|
|
|
+ // 환불 사전 정보 설정
|
|
|
+ int idx = 0;
|
|
|
+ int size = orderChangeList.size();
|
|
|
+ String chgGb = orderChangeList.iterator().next().getChgGb();
|
|
|
+ Integer ordNo = orderChangeList.iterator().next().getOrdNo();
|
|
|
+ Integer custNo = orderChangeList.iterator().next().getCustNo();
|
|
|
+ String ordNm = orderChangeList.iterator().next().getOrdNm();
|
|
|
+ String ordPhnno = orderChangeList.iterator().next().getOrdPhnno();
|
|
|
+ int[] ordDtlNoArr = new int[size];
|
|
|
+ int[] cnclRtnReqQtyArr = new int[size];
|
|
|
+
|
|
|
+ for (OrderChange param : orderChangeList) {
|
|
|
+ ordDtlNoArr[idx] = param.getOrdDtlNo();
|
|
|
+ cnclRtnReqQtyArr[idx] = param.getChgQty();
|
|
|
+ idx++;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 회원/비회원 정보 설정
|
|
|
+ if (custNo > 0) {
|
|
|
+ orderChange.setCustNo(custNo);
|
|
|
+ } else {
|
|
|
+ orderChange.setOrdNm(ordNm);
|
|
|
+ orderChange.setOrdPhnno(ordPhnno);
|
|
|
+ }
|
|
|
+
|
|
|
+ orderChange.setOrdNo(ordNo);
|
|
|
+ orderChange.setChgGb(chgGb);
|
|
|
+ orderChange.setOrdDtlNoArr(ordDtlNoArr);
|
|
|
+ orderChange.setCnclRtnReqQtyArr(cnclRtnReqQtyArr);
|
|
|
+
|
|
|
+ // 환불 사전 정보 조회
|
|
|
+ GagaMap refundPreInfo = orderChangeService.getRefundPreInfo(orderChange);
|
|
|
+ List<Order> cnclReqList2 = (List<Order>)refundPreInfo.get("cnclReqList");
|
|
|
+
|
|
|
+ GagaMap info = orderRefundService.cnclRtnRefundAmt(cnclReqList2);
|
|
|
+
|
|
|
+ List<Order> cancelOrderRefundList = (List<Order>)info.get("cancelOrderRefundList");
|
|
|
+ //log.info("cnclReqList {}"+cnclReqList);
|
|
|
+ log.info("cancelOrderRefundList {}"+cancelOrderRefundList);
|
|
|
+
|
|
|
+ for (Order vo : cancelOrderRefundList) {
|
|
|
+
|
|
|
+ if(dtlNo.getOrdDtlNo().equals(vo.getOrdDtlNo()))
|
|
|
+ {
|
|
|
+ vo.setRegNo(TsbConstants.REG_NO);
|
|
|
+ vo.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ vo.setOrdDtlStat(OrderDetailStat.PAYMENT_AFTER_CANCEL.value());
|
|
|
+ // 원주문 상세정보 수정
|
|
|
+ orderChangeDao.updateOrderDetail(vo);
|
|
|
+ // 원주문 상세 이력 등록
|
|
|
+ orderDao.createOrderDetailHst(vo);
|
|
|
+
|
|
|
+ //vo.setOrdDtlNo(data.getOrderdtlno());
|
|
|
+ // 3-2-3. 주문상세단품정보 수정 및 주문상세단품이력 등록
|
|
|
+ // 주문상세단품정보조회
|
|
|
+ Collection<Order> orderDetailItemList = orderChangeDao.getOrderDetailItemForCnclRtn(vo);
|
|
|
+ int ordDtlOrdAmt = orderDetailItemList.iterator().next().getOrdAmt();
|
|
|
+ int ordDtlCnclRtnAmt = orderDetailItemList.iterator().next().getCnclRtnAmt();
|
|
|
+ int ordDtlCpn1DcAmt = orderDetailItemList.iterator().next().getCpn1DcAmt();
|
|
|
+ int ordDtlTmtb1DcAmt = orderDetailItemList.iterator().next().getTmtb1DcAmt();
|
|
|
+ int ordDtlTmtb2DcAmt = orderDetailItemList.iterator().next().getTmtb2DcAmt();
|
|
|
+ int ordDtlGoodsCpnDcAmt = orderDetailItemList.iterator().next().getGoodsCpnDcAmt();
|
|
|
+ int ordDtlCartCpnDcAmt = orderDetailItemList.iterator().next().getCartCpnDcAmt();
|
|
|
+ int ordDtlPntDcAmt = orderDetailItemList.iterator().next().getPntDcAmt();
|
|
|
+ int ordDtlPrePntDcAmt = orderDetailItemList.iterator().next().getPrePntDcAmt();
|
|
|
+ int ordDtlSavePntAmt = orderDetailItemList.iterator().next().getSavePntAmt();
|
|
|
+ int ordDtlRealOrdAmt = orderDetailItemList.iterator().next().getRealOrdAmt();
|
|
|
+ int ordDtlGfcdUseAmt = orderDetailItemList.iterator().next().getGfcdUseAmt();
|
|
|
+
|
|
|
+ // 주문상세단품단위 금액 등록
|
|
|
+ int length = orderDetailItemList.size();
|
|
|
+ int index = 1;
|
|
|
+ int leftOrdAmt = ordDtlOrdAmt;
|
|
|
+ int leftCnclRtnAmt = ordDtlCnclRtnAmt;
|
|
|
+ int leftCpn1DcAmt = ordDtlCpn1DcAmt;
|
|
|
+ int leftTmtb1DcAmt = ordDtlTmtb1DcAmt;
|
|
|
+ int leftTmtb2DcAmt = ordDtlTmtb2DcAmt;
|
|
|
+ int leftGoodsCpnDcAmt = ordDtlGoodsCpnDcAmt;
|
|
|
+ int leftCartCpnDcAmt = ordDtlCartCpnDcAmt;
|
|
|
+ int leftPntDcAmt = ordDtlPntDcAmt;
|
|
|
+ int leftPrePntDcAmt = ordDtlPrePntDcAmt;
|
|
|
+ int leftSavePntAmt = ordDtlSavePntAmt;
|
|
|
+ int leftRealOrdAmt = ordDtlRealOrdAmt;
|
|
|
+ int leftGfcdUseAmt = ordDtlGfcdUseAmt;
|
|
|
+
|
|
|
+ for (Order orderDetailItem : orderDetailItemList) {
|
|
|
+ double dtlOrdAmt = orderDetailItem.getDtlOrdAmt();
|
|
|
+ double dtlItemOrdAmt = orderDetailItem.getDtlItemOrdAmt();
|
|
|
+ double tempDivD = (dtlItemOrdAmt / dtlOrdAmt) * 100;
|
|
|
+
|
|
|
+ int tempDiv = Integer.parseInt(String.valueOf(Math.round(tempDivD)));
|
|
|
+
|
|
|
+ if (index == length) {
|
|
|
+ orderDetailItem.setCnclRtnAmt(leftCnclRtnAmt);
|
|
|
+ orderDetailItem.setCpn1DcAmt(leftCpn1DcAmt);
|
|
|
+ orderDetailItem.setTmtb1DcAmt(leftTmtb1DcAmt);
|
|
|
+ orderDetailItem.setTmtb2DcAmt(leftTmtb2DcAmt);
|
|
|
+ orderDetailItem.setGoodsCpnDcAmt(leftGoodsCpnDcAmt);
|
|
|
+ orderDetailItem.setCartCpnDcAmt(leftCartCpnDcAmt);
|
|
|
+ orderDetailItem.setPrePntDcAmt(leftPrePntDcAmt);
|
|
|
+ orderDetailItem.setPntDcAmt(leftPntDcAmt);
|
|
|
+ orderDetailItem.setGfcdUseAmt(leftGfcdUseAmt);
|
|
|
+ orderDetailItem.setRealOrdAmt(leftRealOrdAmt);
|
|
|
+ orderDetailItem.setSavePntAmt(leftSavePntAmt);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ orderDetailItem.setCnclRtnAmt((ordDtlCnclRtnAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setCpn1DcAmt((ordDtlCpn1DcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setTmtb1DcAmt((ordDtlTmtb1DcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setTmtb2DcAmt((ordDtlTmtb2DcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setGoodsCpnDcAmt((ordDtlGoodsCpnDcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setCartCpnDcAmt((ordDtlCartCpnDcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setPrePntDcAmt((ordDtlPrePntDcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setPntDcAmt((ordDtlPntDcAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setGfcdUseAmt((ordDtlGfcdUseAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setRealOrdAmt((ordDtlRealOrdAmt * tempDiv) / 100);
|
|
|
+ orderDetailItem.setSavePntAmt((ordDtlSavePntAmt * tempDiv) / 100);
|
|
|
+
|
|
|
+ leftCnclRtnAmt -= ((ordDtlCnclRtnAmt * tempDiv) / 100);
|
|
|
+ leftCpn1DcAmt -= ((ordDtlCpn1DcAmt * tempDiv) / 100);
|
|
|
+ leftTmtb1DcAmt -= ((ordDtlTmtb1DcAmt * tempDiv) / 100);
|
|
|
+ leftTmtb2DcAmt -= ((ordDtlTmtb2DcAmt * tempDiv) / 100);
|
|
|
+ leftGoodsCpnDcAmt -= ((ordDtlGoodsCpnDcAmt * tempDiv) / 100);
|
|
|
+ leftCartCpnDcAmt -= ((ordDtlCartCpnDcAmt * tempDiv) / 100);
|
|
|
+ leftPrePntDcAmt -= ((ordDtlPrePntDcAmt * tempDiv) / 100);
|
|
|
+ leftPntDcAmt -= ((ordDtlPntDcAmt * tempDiv) / 100);
|
|
|
+ leftGfcdUseAmt -= ((ordDtlGfcdUseAmt * tempDiv) / 100);
|
|
|
+ leftRealOrdAmt -= ((ordDtlRealOrdAmt * tempDiv) / 100);
|
|
|
+ leftSavePntAmt -= ((ordDtlSavePntAmt * tempDiv) / 100);
|
|
|
+ }
|
|
|
+
|
|
|
+ orderDetailItem.setRegNo(TsbConstants.REG_NO);
|
|
|
+ orderDetailItem.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ orderDetailItem.setOrdDtlStat(vo.getOrdDtlStat());
|
|
|
+
|
|
|
+ // 2021.06.25 WMS 회수정보 수집 (교환완료) (정산구분값추가)
|
|
|
+ orderDetailItem.setOrdDtlStat(TscConstants.OrdDtlItemStat.SALE_RETURN_EXCHANGE_COMPLETE.value());
|
|
|
+ orderDetailItem.setCnclRtnQty(vo.getOrdCanChgQty());
|
|
|
+ orderDetailItem.setOrdChgSq(data.getOrdChgSq());
|
|
|
+ orderChangeDao.createOrderDetailItemHst(orderDetailItem);
|
|
|
+
|
|
|
+ orderChangeDao.updateOrderDetailItem(orderDetailItem);
|
|
|
+
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 교환주문 상세 수정
|
|
|
+ vo.setOrdDtlStat(OrderDetailStat.PAYMENT_COMPLETE.value()); // 교환주문상세 결제완료
|
|
|
+ vo.setOrdDtlNo(dtlNo.getChgOrdDtlNo());
|
|
|
+ vo.setWdBfSendYn(data.getWdBfSendYn());
|
|
|
+ orderChangeDao.updateChgOrderDetailTemp(vo);
|
|
|
+ // 교환주문 상세 이력 등록
|
|
|
+ orderDao.createOrderDetailHst(vo);
|
|
|
+
|
|
|
+ // 주문상세단품정보조회
|
|
|
+ Collection<Order> orderDetailItemList2 = orderChangeDao.getOrderDetailItemForCnclRtn(vo);
|
|
|
+ int ordDtlOrdAmt2 = orderDetailItemList2.iterator().next().getOrdAmt();
|
|
|
+ int ordDtlCnclRtnAmt2 = orderDetailItemList2.iterator().next().getCnclRtnAmt();
|
|
|
+ int ordDtlCpn1DcAmt2 = orderDetailItemList2.iterator().next().getCpn1DcAmt();
|
|
|
+ int ordDtlTmtb1DcAmt2 = orderDetailItemList2.iterator().next().getTmtb1DcAmt();
|
|
|
+ int ordDtlTmtb2DcAmt2 = orderDetailItemList2.iterator().next().getTmtb2DcAmt();
|
|
|
+ int ordDtlGoodsCpnDcAmt2 = orderDetailItemList2.iterator().next().getGoodsCpnDcAmt();
|
|
|
+ int ordDtlCartCpnDcAmt2 = orderDetailItemList2.iterator().next().getCartCpnDcAmt();
|
|
|
+ int ordDtlPntDcAmt2 = orderDetailItemList2.iterator().next().getPntDcAmt();
|
|
|
+ int ordDtlPrePntDcAmt2 = orderDetailItemList2.iterator().next().getPrePntDcAmt();
|
|
|
+ int ordDtlSavePntAmt2 = orderDetailItemList2.iterator().next().getSavePntAmt();
|
|
|
+ int ordDtlRealOrdAmt2 = orderDetailItemList2.iterator().next().getRealOrdAmt();
|
|
|
+ int ordDtlGfcdUseAmt2 = orderDetailItemList2.iterator().next().getGfcdUseAmt();
|
|
|
+
|
|
|
+ // 주문상세단품단위 금액 등록
|
|
|
+ int length2 = orderDetailItemList2.size();
|
|
|
+ int index2 = 1;
|
|
|
+ int leftOrdAmt2 = ordDtlOrdAmt2;
|
|
|
+ int leftCnclRtnAmt2 = ordDtlCnclRtnAmt2;
|
|
|
+ int leftCpn1DcAmt2 = ordDtlCpn1DcAmt2;
|
|
|
+ int leftTmtb1DcAmt2 = ordDtlTmtb1DcAmt2;
|
|
|
+ int leftTmtb2DcAmt2 = ordDtlTmtb2DcAmt2;
|
|
|
+ int leftGoodsCpnDcAmt2 = ordDtlGoodsCpnDcAmt2;
|
|
|
+ int leftCartCpnDcAmt2 = ordDtlCartCpnDcAmt2;
|
|
|
+ int leftPntDcAmt2 = ordDtlPntDcAmt2;
|
|
|
+ int leftPrePntDcAmt2 = ordDtlPrePntDcAmt2;
|
|
|
+ int leftSavePntAmt2 = ordDtlSavePntAmt2;
|
|
|
+ int leftRealOrdAmt2 = ordDtlRealOrdAmt2;
|
|
|
+ int leftGfcdUseAmt2 = ordDtlGfcdUseAmt2;
|
|
|
+
|
|
|
+ for (Order orderDetailItem : orderDetailItemList2) {
|
|
|
+ double dtlOrdAmt = orderDetailItem.getDtlOrdAmt();
|
|
|
+ double dtlItemOrdAmt = orderDetailItem.getDtlItemOrdAmt();
|
|
|
+ double tempDivD = (dtlItemOrdAmt / dtlOrdAmt) * 100;
|
|
|
+
|
|
|
+ int tempDiv = Integer.parseInt(String.valueOf(Math.round(tempDivD)));
|
|
|
+
|
|
|
+ if (index2 == length2) {
|
|
|
+ orderDetailItem.setOrdAmt(leftOrdAmt2);
|
|
|
+ orderDetailItem.setCnclRtnAmt(leftCnclRtnAmt2);
|
|
|
+ orderDetailItem.setCpn1DcAmt(leftCpn1DcAmt2);
|
|
|
+ orderDetailItem.setTmtb1DcAmt(leftTmtb1DcAmt2);
|
|
|
+ orderDetailItem.setTmtb2DcAmt(leftTmtb2DcAmt2);
|
|
|
+ orderDetailItem.setGoodsCpnDcAmt(leftGoodsCpnDcAmt2);
|
|
|
+ orderDetailItem.setCartCpnDcAmt(leftCartCpnDcAmt2);
|
|
|
+ orderDetailItem.setPrePntDcAmt(leftPrePntDcAmt2);
|
|
|
+ orderDetailItem.setPntDcAmt(leftPntDcAmt2);
|
|
|
+ orderDetailItem.setGfcdUseAmt(leftGfcdUseAmt2);
|
|
|
+ orderDetailItem.setRealOrdAmt(leftRealOrdAmt2);
|
|
|
+ orderDetailItem.setSavePntAmt(leftSavePntAmt2);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ orderDetailItem.setOrdAmt((ordDtlOrdAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setCnclRtnAmt((ordDtlCnclRtnAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setCpn1DcAmt((ordDtlCpn1DcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setTmtb1DcAmt((ordDtlTmtb1DcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setTmtb2DcAmt((ordDtlTmtb2DcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setGoodsCpnDcAmt((ordDtlGoodsCpnDcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setCartCpnDcAmt((ordDtlCartCpnDcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setPrePntDcAmt((ordDtlPrePntDcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setPntDcAmt((ordDtlPntDcAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setGfcdUseAmt((ordDtlGfcdUseAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setRealOrdAmt((ordDtlRealOrdAmt2 * tempDiv) / 100);
|
|
|
+ orderDetailItem.setSavePntAmt((ordDtlSavePntAmt2 * tempDiv) / 100);
|
|
|
+
|
|
|
+ leftOrdAmt2 -= ((ordDtlOrdAmt2 * tempDiv) / 100);
|
|
|
+ leftCnclRtnAmt2 -= ((ordDtlCnclRtnAmt2 * tempDiv) / 100);
|
|
|
+ leftCpn1DcAmt2 -= ((ordDtlCpn1DcAmt2 * tempDiv) / 100);
|
|
|
+ leftTmtb1DcAmt2 -= ((ordDtlTmtb1DcAmt2 * tempDiv) / 100);
|
|
|
+ leftTmtb2DcAmt2 -= ((ordDtlTmtb2DcAmt2 * tempDiv) / 100);
|
|
|
+ leftGoodsCpnDcAmt2 -= ((ordDtlGoodsCpnDcAmt2 * tempDiv) / 100);
|
|
|
+ leftCartCpnDcAmt2 -= ((ordDtlCartCpnDcAmt2 * tempDiv) / 100);
|
|
|
+ leftPrePntDcAmt2 -= ((ordDtlPrePntDcAmt2 * tempDiv) / 100);
|
|
|
+ leftPntDcAmt2 -= ((ordDtlPntDcAmt2 * tempDiv) / 100);
|
|
|
+ leftGfcdUseAmt2 -= ((ordDtlGfcdUseAmt2 * tempDiv) / 100);
|
|
|
+ leftRealOrdAmt2 -= ((ordDtlRealOrdAmt2 * tempDiv) / 100);
|
|
|
+ leftSavePntAmt2 -= ((ordDtlSavePntAmt2 * tempDiv) / 100);
|
|
|
+ }
|
|
|
+ log.info("orderDetailItem: "+orderDetailItem.getOrdAmt());
|
|
|
+ orderDetailItem.setRegNo(TsbConstants.REG_NO);
|
|
|
+ orderDetailItem.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ orderDetailItem.setOrdDtlStat(vo.getOrdDtlStat());
|
|
|
+
|
|
|
+ // 2021.06.25 WMS 회수정보 수집 (교환결제완료) (정산구분값추가)
|
|
|
+ orderDetailItem.setOrdDtlStat(TscConstants.OrdDtlItemStat.SALE_PAYMENT_COMPLETE.value()); // G720_10 판매-결제완료
|
|
|
+ orderDetailItem.setCnclRtnQty(0);
|
|
|
+ orderDetailItem.setOrdChgSq(data.getOrdChgSq());
|
|
|
+ orderChangeDao.updateChgOrderDetailItemTemp(orderDetailItem);
|
|
|
+ orderDetailItem.setExchangeOrdDtlItemSq(orderDetailItem.getOrdDtlItemSq());
|
|
|
+ orderChangeDao.createOrderDetailItemHstForExchange(orderDetailItem);
|
|
|
+
|
|
|
+ index2++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // TB_WITHDRAW 입력
|
|
|
+ deliveryDao.insertTbWithdraw(data); // 주문변경번호단위
|
|
|
+
|
|
|
+ Collection<Delivery> ordDtlItemList = wmsDeliveryService.getWmsOrdDtlItemList(data);
|
|
|
+ for(Delivery item : ordDtlItemList) {
|
|
|
+
|
|
|
+ if (999999999 == item.getOrderdtlno()) {
|
|
|
+ item.setOrderno(data.getOrderno());
|
|
|
+ Delivery ordDtlNo = deliveryDao.getOrdDtlno2(item);
|
|
|
+ item.setOrdDtlNo(ordDtlNo.getOrdDtlNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ item.setRegNo(TsbConstants.REG_NO);
|
|
|
+ item.setOrdChgSq(data.getOrdChgSq());
|
|
|
+ Delivery ordInfo = deliveryDao.getOrderInfoList(item);
|
|
|
+
|
|
|
+ item.setItemCd(ordInfo.getItemCd());
|
|
|
+ item.setOptCd1(ordInfo.getOptCd1());
|
|
|
+ item.setOptCd2(ordInfo.getOptCd2());
|
|
|
+ item.setSellStoreCd(ordInfo.getSellStoreCd());
|
|
|
+ // TB_WITHDRAW_DETAIL 입력
|
|
|
+ deliveryDao.insertTbWithdrawDetail(item); // 주문변경번호 ITEM단위
|
|
|
+
|
|
|
+ data.setCustNo(ordInfo.getCustNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
/**
|
|
|
* 주문정보 조회
|
|
|
* @param Delivery
|
|
|
@@ -1453,5 +1813,4 @@ public class TsbDeliveryService {
|
|
|
data.setRegNo(userNo);
|
|
|
deliveryDao.insertTbExchangeDelvFail(data);
|
|
|
}
|
|
|
-
|
|
|
}
|