|
@@ -1,17 +1,12 @@
|
|
package com.management.platform.service.impl;
|
|
package com.management.platform.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.management.platform.config.DefaultCommonModuleConfig;
|
|
import com.management.platform.config.DefaultCommonModuleConfig;
|
|
-import com.management.platform.entity.SysModule;
|
|
|
|
-import com.management.platform.entity.SysRoleModule;
|
|
|
|
-import com.management.platform.entity.User;
|
|
|
|
-import com.management.platform.entity.UserCommonModule;
|
|
|
|
|
|
+import com.management.platform.entity.*;
|
|
import com.management.platform.entity.vo.UserCommonModuleVO;
|
|
import com.management.platform.entity.vo.UserCommonModuleVO;
|
|
-import com.management.platform.mapper.SysModuleMapper;
|
|
|
|
-import com.management.platform.mapper.SysRoleModuleMapper;
|
|
|
|
-import com.management.platform.mapper.UserCommonModuleMapper;
|
|
|
|
-import com.management.platform.mapper.UserMapper;
|
|
|
|
|
|
+import com.management.platform.mapper.*;
|
|
import com.management.platform.service.UserCommonModuleService;
|
|
import com.management.platform.service.UserCommonModuleService;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -42,6 +37,12 @@ public class UserCommonModuleServiceImpl extends ServiceImpl<UserCommonModuleMap
|
|
@Resource
|
|
@Resource
|
|
private SysModuleMapper sysModuleMapper;
|
|
private SysModuleMapper sysModuleMapper;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private CompanyMapper companyMapper;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private TimeTypeMapper timeTypeMapper;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private DefaultCommonModuleConfig defaultCommonModuleConfig;
|
|
private DefaultCommonModuleConfig defaultCommonModuleConfig;
|
|
|
|
|
|
@@ -87,6 +88,14 @@ public class UserCommonModuleServiceImpl extends ServiceImpl<UserCommonModuleMap
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //角色赋有的module
|
|
|
|
+ List<Integer> modelIds = sysRoleModuleMapper.selectList(new QueryWrapper<SysRoleModule>().eq("role_id", user.getRoleId()))
|
|
|
|
+ .stream().map(sr -> sr.getModuleId()).collect(Collectors.toList());
|
|
|
|
+ if(CollectionUtils.isNotEmpty(modelIds)){
|
|
|
|
+ commonModules = commonModules.stream().filter(t -> modelIds.contains(t.getModuleId())).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
httpRespMsg.setData(commonModules);
|
|
httpRespMsg.setData(commonModules);
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|