From 565c78c955ee375a9e26c1e4c954818c951f39af Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 16 一月 2025 17:17:25 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java |    4 +++-
 ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java                    |   15 ++++++++++++++-
 ruoyi-auth/pom.xml                                                                      |    5 ++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ruoyi-auth/pom.xml b/ruoyi-auth/pom.xml
index 275881a..1265332 100644
--- a/ruoyi-auth/pom.xml
+++ b/ruoyi-auth/pom.xml
@@ -20,7 +20,10 @@
     </properties>
     
     <dependencies>
-        
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>ruoyi-api-other</artifactId>
+        </dependency>
         <!-- SpringCloud Alibaba Nacos -->
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
index b41500b..ce5d0dc 100644
--- a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
+++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -1,5 +1,7 @@
 package com.ruoyi.auth.service;
 
+import com.ruoyi.other.api.domain.Shop;
+import com.ruoyi.other.api.feignClient.ShopClient;
 import com.ruoyi.system.api.RemoteUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -39,7 +41,8 @@
 	
 	@Resource
 	private RedisService redisService;
-	
+	@Resource
+	private ShopClient shopClient;
 	/**
 	 * 登录
 	 */
@@ -93,6 +96,16 @@
 //			throw new ServiceException("对不起,您的账号:" + username + " 已停用");
 			throw new ServiceException("您的账号已被禁用,请联系平台");
 		}
+		if (user.getRoleType()==2){
+			Shop data = shopClient.getShopById(user.getObjectId()).getData();
+			if (data==null){
+				throw new ServiceException("门店不存在");
+			}else{
+				if (data.getStatus()==2){
+					throw new ServiceException("您的账号已被禁用,请联系平台");
+				}
+			}
+		}
 		passwordService.validate(user, password, request);
 		recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功");
 		return userInfo;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
index a1e1094..bd49cec 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -235,7 +235,9 @@
 
     @PostMapping("/byUserId")
     public R<List<Order>> byUserId(@RequestParam("appUserId") Long appUserId,@RequestParam("shopId") Integer shopId){
-        return R.ok(orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).eq(Order::getShopId, shopId).list());
+        return R.ok(orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).eq(Order::getShopId, shopId)
+                        .isNotNull(Order::getEndTime)
+                .list());
     }
     @PostMapping("/byShopId")
     public R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId){

--
Gitblit v1.7.1