|
|
@@ -5,10 +5,7 @@ import com.github.microservice.net.ResultMessage;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.zhongshu.card.client.model.base.SortParam;
|
|
|
import com.zhongshu.card.client.model.org.role.RoleSimpleModel;
|
|
|
-import com.zhongshu.card.client.model.scene.RoleBindAllParam;
|
|
|
-import com.zhongshu.card.client.model.scene.RoleBindSceneParam;
|
|
|
-import com.zhongshu.card.client.model.scene.RoleSceneInfoModel;
|
|
|
-import com.zhongshu.card.client.model.scene.SceneInfoModel;
|
|
|
+import com.zhongshu.card.client.model.scene.*;
|
|
|
import com.zhongshu.card.client.type.DataState;
|
|
|
import com.zhongshu.card.server.core.dao.org.RoleDao;
|
|
|
import com.zhongshu.card.server.core.dao.scene.ProjectSceneInfoDao;
|
|
|
@@ -148,6 +145,7 @@ public class RoleSceneInfoService extends SuperService {
|
|
|
public List<SceneInfoModel> getAllEnableScenes(String roleId) {
|
|
|
List<SceneInfoModel> models = new ArrayList<>();
|
|
|
if (StringUtils.isNotEmpty(roleId)) {
|
|
|
+ // 角色关联的场景数据
|
|
|
List<RoleSceneInfo> list = roleSceneInfoDao.findByRoleIdOrderBySortAsc(roleId);
|
|
|
if (ObjectUtils.isNotEmpty(list)) {
|
|
|
list.stream().forEach(it -> {
|
|
|
@@ -164,13 +162,14 @@ public class RoleSceneInfoService extends SuperService {
|
|
|
return models;
|
|
|
}
|
|
|
|
|
|
- public List<SceneInfoModel> getUserAllEnableScenes() {
|
|
|
+ public List<SceneInfoAboutComModel> getUserAllEnableScenes() {
|
|
|
// 得到当前用户所有的角色
|
|
|
ResultContent<List<RoleSimpleModel>> content = roleServiceImpl.xcxGetCurrentRoles();
|
|
|
if (content.isSuccess()) {
|
|
|
List<RoleSimpleModel> roles = content.getContent();
|
|
|
if (ObjectUtils.isNotEmpty(roles)) {
|
|
|
- List<SceneInfoModel> models = new ArrayList<>();
|
|
|
+
|
|
|
+ List<SceneInfoAboutComModel> models = new ArrayList<>();
|
|
|
List<String> roleIds = roles.stream().map(it -> it.getId()).collect(Collectors.toUnmodifiableList());
|
|
|
List<RoleSceneInfo> list = roleSceneInfoDao.findByRoleIdInOrderBySortAsc(roleIds);
|
|
|
if (ObjectUtils.isNotEmpty(list)) {
|
|
|
@@ -179,7 +178,7 @@ public class RoleSceneInfoService extends SuperService {
|
|
|
ProjectSceneInfo projectSceneInfo = it.getProjectSceneInfo();
|
|
|
if (ObjectUtils.isNotEmpty(projectSceneInfo) && ObjectUtils.isNotEmpty(sceneInfo)) {
|
|
|
if (projectSceneInfo.getState() == DataState.Enable && sceneInfo.getState() == DataState.Enable) {
|
|
|
- models.add(sceneInfoService.toModel(sceneInfo));
|
|
|
+ models.add(sceneInfoService.toAboutComModel(sceneInfo));
|
|
|
}
|
|
|
}
|
|
|
});
|