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 b1025ab0a..4fb9f0d26 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 @@ -147,6 +147,15 @@ public class FleetInfoServiceImpl extends ServiceImpl .eq(MtUser::getMobile, fleetInfo.getMobile()) .last("limit 1")); createVaseInfo(mtUser, nowAccountInfo.getStoreId().toString(), fleetInfo.getStaffId(), null); + }else { + //判断当前用户是否已加入车队 + FleetInfo fleetInfo2 = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(FleetInfo::getUserId, mtUser.getId()) + .eq(FleetInfo::getStoreId, nowAccountInfo.getStoreId()) + .last("limit 1")); + if (ObjectUtil.isNotEmpty(fleetInfo2)){ + throw new RuntimeException("当前用户已创建车队"); + } } 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 f3ba7d0e0..e3a2fd446 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 @@ -102,10 +102,18 @@ public class FleetMemberServiceImpl extends ServiceImpl() + .eq(FleetMember::getMobile, fleetMember.getMobile()) + .eq(FleetMember::getFleetId, fleetMember.getFleetId()) + .last("limit 1")); + if (ObjectUtil.isNotEmpty(fleetMember2)){ + throw new RuntimeException("该用户已加入该车队"); } +// if (ObjectUtil.isNotEmpty(fleetMember1)) { +// return 0; +// } // LJUserVo user = userService.selectUserByMobileAndChantStoreId(fleetMember.getMobile()); //判断当前车队负责人是否存在账号 MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper()