Merge remote-tracking branch 'remotes/origin/branch_20190822' into openapi_20190828
# Conflicts: # ecp-mbu-web/src/main/java/com/murong/ecp/netpay/mbu/web/interceptor/BUIInterceptor.java # ecp-mbu-web/src/main/java/com/murong/ecp/netpay/mbu/web/pub/action/buipubbpc1/BuiDctDeleteAction.java # ecp-mbu-web/src/main/java/com/murong/ecp/netpay/mbu/web/pub/dal/dao/BuiDctMapper.java
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:title="title"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<!--el-form-item label="角色编号" prop="roleId" type="hidden"> -->
|
||||
<el-input v-model="dataForm.roleId" placeholder="角色编号" type="hidden"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.roleId" placeholder="角色编号" type="hidden"></el-input>
|
||||
<!--/el-form-item> -->
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="dataForm.roleName" placeholder="角色名称"></el-input>
|
||||
<el-input :disabled="readonly" v-model="dataForm.roleName" placeholder="角色名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
<el-input :disabled="readonly" v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item size="mini" label="授权">
|
||||
<el-scrollbar style="height: 100%">
|
||||
<el-scrollbar style="height: 1000px">
|
||||
<el-tree
|
||||
:data="menuList"
|
||||
:props="menuListTreeProps"
|
||||
@@ -25,6 +25,7 @@
|
||||
ref="menuListTree"
|
||||
:default-expand-all="true"
|
||||
show-checkbox
|
||||
:disabled="readonly"
|
||||
>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
@@ -34,7 +35,7 @@
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<el-button :disabled="readonly" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -45,11 +46,14 @@
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
title: '',
|
||||
readonly: false,
|
||||
visible: false,
|
||||
menuList: [],
|
||||
menuListTreeProps: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
children: 'children',
|
||||
disabled: this.disabledFn
|
||||
},
|
||||
dataForm: {
|
||||
id: '',
|
||||
@@ -77,10 +81,18 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
disabledFn(data, node) {
|
||||
this.visible = true
|
||||
if (this.title == '查看') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/buipubbpc1/buiMenuList.do'),
|
||||
method: 'get',
|
||||
@@ -115,6 +127,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-input v-model="dataForm.roleName" placeholder="角色名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="text" size="small" @click="queryHandle(scope.row.id)">查看</el-button>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('sys:role:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('sys:role:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
@@ -145,6 +145,8 @@
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.title = !id ? '新增' : '修改'
|
||||
this.$refs.addOrUpdate.readonly = false
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
@@ -152,6 +154,7 @@
|
||||
queryHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.title = '查看'
|
||||
this.$refs.addOrUpdate.readonly = true
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:title="title"
|
||||
:close-on-click-modal="false"
|
||||
:inline = true
|
||||
:visible.sync="visible" >
|
||||
@@ -8,36 +8,39 @@
|
||||
<el-row type="flex" class="row-bg">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="登录账号" prop="operNo">
|
||||
<el-input v-model="dataForm.operNo" v-bind:disabled="dataForm.id==null" placeholder="登录账号" style="width:170px"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.operNo" v-bind:disabled="dataForm.id==null"
|
||||
placeholder="登录账号" style="width:170px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="operName">
|
||||
<el-input v-model="dataForm.operName" placeholder="姓名" style="width:170px"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.operName" placeholder="姓名" style="width:170px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" class="row-bg">
|
||||
<el-col :span="12" v-if="!dataForm.id">
|
||||
<el-form-item label="密码" prop="password" :class="{ 'is-required': !dataForm.id }">
|
||||
<el-input v-model="dataForm.password" type="password" placeholder="密码" style="width:170px"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.password" type="password" placeholder="密码"
|
||||
style="width:170px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="!dataForm.id">
|
||||
<el-form-item label="确认密码" prop="comfirmPassword" :class="{ 'is-required': !dataForm.id }">
|
||||
<el-input v-model="dataForm.comfirmPassword" type="password" placeholder="确认密码" style="width:170px"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.comfirmPassword" type="password" placeholder="确认密码"
|
||||
style="width:170px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" class="row-bg">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="dataForm.email" placeholder="邮箱" style="width:170px"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.email" placeholder="邮箱" style="width:170px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input v-model="dataForm.mblNo" placeholder="手机号" style="width:170px"></el-input>
|
||||
<el-input :readonly="readonly" v-model="dataForm.mblNo" placeholder="手机号" style="width:170px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -45,7 +48,8 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机构号" prop="orgNo">
|
||||
<el-select v-model="dataForm.orgNoList" placeholder="请选择" style="width:170px">
|
||||
<el-option v-for="item in orgNoList" :key="item.id" :label="item.org_nm" :value="item.id">
|
||||
<el-option v-for="item in orgNoList" :key="item.id" :label="item.org_nm" :value="item.id"
|
||||
:disabled="readonly">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -53,19 +57,21 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户类型" prop="operType">
|
||||
<el-select v-model="dataForm.operTypeList" placeholder="请选择" style="width:170px">
|
||||
<el-option v-for="item in dict.get('oper_typ')" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-option v-for="item in dict.get('oper_typ')" :key="item.value" :label="item.label" :value="item.value"
|
||||
:disabled="readonly">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="角色" size="mini" prop="roleIdList">
|
||||
<el-checkbox-group v-model="dataForm.roleIdList">
|
||||
<el-checkbox v-for="role in roleList" :key="role.id" :label="role.id">{{ role.name }}</el-checkbox>
|
||||
<el-checkbox-group v-model="dataForm.roleIdList" :disabled="readonly">
|
||||
<el-checkbox v-for="role in roleList" :key="role.id" :label="role.id" :disabled="readonly">{{ role.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" size="mini" prop="status">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio-group v-model="dataForm.status" :disabled="readonly">
|
||||
<el-radio label="0">正常</el-radio>
|
||||
<el-radio label="1">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -73,7 +79,7 @@
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<el-button :disabled="readonly" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -115,6 +121,8 @@
|
||||
}
|
||||
}
|
||||
return {
|
||||
title: '',
|
||||
readonly: false,
|
||||
visible: false,
|
||||
roleList: [],
|
||||
dataForm: {
|
||||
@@ -133,6 +141,7 @@
|
||||
status: '0'
|
||||
},
|
||||
orgNoList: [],
|
||||
|
||||
dataRule: {
|
||||
operNo: [
|
||||
{ required: true, message: '登录账号不能为空', trigger: 'blur' }
|
||||
@@ -160,6 +169,7 @@
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/buipubbpc1/buiRoleList.do`),
|
||||
method: 'get',
|
||||
|
||||
@@ -128,6 +128,8 @@
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.title = !id ? '新增' : '修改'
|
||||
this.$refs.addOrUpdate.readonly = false
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
@@ -135,6 +137,8 @@
|
||||
queryHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.title = '查看'
|
||||
this.$refs.addOrUpdate.readonly = true
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
|
||||
+22
-11
@@ -532,38 +532,49 @@ create table T_BUI_OPERLOG
|
||||
)
|
||||
;
|
||||
|
||||
comment on table T_BUI_CONFIG is '系统配置信息表'
|
||||
comment on table T_BUI_OPERLOG is '操作日志'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.PARAM_KEY is 'key'
|
||||
comment on column T_BUI_OPERLOG.PARAM_KEY is 'key'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.PARAM_VALUE is 'value'
|
||||
comment on column T_BUI_OPERLOG.PARAM_VALUE is 'value'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.STS is '状态 0:正常 1:无效'
|
||||
comment on column T_BUI_OPERLOG.STS is '状态 0:正常 1:无效'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.REMARK is '备注'
|
||||
comment on column T_BUI_OPERLOG.REMARK is '备注'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.REQ_ID is '请求id'
|
||||
comment on column T_BUI_OPERLOG.REQ_ID is '请求id'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.NOD_ID is '节点'
|
||||
comment on column T_BUI_OPERLOG.NOD_ID is '节点'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.TM_SMP is '时间戳'
|
||||
comment on column T_BUI_OPERLOG.TM_SMP is '时间戳'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.UPD_OPR is '操作员'
|
||||
comment on column T_BUI_OPERLOG.UPD_OPR is '操作员'
|
||||
;
|
||||
|
||||
comment on column T_BUI_CONFIG.MSG_CODE is '响应码'
|
||||
comment on column T_BUI_OPERLOG.MSG_CODE is '响应码'
|
||||
;
|
||||
|
||||
comment on column T_BUI_OPERLOG.MSG_INFO is '结果'
|
||||
;
|
||||
|
||||
|
||||
create unique index ui1_T_BUI_CONFIG on T_BUI_CONFIG (PARAM_KEY);
|
||||
create unique index ui1_T_BUI_OPERLOG on T_BUI_OPERLOG (PARAM_KEY);
|
||||
-- auto-generated definition
|
||||
|
||||
create sequence S_PUB_ID
|
||||
minvalue 1
|
||||
start with 1
|
||||
maxvalue 9999999999999999999
|
||||
cache 100
|
||||
/
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
+62
-2
@@ -1,5 +1,6 @@
|
||||
package com.murong.ecp.netpay.mbu.web.pub.action.buipubbpc1;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.murong.ecp.netpay.mbu.web.common.utils.*;
|
||||
import com.murong.ecp.netpay.mbu.web.pub.common.PUBUtils;
|
||||
import com.murong.ecp.netpay.mbu.web.pub.dal.dao.BuiMenuMapper;
|
||||
@@ -7,6 +8,7 @@ import com.murong.ecp.netpay.mbu.web.pub.dal.entity.BuiMenuDO;
|
||||
import com.murong.ecp.netpay.mbu.web.pub.model.BuiMenuDTO;
|
||||
import com.murong.ecp.netpay.mbu.web.pub.model.BuiMenuNavRspBO;
|
||||
import com.murong.ecp.netpay.mbu.web.pub.model.BuiOperDTO;
|
||||
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
|
||||
import com.yuangou.ecp.bp.core.common.exception.YGException;
|
||||
import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
|
||||
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
|
||||
@@ -14,10 +16,12 @@ import com.yuangou.ecp.bp.core.common.message.YGEDB;
|
||||
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
|
||||
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 菜单管理管理服务
|
||||
@@ -45,9 +49,42 @@ public class BuiMenuNavAction extends BaseAction {
|
||||
|
||||
buiOperDTO.setOperId(buiOperDTO.getOperId());
|
||||
|
||||
YGPageEntity pageEntity = new YGPageEntity();
|
||||
pageEntity.setPag_no(1);
|
||||
pageEntity.setLimit(9999);
|
||||
BuiMenuDO menuDO = new BuiMenuDO();
|
||||
List<BuiMenuDO> list = buiMenuMapper.selectPage(pageEntity, menuDO);
|
||||
|
||||
List<BuiMenuDTO> list2 = PUBUtils.menuProc1(list);
|
||||
|
||||
List<BuiMenuDO> list1 = buiMenuMapper.selectByOperId(buiOperDTO.getOperId());
|
||||
|
||||
BuiMenuNavRspBO rspBO = PUBUtils.menuProc(list1);
|
||||
Set<Long> authMenuIdSet = new HashSet<Long>();
|
||||
for( BuiMenuDO menuDO1: list1 ) {
|
||||
authMenuIdSet.add(menuDO1.getMenuId());
|
||||
}
|
||||
|
||||
Set<String> permissions = new HashSet<String>();
|
||||
for( BuiMenuDO menuDO1: list1 ) {
|
||||
String perms = menuDO1.getPerms();
|
||||
if (StringUtils.isNotBlank(perms)) {
|
||||
String[] values = StringUtils.split(perms, ",");
|
||||
for (String value : values) {
|
||||
if (!permissions.contains(value)) {
|
||||
permissions.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
walkMenuTree(list2, authMenuIdSet);
|
||||
|
||||
msgLog.info("list2:" + JSON.toJSONString(list2));
|
||||
|
||||
BuiMenuNavRspBO rspBO = new BuiMenuNavRspBO();
|
||||
rspBO.setMenulist(list2);
|
||||
rspBO.setPermissions(StringUtils.join(permissions, "|"));
|
||||
|
||||
|
||||
ResultT resultT = new ResultT();
|
||||
resultT.setMsgCod(CommonMessageCode.SUCC);
|
||||
@@ -56,5 +93,28 @@ public class BuiMenuNavAction extends BaseAction {
|
||||
return resultT;
|
||||
}
|
||||
|
||||
private boolean walkMenuTree(List<BuiMenuDTO> list, Set<Long> authMenuIdSet) {
|
||||
boolean flag = false;
|
||||
|
||||
for( Iterator iter = list.iterator(); iter.hasNext(); ) {
|
||||
BuiMenuDTO menuDTO = (BuiMenuDTO)iter.next();
|
||||
if( authMenuIdSet.contains(menuDTO.getMenuId())) {
|
||||
menuDTO.setFlag("Y");
|
||||
flag = true;
|
||||
}
|
||||
if( !menuDTO.getList().isEmpty() ) {
|
||||
boolean flag1 = walkMenuTree(menuDTO.getList(), authMenuIdSet);
|
||||
if( flag1 ) {
|
||||
menuDTO.setFlag("Y");
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if( "N".equals(menuDTO.getFlag())) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,45 @@ import java.util.List;
|
||||
* copyright @2018 北京沐融信息科技股份有限公司
|
||||
*/
|
||||
public class PUBUtils {
|
||||
public static List<BuiMenuDTO> menuProc1(List<BuiMenuDO> menus)
|
||||
throws YGException {
|
||||
|
||||
List<BuiMenuDTO> list = new ArrayList<BuiMenuDTO>();
|
||||
|
||||
for (BuiMenuDO menuDO : menus) {
|
||||
Long menuId = menuDO.getMenuId();
|
||||
Long parentId = menuDO.getParentId();
|
||||
if (2 == menuDO.getType()) {
|
||||
continue;
|
||||
}
|
||||
BuiMenuDTO menuDTO = new BuiMenuDTO();
|
||||
BeanUtils.copyProperties(menuDO, menuDTO);
|
||||
if( "0".equals(menuDTO.getMenuId())) {
|
||||
list.add(menuDTO);
|
||||
continue;
|
||||
}
|
||||
|
||||
BuiMenuDTO parentMenuDTO = getParentMenuDTO(list, parentId);
|
||||
if (parentMenuDTO == null) {
|
||||
BuiMenuDO parentMenuDO = geParentMenuDO(menus, parentId);
|
||||
if (parentMenuDO == null) {
|
||||
// root
|
||||
list.add(menuDTO);
|
||||
continue;
|
||||
} else {
|
||||
parentMenuDTO = new BuiMenuDTO();
|
||||
BeanUtils.copyProperties(parentMenuDO, parentMenuDTO);
|
||||
list.add(parentMenuDTO);
|
||||
}
|
||||
}
|
||||
|
||||
List<BuiMenuDTO> list1 = parentMenuDTO.getList();
|
||||
list1.add(menuDTO);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单处理
|
||||
*
|
||||
|
||||
@@ -45,6 +45,10 @@ public class BuiMenuDTO extends BaseDO {
|
||||
* 授权(多个用逗号分隔,如:user:list,user:create)
|
||||
*/
|
||||
private String perms = "";
|
||||
/**
|
||||
* 是否有权限
|
||||
*/
|
||||
private String flag = "N";
|
||||
/**
|
||||
* 类型 0:目录 1:菜单 2:按钮
|
||||
*/
|
||||
@@ -140,4 +144,12 @@ public class BuiMenuDTO extends BaseDO {
|
||||
public void setList(List<BuiMenuDTO> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,4 +141,5 @@
|
||||
<delete id="deleteByIdCascade" parameterType="java.lang.Long">
|
||||
delete from t_bui_menu where menu_id in (select menu_id from t_bui_menu start with menu_id=${menuId} connect by prior menu_id = parent_id)
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user