修改计费规则

This commit is contained in:
wuweihua
2026-10-23 17:43:07 +08:00
parent 55b5ed8951
commit 2bb562372e
3 changed files with 27 additions and 3 deletions
@@ -21,6 +21,7 @@ import com.bms.price.domain.vo.BillingTaskSubmitRequest;
import com.bms.price.domain.vo.TmsPriceBillRequest;
import com.bms.price.domain.vo.TmsPriceQuoteResult;
import com.bms.price.enums.BillBillingFailStatus;
import com.bms.price.enums.BillOrderStatus;
import com.bms.price.enums.BillTaskFailCode;
import com.bms.price.enums.BillTaskSuccessStatus;
import com.bms.price.enums.BillTaskType;
@@ -293,6 +294,20 @@ public class PrcBillingTaskServiceImpl implements IPrcBillingTaskService
{
throw new ServiceException("Oracle order mapped orderNo empty");
}
// Upstream ORDER_STATUS 9/10 -> REFUND (even if task was submitted as PENDING/REBILL).
if (BillOrderStatus.requiresFeeRefund(billReq.getOrderStatus()))
{
String refundOrderNo = StringUtils.isNotEmpty(billReq.getOrderNo())
? billReq.getOrderNo().trim()
: resolveRefundOrderNo(task);
log.info("billing task upstream status {} -> REFUND path taskId={} orderNo={}",
billReq.getOrderStatus(), taskId, refundOrderNo);
task.setBillType(BillTaskType.REFUND.getCode());
fillCustomerCodeFromBill(task, refundOrderNo);
refundWithDbRetry(taskId, refundOrderNo);
deleteTaskAfterBillSaved(task);
return;
}
if (StringUtils.isEmpty(billReq.getCustomerCode()))
{
throw new ServiceException("Oracle order mapped customerCode empty");