From 1386342e710ed0b5ccd2eb0b25229e3fa2b0f99c Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 31 十二月 2025 17:04:43 +0800
Subject: [PATCH] 优化
---
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/InsuranceController.java | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/InsuranceController.java b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/InsuranceController.java
index 3af70c0..654f79f 100644
--- a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/InsuranceController.java
+++ b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/InsuranceController.java
@@ -109,13 +109,16 @@
String payNo = OrderNos.getDid();
insuranceOrder.setPayNo(payNo);
boolean save = tInsuranceOrderService.save(insuranceOrder);
+ if(dto.getType()==2){
+ return R.ok();
+ }
Map<String, Object> result = wxV3Pay.jsApiInsurance(payNo, insuranceOrder.getPayMoney().multiply(BigDecimal.valueOf(100)).longValue(), appUser.getOpenId(),"购买保险","");
return R.ok(result);
}
- @ApiOperation(value = "保险模块--缴费记录")
+ @ApiOperation(value = "保险模块--缴费记录",response = TInsuranceOrder.class)
@PostMapping("/getInsuranceOrderList")
public R<?> getInsuranceOrderList(@RequestBody BasePage query) {
String userId = tokenService.getLoginUserApplet().getUserId();
@@ -139,6 +142,18 @@
Integer type = order1.getType();
+ String insuranceId = order1.getInsuranceId();
+
+ TInsurance insurance = tInsuranceService.getById(insuranceId);
+ if(insurance==null){
+ return R.fail("保险已关闭,无法退款");
+ }
+
+ // 判断是否过期
+ if(order1.getEndTime().before(new Date())){
+ return R.fail("保险已过期,无法退款");
+ }
+
// 判断是否有当前的课程 待支付 和已完成
int count = tCourseOrderService.countOrderNum( userId, type);
if(count>0){
@@ -156,7 +171,7 @@
if(payTime==null){
return R.fail("状态不允许退款");
}
- if(payTime.plusDays(2).isBefore(LocalDateTime.now()) || order.getPayType()==2){
+ if(payTime.plusDays(2).isBefore(LocalDateTime.now()) || order1.getPayType()==2){
order1.setBankCardNumber(order.getBankCardNumber());
order1.setCardholderName(order.getCardholderName());
order1.setRefundStatus(1);
--
Gitblit v1.7.1