自动化立体仓库 - WMS系统
#
whycq
2023-06-25 6838152273d695393c4a10e81051b8232aa965b2
#
5个文件已修改
137 ■■■■■ 已修改文件
src/main/java/com/zy/common/web/AuthController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/controller/PermissionController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/permission/permission.js 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/permission/permission_detail.html 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/AuthController.java
@@ -22,6 +22,7 @@
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
/**
 * Created by vincent on 2019-07-30
@@ -375,4 +376,23 @@
        return R.ok("激活成功,有效期至"+DateUtils.convert(exprTime));
    }
    @RequestMapping("/menu/pda/auth")
    @ManagerAuth
    public R menuPda(){
        Long userId = getUserId();
        List<RolePermission> rolePermissions;
        if (userId == 9527L) {
            rolePermissions = rolePermissionService.selectList(new EntityWrapper<>());
        } else {
            Long roleId = getUser().getRoleId();
            rolePermissions = rolePermissionService.selectList(new EntityWrapper<RolePermission>().eq("role_id", roleId));
        }
        if (Cools.isEmpty(rolePermissions)) {
            return R.ok();
        }
        List<Long> collect = rolePermissions.stream().map(RolePermission::getPermissionId).distinct().collect(Collectors.toList());
        List<Permission> permissions = permissionService.selectBatchIds(collect);
        return R.ok().add(permissions);
    }
}
src/main/java/com/zy/system/controller/PermissionController.java
@@ -61,6 +61,7 @@
            return R.error();
        }
        if (null == permission.getId()){
            permission.setStatus((short) 1);
            permissionService.insert(permission);
        } else {
            permissionService.updateById(permission);
@@ -71,11 +72,12 @@
    @RequestMapping(value = "/permission/add/auth")
    @ManagerAuth
    public R add(Permission permission) {
        permission.setStatus((short) 1);
        permissionService.insert(permission);
        return R.ok();
    }
    @RequestMapping(value = "/permission/update/auth")
    @RequestMapping(value = "/permission/update/auth")
    @ManagerAuth
    public R update(Permission permission){
        if (Cools.isEmpty(permission) || null==permission.getId()){
src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
  port: 8081
  port: 8080
  servlet:
    context-path: /@pom.build.finalName@
@@ -10,7 +10,8 @@
    enabled: false
  datasource:
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    url: jdbc:sqlserver://192.168.4.15:1433;databasename=phpsasrs
#    url: jdbc:sqlserver://192.168.4.15:1433;databasename=phpsasrs
    url: jdbc:sqlserver://127.0.0.1:1433;databasename=phpsasrs
    username: sa
    password: sa@123
  mvc:
src/main/webapp/static/js/permission/permission.js
@@ -18,11 +18,11 @@
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox', fixed: 'left'}
            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'name', align: 'center',title: '权限名称'}
            ,{field: 'action', align: 'center',title: '接口地址'}
            ,{field: 'resourceName', align: 'center',title: '所属菜单',event: 'Resource', style: 'text-decoration: underline;cursor:pointer'}
            ,{field: 'status$', align: 'center',title: '状态'}
            // ,{field: 'resourceName', align: 'center',title: '所属菜单',event: 'Resource', style: 'text-decoration: underline;cursor:pointer'}
            // ,{field: 'status$', align: 'center',title: '状态'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
        ]],
@@ -86,7 +86,7 @@
                    shadeClose: false,
                    content: 'permission_detail.html',
                    success: function(layero, index){
                        clearFormVal(layer.getChildFrame('#detail', index));
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                    }
                });
@@ -214,34 +214,34 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '所属详情',
                       maxmin: true,
                       area: [top.detailHeight, top.detailWidth],
                       shadeClose: false,
                       content: '../resource/resource_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/resource/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '所属详情',
                        maxmin: true,
                        area: [top.detailHeight, top.detailWidth],
                        shadeClose: false,
                        content: '../resource/resource_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/resource/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
src/main/webapp/views/permission/permission_detail.html
@@ -33,28 +33,28 @@
                <input id="action" class="layui-input" type="text" placeholder="接口地址" lay-verify="required" >
            </div>
        </div>
        <div class="layui-inline"  style="width:31%;">
            <label class="layui-form-label">所属菜单:</label>
            <div class="layui-input-inline cool-auto-complete">
                <input id="resourceId" class="layui-input" type="text" placeholder="所属菜单" style="display: none">
                <input id="resourceName" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="所属菜单" onfocus=this.blur()>
                <div class="cool-auto-complete-window">
                    <input class="cool-auto-complete-window-input" data-key="resourceQuery" onkeyup="autoLoad(this.getAttribute('data-key'))">
                    <select class="cool-auto-complete-window-select" data-key="resourceQuerySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-inline"  style="width:31%;">
            <label class="layui-form-label"><span class="not-null">*</span>状  态:</label>
            <div class="layui-input-inline">
                <select id="status" lay-verify="required">
                    <option value="" style="display: none"></option>
                    <option value="1">正常</option>
                    <option value="0">禁用</option>
                </select>
            </div>
        </div>
        <!--        <div class="layui-inline"  style="width:31%;">-->
        <!--            <label class="layui-form-label">所属菜单:</label>-->
        <!--            <div class="layui-input-inline cool-auto-complete">-->
        <!--                <input id="resourceId" class="layui-input" type="text" placeholder="所属菜单" style="display: none">-->
        <!--                <input id="resourceName" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="所属菜单" onfocus=this.blur()>-->
        <!--                <div class="cool-auto-complete-window">-->
        <!--                    <input class="cool-auto-complete-window-input" data-key="resourceQuery" onkeyup="autoLoad(this.getAttribute('data-key'))">-->
        <!--                    <select class="cool-auto-complete-window-select" data-key="resourceQuerySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">-->
        <!--                    </select>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--        </div>-->
        <!--        <div class="layui-inline"  style="width:31%;">-->
        <!--            <label class="layui-form-label"><span class="not-null">*</span>状  态:</label>-->
        <!--            <div class="layui-input-inline">-->
        <!--                <select id="status" lay-verify="required">-->
        <!--                    <option value="" style="display: none"></option>-->
        <!--                    <option value="1">正常</option>-->
        <!--                    <option value="0">禁用</option>-->
        <!--                </select>-->
        <!--            </div>-->
        <!--        </div>-->
        <hr class="layui-bg-gray">