退款申请列表查询接口增加查询字段

This commit is contained in:
dzl 2025-05-20 14:34:16 +08:00
parent 518bfb8ae9
commit fd3ae2fd3c
5 changed files with 104 additions and 60 deletions

View File

@ -79,7 +79,8 @@ public class ResApplyRefundDto {
/**
* 骑行设备编号
*/
private String ebikeCode;;
private String ebikeCode;
;
/**
* 骑行开始时间
@ -91,4 +92,14 @@ public class ResApplyRefundDto {
*/
private LocalDateTime endTime;
/**
* 骑点坐标
*/
private String ridePoint;
/**
* 还车坐标
*/
private String returnPoint;
}

View File

@ -89,7 +89,8 @@ public class ResCloseRefundDto {
/**
* 骑行设备编号
*/
private String ebikeCode;;
private String ebikeCode;
;
/**
* 骑行开始时间
@ -101,4 +102,14 @@ public class ResCloseRefundDto {
*/
private LocalDateTime endTime;
/**
* 骑点坐标
*/
private String ridePoint;
/**
* 还车坐标
*/
private String returnPoint;
}

View File

@ -96,4 +96,13 @@ public class ResHandleRefundDto {
*/
private LocalDateTime endTime;
/**
* 骑点坐标
*/
private String ridePoint;
/**
* 还车坐标
*/
private String returnPoint;
}

View File

@ -121,4 +121,13 @@ public class ResProcessedRefundDto {
*/
private LocalDateTime endTime;
/**
* 骑点坐标
*/
private String ridePoint;
/**
* 还车坐标
*/
private String returnPoint;
}

View File

