|
|
@@ -2398,6 +2398,8 @@ public class TscOrderChangeService {
|
|
|
|
|
|
// 전체 및 마지막 취소여부 설정
|
|
|
int cnt = 0;
|
|
|
+ int sumCnclRtnQty = 0;
|
|
|
+ int totOrdQty = 0;
|
|
|
String delvFeeCd = "";
|
|
|
String delvFeeCd2 = "";
|
|
|
String allCanYn = "Y";
|
|
|
@@ -2413,11 +2415,19 @@ public class TscOrderChangeService {
|
|
|
int ordQty = order.getOrdQty();
|
|
|
int cnclRtnQty = order.getCnclRtnQty();
|
|
|
|
|
|
- // 전체 취소 여부 설정
|
|
|
- if ("Y".equals(allCanYn) && (index < 0 || cnclRtnReqQtyArr[index] != ordQty)) {
|
|
|
- allCanYn = "N";
|
|
|
+ // 전체 주문 수량
|
|
|
+ totOrdQty = order.getTotOrdQty();
|
|
|
+
|
|
|
+ // 취소 요청 수량 합계
|
|
|
+ if (index >= 0) {
|
|
|
+ sumCnclRtnQty += cnclRtnReqQtyArr[index];
|
|
|
}
|
|
|
|
|
|
+ // 전체 취소 여부 설정
|
|
|
+ // if ("Y".equals(allCanYn) && (index < 0 || cnclRtnReqQtyArr[index] != ordQty)) {
|
|
|
+ // allCanYn = "N";
|
|
|
+ // }
|
|
|
+
|
|
|
// 배송비 코드 별 전체 취소/반품 여부 처리
|
|
|
if (!delvFeeCd2.equals(order.getDelvFeeCd())) {
|
|
|
if (cnt > 0) {
|
|
|
@@ -2475,6 +2485,11 @@ public class TscOrderChangeService {
|
|
|
delvCanYn.set("delvFeeCdCanList", delvFeeCdCanList);
|
|
|
delvCanYn.set("allDelvCanYnList", allDelvCanYnList);
|
|
|
|
|
|
+ // 전체 취소 여부 설정
|
|
|
+ if (totOrdQty != sumCnclRtnQty) {
|
|
|
+ allCanYn = "N";
|
|
|
+ }
|
|
|
+
|
|
|
// 무통장입금전 전체취소여부 설정
|
|
|
String allCanYnBeforePayment = "N";
|
|
|
if ("Y".equals(allCanYnBeforePayment)
|
|
|
@@ -2577,7 +2592,7 @@ public class TscOrderChangeService {
|
|
|
orderChange.setOrdNo(ordNo);
|
|
|
orderChange.setChgGb(chgGb);
|
|
|
orderChange.setChgStat(chgStat);
|
|
|
- orderChange.setDelvFeeCd(delvFeeCd);
|
|
|
+ orderChange.setDelvFeeCdGrp(delvFeeCd);
|
|
|
orderChange.setOrdDtlNoArr(ordDtlNoArr);
|
|
|
orderChange.setCnclRtnReqQtyArr(cnclRtnReqQtyArr);
|
|
|
|
|
|
@@ -2668,6 +2683,7 @@ public class TscOrderChangeService {
|
|
|
|
|
|
if (refundInfo.getOrgDelvFee() < 0) {
|
|
|
refundAmt += refundInfo.getOrgDelvFee();
|
|
|
+ rfDeliveryFee += refundInfo.getOrgDelvFee();
|
|
|
}
|
|
|
|
|
|
// 4. 주문변경정보, 주문정보, 환불정보 (배송정책코드 별)
|
|
|
@@ -3162,6 +3178,7 @@ public class TscOrderChangeService {
|
|
|
}
|
|
|
// 네이버페이 결제형 결제 취소 처리
|
|
|
else if (TscConstants.PgGb.NAVER.value().equals(pgGb)) {
|
|
|
+ pg.setPayAmt(pg.getPartCancelAmt());
|
|
|
pg.setPayMeans(payMeans);
|
|
|
pg.setChgReasonNm(chgReasonNm);
|
|
|
|
|
|
@@ -3169,6 +3186,7 @@ public class TscOrderChangeService {
|
|
|
}
|
|
|
// 카카오페이 결제 취소 처리
|
|
|
else if (TscConstants.PgGb.KAKAO.value().equals(pgGb)) {
|
|
|
+ pg.setPayAmt(pg.getPartCancelAmt());
|
|
|
pg.setPayMeans(payMeans);
|
|
|
kakaoPayService.cancelKakaoPayment(pg);
|
|
|
}
|