用户订单筛选及用户退款回调配置
This commit is contained in:
parent
f0e0086171
commit
ccce3bd3f0
@ -7,6 +7,7 @@ import com.cdzy.payment.model.entity.EbikeOrder;
|
||||
import com.cdzy.payment.service.EbikeOrderService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import static com.cdzy.payment.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
||||
@ -17,6 +18,7 @@ import static com.cdzy.payment.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER
|
||||
* @author yanglei
|
||||
* @since 2025-11-19 15:54
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EbikeOrderServiceImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> implements EbikeOrderService {
|
||||
|
||||
@ -36,6 +38,10 @@ public class EbikeOrderServiceImpl extends ServiceImpl<EbikeOrderMapper, EbikeOr
|
||||
.where(EBIKE_ORDER.ORDER_ID.eq(orderId))
|
||||
.where(EBIKE_ORDER.ORDER_STATUS.eq(EbikeOrderStatus.REFUNDING));
|
||||
EbikeOrder userOrders = this.mapper.selectOneByQuery(queryWrapper);
|
||||
if (userOrders == null) {
|
||||
log.warn("退款完成时未找到订单,订单ID: {}, 或订单状态不是退款中", orderId);
|
||||
return;
|
||||
}
|
||||
userOrders.setOrderStatus(EbikeOrderStatus.REFUNDED);
|
||||
this.mapper.update(userOrders);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
||||
int totalSeconds = duration * 60;
|
||||
|
||||
String timeFilter = String.format(
|
||||
"%s + INTERVAL '%d seconds' >= NOW()",
|
||||
"%s + INTERVAL '%d seconds' <= NOW()",
|
||||
EBIKE_REFUND.CREATE_TIME.getName(),
|
||||
totalSeconds
|
||||
);
|
||||
|
||||
@ -442,10 +442,6 @@ public class EbikeWxPayServiceImpl implements EbikeWxPayService {
|
||||
ebikeRefund.setRefundTransactionId(result.getRefundId());
|
||||
ebikeRefund.setReviewOperator(refundDto.getStaffId());
|
||||
ebikeRefundService.updateById(ebikeRefund);
|
||||
// 更新退款单状态
|
||||
ebikeRefundService.updateRefundStatus(result);
|
||||
// 更新订单状态 为退款已完成
|
||||
ebikeOrderService.doneRefund(orderId);
|
||||
notifyVo.setSuccess(true);
|
||||
notifyVo.setMessage("退款成功");
|
||||
return notifyVo;
|
||||
|
||||
@ -86,8 +86,8 @@ payment:
|
||||
merchant-serial-number: 7873E3E694ADD0368EA3E9FAC929F496EECB8DF9
|
||||
api-v3-key: 1715147005V3Key20250425174554633
|
||||
public-key-id: PUB_KEY_ID_0117151470052025042500331704000601
|
||||
pay-notify_url: http://192.168.2.156:10017/wxPayment/pay-notify
|
||||
refund-notify_url: http://192.168.2.156:10017/wxPayment/refund-notify
|
||||
pay-notify_url: http://192.168.101.18:10010/payment/wxPayment/pay-notify
|
||||
refund-notify_url: http://192.168.101.18:10010/payment/wxPayment/refund-notify
|
||||
expire-minutes: 1440
|
||||
pay-schedule: 0 0 0/12 * * ?
|
||||
refund-schedule: 0 0/30 * * * ?
|
||||
|
||||
@ -202,6 +202,17 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<!-- 关键配置:使用 <parameters>true</parameters> -->
|
||||
<parameters>true</parameters>
|
||||
<source>17</source> <!-- JDK 版本 -->
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
|
||||
@ -115,8 +115,8 @@ public class EbikeOrderController {
|
||||
* @param userId 用户订单表主键
|
||||
*/
|
||||
@GetMapping("getUserAllOrder")
|
||||
public JsonResult<?> getUserAllOrder(@RequestParam("userId") Long userId, PageParam page) {
|
||||
Page<EbikeUserAllOrdersVo> userAllOrders = ebikeOrderService.getUserAllOrder(userId, page);
|
||||
public JsonResult<?> getUserAllOrder(Long userId, Integer orderStatus, PageParam page) {
|
||||
Page<EbikeUserAllOrdersVo> userAllOrders = ebikeOrderService.getUserAllOrder(userId, orderStatus, page);
|
||||
return JsonResult.success(userAllOrders);
|
||||
}
|
||||
|
||||
|
||||
@ -54,6 +54,16 @@ public class EbikeRefundOrderDetailVo {
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer processStatus;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 起步费用
|
||||
|
||||
@ -21,12 +21,16 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class EbikeUserAllOrdersVo {
|
||||
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 退款id
|
||||
*/
|
||||
private Long refundId;
|
||||
|
||||
/**
|
||||
* 运营商ID
|
||||
*/
|
||||
|
||||
@ -118,5 +118,5 @@ public interface EbikeOrderService extends IService<EbikeOrder> {
|
||||
* @param userId 用户id
|
||||
* @return 用户订单
|
||||
*/
|
||||
Page<EbikeUserAllOrdersVo> getUserAllOrder(Long userId, PageParam page);
|
||||
Page<EbikeUserAllOrdersVo> getUserAllOrder(Long userId, Integer orderStatus, PageParam page);
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cdzy.user.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
||||
import static com.cdzy.user.model.entity.table.EbikeRefundTableDef.EBIKE_REFUND;
|
||||
|
||||
|
||||
/**
|
||||
@ -259,10 +260,11 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EbikeUserAllOrdersVo> getUserAllOrder(Long userId, PageParam page) {
|
||||
public Page<EbikeUserAllOrdersVo> getUserAllOrder(Long userId, Integer orderStatus, PageParam page) {
|
||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||
.select(
|
||||
EBIKE_ORDER.ORDER_ID,
|
||||
EBIKE_REFUND.REFUND_ID,
|
||||
EBIKE_ORDER.OPERATOR_ID,
|
||||
EBIKE_ORDER.BIKE_CODE,
|
||||
EBIKE_ORDER.ORDER_TYPE,
|
||||
@ -287,7 +289,9 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
|
||||
EBIKE_ORDER.CREATE_TIME
|
||||
)
|
||||
.where(EBIKE_ORDER.USER_ID.eq(userId))
|
||||
.orderBy(EBIKE_ORDER.CREATE_TIME.desc());
|
||||
.and(EBIKE_ORDER.ORDER_STATUS.eq(orderStatus,Objects.nonNull(orderStatus)))
|
||||
.leftJoin(EBIKE_REFUND).on(EBIKE_REFUND.ORDER_ID.eq(EBIKE_ORDER.ORDER_ID));
|
||||
queryWrapper.orderBy(EBIKE_ORDER.CREATE_TIME.desc());
|
||||
return this.mapper.paginateAs(page.getPage(), queryWrapper, EbikeUserAllOrdersVo.class);
|
||||
}
|
||||
|
||||
|
||||
@ -529,7 +529,9 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
||||
EBIKE_PAYMENT.TOTAL.as("actualPaymentAmount"),
|
||||
EBIKE_PAYMENT.COST_PRICE.as("originalOrderPrice"),
|
||||
EBIKE_USER.NICKNAME.as("username"),
|
||||
EBIKE_USER.MOBILE
|
||||
EBIKE_USER.MOBILE,
|
||||
EBIKE_REFUND.PROCESS_STATUS,
|
||||
EBIKE_REFUND.REMARK
|
||||
)
|
||||
.leftJoin(EBIKE_PAYMENT).on(EBIKE_PAYMENT.ORDER_ID.eq(EbikeRefundTableDef.EBIKE_REFUND.ORDER_ID))
|
||||
.leftJoin(EBIKE_USER).on(EBIKE_USER.USER_ID.eq(EBIKE_PAYMENT.USER_ID))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user