fix : 관리자 결제취소, 환불 원화추가
This commit is contained in:
@@ -993,6 +993,12 @@ public interface BOOrdrMapper {
|
||||
* @return List<DataMap>
|
||||
*/
|
||||
public List<DataMap> selectMbrSubsvcOrdrList(BOOrdrDlvyVO ordrDlvyVO);
|
||||
|
||||
/**
|
||||
* 최종 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update
|
||||
* @param refundVO
|
||||
*/
|
||||
public void updateBOWonRefundAmt(BOOrdrRefundVO refundVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2655,9 +2655,10 @@ public class BOOrdrService{
|
||||
mapper.updateBOFinalReturnDlvyAmtUpdt(refundVO);
|
||||
|
||||
}
|
||||
|
||||
/** ------------------------------------------ 반품 배송비 산정 END ------------------------------------------ */
|
||||
|
||||
/* 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update */
|
||||
mapper.updateBOWonRefundAmt(refundVO);
|
||||
|
||||
|
||||
// 수동환불 처리 세팅
|
||||
@@ -2689,8 +2690,6 @@ public class BOOrdrService{
|
||||
|
||||
message.put("adcript", adcriptContent);
|
||||
|
||||
|
||||
|
||||
BOOrdrRefundVO resultRefundVO = refundMapper.selectBORtngudDtlInqire(refundVO);
|
||||
|
||||
if (!StringUtils.isEmpty(resultRefundVO.getOrderRefundInnb()) && !StringUtils.isEmpty(resultRefundVO.getRefundCd())) {
|
||||
|
||||
@@ -248,7 +248,7 @@ public interface BORtngudrefndMapper {
|
||||
* @param boRtngudrefndVO
|
||||
* @return
|
||||
*/
|
||||
public Integer selectBOORderRefundAmtSumInqire(BORtngudrefndVO boRtngudrefndVO);
|
||||
public DataMap selectBOORderRefundAmtSumInqire(BORtngudrefndVO boRtngudrefndVO);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.wb.domainserver.domain.gcone.setup.site.mapper.BOSiteMapper;
|
||||
import com.wb.domainserver.domain.gcone.setup.site.vo.BOSetupContentsItemVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.util.string.StringUtil;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -249,7 +250,6 @@ public class BORtngudrefndService {
|
||||
|
||||
|
||||
try {
|
||||
|
||||
if (boRtngudrefndVO.getRefundProcsSttusCd() != null) {
|
||||
|
||||
if (boRtngudrefndVO.getReturnCstmrTelnb() != null) {
|
||||
@@ -278,28 +278,38 @@ public class BORtngudrefndService {
|
||||
}
|
||||
}
|
||||
|
||||
/*한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update를 위한 파라미터 셋팅*/
|
||||
BOOrdrRefundVO refundVO = new BOOrdrRefundVO();
|
||||
refundVO.setSopmalCd(boRtngudrefndVO.getSopmalCd());
|
||||
refundVO.setOrdrInnb(new BigInteger(boRtngudrefndVO.getOrdrInnb()));
|
||||
refundVO.setOrderRefundInnb(boRtngudrefndVO.getOrderRefundInnb());
|
||||
|
||||
if ( "01".equals(boRtngudrefndVO.getRefundTyCd()) ) { // 결제 취소
|
||||
if ("01".equals(boRtngudrefndVO.getRefundProcsSttusCd())) {
|
||||
if ("01".equals(boRtngudrefndVO.getRefundProcsSttusCd())) { // 환불신청
|
||||
// TODO : 신청일때 로직
|
||||
mapper.updateBOOrderReSttusUpdt(boRtngudrefndVO); // 반품/환불 상태값 수정
|
||||
/* 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update */
|
||||
ordrMapper.updateBOWonRefundAmt(refundVO);
|
||||
|
||||
} else if ("02".equals(boRtngudrefndVO.getRefundProcsSttusCd())) {
|
||||
} else if ("02".equals(boRtngudrefndVO.getRefundProcsSttusCd())) { //환불진행중
|
||||
|
||||
if ("01".equals(boRtngudrefndVO.getOldRefundProcsSttusCd())) {
|
||||
if ("01".equals(boRtngudrefndVO.getOldRefundProcsSttusCd())) { //이전 환불진행상태 = 환불신청
|
||||
orderRefundSttusUpdtPorcs(boRtngudrefndVO); // 주문에 환불건 관련 상태 및 수량 업데이트
|
||||
}
|
||||
|
||||
if ( "02".equals(boRtngudrefndVO.getRefundMthCd()) ) {
|
||||
if ( "02".equals(boRtngudrefndVO.getRefundMthCd()) ) { //환불방법 = 무통장계좌이체
|
||||
|
||||
mapper.updateBOOrderReSttusUpdt(boRtngudrefndVO); // 반품/환불 상태값 수정
|
||||
/* 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update */
|
||||
ordrMapper.updateBOWonRefundAmt(refundVO);
|
||||
|
||||
} else {
|
||||
// message = updateBORefundProcsProcess(boRtngudrefndVO); // 완료시에만 환불 처리
|
||||
}
|
||||
|
||||
} else if ("03".equals(boRtngudrefndVO.getRefundProcsSttusCd())) {
|
||||
} else if ("03".equals(boRtngudrefndVO.getRefundProcsSttusCd())) { //환불완료
|
||||
|
||||
if ("01".equals(boRtngudrefndVO.getOldRefundProcsSttusCd())) { // 신청에서 완료처리시
|
||||
if ("01".equals(boRtngudrefndVO.getOldRefundProcsSttusCd())) { // 이전 환불진행상태 = 환불신청 => 신청에서 완료처리시
|
||||
orderRefundSttusUpdtPorcs(boRtngudrefndVO); // 주문에 환불건 관련 상태 및 수량 업데이트
|
||||
}
|
||||
|
||||
@@ -313,6 +323,8 @@ public class BORtngudrefndService {
|
||||
log.debug("상태 업데이트 파라미터 확인 : {}", boRtngudrefndVO);
|
||||
|
||||
mapper.updateBOOrderReSttusUpdt(boRtngudrefndVO); // 반품/환불 상태값 수정
|
||||
/* 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update */
|
||||
ordrMapper.updateBOWonRefundAmt(refundVO);
|
||||
|
||||
} else if ( "02".equals(boRtngudrefndVO.getRefundProcsSttusCd()) && "02".equals(boRtngudrefndVO.getReturnProcsSttusCd()) ) { // 상품 받은거 확인하고 돈을 입금하지않았을 경우
|
||||
|
||||
@@ -321,6 +333,8 @@ public class BORtngudrefndService {
|
||||
}
|
||||
|
||||
mapper.updateBOOrderReSttusUpdt(boRtngudrefndVO); // 반품/환불 상태값 수정
|
||||
/* 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update */
|
||||
ordrMapper.updateBOWonRefundAmt(refundVO);
|
||||
|
||||
} else if ( "03".equals(boRtngudrefndVO.getRefundProcsSttusCd()) && "02".equals(boRtngudrefndVO.getReturnProcsSttusCd()) ) { // 상품 받은거 확인하고
|
||||
|
||||
@@ -466,21 +480,35 @@ public class BORtngudrefndService {
|
||||
Long lordrInnb = Long.valueOf(ordrInnb);
|
||||
BigInteger intOrdrInnb = BigInteger.valueOf(lordrInnb);
|
||||
String sopmalCd = refundVO.getSopmalCd();
|
||||
Integer refundAmt = 0;
|
||||
Integer refundAmt = 0; //현재 상품환불금액
|
||||
Integer wonRefundAmt = 0; //현재 상품환불금액(원화)
|
||||
|
||||
if (!CollectionUtils.isEmpty(orderReItemVOList)) {
|
||||
refundAmt = orderReItemVOList.stream()
|
||||
.mapToInt(BOOrderReItemVO::getGoodsRefundAmt)
|
||||
.sum();
|
||||
} else {
|
||||
refundAmt = Integer.parseInt(refundVO.getRefundAmt()); // 현재 환불 금액
|
||||
refundAmt = Integer.parseInt(refundVO.getRefundAmt()); // 현재 상품환불금액
|
||||
}
|
||||
wonRefundAmt = Integer.parseInt(refundVO.getWonRefundAmt()); //현재 상품환불금액(원화)
|
||||
|
||||
DataMap beforeRefund = mapper.selectBOORderRefundAmtSumInqire(refundVO);
|
||||
Integer orderRefundAmtSum = 0; // 해당주문의 이전 총환불금액
|
||||
Integer wonOrderRefundAmtSum = 0; // 해당주문의 이전 총환불금액(원화)
|
||||
if(!ObjectUtils.isEmpty(beforeRefund)) {
|
||||
orderRefundAmtSum = ((BigDecimal) beforeRefund.get("orderRefundAmtSum")).intValue(); // 해당주문의 이전 총환불금액
|
||||
wonOrderRefundAmtSum = ((BigDecimal)beforeRefund.get("wonOrderRefundAmtSum")).intValue(); // 해당주문의 이전 총환불금액(원화)
|
||||
}
|
||||
Integer orderRefundAmtSum = mapper.selectBOORderRefundAmtSumInqire(refundVO); // 해당 주문의 총 환불금액
|
||||
|
||||
Integer dlvyAmtRefundAmt = 0; // 최종 배송비 처리 금액 ( 환불 배송비, 반품 배송비 조건에 따라 변동 )
|
||||
Integer wonDlvyAmtRefundAmt = 0; // 최종 배송비 처리 금액 ( 환불 배송비, 반품 배송비 조건에 따라 변동 )
|
||||
Integer refundDlvyAmt = 0; // 환불 배송비 금액
|
||||
Integer wonRefundDlvyAmt = 0; // 환불 배송비 금액
|
||||
|
||||
Integer finalRefundAmt = 0;
|
||||
Integer finalWonRefundAmt = 0;
|
||||
finalRefundAmt = refundAmt;
|
||||
finalWonRefundAmt = wonRefundAmt;
|
||||
|
||||
try {
|
||||
|
||||
@@ -506,16 +534,19 @@ public class BORtngudrefndService {
|
||||
*/
|
||||
|
||||
refundDlvyAmt = Integer.parseInt(refundVO.getRefundDlvyAmt());
|
||||
wonRefundDlvyAmt = Integer.parseInt(refundVO.getWonRefundDlvyAmt());
|
||||
log.debug("여기 아래부터 배송비랑 환불금액 산정하는데 그전에 refundVO 데이터 확인 : {}", refundVO);
|
||||
if ("01".equals(refundVO.getRefundTyCd())) {
|
||||
|
||||
refundAmt += refundDlvyAmt; // 환불 배송비 포함 반품
|
||||
wonRefundAmt += wonRefundDlvyAmt;
|
||||
|
||||
refundVO.setDlvyAmtRefundAmt("0");
|
||||
|
||||
} else if ("02".equals(refundVO.getRefundTyCd())) {
|
||||
|
||||
dlvyAmtRefundAmt = Integer.parseInt(refundVO.getReturnDlvyAmt());
|
||||
wonDlvyAmtRefundAmt = Integer.parseInt(refundVO.getWonReturnDlvyAmt());
|
||||
|
||||
// 배송비 책임
|
||||
if ("01".equals(refundVO.getReturnDlvyRspnsblCd())) { // 구매자 책임
|
||||
@@ -530,12 +561,14 @@ public class BORtngudrefndService {
|
||||
if ("02".equals(refundVO.getReturnDlvyPymntTyCd()) && refundVO.getReturnDlvyAmt() != null) { // 환불금액에서 차감
|
||||
// refundAmt -= dlvyAmtRefundAmt;
|
||||
refundAmt = refundAmt - dlvyAmtRefundAmt > 0 ? refundAmt - dlvyAmtRefundAmt : 0;
|
||||
wonRefundAmt = wonRefundAmt - wonDlvyAmtRefundAmt > 0 ? wonRefundAmt - wonDlvyAmtRefundAmt : 0;
|
||||
}
|
||||
|
||||
refundVO.setDlvyAmtRefundAmt(StringUtil.isNullToString(dlvyAmtRefundAmt));
|
||||
|
||||
} else if ("02".equals(refundVO.getReturnDlvyRspnsblCd())) { // 판매자
|
||||
refundAmt += refundDlvyAmt; // 환불 배송비 포함 반품
|
||||
wonRefundAmt += wonRefundDlvyAmt;
|
||||
|
||||
refundVO.setDlvyAmtRefundAmt("0");
|
||||
}
|
||||
@@ -568,13 +601,23 @@ public class BORtngudrefndService {
|
||||
|
||||
log.info("setle : {}", setle);
|
||||
Integer setleAmt = setle.getSetleAmt(); // 결제금액
|
||||
Integer wonSetleAmt = setle.getWonSetleAmt(); // 결제금액(원화)
|
||||
|
||||
Integer remMnyAmt = setleAmt - orderRefundAmtSum;
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 remMnyAmt : {}", remMnyAmt);
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 refundAmt : {}", refundAmt);
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 orderRefundAmtSum : {}", orderRefundAmtSum);
|
||||
Integer wonRemMnyAmt = wonSetleAmt - wonOrderRefundAmtSum;
|
||||
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 remMnyAmt : {}, {}", remMnyAmt, wonRemMnyAmt);
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 refundAmt : {}, {}", refundAmt, wonRefundAmt);
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 orderRefundAmtSum : {}, {}", orderRefundAmtSum, wonOrderRefundAmtSum);
|
||||
|
||||
Integer cancelAmt = 0; // 취소금액
|
||||
Integer wonCancelAmt = 0; // 취소금액(원화)
|
||||
|
||||
// 환불금액, 결제금액 - (이전환불금액 - 환불금액)
|
||||
cancelAmt = Math.min(refundAmt, setleAmt - (orderRefundAmtSum - refundAmt));
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 cancelAmt : {}", cancelAmt);
|
||||
wonCancelAmt = Math.min(wonRefundAmt, wonSetleAmt - (wonOrderRefundAmtSum - wonRefundAmt));
|
||||
|
||||
log.info("이번 환불 결제건에서 환불할 금액 확인 cancelAmt : {}, {}", cancelAmt, wonCancelAmt);
|
||||
Integer receiptCancelAmt = cancelAmt; // 현금영수증 취소금액
|
||||
log.info("이번 환불 결제건에서 환불할 현금영수증 GC 머니 추가 전 금액 확인 receiptCancelAmt : {}", receiptCancelAmt);
|
||||
|
||||
@@ -734,6 +777,7 @@ public class BORtngudrefndService {
|
||||
}
|
||||
/************************** KCP 환불 코드 세팅 END *************************/
|
||||
|
||||
// 02:무통장계좌이체, 08:마일리지, 13:수동
|
||||
if ("02".equals(setle.getSetleTyCd()) || "08".equals(setle.getSetleTyCd()) || "13".equals(setle.getSetleTyCd())) {
|
||||
|
||||
if ("02".equals(setle.getSetleTyCd())) { // 무통장입금
|
||||
@@ -788,8 +832,6 @@ public class BORtngudrefndService {
|
||||
|
||||
// TODO :
|
||||
|
||||
} else if ("08".equals(setle.getSetleTyCd())) { // 마일리지
|
||||
// 마일리지 사용취소로 처리
|
||||
} else if ("09".equals(setle.getSetleTyCd())) {
|
||||
// 포스 환불은 포스기계쪽에서 처리됌 GCONE 에서는 데이터 처리만 진행
|
||||
} else if ("11".equals(setle.getSetleTyCd())) { // TODO : 복합 결제 취소 로직 확인 필요
|
||||
@@ -812,9 +854,9 @@ public class BORtngudrefndService {
|
||||
payVO.setCancelReason(refundVO.getRefundResnCn()); // 취소사유
|
||||
|
||||
if ("01".equals(refundVO.getRefundScopeCd())) {
|
||||
payVO.setCancelAmount(String.valueOf(cancelAmt)); // 취소금액 ( 금액이 없으면 전체취소 )
|
||||
payVO.setCancelAmount(String.valueOf(wonCancelAmt)); // 취소금액 ( 금액이 없으면 전체취소 )
|
||||
} else if ("02".equals(refundVO.getRefundScopeCd())) {
|
||||
payVO.setCancelAmount(String.valueOf(cancelAmt)); // 취소금액 ( 금액이 없으면 전체취소 )
|
||||
payVO.setCancelAmount(String.valueOf(wonCancelAmt)); // 취소금액 ( 금액이 없으면 전체취소 )
|
||||
}
|
||||
|
||||
payVO.setBank(refundVO.getRefundAcntBnnkCd()); // 환불 은행코드
|
||||
@@ -841,10 +883,12 @@ public class BORtngudrefndService {
|
||||
payVO.setMId(setle.getSetleMid()); // 결제 MID(상점키)
|
||||
|
||||
payVO.setPaymentKey(setle.getDelngNb()); // 거래번호
|
||||
|
||||
log.info("토스 취소 파라미터 확인 : {}", payVO);
|
||||
setleCancelResultMessage = payService.cancelTossPay(payVO);
|
||||
log.info("결제 취소 API 결과 확인 : {}", setleCancelResultMessage);
|
||||
log.info("결제 취소 API 결과 확인 : {}", setleCancelResultMessage.get("response"));
|
||||
|
||||
String jsonString = (String) setleCancelResultMessage.get("response");
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
responseMap = objectMapper.readValue(jsonString, Map.class);
|
||||
@@ -984,7 +1028,7 @@ public class BORtngudrefndService {
|
||||
payVO.setSetleTyCd(setle.getSetleTyCd()); // 결제 유형 코드
|
||||
|
||||
payVO.setCancelReason(refundVO.getRefundResnCn()); // 취소사유
|
||||
payVO.setCancelAmount(String.valueOf(cancelAmt)); // 취소금액 ( 금액이 없으면 전체취소 )
|
||||
payVO.setCancelAmount(String.valueOf(wonCancelAmt)); // 취소금액 ( 금액이 없으면 전체취소 )
|
||||
|
||||
payVO.setBank(refundVO.getRefundAcntBnnkCd()); // 계좌 입금 후 취소시 환불은행코드?
|
||||
payVO.setAccountNumber(refundVO.getRefundAcntnb()); // 환불 계좌번호
|
||||
@@ -992,8 +1036,8 @@ public class BORtngudrefndService {
|
||||
|
||||
payVO.setTno(setle.getDelngNb()); // 거래번호
|
||||
payVO.setModType(refundModeType); // 전체 취소, 부분 취소
|
||||
payVO.setModMny(String.valueOf(cancelAmt)); // 부분취소 요청 금액
|
||||
payVO.setRemMny(String.valueOf(remMnyAmt)); // 부분취소 가능 금액
|
||||
payVO.setModMny(String.valueOf(wonCancelAmt)); // 부분취소 요청 금액
|
||||
payVO.setRemMny(String.valueOf(wonRemMnyAmt)); // 부분취소 가능 금액
|
||||
|
||||
payVO.setSubModType(sub_mod_type); // 전체 취소, 부분 취소
|
||||
|
||||
@@ -1202,6 +1246,7 @@ public class BORtngudrefndService {
|
||||
|
||||
// ########################################### 최종 반품/환불 상태변경 ###########################################
|
||||
boRtngudrefndVO.setRefundAmt(String.valueOf(finalRefundAmt));
|
||||
boRtngudrefndVO.setWonRefundAmt(String.valueOf(finalWonRefundAmt));
|
||||
boRtngudrefndVO.setDlvyAmtRefundAmt(refundVO.getDlvyAmtRefundAmt());
|
||||
boRtngudrefndVO.setRefundProcsSttusCd("03");
|
||||
log.debug("환불 상태값이랑 정보 수정하기 전 boRtngudrefndVO :: {}", boRtngudrefndVO);
|
||||
|
||||
@@ -23,6 +23,8 @@ public class BORefundSetleVO extends AbstractVO {
|
||||
|
||||
private Integer setleAmt;
|
||||
|
||||
private Integer wonSetleAmt;
|
||||
|
||||
private String pgCmpnyNm;
|
||||
|
||||
private String pgInnb;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
private String ordrDlvyInnb;
|
||||
|
||||
private String[] ordrDlvyInnbArr;
|
||||
//쇼핑몰코드
|
||||
/**쇼핑몰코드*/
|
||||
private String sopmalCd;
|
||||
//TODO:: 추후 SESSION에서 처리 사용자,관리자 구분
|
||||
private String usrDv;
|
||||
@@ -25,69 +25,71 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
private String orderReInnb;
|
||||
private String refundCd; // 환불 코드 번호
|
||||
private String orderRefundInnb;
|
||||
/*주문고유번호*/
|
||||
/**주문고유번호*/
|
||||
private String ordrInnb;
|
||||
/*환불신청일시*/
|
||||
/**환불신청일시*/
|
||||
private String refundReqstDt;
|
||||
/*환불완료일시*/
|
||||
/**환불완료일시*/
|
||||
private String refundComptDt;
|
||||
/*신청(request), 처리중(ing), 완료(complete)*/
|
||||
/**신청(request), 처리중(ing), 완료(complete)*/
|
||||
private String refundProcsSttusCd;
|
||||
/*신청(request), 처리중(ing), 완료(complete) 이전 상태 */
|
||||
/**신청(request), 처리중(ing), 완료(complete) 이전 상태 */
|
||||
private String oldRefundProcsSttusCd;
|
||||
/*결제취소(cancel_payment),반품환불(return),배송비환불(shipping_price)*/
|
||||
/**결제취소(cancel_payment),반품환불(return),배송비환불(shipping_price)*/
|
||||
private String refundTyCd;
|
||||
/*전체취소(full), 부분취소(partial)*/
|
||||
/**전체취소(full), 부분취소(partial)*/
|
||||
private String refundScopeCd;
|
||||
/*환불사유내용*/
|
||||
/**환불사유내용*/
|
||||
private String refundResnCn;
|
||||
/*계좌이체(account), 무통장(bank), 신용카드(card), 수동(manual), ?(payco_coupon), 포스기기(pos)*/
|
||||
/**계좌이체(account), 무통장(bank), 신용카드(card), 수동(manual), ?(payco_coupon), 포스기기(pos)*/
|
||||
private String refundMthCd;
|
||||
/** 환불계좌은행코드 */
|
||||
private String refundAcntBnnkCd; // 환불계좌은행코드
|
||||
/*환불계좌은행명*/
|
||||
/**환불계좌은행명*/
|
||||
private String refundAcntBnnkNm;
|
||||
/*환불계좌예금주명*/
|
||||
/**환불계좌예금주명*/
|
||||
private String refundAcntDpstrNm;
|
||||
/*환불계좌번호*/
|
||||
/**환불계좌번호*/
|
||||
private String refundAcntnb;
|
||||
/*환불금액*/
|
||||
/**환불금액*/
|
||||
private String refundAmt;
|
||||
/*환불적립금액*/
|
||||
/**환불금액(원화)*/
|
||||
private String wonRefundAmt;
|
||||
/**환불적립금액*/
|
||||
private Integer refundAccmlmnyAmt;
|
||||
/*배송비환불총금액*/
|
||||
/**배송비환불총금액*/
|
||||
private Integer dlvyAmtTotRefundAmt;
|
||||
/*쿠폰할인보정금액*/
|
||||
/**쿠폰할인보정금액*/
|
||||
private Integer coupDscntRevisnAmt;
|
||||
/*적립금보정금액*/
|
||||
/**적립금보정금액*/
|
||||
private Integer accmlmnyRevisnAmt;
|
||||
/*에누리보정금액*/
|
||||
/**에누리보정금액*/
|
||||
private Integer enuriRevisnAmt;
|
||||
/*적립금유효일자*/
|
||||
/**적립금유효일자*/
|
||||
private String accmlmnyValidDe;
|
||||
/*다운로드쿠폰 고유번호*/
|
||||
/**다운로드쿠폰 고유번호*/
|
||||
private String dwldCouponInnb;
|
||||
/*상태메모내용*/
|
||||
/**상태메모내용*/
|
||||
private String sttusMemoCn;
|
||||
/*관리자메모내용*/
|
||||
/**관리자메모내용*/
|
||||
private String mngrMemoCn;
|
||||
/*관리자 고유번호*/
|
||||
/**관리자 고유번호*/
|
||||
private String mngrInnb;
|
||||
/*스마트쇼핑환불신청일시*/
|
||||
/**스마트쇼핑환불신청일시*/
|
||||
private String smrtShopngRefndReqstDt;
|
||||
/*스마트쇼핑환불완료일시*/
|
||||
/**스마트쇼핑환불완료일시*/
|
||||
private String smrtShopngRefndComptDt;
|
||||
/*cancel_done, refund_request*/
|
||||
/**cancel_done, refund_request*/
|
||||
private String smrtShopngRefndProcsSttusCd;
|
||||
/*스마트쇼핑클레임발생금액*/
|
||||
/**스마트쇼핑클레임발생금액*/
|
||||
private Integer smrtShopngClaimOccrrncAmt;
|
||||
/*스마트쇼핑초도배송비금액*/
|
||||
/**스마트쇼핑초도배송비금액*/
|
||||
private Integer smrtShopngFrsttmeDlvyAmtAmt;
|
||||
/*반품환불보류상품번호내용*/
|
||||
/**반품환불보류상품번호내용*/
|
||||
private String returnRefndDferGoodsNbCn;
|
||||
/*사용여부*/
|
||||
/**사용여부*/
|
||||
private String useAt;
|
||||
/*처리대상자 구분*/
|
||||
/**처리대상자 구분*/
|
||||
private String procsTargetDv;
|
||||
private String returnCd; // 반품 코드
|
||||
/**신청(request), 완료(complete), 철회(retraction)*/
|
||||
@@ -108,6 +110,8 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
private String returnCstmrMbtlnb;
|
||||
/** 반품배송비금액 */
|
||||
private String returnDlvyAmt;
|
||||
/** 반품배송비금액(원화) */
|
||||
private String wonReturnDlvyAmt;
|
||||
/** company,provider */
|
||||
private String returnDlvyAmtRecptTrgetCd;
|
||||
/**구매자(buyer), 판매자(seller)*/
|
||||
@@ -144,10 +148,14 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
private String smrtShopngReturnProcsSttusCd;
|
||||
/** 배송비환불금액 */
|
||||
private String dlvyAmtRefundAmt;
|
||||
/** 배송비환불금액(원화) */
|
||||
private String wonDlvyAmtRefundAmt;
|
||||
/** 지번 or 도로명 주소 */
|
||||
private String lnbOrRnmAdres;
|
||||
/** 환불배송비총금액 */
|
||||
private String refundDlvyAmt;
|
||||
/** 환불배송비총금액(원화) */
|
||||
private String wonRefundDlvyAmt;
|
||||
/** 반품 환불 상품 옵션 리스트 */
|
||||
private List<BOOrderReItemVO> orderReItemVOList;
|
||||
/**상세 내용*/
|
||||
@@ -167,11 +175,11 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
public String endDt;
|
||||
//날짜 검색 구분
|
||||
private String srchDtDv;
|
||||
//** 반품처리상태 */
|
||||
/** 반품처리상태 */
|
||||
private String[] srchReturnProcsStuusCd;
|
||||
//** 환불처리상태 */
|
||||
/** 환불처리상태 */
|
||||
private String[] srchRefundProcsSttusCd;
|
||||
//** 회수방법(반품) */
|
||||
/** 회수방법(반품) */
|
||||
private String srchReturnMthCd;
|
||||
/**검색시작일*/
|
||||
public String srchStartDate;
|
||||
@@ -189,9 +197,9 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
private String mbtlnb;
|
||||
/** 회원타입코드 */
|
||||
private String mbrTyCd;
|
||||
/*시크릿 키*/
|
||||
/**시크릿 키*/
|
||||
private String secretKey;
|
||||
/*회원 사이트정보 갱신용*/
|
||||
/**회원 사이트정보 갱신용*/
|
||||
private String siteMbrInnb;
|
||||
private String siteMbrDvCd;
|
||||
|
||||
@@ -200,7 +208,7 @@ public class BORtngudrefndVO extends AbstractVO{
|
||||
/** 실 환불 GC 머니 금액 */
|
||||
private String prosbleCancelCashAmt;
|
||||
|
||||
//** 반품처리상태 */
|
||||
/** 반품처리상태 */
|
||||
private String[] returnProcsStuusCd;
|
||||
|
||||
private String serverDv;
|
||||
|
||||
@@ -3920,6 +3920,7 @@
|
||||
AND FOS.ORDR_INNB = FO.ORDR_INNB
|
||||
WHERE FO.USE_AT = 'Y'
|
||||
AND FO.SUBSVC_AT = 'N' /*구독서비스 제외*/
|
||||
AND ( ( FO.ORDR_STTUS_CD BETWEEN '15' AND '75' ) OR FO.ORDR_STTUS_CD = '95' )
|
||||
AND IFNULL(FOS.ORDR_INNB, '') != ''
|
||||
AND FO.SOPMAL_CD = #{sopmalCd}
|
||||
AND FO.MBR_DV_CD = #{mbrDvCd}
|
||||
@@ -5587,6 +5588,32 @@
|
||||
) PV
|
||||
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
|
||||
</select>
|
||||
|
||||
<!-- 한화금액이 결제금액보다 많은지 체크하여 환불금액(원화) update -->
|
||||
<update id="updateBOWonRefundAmt" parameterType="com.wb.domainserver.domain.gcone.ordr.ordr.vo.BOOrdrRefundVO">
|
||||
<![CDATA[
|
||||
WITH BF AS (SELECT MAX(O.WON_RL_SETLE_AMT) - IFNULL(SUM(IFNULL(GOR2.WON_REFUND_AMT,0))+SUM(IFNULL(GOR2.WON_REFUND_DLVY_AMT,0)),0) AS WON_REST_AMT
|
||||
FROM GC_ORDER O
|
||||
LEFT OUTER JOIN GC_ORDER_REFUND GOR2
|
||||
ON GOR2.SOPMAL_CD = O.SOPMAL_CD
|
||||
AND GOR2.ORDR_INNB = O.ORDR_INNB
|
||||
AND GOR2.USE_AT = 'Y'
|
||||
AND GOR2.REFUND_PROCS_STTUS_CD = '03'
|
||||
AND GOR2.ORDER_REFUND_INNB != #{orderRefundInnb}
|
||||
WHERE O.SOPMAL_CD = #{sopmalCd}
|
||||
AND O.ORDR_INNB = #{ordrInnb}
|
||||
)
|
||||
UPDATE GC_ORDER_REFUND
|
||||
SET WON_REFUND_AMT = (CASE
|
||||
WHEN WON_REFUND_AMT + WON_REFUND_DLVY_AMT > (SELECT WON_REST_AMT FROM BF) THEN (SELECT WON_REST_AMT FROM BF) - WON_REFUND_DLVY_AMT
|
||||
ELSE WON_REFUND_AMT
|
||||
END)
|
||||
, UPDT_DT = NOW()
|
||||
WHERE SOPMAL_CD = #{sopmalCd}
|
||||
AND ORDER_REFUND_INNB = #{orderRefundInnb}
|
||||
]]>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
||||
@@ -1144,12 +1144,20 @@
|
||||
</when>
|
||||
</choose>
|
||||
<if test="@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(dlvyAmtRefundAmt)">
|
||||
<![CDATA[DLVY_AMT_REFUND_AMT = #{dlvyAmtRefundAmt},]]>
|
||||
DLVY_AMT_REFUND_AMT = #{dlvyAmtRefundAmt},
|
||||
WON_DLVY_AMT_REFUND_AMT = ROUND((SELECT GO2.BUY_RATE FROM GC_ORDER GO2 WHERE GO2.SOPMAL_CD = #{sopmalCd} AND GO2.ORDR_INNB = #{ordrInnb}) * #{dlvyAmtRefundAmt}, 0),
|
||||
</if>
|
||||
<if test="@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(refundAmt)">
|
||||
REFUND_AMT = #{refundAmt},
|
||||
WON_REFUND_AMT = ROUND((SELECT GO2.BUY_RATE FROM GC_ORDER GO2 WHERE GO2.SOPMAL_CD = #{sopmalCd} AND GO2.ORDR_INNB = #{ordrInnb}) * #{refundAmt}, 0) ,
|
||||
</if>
|
||||
<choose>
|
||||
<when test="@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(refundAmt) and @com.wb.domainserver.util.dataaccess.MybaitsUtil@isEmpty(wonRefundAmt)">
|
||||
WON_REFUND_AMT = ROUND((SELECT GO2.BUY_RATE FROM GC_ORDER GO2 WHERE GO2.SOPMAL_CD = #{sopmalCd} AND GO2.ORDR_INNB = #{ordrInnb}) * #{refundAmt}, 0) ,
|
||||
</when>
|
||||
<when test="@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(refundAmt) and @com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(wonRefundAmt)">
|
||||
WON_REFUND_AMT = #{wonRefundAmt},
|
||||
</when>
|
||||
</choose>
|
||||
MNGR_INNB = #{updusr},
|
||||
UPDT_DT = SYSDATE()
|
||||
<![CDATA[
|
||||
@@ -1347,8 +1355,10 @@
|
||||
RE.REFUND_ACNT_DPSTR_NM,
|
||||
RE.REFUND_ACNTNB,
|
||||
ROUND(RE.REFUND_AMT) AS REFUND_AMT,
|
||||
ROUND(RE.WON_REFUND_AMT) AS WON_REFUND_AMT,
|
||||
RE.REFUND_ACCMLMNY_AMT,
|
||||
ROUND(RE.REFUND_DLVY_AMT) AS REFUND_DLVY_AMT,
|
||||
ROUND(RE.WON_REFUND_DLVY_AMT) AS WON_REFUND_DLVY_AMT,
|
||||
RE.MLG_ACCMLMNY_AMT,
|
||||
RE.MLG_ACCMLMNY_VALID_DT,
|
||||
RE.ENURI_REVISN_AMT,
|
||||
@@ -1369,6 +1379,7 @@
|
||||
REGEXP_REPLACE(CAST(AES_DECRYPT(UNHEX(RE.RETURN_CSTMR_TELNB), '1df5be2f7e90ae36') AS CHAR(50)), '(.{3})(.{4})(.{4})', '$1-$2-$3') AS RETURN_CSTMR_TELNB,
|
||||
REGEXP_REPLACE(CAST(AES_DECRYPT(UNHEX(RE.RETURN_CSTMR_MBTLNB), '1df5be2f7e90ae36') AS CHAR(50)), '(.{3})(.{4})(.{4})', '$1-$2-$3') AS RETURN_CSTMR_MBTLNB,
|
||||
ROUND(RE.RETURN_DLVY_AMT) AS RETURN_DLVY_AMT,
|
||||
ROUND(RE.RETURN_DLVY_AMT * O.BUY_RATE) AS WON_RETURN_DLVY_AMT,
|
||||
RE.RETURN_DLVY_TRGET_CD,
|
||||
RE.RETURN_DLVY_RSPNSBL_CD,
|
||||
RE.RETURN_DLVY_PYMNT_TY_CD,
|
||||
@@ -1388,7 +1399,10 @@
|
||||
RE.REGIST_DT,
|
||||
RE.UPDT_DT,
|
||||
O.MBR_DV_CD,
|
||||
O.MBR_INNB
|
||||
O.MBR_INNB,
|
||||
O.BUY_RATE,
|
||||
ROUND(RE.DLVY_AMT_REFUND_AMT) AS DLVY_AMT_REFUND_AMT,
|
||||
ROUND(RE.DLVY_AMT_REFUND_AMT * O.BUY_RATE) AS WON_DLVY_AMT_REFUND_AMT
|
||||
FROM
|
||||
GC_ORDER_REFUND RE
|
||||
INNER JOIN GC_ORDER O ON RE.SOPMAL_CD = O.SOPMAL_CD
|
||||
@@ -1539,6 +1553,7 @@
|
||||
,ST.SOPMAL_CD
|
||||
,ST.ORDR_INNB
|
||||
,IFNULL(ST.SETLE_AMT, 0) AS SETLE_AMT -- 결제금액
|
||||
,IFNULL(ST.WON_SETLE_AMT, 0) AS WON_SETLE_AMT -- 결제금액
|
||||
,ST.PG_CMPNY_NM -- pg 회사명
|
||||
,ST.PG_INNB -- pg고유번호
|
||||
,ST.SETLE_TY_CD
|
||||
@@ -1572,10 +1587,8 @@
|
||||
<!-- 주문 환불 총 금액 -->
|
||||
<select id="selectBOORderRefundAmtSumInqire"
|
||||
parameterType="com.wb.domainserver.domain.gcone.ordr.rtngudrefnd.vo.BORtngudrefndVO"
|
||||
resultType="Integer">
|
||||
resultType="dataMap">
|
||||
<![CDATA[
|
||||
SELECT
|
||||
IFNULL((
|
||||
SELECT ROUND(
|
||||
SUM(
|
||||
CASE
|
||||
@@ -1586,14 +1599,24 @@
|
||||
ELSE RE.REFUND_AMT
|
||||
END
|
||||
END
|
||||
), 0)
|
||||
), 0) AS ORDER_REFUND_AMT_SUM
|
||||
, ROUND(
|
||||
SUM(
|
||||
CASE
|
||||
WHEN RE.REFUND_TY_CD = '01' THEN RE.WON_REFUND_AMT + RE.WON_REFUND_DLVY_AMT
|
||||
WHEN RE.REFUND_TY_CD = '02' THEN
|
||||
CASE
|
||||
WHEN RE.RETURN_DLVY_PYMNT_TY_CD = '02' THEN GREATEST(RE.WON_REFUND_AMT - IFNULL(RE.WON_DLVY_AMT_REFUND_AMT, 0), 0)
|
||||
ELSE RE.WON_REFUND_AMT
|
||||
END
|
||||
END
|
||||
), 0) AS WON_ORDER_REFUND_AMT_SUM
|
||||
FROM GC_ORDER_REFUND RE
|
||||
WHERE RE.SOPMAL_CD = #{sopmalCd}
|
||||
AND RE.ORDR_INNB = #{ordrInnb}
|
||||
AND RE.ORDER_REFUND_INNB != #{orderRefundInnb}
|
||||
AND RE.USE_AT = 'Y'
|
||||
GROUP BY RE.ORDR_INNB, RE.SOPMAL_CD
|
||||
), 0) AS ORDER_REFUND_AMT_SUM
|
||||
]]>
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user