Commit 604096b5 authored by liboyang's avatar liboyang

新增页面

parent 792d505b
......@@ -237,7 +237,6 @@ public class AdminApi {
String str = "0";
SysPermission sysPermission = new SysPermission();
sysPermission.setName(jsonObject.getString("name"));
sysPermission.setResource_type(jsonObject.getString("resourceType"));
sysPermission.setUrl(jsonObject.getString("url"));
sysPermission.setPermission(jsonObject.getString("permission"));
// sysPermission.setParent_id(Long.parseLong(jsonObject.getString("parentId")));
......@@ -335,6 +334,7 @@ public class AdminApi {
SysRole sysRole = new SysRole();
sysRole.setRole(jsonObject.getString("role"));
sysRole.setDescription(jsonObject.getString("description"));
sysRole.setProcess(Integer.parseInt(jsonObject.getString("process")));
String permissionIds = jsonObject.getString("permissionIds");
JSONArray jsonArray = JSONArray.fromObject(permissionIds);
......@@ -402,19 +402,11 @@ public class AdminApi {
JSONObject jsonObject = JSONObject.fromObject(jsonStr);
Map<String, String> map = new HashMap<>();
boolean flag = false;
// String str = "0";
SysPermission sysPermission = new SysPermission();
sysPermission.setId(Integer.parseInt(jsonObject.getString("id")));
sysPermission.setName(jsonObject.getString("name"));
sysPermission.setResource_type(jsonObject.getString("resourceType"));
sysPermission.setUrl(jsonObject.getString("url"));
sysPermission.setPermission(jsonObject.getString("permission"));
// sysPermission.setParent_id(Long.parseLong(parentId));
// if(parentId.equals(str)){
// sysPermission.setParent_ids(parentId+"/");
// }else{
// sysPermission.setParent_ids(str+"/"+parentId);
// }
System.out.println(sysPermission);
flag = sysPermissionService.updatePermission(sysPermission);
if (flag) {
......@@ -426,4 +418,4 @@ public class AdminApi {
return map;
}
}
}
......@@ -5,7 +5,7 @@ import java.io.Serializable;
import java.util.List;
/**
* @author zhangyusheng
* @author liboyang
*/
@Entity
@Table(name="SYS_PERMISSION")
......@@ -20,10 +20,7 @@ public class SysPermission implements Serializable {
* 名称.
*/
private String name;
/**
* 资源类型
*/
private String resource_type;
/**
* 资源路径.
*/
......@@ -33,19 +30,6 @@ public class SysPermission implements Serializable {
*/
private String permission;
/**
* 父编号
*/
private Long parent_id;
/**
* 父编号列表
*/
private String parent_ids;
private byte available = 0;
@ManyToMany
@JoinTable(name="SysRolePermission",joinColumns={@JoinColumn(name="permissionId")},inverseJoinColumns={@JoinColumn(name="roleId")})
......@@ -67,22 +51,6 @@ public class SysPermission implements Serializable {
this.name = name;
}
public String getResource_type() {
return resource_type;
}
public void setResource_type(String resource_type) {
this.resource_type = resource_type;
}
public String getParent_ids() {
return parent_ids;
}
public void setParent_ids(String parent_ids) {
this.parent_ids = parent_ids;
}
public String getUrl() {
return url;
}
......@@ -99,16 +67,6 @@ public class SysPermission implements Serializable {
this.permission = permission;
}
public Long getParent_id() {
return parent_id;
}
public void setParent_id(Long parent_id) {
this.parent_id = parent_id;
}
public byte getAvailable() {
return available;
}
......
......@@ -4,7 +4,7 @@ import javax.persistence.*;
import java.util.List;
/**
* @author zhangyusheng
* @author liboyang
*/
@Entity
@Table(name="SYS_ROLE")
......@@ -28,6 +28,8 @@ public class SysRole {
*/
private byte available = 0;
private Integer process;
/**
* 角色 -- 权限关系:多对多关系;
*/
......@@ -94,4 +96,12 @@ public class SysRole {
public void setUserInfos(List<UserInfo> userInfos) {
this.userInfos = userInfos;
}
public Integer getProcess() {
return process;
}
public void setProcess(Integer process) {
this.process = process;
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ import java.io.Serializable;
import java.util.List;
/**
* @author zhangyusheng
* @author liboyang
*/
@Entity
@Table(name="USER_INFO")
......@@ -19,7 +19,6 @@ public class UserInfo implements Serializable {
private String password;
private String salt;
private byte state;
private String workshop;
@ManyToMany(fetch= FetchType.EAGER)
@JoinTable(name = "SysUserRole", joinColumns = { @JoinColumn(name = "userId") }, inverseJoinColumns ={@JoinColumn(name = "roleId") })
private List<SysRole> roleList;
......@@ -80,11 +79,4 @@ public class UserInfo implements Serializable {
this.roleList = roleList;
}
public String getWorkshop() {
return workshop;
}
public void setWorkshop(String workshop) {
this.workshop = workshop;
}
}
\ No newline at end of file
......@@ -2,8 +2,10 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.SysPermission;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
......@@ -14,8 +16,8 @@ public interface SysPermissionMapper{
* 新增权限
* @param sysPermission
*/
@Insert("INSERT INTO sys_permission (id,available,name,parent_id,parent_ids,permission,resource_type,url)\n" +
"VALUES (PERMISSION_seq.nextval,0,#{name},'0','0/',#{permission},#{resource_type},#{url})")
@Insert("INSERT INTO sys_permission (id,available,name,permission,url)\n" +
"VALUES (PERMISSION_seq.nextval,0,#{name},#{permission},#{url})")
public void addPermissionByMap(SysPermission sysPermission);
/**
......@@ -74,7 +76,7 @@ public interface SysPermissionMapper{
* 修改权限信息
* @param sysPermission
*/
@Update("update SYS_PERMISSION SET NAME=#{name},resource_type=#{resource_type},url=#{url}," +
@Update("update SYS_PERMISSION SET NAME=#{name},url=#{url}," +
"permission=#{permission} where id=#{id}")
public void updatePermission(SysPermission sysPermission);
}
......@@ -2,6 +2,7 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.SysRole;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -14,8 +15,8 @@ public interface SysRoleMapper {
* 添加角色
* @param sysRole
*/
@Insert("INSERT INTO SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE)\n" +
"VALUES(PERMISSION_seq.nextval,0,#{description},#{role})")
@Insert("INSERT INTO SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE,PROCESS)\n" +
"VALUES(PERMISSION_seq.nextval,0,#{description},#{role},#{process})")
@Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id")
public void addRoleByMap(SysRole sysRole);
......@@ -36,6 +37,7 @@ public interface SysRoleMapper {
@Result(property = "role",column = "role"),
@Result(property = "description",column = "description"),
@Result(property = "available",column = "available"),
@Result(property = "process",column = "process"),
@Result(property = "permissions",javaType = List.class,column ="id",
many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))})
public List<SysRole> selectAllRole();
......@@ -65,6 +67,7 @@ public interface SysRoleMapper {
@Result(property = "role",column = "role"),
@Result(property = "description",column = "description"),
@Result(property = "available",column = "available"),
@Result(property = "process",column = "process"),
@Result(property = "permissions",javaType = List.class,column ="id",
many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))})
List<SysRole> selectRoleAndPermissionByUserId(@Param("userId") Integer userId);
......@@ -102,6 +105,7 @@ public interface SysRoleMapper {
@Result(property = "role",column = "role"),
@Result(property = "description",column = "description"),
@Result(property = "available",column = "available"),
@Result(property = "process",column = "process"),
@Result(property = "permissions",javaType = List.class,column ="id",
many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))})
public SysRole selectRoleByRoleId(@Param("roleId") Integer roleId);
......
......@@ -88,138 +88,156 @@
<a class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div style="text-align: right;font-size:1.8em;line-height: 50px;color: #fff;font-family:'黑体';padding-right: 20px;">北京制证辅助平台</div>
</nav>
</header>
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar" >
<!-- search form -->
<form class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" ng-model="searchInput" placeholder="Search...">
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-flat" ng-click="doSearch(searchInput)">
<i class="fa fa-search"></i>
</button>
</span>
<div class="pull-right" style="font-size:1.8em;line-height: 50px;color: #fff;font-family:'黑体';padding:0 20px;cursor: pointer;">北京制证辅助平台</div>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Messages: style can be found in dropdown.less-->
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>
<span class="label label-success">4</span>
</a>
<ul class="dropdown-menu">
<li class="header">You have 4 messages</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<li><!-- start message -->
<a href="#">
<div class="pull-left">
<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
</div>
</form>
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree">
<li class="header">
导航
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/xmlAndSearch']" ng-click="getFocus('/xmlAndSearch')">
<a href="#!/xmlAndSearch">
<i class="fa fa-file-code-o"></i>
<span>制证包管理</span>
<h4>
Support Team
<small><i class="fa fa-clock-o"></i> 5 mins</small>
</h4>
<p>Why not buy a new awesome theme?</p>
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/excelAndSearch']" ng-click="getFocus('/excelAndSearch')">
<a href="#!/excelAndSearch">
<i class="fa fa-file-excel-o"></i>
<span>格口文件管理</span>
<!-- end message -->
<li>
<a href="#">
<div class="pull-left">
<img src="dist/img/user3-128x128.jpg" class="img-circle" alt="User Image">
</div>
<h4>
AdminLTE Design Team
<small><i class="fa fa-clock-o"></i> 2 hours</small>
</h4>
<p>Why not buy a new awesome theme?</p>
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/cardProdPackage']" ng-click="getFocus('/cardProdPackage')">
<a href="#!/cardProdPackage">
<i class="fa fa-folder"></i>
<span>制证信息打包</span>
<li>
<a href="#">
<div class="pull-left">
<img src="dist/img/user4-128x128.jpg" class="img-circle" alt="User Image">
</div>
<h4>
Developers
<small><i class="fa fa-clock-o"></i> Today</small>
</h4>
<p>Why not buy a new awesome theme?</p>
</a>
</li>
<li class="treeview" ng-class="{true: 'active', false: ''}[tab =='/cardProdUpdate']" ng-click="getFocus('/cardProdUpdate')">
<li>
<a href="#">
<i class="fa fa-cog"></i> <span>系统管理</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
<div class="pull-left">
<img src="dist/img/user3-128x128.jpg" class="img-circle" alt="User Image">
</div>
<h4>
Sales Department
<small><i class="fa fa-clock-o"></i> Yesterday</small>
</h4>
<p>Why not buy a new awesome theme?</p>
</a>
<ul class="treeview-menu">
<li><a href="#!/analysisLog"><i class="fa fa-circle-o"></i> 解析日志</a></li>
<li><a href="#!/packageLog"><i class="fa fa-circle-o"></i> 新包日志</a></li>
<li><a href="#!/cardProdUpdate"><i class="fa fa-circle-o"></i> 制证信息管理</a></li>
</ul>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/searchCardMsg']" ng-click="getFocus('/searchCardMsg')">
<a href="#!/searchCardMsg">
<i class="fa fa-files-o"></i>
<span>邮政快递单打印</span>
<li>
<a href="#">
<div class="pull-left">
<img src="dist/img/user4-128x128.jpg" class="img-circle" alt="User Image">
</div>
<h4>
Reviewers
<small><i class="fa fa-clock-o"></i> 2 days</small>
</h4>
<p>Why not buy a new awesome theme?</p>
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/uploadExcelAndSearch']" ng-click="getFocus('/uploadExcelAndSearch')">
<a href="#!/uploadExcelAndSearch">
<i class="fa fa-table"></i>
<span>邮政信息查询</span>
</a>
</ul>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/createTaskList']" ng-click="getFocus('/createTaskList')">
<a href="#!/createTaskList">
<i class="fa fa-dashboard"></i>
<span>任务单创建</span>
</a>
<li class="footer"><a href="#">See All Messages</a></li>
</ul>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/dispatchTask']" ng-click="getFocus('/dispatchTask')">
<a href="#!/dispatchTask">
<i class="fa fa-dashboard"></i>
<span>任务单下发</span>
<!-- Notifications: style can be found in dropdown.less -->
<li class="dropdown notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bell-o"></i>
<span class="label label-warning">10</span>
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/taskListPrint']" ng-click="getFocus('/taskListPrint')">
<a href="#!/taskListPrint">
<i class="fa fa-dashboard"></i>
<span>膜打印任务单</span>
<ul class="dropdown-menu">
<li class="header">You have 10 notifications</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<li>
<a href="#">
<i class="fa fa-users text-aqua"></i> 5 new members joined today
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/taskListPreLocating']" ng-click="getFocus('/taskListPreLocating')">
<a href="#!/taskListPreLocating">
<i class="fa fa-dashboard"></i>
<span>预定位任务单</span>
<li>
<a href="#">
<i class="fa fa-warning text-yellow"></i> Very long description here that may not fit into the
page and may cause design problems
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/taskListQualityCheck']" ng-click="getFocus('/taskListQualityCheck')">
<a href="#!/taskListQualityCheck">
<i class="fa fa-dashboard"></i>
<span>质检任务单</span>
<li>
<a href="#">
<i class="fa fa-users text-red"></i> 5 new members joined
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/taskListSorting']" ng-click="getFocus('/taskListSorting')">
<a href="#!/taskListSorting">
<i class="fa fa-dashboard"></i>
<span>分拣任务单</span>
<li>
<a href="#">
<i class="fa fa-shopping-cart text-green"></i> 25 sales made
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/tagPrint']" ng-click="getFocus('/tagPrint')">
<a href="#!/tagPrint">
<i class="fa fa-dashboard"></i>
<span>打印封条</span>
<li>
<a href="#">
<i class="fa fa-user text-red"></i> You changed your username
</a>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/receitp']" ng-click="getFocus('/receitp')">
<a href="#!/receitp">
<i class="fa fa-file-text-o"></i>
<span>交接单</span>
</a>
</ul>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/addFailed']" ng-click="getFocus('/addFailed')">
<a href="#!/addFailed">
<i class="fa fa-plus"></i>
<span>添加废证</span>
</a>
<li class="footer"><a href="#">View all</a></li>
</ul>
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/addRest']" ng-click="getFocus('/addRest')">
<a href="#!/addRest">
<i class="fa fa-plus"></i>
<span>添加余证</span>
</a>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar" >
<!-- search form -->
<form class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" ng-model="searchInput" placeholder="Search...">
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-flat" ng-click="doSearch(searchInput)">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree">
<li class="header">
导航
</li>
<li ng-class="{true: 'active', false: ''}[tab =='/historyBack']" ng-click="getFocus('/historyBack')">
<a href="#!/historyBack">
<i class="fa fa-plus"></i>
<span>历史回迁证</span>
<li ng-repeat="menu in menuList" ng-class="{true: 'active', false: ''}[tab =='{{menu.url}}']" ng-click="getFocus('{{menu.url}}')">
<a href="#!{{menu.url}}">
<i class="fa fa-file-code-o"></i>
<span ng-bind="menu.name"></span>
</a>
</li>
<li>
......
......@@ -24,9 +24,9 @@ angular.module('AvatarCheck', [
'AvatarCheck.packageLog',
'AvatarCheck.tagPrint',
'tm.pagination'
]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider', function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) {
]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider',function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo: '/xmlAndSearch'});
$routeProvider.otherwise({redirectTo: '/createTaskList'});
localStorageServiceProvider.setPrefix('AvatarCheck')
$qProvider.errorOnUnhandledRejections(false)
}])
......@@ -37,15 +37,21 @@ angular.module('AvatarCheck', [
$rootScope.loginData = localStorageService.get('loginData')
if($rootScope.loginData == null){
$rootScope.loginData = {userid:'用户未登录', login:false};
}
if($rootScope.loginData.login == false){
$location.path("/login");
}
if($rootScope.loginData.login == true){
$rootScope.menuList = $rootScope.loginData.roleList[0].permissions;
console.log($scope.menuList)
}
$rootScope.tab = '/xmlAndSearch';
if ($location.path() == "/excelAndSearch") {
$rootScope.tab = '/excelAndSearch';
}
......@@ -118,7 +124,6 @@ angular.module('AvatarCheck', [
}
console.log($rootScope.tab)
$scope.getFocus = function (index) {
if(index=='/tagPrint'){
......
......@@ -24,19 +24,19 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm
$('#datepicker1').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-mm-dd',
format: 'yyyyMMdd',
todayBtn: 1,
autoclose: 1
});
$('#datepicker2').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-mm-dd',
format: 'yyyyMMdd',
todayBtn: 1,
autoclose: 1
});
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.choseDate = $filter("date")(new Date(), "yyyyMMdd");
$scope.paginationConf = {
currentPage: 1,
......@@ -46,6 +46,7 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm
$scope.paginationConf.totalItems = 50;
$scope.uploadExcel = function () {
console.log($("#datepicker1").val())
var fd = new FormData();
var files = document.querySelector('input#id_file_photo_for_check').files;
fd.append("formStartTime",$("#datepicker1").val());
......
......@@ -28,6 +28,38 @@ angular.module('AvatarCheck.login', ['ngRoute', 'AvatarCheck.http'])
}
}
var whereToGo = function(process){
switch (process){
case 1:
$location.path("/createTaskList");
$rootScope.tab = '/createTaskList';
break;
case 2:
$location.path("/taskListPrint");
$rootScope.tab = '/taskListPrint';
break;
case 3:
$location.path("/taskListPreLocating");
$rootScope.tab = '/taskListPreLocating';
break;
case 4:
$location.path("/taskListSorting");
$rootScope.tab = '/taskListSorting';
break;
case 5:
$location.path("/taskListQualityCheck");
$rootScope.tab = '/taskListQualityCheck';
break;
case 6:
$location.path("/receitp");
$rootScope.tab = '/receitp';
break;
case 7:
$location.path("/excelAndSearch");
$rootScope.tab = '/excelAndSearch';
break;
}
}
$scope.user = {};
$scope.doLogin = function(){
......@@ -41,7 +73,9 @@ angular.module('AvatarCheck.login', ['ngRoute', 'AvatarCheck.http'])
$rootScope.loginData = resp.data.user;
$rootScope.loginData.login =true;
localStorageService.set('loginData', resp.data.user);
$location.path('/xmlAndSearch')
$rootScope.menuList = $rootScope.loginData.roleList[0].permissions;
console.log($scope.menuList)
whereToGo($rootScope.loginData.roleList[0].process)
if(userAgent.indexOf('.NET')!=-1){
window.location.reload();
}else{
......
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