From 8dceb015ec8bd9642297d757e73936af84f4aaf1 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期三, 14 八月 2024 18:32:19 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
index 7441137..bcd2ad1 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -1,5 +1,7 @@
 package com.ruoyi.order.service.impl;
 
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -19,6 +21,7 @@
 import com.ruoyi.common.core.enums.PointStatusEnum;
 import com.ruoyi.common.core.enums.RequestTypeEnum;
 import com.ruoyi.common.core.enums.ReturnRequestStatusEnum;
+import com.ruoyi.common.core.enums.StartStatusEnum;
 import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.page.BeanUtils;
@@ -515,6 +518,9 @@
         return memberOrderVO;
     }
 
+    public static void main(String[] args) {
+        System.err.println(DateUtil.format(LocalDateTime.now(), DatePattern.NORM_DATETIME_PATTERN));
+    }
     @Override
     public MemberTiOrderVO updMemberOrder(MemberOrderDTO memberOrderDTO) {
         Order order = baseMapper.selectById(memberOrderDTO.getId());
@@ -858,7 +864,8 @@
                     Wrappers.lambdaQuery(OrderReturnRequest.class)
                             .eq(OrderReturnRequest::getOrderId,
                                     MemberOrderList.getId()).last("limit 1"));
-            if (StringUtils.isNotNull(orderReturnRequest)&&orderReturnRequest!=null) {
+            if (StringUtils.isNotNull(orderReturnRequest)
+                    && orderReturnRequest.getStatus() != ReturnRequestStatusEnum.QX) {
                 MemberOrderList.setStatus(orderReturnRequest.getStatus());
                 MemberOrderList.setRequestId(orderReturnRequest.getId());
                 MemberOrderList.setIsRequest(2);
@@ -977,6 +984,12 @@
                     goodsStockUpdDTO1.setSoldQuantity(data.getSoldQuantity()-order.getGoodsQuantity());
                 }
                 goodsSkuClient.updGoodsSeckill(goodsStockUpdDTO1,SecurityConstants.INNER);
+                if (data.getStartStatus().equals(StartStatusEnum.ENDED)) {
+                    GoodsStockUpdDTO dto = new GoodsStockUpdDTO();
+                    dto.setGoodsSkuId(data.getGoodsSkuId());
+                    dto.setAuctionStock(order.getGoodsQuantity());
+                    goodsSkuClient.updGoodsStock(Lists.newArrayList(dto), SecurityConstants.INNER);
+                }
             }
 
 

--
Gitblit v1.7.1