From 4b735e02ce063be311d7767870681d46f170d561 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com>
Date: Sat, 28 Sep 2024 09:33:14 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B09.28?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fleet/controller/FleetInfoController.java | 10 ++++
.../fleet/mapper/xml/FleetMemberMapper.xml | 2 +-
.../fleet/service/FleetInfoService.java | 7 +++
.../service/impl/FleetInfoServiceImpl.java | 18 +++++++
.../service/impl/FleetMemberServiceImpl.java | 47 ++++++++++---------
5 files changed, 60 insertions(+), 24 deletions(-)
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetInfoController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetInfoController.java
index 5a40cb6a9..56770b4b0 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetInfoController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetInfoController.java
@@ -127,5 +127,15 @@ public class FleetInfoController extends BaseController {
public ResponseObject getFleetInfoByFleetId(@Param("fleetId")Integer fleetId){
return getSuccessResult(fleetInfoService.queryByFleetId(fleetId));
}
+
+ /**
+ * 判断当前用户是否是该车队的管理员
+ * @param fleetId
+ * @return
+ */
+ @GetMapping("/ifFleetAdmin")
+ public ResponseObject ifFleetAdmin(Integer fleetId) {
+ return getSuccessResult(fleetInfoService.ifFleetAdmin(fleetId));
+ }
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetMemberMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetMemberMapper.xml
index e1339718b..a210ebda3 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetMemberMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetMemberMapper.xml
@@ -65,7 +65,7 @@
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetInfoService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetInfoService.java
index 49573e489..26fb6ec84 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetInfoService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetInfoService.java
@@ -91,4 +91,11 @@ public interface FleetInfoService {
* @return
*/
int editFleetInfo(FleetInfo fleetInfo);
+
+ /**
+ * 判断当前是否是车队管理员(小程序)
+ * @param fleetId
+ * @return
+ */
+ int ifFleetAdmin(Integer fleetId);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetInfoServiceImpl.java
index 367c39aed..890f7d11d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetInfoServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetInfoServiceImpl.java
@@ -377,6 +377,24 @@ public class FleetInfoServiceImpl extends ServiceImpl()
+ .eq(FleetInfo::getId, fleetId)
+ .eq(FleetInfo::getUserId, nowAccountInfo.getId()));
+ if (ObjectUtil.isNotEmpty(fleetInfo)) {
+ return 1;
+ }
+ return 0;
+ }
+
/**
* 创建用户的基础信息
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java
index d03f1114e..ee9c56871 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java
@@ -203,29 +203,29 @@ public class FleetMemberServiceImpl extends ServiceImpl