lyhzzz %!s(int64=2) %!d(string=hai) anos
pai
achega
9c97d9494f

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/ICameraDetailService.java

@@ -41,5 +41,5 @@ public interface ICameraDetailService extends IService<CameraDetail> {
 
     void uploadUserCameraInfo(Long id, String cameraVersion, String appVersion);
 
-    Long getCountByUserId(Long userId, Integer type);
+    Long getCountByUserId(Long companyId,Long userId, Integer type);
 }

+ 2 - 2
src/main/java/com/fdkankan/ucenter/service/impl/AppUserService.java

@@ -45,9 +45,9 @@ public class AppUserService {
         Set<Long> roleIds = userRoleService.getByUser(user);
         Long cameraCount = 0L;
         if(!roleIds.contains(5L) && !roleIds.contains(6L) && !roleIds.contains(1L)){
-            cameraCount = cameraDetailService.getCountByCompanyId(user.getCompanyId(),cameraType);
+            cameraCount = cameraDetailService.getCountByUserId(user.getCompanyId(),user.getId(),cameraType);
         }else {
-            cameraCount = cameraDetailService.getCountByUserId(user.getId(),cameraType);
+            cameraCount = cameraDetailService.getCountByCompanyId(user.getCompanyId(),cameraType);
         }
 
         Long proCount = sceneProService.getCountByUserId(user.getId(), cameraType);

+ 2 - 1
src/main/java/com/fdkankan/ucenter/service/impl/CameraDetailServiceImpl.java

@@ -82,8 +82,9 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
     }
 
     @Override
-    public Long getCountByUserId(Long userId, Integer type) {
+    public Long getCountByUserId(Long companyId,Long userId, Integer type) {
         LambdaQueryWrapper<CameraDetail> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CameraDetail::getCompanyId,companyId);
         wrapper.eq(CameraDetail::getUserId,userId);
         if(type != null){
             wrapper.eq(CameraDetail::getGoodsId,type);

+ 2 - 2
src/main/java/com/fdkankan/ucenter/service/impl/UserServiceImpl.java

@@ -143,9 +143,9 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
         Set<Long> roleIds = userRoleService.getByUser(user);
         Long cameraCount = 0L;
         if(!roleIds.contains(5L) && !roleIds.contains(6L) && !roleIds.contains(1L)){
-            cameraCount = cameraDetailService.getCountByCompanyId(user.getCompanyId(),null);
+            cameraCount = cameraDetailService.getCountByUserId(user.getCompanyId(),user.getId(),null);
         }else {
-            cameraCount = cameraDetailService.getCountByUserId(user.getId(),null);
+            cameraCount = cameraDetailService.getCountByCompanyId(user.getCompanyId(),null);
         }
         Long incrementNum = userIncrementService.getCountByUserId(user.getId(),0);
         Long incrementBindNum = userIncrementService.getCountByUserId(user.getId(),1);