@ -32,7 +32,7 @@ import static com.mybatisflex.core.constant.FuncName.*;
* @since 2025-04-25
*/
@Service
public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, EbikeRefund> implements EbikeRefundService{
public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, EbikeRefund> implements EbikeRefundService {
@Resource
private OrdersFeignClient ordersFeignClient;
@ -41,7 +41,7 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
public Boolean saveRefundResult(EbikeRefund ebikeRefund) {
boolean r = save(ebikeRefund);
// 同步发起退款
if(r)
if (r)
ordersFeignClient.refund(Long.valueOf(ebikeRefund.getOrderId()));
return r;
}
@ -85,27 +85,28 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
public Page<ResApplyRefundDto> getApplyingList(ReqRefundQueryDto refundDto) {
QueryWrapper query = QueryWrapper.create()
.select(EBIKE_REFUND.REFUND_ID.as("id"), EBIKE_REFUND.CREATE_TIME.as("apply_time"), EBIKE_USER.MOBILE.as("phone"),
EBIKE_REFUND.ORDER_ID.as("cycling_order_number"), EBIKE_REFUND.REFUND_APPLY.as("apply_refund_amount"),
EBIKE_REFUND.ORDER_ID.as("cycling_order_number"), EBIKE_REFUND.REFUND_APPLY.as("apply_refund_amount"),
EBIKE_PAYMENT.TOTAL.as("actual_pay_amount"), QueryMethods.case_(EBIKE_PAYMENT.PAYMENT_METHOD)
.when(PayMethod.wechat.name()).then("微信支付")
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
EBIKE_PAYMENT.PAYMENT_TIME.as("pay_time"), EBIKE_REFUND.REASON.as("apply_reason"),
EBIKE_PAYMENT.PAYMENT_TIME.as("pay_time"), EBIKE_REFUND.REASON.as("apply_reason"),
QueryMethods.case_(EBIKE_REFUND.SOURCE).when("0").then("用户")
.when("1").then("客服").end().as("source"), EBIKE_USER.NICKNAME.as("applicant"),
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"),EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time")
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"), EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time"),
EBIKE_USER_ORDERS.RIDE_POINT, EBIKE_USER_ORDERS.RETURN_POINT
)
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
.leftJoin(EBIKE_USER_ORDERS).on(EBIKE_USER_ORDERS.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(applying.ordinal())));
if(refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(applying.ordinal())));
if (refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
query.and(EBIKE_USER.MOBILE.like(refundDto.getPhone()));
if(refundDto.getCyclingOrderNumber()!= null &&!refundDto.getCyclingOrderNumber().isEmpty())
if (refundDto.getCyclingOrderNumber() != null && !refundDto.getCyclingOrderNumber().isEmpty())
query.and(EBIKE_REFUND.ORDER_ID.like(refundDto.getCyclingOrderNumber()));
if(refundDto.getRefundTime()!=null&&!refundDto.getRefundTime().isEmpty()){
if (refundDto.getRefundTime() != null && !refundDto.getRefundTime().isEmpty()) {
query.and(EBIKE_REFUND.REFUND_TIME.ge(refundDto.getRefundTime().get(0)));
if(refundDto.getRefundTime().size()==2)
if (refundDto.getRefundTime().size() == 2)
query.and(EBIKE_REFUND.REFUND_TIME.le(refundDto.getRefundTime().get(1)));
}
Page<ResApplyRefundDto> page = refundDto.getPageParam().getPage();
@ -122,25 +123,26 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
EBIKE_REFUND.REFUND.as("refund_amount"), QueryMethods.case_(EBIKE_REFUND.REFUND_METHOD)
.when("0").then("原路返回")
.when("1").then("余额退款")
.when("2").then("线下退款").end().as("refund_method"),
.when("0").then("原路返回")
.when("1").then("余额退款")
.when("2").then("线下退款").end().as("refund_method"),
EBIKE_PAYMENT.PAYMENT_TIME.as("pay_time"), EBIKE_REFUND.REASON.as("apply_reason"),
QueryMethods.case_(EBIKE_REFUND.SOURCE).when("0").then("用户")
.when("1").then("客服").end().as("source"), EBIKE_USER.NICKNAME.as("applicant"),
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"),EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time")
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"), EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time"),
EBIKE_USER_ORDERS.RIDE_POINT, EBIKE_USER_ORDERS.RETURN_POINT
)
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
.leftJoin(EBIKE_USER_ORDERS).on(EBIKE_USER_ORDERS.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(processing.ordinal())));
if(refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
if (refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
query.and(EBIKE_USER.MOBILE.like(refundDto.getPhone()));
if(refundDto.getCyclingOrderNumber()!= null &&!refundDto.getCyclingOrderNumber().isEmpty())
if (refundDto.getCyclingOrderNumber() != null && !refundDto.getCyclingOrderNumber().isEmpty())
query.and(EBIKE_REFUND.ORDER_ID.like(refundDto.getCyclingOrderNumber()));
if(refundDto.getRefundTime()!=null&&!refundDto.getRefundTime().isEmpty()){
if (refundDto.getRefundTime() != null && !refundDto.getRefundTime().isEmpty()) {
query.and(EBIKE_REFUND.REFUND_TIME.ge(refundDto.getRefundTime().get(0)));
if(refundDto.getRefundTime().size()==2)
if (refundDto.getRefundTime().size() == 2)
query.and(EBIKE_REFUND.REFUND_TIME.le(refundDto.getRefundTime().get(1)));
}
Page<ResHandleRefundDto> page = refundDto.getPageParam().getPage();
@ -150,37 +152,38 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
@Override
public Page<ResProcessedRefundDto> getProcessedList(ReqRefundQueryDto refundDto) {
QueryWrapper query = QueryWrapper.create()
.select(EBIKE_REFUND.REFUND_ID.as("id"), EBIKE_REFUND.CREATE_TIME.as("apply_time"), EBIKE_USER.MOBILE.as("phone"),
.select(EBIKE_REFUND.REFUND_ID.as("id"), EBIKE_REFUND.CREATE_TIME.as("apply_time"), EBIKE_USER.MOBILE.as("phone"),
EBIKE_REFUND.ORDER_ID.as("cycling_order_number"), EBIKE_PAYMENT.TOTAL.as("actual_pay_amount"),
QueryMethods.case_(EBIKE_REFUND.STATUS).when(String.valueOf(Status.SUCCESS.ordinal())).then("退款成功")
.when(String.valueOf(Status.PROCESSING.ordinal())).then("退款中")
QueryMethods.case_(EBIKE_REFUND.STATUS).when(String.valueOf(Status.SUCCESS.ordinal())).then("退款成功")
.when(String.valueOf(Status.PROCESSING.ordinal())).then("退款中")
.when(String.valueOf(Status.ABNORMAL.ordinal())).then("退款异常")
.when(String.valueOf(Status.CLOSED.ordinal())).then("退款终止").end().as("arrived_state"),
EBIKE_REFUND.REFUND_TIME.as("arrived_time"),EBIKE_REFUND.REFUND_TRANSACTION_ID.as("trade_serial_number"),
QueryMethods.case_(EBIKE_PAYMENT.PAYMENT_METHOD)
.when(PayMethod.wechat.name()).then("微信支付")
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
.when(String.valueOf(Status.CLOSED.ordinal())).then("退款终止").end().as("arrived_state"),
EBIKE_REFUND.REFUND_TIME.as("arrived_time"), EBIKE_REFUND.REFUND_TRANSACTION_ID.as("trade_serial_number"),
QueryMethods.case_(EBIKE_PAYMENT.PAYMENT_METHOD)
.when(PayMethod.wechat.name()).then("微信支付")
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
EBIKE_REFUND.REFUND.as("refund_amount"), QueryMethods.case_(EBIKE_REFUND.REFUND_METHOD)
.when("0").then("原路返回")
.when("1").then("余额退款")
.when("2").then("线下退款").end().as("refund_method"),
.when("0").then("原路返回")
.when("1").then("余额退款")
.when("2").then("线下退款").end().as("refund_method"),
EBIKE_PAYMENT.PAYMENT_TIME.as("pay_time"), EBIKE_REFUND.REASON.as("apply_reason"),
QueryMethods.case_(EBIKE_REFUND.SOURCE).when("0").then("用户")
.when("1").then("客服").end().as("source"), EBIKE_USER.NICKNAME.as("applicant"),
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"),EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time")
.when("1").then("客服").end().as("source"), EBIKE_USER.NICKNAME.as("applicant"),
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"), EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time"),
EBIKE_USER_ORDERS.RIDE_POINT, EBIKE_USER_ORDERS.RETURN_POINT
)
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
.leftJoin(EBIKE_USER_ORDERS).on(EBIKE_USER_ORDERS.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(processed.ordinal())));
if(refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(processed.ordinal())));
if (refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
query.and(EBIKE_USER.MOBILE.like(refundDto.getPhone()));
if(refundDto.getCyclingOrderNumber()!= null &&!refundDto.getCyclingOrderNumber().isEmpty())
if (refundDto.getCyclingOrderNumber() != null && !refundDto.getCyclingOrderNumber().isEmpty())
query.and(EBIKE_REFUND.ORDER_ID.like(refundDto.getCyclingOrderNumber()));
if(refundDto.getRefundTime()!=null&&!refundDto.getRefundTime().isEmpty()){
if (refundDto.getRefundTime() != null && !refundDto.getRefundTime().isEmpty()) {
query.and(EBIKE_REFUND.REFUND_TIME.ge(refundDto.getRefundTime().get(0)));
if(refundDto.getRefundTime().size()==2)
if (refundDto.getRefundTime().size() == 2)
query.and(EBIKE_REFUND.REFUND_TIME.le(refundDto.getRefundTime().get(1)));
}
Page<ResProcessedRefundDto> page = refundDto.getPageParam().getPage();
@ -190,29 +193,30 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
@Override
public Page<ResCloseRefundDto> getClosedList(ReqRefundQueryDto refundDto) {
QueryWrapper query = QueryWrapper.create()
.select(EBIKE_REFUND.REFUND_ID.as("id"), EBIKE_REFUND.CREATE_TIME.as("apply_time"), EBIKE_USER.MOBILE.as("phone"),
.select(EBIKE_REFUND.REFUND_ID.as("id"), EBIKE_REFUND.CREATE_TIME.as("apply_time"), EBIKE_USER.MOBILE.as("phone"),
EBIKE_REFUND.ORDER_ID.as("cycling_order_number"), EBIKE_PAYMENT.TOTAL.as("actual_pay_amount"),
EBIKE_REFUND.REMARK.as("reject_reason"), EBIKE_REFUND.PROCESS_TIME.as("reject_time"),
QueryMethods.case_(EBIKE_PAYMENT.PAYMENT_METHOD)
.when(PayMethod.wechat.name()).then("微信支付")
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
EBIKE_PAYMENT.PAYMENT_TIME.as("pay_time"), EBIKE_REFUND.REASON.as("apply_reason"),
QueryMethods.case_(EBIKE_REFUND.SOURCE).when("0").then("用户")
.when("1").then("客服").end().as("source"), EBIKE_USER.NICKNAME.as("applicant"),
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"),EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time")
)
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
EBIKE_REFUND.REMARK.as("reject_reason"), EBIKE_REFUND.PROCESS_TIME.as("reject_time"),
QueryMethods.case_(EBIKE_PAYMENT.PAYMENT_METHOD)
.when(PayMethod.wechat.name()).then("微信支付")
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
EBIKE_PAYMENT.PAYMENT_TIME.as("pay_time"), EBIKE_REFUND.REASON.as("apply_reason"),
QueryMethods.case_(EBIKE_REFUND.SOURCE).when("0").then("用户")
.when("1").then("客服").end().as("source"), EBIKE_USER.NICKNAME.as("applicant"),
EBIKE_USER_ORDERS.BIKE_CODE.as("ebike_code"), EBIKE_USER_ORDERS.START_TIME.as("start_time"), EBIKE_USER_ORDERS.END_TIME.as("end_time"),
EBIKE_USER_ORDERS.RIDE_POINT, EBIKE_USER_ORDERS.RETURN_POINT
)
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
.leftJoin(EBIKE_USER_ORDERS).on(EBIKE_USER_ORDERS.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(closed.ordinal())));
if(refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
.where(EBIKE_REFUND.PROCESS_STATE.eq(String.valueOf(closed.ordinal())));
if (refundDto.getPhone() != null && !refundDto.getPhone().isEmpty())
query.and(EBIKE_USER.MOBILE.like(refundDto.getPhone()));
if(refundDto.getCyclingOrderNumber()!= null &&!refundDto.getCyclingOrderNumber().isEmpty())
if (refundDto.getCyclingOrderNumber() != null && !refundDto.getCyclingOrderNumber().isEmpty())
query.and(EBIKE_REFUND.ORDER_ID.like(refundDto.getCyclingOrderNumber()));
if(refundDto.getRefundTime()!=null&&!refundDto.getRefundTime().isEmpty()){
if (refundDto.getRefundTime() != null && !refundDto.getRefundTime().isEmpty()) {
query.and(EBIKE_REFUND.REFUND_TIME.ge(refundDto.getRefundTime().get(0)));
if(refundDto.getRefundTime().size()==2)
if (refundDto.getRefundTime().size() == 2)
query.and(EBIKE_REFUND.REFUND_TIME.le(refundDto.getRefundTime().get(1)));
}
Page<ResCloseRefundDto> page = refundDto.getPageParam().getPage();
@ -228,7 +232,7 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
.when(PayMethod.wechat.name()).then("微信支付")
.when(PayMethod.alipay.name()).then("支付宝")
.when(PayMethod.balance.name()).then("余额").end().as("pay_method"),
EBIKE_PAYMENT.TOTAL.as("actual_amount"),EBIKE_PAYMENT.COST_PRICE.as("total_amount"),
EBIKE_PAYMENT.TOTAL.as("actual_amount"), EBIKE_PAYMENT.COST_PRICE.as("total_amount"),
EBIKE_USER.NICKNAME.as("user"), EBIKE_USER.MOBILE.as("phone")
)
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))