Commit 5ce5c5b0 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents bebaf72f d6a1144e
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
width="50" width="50"
height="50" height="50"
v-if="appInfo.appIconPath" v-if="appInfo.appIconPath"
:src="api + appInfo.appIconPath" :src="appInfo.appIconPath"
/> />
<div class="name">{{ appInfo.appName }}</div> <div class="name">{{ appInfo.appName }}</div>
<div class="version">当前版本:v{{ appInfo.version }}</div> <div class="version">当前版本:v{{ appInfo.version }}</div>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
v-if="text.video" v-if="text.video"
width="50" width="50"
:src="filterRes(text.video)" :src="filterRes(text.video)"
@click="handlePreview('video', api2 + text.video)" @click="handlePreview('video', text.video)"
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
...@@ -320,7 +320,7 @@ export default { ...@@ -320,7 +320,7 @@ export default {
// 过滤影音 // 过滤影音
filterRes(data) { filterRes(data) {
let resource = data.split(",").map((v) => { let resource = data.split(",").map((v) => {
return this.api2 + v; return v;
}); });
return resource[0]; return resource[0];
...@@ -328,7 +328,7 @@ export default { ...@@ -328,7 +328,7 @@ export default {
// 预览 // 预览
handlePreview(type, data) { handlePreview(type, data) {
let resource = data.split(",").map((v) => { let resource = data.split(",").map((v) => {
return this.api2 + v; return v;
}); });
if (type == "img") { if (type == "img") {
this.$viewerApi({ this.$viewerApi({
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<h2 class="show-titlw">{{ curSkin.name }}</h2> <h2 class="show-titlw">{{ curSkin.name }}</h2>
<p> <p>
更新时间:<span style="margin-right: 20px">{{ 更新时间:<span style="margin-right: 20px">{{
curSkin.updateTime | dateFormat curSkin.updateTime
? dateFormat(curSkin.updateTime)
: dateFormat(curSkin.createTime)
}}</span> }}</span>
支持分辨率:<span 支持分辨率:<span
>{{ filterItems(curSkin.imageResolution, imageResolution) }} >{{ filterItems(curSkin.imageResolution, imageResolution) }}
...@@ -167,6 +169,9 @@ export default { ...@@ -167,6 +169,9 @@ export default {
}, },
}); });
}, },
dateFormat(val) {
return this.$moment(val).format("YYYY-MM-DD HH:mm:ss");
},
}, },
}; };
</script> </script>
......
<template> <template>
<div class="system flex flexc"> <div class="system flex flexc">
<a-tabs :activeKey="activeKey" @change="changeRouter"> <a-tabs :activeKey="activeKey" @change="changeRouter">
<!-- <a-tab-pane key="/system/user"> <a-tab-pane key="/system/user">
<span slot="tab"> <span slot="tab">
<a-icon type="user" /> <a-icon type="user" />
用户管理 用户管理
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<a-icon type="deployment-unit" /> <a-icon type="deployment-unit" />
维度管理 维度管理
</span> </span>
</a-tab-pane> --> </a-tab-pane>
<a-tab-pane key="/system/parameter"> <a-tab-pane key="/system/parameter">
<span slot="tab"> <span slot="tab">
<a-icon type="container" /> <a-icon type="container" />
......
...@@ -108,6 +108,10 @@ export default { ...@@ -108,6 +108,10 @@ export default {
return this.dict.dimensionType[text]; return this.dict.dimensionType[text];
}, },
}, },
{
title: "维度值",
dataIndex: "dimensionValue",
},
{ {
title: "创建时间", title: "创建时间",
dataIndex: "createTime", dataIndex: "createTime",
......
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
> >
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="维度值" prop="dimensionValue">
<a-input
v-model="form.dimensionValue"
placeholder="请输入维度值"
></a-input>
</a-form-model-item>
</a-form-model> </a-form-model>
</a-modal> </a-modal>
</div> </div>
...@@ -85,6 +91,9 @@ export default { ...@@ -85,6 +91,9 @@ export default {
dimensionCode: [ dimensionCode: [
{ required: true, message: "请输入维度编码", trigger: "blur" }, { required: true, message: "请输入维度编码", trigger: "blur" },
], ],
dimensionValue: [
{ required: true, message: "请输入维度值", trigger: "blur" },
],
dimensionType: [ dimensionType: [
{ required: true, message: "请选择维度类型", trigger: "change" }, { required: true, message: "请选择维度类型", trigger: "change" },
], ],
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
>分配资源</span >分配资源</span
> >
<span class="primary pointer" @click="handleResDim(text)" <span class="primary pointer" @click="handleResDim(text)"
>资源维度</span >资源规则</span
> >
<span class="primary pointer" @click="handleEdit(text)">编辑</span> <span class="primary pointer" @click="handleEdit(text)">编辑</span>
<span class="delete pointer" @click="handleDel(text.id)">删除</span> <span class="delete pointer" @click="handleDel(text.id)">删除</span>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
></AddRole> ></AddRole>
<!-- 分配资源 --> <!-- 分配资源 -->
<ApportionRes ref="ApportionRes" :visible.sync="resVisible"></ApportionRes> <ApportionRes ref="ApportionRes" :visible.sync="resVisible"></ApportionRes>
<!-- 角色维度 --> <!-- 资源规则 -->
<ResDimList ref="ResDimList" :visible.sync="resDimListVisible"></ResDimList> <ResDimList ref="ResDimList" :visible.sync="resDimListVisible"></ResDimList>
</div> </div>
</template> </template>
......
...@@ -5,14 +5,7 @@ ...@@ -5,14 +5,7 @@
:visible="Visible" :visible="Visible"
@cancel="handleCancel" @cancel="handleCancel"
:maskClosable="false" :maskClosable="false"
> :zIndex="1001"
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
> >
<a-form-model <a-form-model
:model="form" :model="form"
...@@ -21,22 +14,65 @@ ...@@ -21,22 +14,65 @@
:label-col="{ span: 5 }" :label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }" :wrapper-col="{ span: 19 }"
> >
<a-form-model-item label="名称" prop="name"> <a-form-model-item label="所属资源" prop="resourceId">
<a-input v-model="form.name" placeholder="请输入角色名称"></a-input> <a-cascader
:options="resourceList"
v-model="resource"
placeholder="请选择资源"
@change="changeRes"
/>
</a-form-model-item>
<a-form-model-item label="所属维度" prop="ruleCode">
<a-select
allowClear
v-model="form.ruleCode"
@change="changeDim"
placeholder="请选择所属维度"
>
<a-select-option
v-for="v in dimensionList"
:key="v.id"
:value="v.dimensionCode"
:dataset-row="v"
>
{{ v.dimensionName }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="备注" prop="remark"> <a-form-model-item label="规则条件" prop="ruleCondition">
<a-textarea <a-select
v-model="form.remark" allowClear
placeholder="请输入备注" v-model="form.ruleCondition"
></a-textarea> placeholder="请选择规则条件"
>
<a-select-option
v-for="(v, key) in dict.ruleCondition"
:key="key"
:value="key"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import { saveRole } from "@/services/system"; import {
getDimensionList,
getResourceList,
saveDimRes,
} from "@/services/system";
export default { export default {
components: {}, components: {},
...@@ -60,9 +96,30 @@ export default { ...@@ -60,9 +96,30 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
form: {}, resource: [],
dimensionList: [], // 维度列表
resourceList: [], // 资源列表
form: {
roleId: "", // 角色id
resourceId: "", // 资源id
ruleCode: undefined, // 维度编码
ruleName: "", // 维度名称
ruleCondition: undefined, // 规则条件
ruleValue: "", // 维度值
ruleType: "", // 维度类型
roleName: "", // 角色名称
resourceName: "", // 资源名称
},
rules: { rules: {
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }], resourceId: [
{ required: true, message: "请选择资源", trigger: "change" },
],
ruleCode: [
{ required: true, message: "请选择维度", trigger: "change" },
],
ruleCondition: [
{ required: true, message: "请选择规则条件", trigger: "change" },
],
}, },
}; };
}, },
...@@ -76,17 +133,106 @@ export default { ...@@ -76,17 +133,106 @@ export default {
}, },
}, },
}, },
created() {}, created() {
this.getDimensionList();
this.getResourceList();
},
methods: { methods: {
// 获取维度列表
async getDimensionList() {
let res = await getDimensionList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.dimensionList = data;
}
},
// 获取资源列表
async getResourceList() {
let res = await getResourceList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.resourceList = this.groupByAuth(data);
}
},
// 资源分组
groupByAuth(list) {
let group = {};
let groupList = [];
list.forEach((item) => {
let name = item.name.split("-")[0];
if (!group[name]) {
group[name] = {
indeterminate: false,
checkAll: false,
list: [],
};
}
group[name].list.push(item);
});
groupList = Object.keys(group).map((key) => {
return {
label: key,
value: key,
children: group[key].list.map((v) => {
return {
label: v.name,
value: v.id,
};
}),
};
});
return groupList;
},
// 选择资源
changeRes(val, selectedOptions) {
if (selectedOptions.length) {
this.form.resourceId = selectedOptions[1].value;
this.form.resourceName = selectedOptions[1].label;
} else {
this.form.resourceId = "";
this.form.resourceName = "";
}
},
// 选择维度
changeDim(val, e) {
if (val && e) {
let { dimensionName, dimensionType, dimensionValue } = e.data.attrs[
"dataset-row"
];
this.form.ruleName = dimensionName;
this.form.ruleType = dimensionType;
this.form.ruleValue = dimensionValue;
} else {
this.form.ruleName = "";
this.form.ruleType = "";
this.form.ruleValue = "";
}
},
// 新增 // 新增
onAdd() { onAdd(roleInfo) {
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id"); this.form.id && this.$delete(this.form, "id");
this.form.roleId = roleInfo.id;
this.form.roleName = roleInfo.name;
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.$nextTick(() => { this.$nextTick(() => {
this.form = { ...row }; this.form = { ...row };
let resName = this.form.resourceName.split("-")[0];
this.resource = [resName, this.form.resourceId];
}); });
}, },
// 保存 // 保存
...@@ -94,7 +240,7 @@ export default { ...@@ -94,7 +240,7 @@ export default {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
let res = await saveRole(this.form); let res = await saveDimRes(this.form);
let { code, msg } = res.data; let { code, msg } = res.data;
this.loading = false; this.loading = false;
if (code == 1) { if (code == 1) {
...@@ -108,10 +254,16 @@ export default { ...@@ -108,10 +254,16 @@ export default {
// 重置 // 重置
handleReset() { handleReset() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.form.ruleName = "";
this.form.ruleType = "";
this.form.ruleValue = "";
this.form.resourceId = "";
this.form.resourceName = "";
this.resource = [];
}, },
// 关闭 // 关闭
handleCancel() { handleCancel() {
this.$refs.form.resetFields(); this.handleReset();
this.Visible = false; this.Visible = false;
}, },
}, },
......
<template> <template>
<div> <div>
<a-drawer <a-drawer
title="角色资源规则管理" title="资源规则"
:visible="Visible" :visible="Visible"
@close="onClose" @close="onClose"
:maskClosable="false" :maskClosable="false"
:destroyOnClose="true" :destroyOnClose="true"
width="50%" width="50%"
> >
<div class="mb10">
角色名称:<span class="primary">{{ roleInfo.name }}</span>
</div>
<div class="search-box flex aic jcb mb20"> <div class="search-box flex aic jcb mb20">
<div> <div>
<a-space> <a-space>
...@@ -17,7 +20,7 @@ ...@@ -17,7 +20,7 @@
</div> </div>
<a-input-search <a-input-search
style="width: 300px" style="width: 300px"
placeholder="请输入名称搜索" placeholder="请输入维度名称搜索"
enter-button="搜索" enter-button="搜索"
v-model="searchVal" v-model="searchVal"
allowClear allowClear
...@@ -31,6 +34,7 @@ ...@@ -31,6 +34,7 @@
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectChange, onChange: onSelectChange,
}" }"
size="small"
:loading="loading" :loading="loading"
bordered bordered
:scroll="{ y: 460 }" :scroll="{ y: 460 }"
...@@ -53,15 +57,7 @@ ...@@ -53,15 +57,7 @@
<span slot="num" slot-scope="text, record, index">{{ <span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1 (current - 1) * size + index + 1
}}</span> }}</span>
<!-- 统计类型 -->
<template slot="censusType" slot-scope="text">
{{ filterDict(text.censusType) }}
</template>
<!-- 是否开放 -->
<template slot="status" slot-scope="text">
<a-tag color="blue" v-if="text.status === 1"></a-tag>
<a-tag color="red" v-else></a-tag>
</template>
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a-space> <a-space>
...@@ -80,6 +76,7 @@ ...@@ -80,6 +76,7 @@
:addVisible.sync="addVisible" :addVisible.sync="addVisible"
:title="title" :title="title"
:dict="dict" :dict="dict"
@addSuccess="getDimResList"
></AddResDim> ></AddResDim>
</a-drawer> </a-drawer>
</div> </div>
...@@ -87,46 +84,9 @@ ...@@ -87,46 +84,9 @@
<script> <script>
import { pageSizeOptions } from "@/config/pageConfig.js"; import { pageSizeOptions } from "@/config/pageConfig.js";
import { getDimResList } from "@/services/system"; import { getDimResList, delDimRes } from "@/services/system";
import AddResDim from "./AddResDim.vue"; import AddResDim from "./AddResDim.vue";
const ruleCondition = [
{
key: "IN",
name: "属于",
},
{
key: "<",
name: "小于",
},
{
key: ">",
name: "大于",
},
{
key: "=",
name: "等于",
},
{
key: "!=",
name: "不等于",
},
{
key: ">=",
name: "大于等于",
},
{
key: "<=",
name: "小于等于",
},
{
key: "% like",
name: "左模糊",
},
{
key: "like %",
name: "右模糊",
},
];
export default { export default {
props: { props: {
visible: { visible: {
...@@ -147,32 +107,38 @@ export default { ...@@ -147,32 +107,38 @@ export default {
}, },
}, },
{ {
title: "规则名称", title: "维度名称",
dataIndex: "ruleName", dataIndex: "ruleName",
}, },
{ {
title: "规则编码", title: "维度编码",
dataIndex: "ruleCode", dataIndex: "ruleCode",
}, },
{ {
title: "规则条件", title: "维度类型",
dataIndex: "ruleCondition", dataIndex: "ruleType",
}, },
{ {
title: "规则", title: "维度",
dataIndex: "ruleValue", dataIndex: "ruleValue",
}, },
{
title: "规则类型",
dataIndex: "ruleType",
},
{ {
title: "所属资源", title: "所属资源",
dataIndex: "resourceName", dataIndex: "resourceName",
}, },
{
title: "规则条件",
dataIndex: "ruleCondition",
customRender: (text) => {
return this.dict.ruleCondition[text];
},
},
{ {
title: "创建时间", title: "创建时间",
dataIndex: "createTime", dataIndex: "createTime",
customRender: (text) => {
return this.$moment(text).format("YYYY-MM-DD HH:mm:ss");
},
}, },
{ {
title: "操作", title: "操作",
...@@ -181,7 +147,6 @@ export default { ...@@ -181,7 +147,6 @@ export default {
}, },
]; ];
return { return {
ruleCondition,
columns, columns,
roleInfo: {}, // 模块信息 roleInfo: {}, // 模块信息
loading: false, loading: false,
...@@ -216,21 +181,26 @@ export default { ...@@ -216,21 +181,26 @@ export default {
// 获取列表 // 获取列表
async getDimResList() { async getDimResList() {
this.loading = true;
let res = await getDimResList({ let res = await getDimResList({
current: this.current, current: this.current,
size: this.size, size: this.size,
roleId: this.roleInfo.id, roleId: this.roleInfo.id,
ruleName: this.searchVal, ruleName: `%${this.searchVal}%`,
}); });
this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
console.log(res.data); let { data, total, dict } = res.data.data;
this.total = total;
this.tableData = data;
this.dict = dict;
} }
}, },
handleAdd() { handleAdd() {
this.title = "新增"; this.title = "新增";
this.addVisible = true; this.addVisible = true;
this.$refs.AddResDim.onAdd(); this.$refs.AddResDim.onAdd(this.roleInfo);
}, },
handleDelAll() { handleDelAll() {
if (!this.selectedRowKeys.length) { if (!this.selectedRowKeys.length) {
...@@ -249,6 +219,7 @@ export default { ...@@ -249,6 +219,7 @@ export default {
// 搜索 // 搜索
onSearch() { onSearch() {
this.current = 1; this.current = 1;
this.getDimResList();
}, },
// 编辑 // 编辑
handleEdit(row) { handleEdit(row) {
...@@ -259,11 +230,13 @@ export default { ...@@ -259,11 +230,13 @@ export default {
// 翻页 // 翻页
handleChange(cur) { handleChange(cur) {
this.current = cur; this.current = cur;
this.getDimResList();
}, },
// 改变每页显示数量 // 改变每页显示数量
showSizeChange(current, size) { showSizeChange(current, size) {
this.current = current; this.current = current;
this.size = size; this.size = size;
this.getDimResList();
}, },
// 删除 // 删除
handleDel(id) { handleDel(id) {
...@@ -278,7 +251,11 @@ export default { ...@@ -278,7 +251,11 @@ export default {
icon: "exclamation-circle", icon: "exclamation-circle",
maskClosable: true, maskClosable: true,
async onOk() { async onOk() {
console.log(id, _this); let res = await delDimRes({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getDimResList();
}
}, },
}); });
}, },
...@@ -286,16 +263,6 @@ export default { ...@@ -286,16 +263,6 @@ export default {
onSelectChange(keys) { onSelectChange(keys) {
this.selectedRowKeys = keys; this.selectedRowKeys = keys;
}, },
// 过滤列表数据
filterDict(dict) {
let str = "";
Object.keys(this.dict.censusType).forEach((keys) => {
if (dict == keys) {
str = this.dict.censusType[keys];
}
});
return str;
},
}, },
}; };
</script> </script>
......
...@@ -61,7 +61,11 @@ ...@@ -61,7 +61,11 @@
</a-table> </a-table>
</div> </div>
<!-- 分配角色 --> <!-- 分配角色 -->
<AddUserRole ref="AddUserRole" :addVisible.sync="addVisible"></AddUserRole> <AddUserRole
ref="AddUserRole"
:addVisible.sync="addVisible"
@addSuccess="getUserList"
></AddUserRole>
</div> </div>
</template> </template>
......
...@@ -107,9 +107,12 @@ export default { ...@@ -107,9 +107,12 @@ export default {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
let { id, roleIds, lastLoginAddress, mobile } = this.form;
let res = await saveUser({ let res = await saveUser({
...this.form, id,
roleIds: this.form.roleIds.join(","), lastLoginAddress,
mobile,
roleIds: roleIds.join(","),
}); });
this.loading = false; this.loading = false;
let { code, msg } = res.data; let { code, msg } = res.data;
......
...@@ -583,7 +583,6 @@ export default { ...@@ -583,7 +583,6 @@ export default {
status: "done", status: "done",
name: this.form.photoPath, name: this.form.photoPath,
url: this.form.photoPath, url: this.form.photoPath,
url2: this.form.photoPath,
}, },
]; ];
} }
...@@ -612,7 +611,6 @@ export default { ...@@ -612,7 +611,6 @@ export default {
this.fileList = [...fileList].slice(-1); this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => { this.fileList = this.fileList.map((v) => {
if (v.response) { if (v.response) {
// v.url2 = v.response.url;
v.url = v.response.url; v.url = v.response.url;
} }
return v; return v;
......
...@@ -306,7 +306,7 @@ const options = { ...@@ -306,7 +306,7 @@ const options = {
meta: { meta: {
icon: "global", icon: "global",
}, },
redirect: "system/parameter", redirect: "system/user",
children: [ children: [
{ {
path: "user", path: "user",
......
...@@ -3,16 +3,16 @@ package com.mortals.xhx.module.role.service.impl; ...@@ -3,16 +3,16 @@ package com.mortals.xhx.module.role.service.impl;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.module.menu.model.MenuEntity; import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.model.MenuQuery; import com.mortals.xhx.module.menu.model.MenuQuery;
import com.mortals.xhx.module.menu.service.MenuService; import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.role.dao.RoleAuthDao; import com.mortals.xhx.module.role.dao.RoleAuthDao;
import com.mortals.xhx.module.role.model.*; import com.mortals.xhx.module.role.model.RoleAuthEntity;
import com.mortals.xhx.module.role.model.RoleAuthQuery;
import com.mortals.xhx.module.role.model.RoleModelEntity;
import com.mortals.xhx.module.role.service.RoleAuthService; import com.mortals.xhx.module.role.service.RoleAuthService;
import com.mortals.xhx.module.role.service.RoleModelService; import com.mortals.xhx.module.role.service.RoleModelService;
import com.mortals.xhx.module.role.service.RoleUserService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -104,6 +104,9 @@ public class RoleAuthServiceImpl extends AbstractCRUDServiceImpl<RoleAuthDao, Ro ...@@ -104,6 +104,9 @@ public class RoleAuthServiceImpl extends AbstractCRUDServiceImpl<RoleAuthDao, Ro
List<RoleAuthEntity> roleModelEntities = this.find(condition); List<RoleAuthEntity> roleModelEntities = this.find(condition);
if (CollectionUtils.isNotEmpty(roleModelEntities)) { if (CollectionUtils.isNotEmpty(roleModelEntities)) {
List<Long> menuIds = roleModelEntities.stream().filter(m->m.getMenuId()!=null).map(RoleAuthEntity::getMenuId).collect(Collectors.toList()); List<Long> menuIds = roleModelEntities.stream().filter(m->m.getMenuId()!=null).map(RoleAuthEntity::getMenuId).collect(Collectors.toList());
if(CollectionUtils.isEmpty(menuIds)){
return Collections.emptyMap();
}
MenuQuery query1 = new MenuQuery(); MenuQuery query1 = new MenuQuery();
query1.setIdList(menuIds); query1.setIdList(menuIds);
List<MenuEntity> menuEntities = menuService.find(query1); List<MenuEntity> menuEntities = menuService.find(query1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment