|
@@ -12,6 +12,8 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
@Service
|
|
|
public class AppUserService {
|
|
|
|
|
@@ -27,6 +29,8 @@ public class AppUserService {
|
|
|
IExpansionOrderService expansionOrderService;
|
|
|
@Autowired
|
|
|
IUserIncrementService userIncrementService;
|
|
|
+ @Autowired
|
|
|
+ IUserRoleService userRoleService;
|
|
|
|
|
|
public UserVo getUserInfo(String phoneNum, Integer cameraType) {
|
|
|
if(StringUtils.isEmpty(phoneNum) ){
|
|
@@ -38,7 +42,14 @@ public class AppUserService {
|
|
|
}
|
|
|
UserVo userVo = new UserVo();
|
|
|
BeanUtils.copyProperties(user,userVo);
|
|
|
- Long cameraCount = cameraDetailService.getCountByCompanyId(user.getCompanyId(),cameraType);
|
|
|
+ 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);
|
|
|
+ }else {
|
|
|
+ cameraCount = cameraDetailService.getCountByUserId(user.getId(),null);
|
|
|
+ }
|
|
|
+
|
|
|
Long proCount = sceneProService.getCountByUserId(user.getId(), cameraType);
|
|
|
Long plusCount = scenePlusService.getCountByUserId(user.getId(), cameraType);
|
|
|
Long expansionCount = expansionOrderService.getCount(user.getId());
|