Browse Source

feat(order): 更新订单售后状态枚举值

- 在 AppOrder 和 AppOrderProInfo 实体中,售后状态添加"3-失败/异常"枚举值
- 为 AppOrderRefundsInfo 类添加序列化支持和类描述注释
-优化 RefundJobService退款任务逻辑及注释说明-重命名 SchoolOrderJobService 为 TodayExpireOrderJobService 并更新其功能描述
- 在 WeChatProfitSharingService 中增加分账金额非零判断条件
wangzq 3 weeks ago
parent
commit
3120f4aa0d

+ 3 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/pay/config/WeChatProfitSharingService.java

@@ -183,13 +183,14 @@ public class WeChatProfitSharingService {
                     Type receiverListType = new TypeToken<List<WechatReceiver>>() {}.getType();
                     // 转换
                     List<WechatReceiver> wechatReceivers = gson.fromJson(
-                            gson.toJson(res.get("receivers")), // 将receivers转为JSON字符串
+                            // 将receivers转为JSON字符串
+                            gson.toJson(res.get("receivers")),
                             receiverListType
                     );
                     for (WechatReceiver wechatReceiver : wechatReceivers) {
                         //关联订单分账详情
                         for (AppProfitSharingInfo appProfitSharingInfo : appProfitSharingInfos) {
-                            if (Objects.equals(wechatReceiver.getAccount(), appProfitSharingInfo.getMchId())) {
+                            if (Objects.equals(wechatReceiver.getAccount(), appProfitSharingInfo.getMchId()) && appProfitSharingInfo.getPreAmount() != 0) {
                                 appProfitSharingInfo.setProfitSharingRecordsId(appProfitSharingRecords.getId());
                                 appProfitSharingInfo.setAmount(wechatReceiver.getAmount());
                                 appProfitSharingInfo.setStatus(wechatReceiver.getResult());

+ 1 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/quartz/job/RefundJobService.java

@@ -8,17 +8,14 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.modules.app.form.RefundOrderForm;
 import org.jeecg.modules.app.service.IOrderService;
-import org.jeecg.modules.pay.config.WeChatProfitSharingService;
 import org.jeecg.modules.system.app.entity.AppOrder;
 import org.jeecg.modules.system.app.entity.AppOrderProInfo;
 import org.jeecg.modules.system.app.entity.AppSitePlace;
 import org.jeecg.modules.system.app.service.IAppOrderProInfoService;
-import org.jeecg.modules.system.app.service.IAppOrderService;
 import org.jeecg.modules.system.app.service.IAppSitePlaceService;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -28,7 +25,7 @@ import java.util.StringJoiner;
 /**
  * @author wzq
  * @date 2025/9/8 14:40
- * @description
+ * @description  无固定场已过期未使用的订单进行退款
  */
 @Slf4j
 @AllArgsConstructor

+ 7 - 12
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/quartz/job/SchoolOrderJobService.java → national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/quartz/job/TodayExpireOrderJobService.java

@@ -6,6 +6,7 @@ import org.jeecg.modules.system.app.mapper.AppGmtInfoMapper;
 import org.jeecg.modules.system.app.service.IAppOrderProInfoService;
 import org.jeecg.modules.system.app.service.IAppOrderService;
 import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
@@ -13,31 +14,25 @@ import javax.annotation.Resource;
 /**
  * @author wzq
  * @date 2025/9/8 15:18
- * @description
+ * @description 统计即将今日过期的子订单,发送延迟队列,在过期时修改订单过期状态,排除过期自动退款(无固定场)的订单
  */
 @Slf4j
 @AllArgsConstructor
-//@Component
-public class SchoolOrderJobService {
+@Component
+public class TodayExpireOrderJobService {
 
-    private final IAppOrderService appOrderService;
-
-    private final IAppOrderProInfoService appOrderProInfoService;
-
-    @Resource
-    private AppGmtInfoMapper appGmtInfoMapper;
 
     /**
-     *  @Description 查询学校开门记录表,匹配已开过门的订单,修改订单状态为已使用
+     *  @Description 统计24小时内即将过期的订单,并发送过期订单延迟消息
      */
     @Scheduled(cron = "")
     @Transactional(rollbackFor = Exception.class)
     public void execute(){
-        log.info("开始执行检查学校开门记录定时任务");
+        log.info("开始执行统计24小时内即将过期的订单,并发送过期订单延迟消息定时任务");
         try {
 
         }catch (Exception e){
-            log.error("检查已过期未使用的订单退款定时任务异常",e);
+            log.error("统计24小时内即将过期的订单,并发送过期订单延迟消息异常",e);
         }
     }
 }

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrder.java

@@ -103,7 +103,7 @@ public class AppOrder implements Serializable {
     @Schema(description = "订单状态 0-待付款 1-待使用 2-已使用 3-已到期 4-已取消 5-退款中 6-已退款")
     private Integer orderStatus;
 
-    @Schema(description = "售后状态 0-暂无售后 1-退款中 2-已退款")
+    @Schema(description = "售后状态 0-暂无售后 1-退款中 2-已退款 3-失败/异常")
     private Integer afterSaleStatus;
 
     @Schema(description = "支付状态 0-待支付 1-支付成功 2-退款中 3-已退款")

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrderProInfo.java

@@ -77,7 +77,7 @@ public class AppOrderProInfo implements Serializable{
     private BigDecimal price;
     @Schema(description = "0-待付款 1-待使用 2-已使用 3-已到期 4-已取消 5-退款中 6已退款")
     private Integer orderStatus;
-    @Schema(description = "售后状态:0-暂无售后 1-待退款 2-已退款")
+    @Schema(description = "售后状态:0-暂无售后 1-待退款 2-已退款 3-失败/异常")
     private Integer afterSaleStatus;
     @Schema(description = "数量")
     private Integer quantity;

+ 8 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrderRefundsInfo.java

@@ -8,16 +8,24 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
+/**
+ * @Description: 订单退款信息
+ * @Author: jeecg-boot
+ * @Date: 2021-08-03
+ * @Version: V1.0
+ */
 @Data
 @TableName("nm_order_refunds_info")
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = false)
 @Schema(description = "订单退款信息")
 public class AppOrderRefundsInfo implements Serializable {
+    @Serial
     private static final long serialVersionUID = 1L;
 
     /**