Commit 604096b5 authored by liboyang's avatar liboyang

新增页面

parent 792d505b
...@@ -237,7 +237,6 @@ public class AdminApi { ...@@ -237,7 +237,6 @@ public class AdminApi {
String str = "0"; String str = "0";
SysPermission sysPermission = new SysPermission(); SysPermission sysPermission = new SysPermission();
sysPermission.setName(jsonObject.getString("name")); sysPermission.setName(jsonObject.getString("name"));
sysPermission.setResource_type(jsonObject.getString("resourceType"));
sysPermission.setUrl(jsonObject.getString("url")); sysPermission.setUrl(jsonObject.getString("url"));
sysPermission.setPermission(jsonObject.getString("permission")); sysPermission.setPermission(jsonObject.getString("permission"));
// sysPermission.setParent_id(Long.parseLong(jsonObject.getString("parentId"))); // sysPermission.setParent_id(Long.parseLong(jsonObject.getString("parentId")));
...@@ -335,6 +334,7 @@ public class AdminApi { ...@@ -335,6 +334,7 @@ public class AdminApi {
SysRole sysRole = new SysRole(); SysRole sysRole = new SysRole();
sysRole.setRole(jsonObject.getString("role")); sysRole.setRole(jsonObject.getString("role"));
sysRole.setDescription(jsonObject.getString("description")); sysRole.setDescription(jsonObject.getString("description"));
sysRole.setProcess(Integer.parseInt(jsonObject.getString("process")));
String permissionIds = jsonObject.getString("permissionIds"); String permissionIds = jsonObject.getString("permissionIds");
JSONArray jsonArray = JSONArray.fromObject(permissionIds); JSONArray jsonArray = JSONArray.fromObject(permissionIds);
...@@ -402,19 +402,11 @@ public class AdminApi { ...@@ -402,19 +402,11 @@ public class AdminApi {
JSONObject jsonObject = JSONObject.fromObject(jsonStr); JSONObject jsonObject = JSONObject.fromObject(jsonStr);
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
boolean flag = false; boolean flag = false;
// String str = "0";
SysPermission sysPermission = new SysPermission(); SysPermission sysPermission = new SysPermission();
sysPermission.setId(Integer.parseInt(jsonObject.getString("id"))); sysPermission.setId(Integer.parseInt(jsonObject.getString("id")));
sysPermission.setName(jsonObject.getString("name")); sysPermission.setName(jsonObject.getString("name"));
sysPermission.setResource_type(jsonObject.getString("resourceType"));
sysPermission.setUrl(jsonObject.getString("url")); sysPermission.setUrl(jsonObject.getString("url"));
sysPermission.setPermission(jsonObject.getString("permission")); 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); System.out.println(sysPermission);
flag = sysPermissionService.updatePermission(sysPermission); flag = sysPermissionService.updatePermission(sysPermission);
if (flag) { if (flag) {
...@@ -426,4 +418,4 @@ public class AdminApi { ...@@ -426,4 +418,4 @@ public class AdminApi {
return map; return map;
} }
} }
...@@ -5,7 +5,7 @@ import java.io.Serializable; ...@@ -5,7 +5,7 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* @author zhangyusheng * @author liboyang
*/ */
@Entity @Entity
@Table(name="SYS_PERMISSION") @Table(name="SYS_PERMISSION")
...@@ -20,10 +20,7 @@ public class SysPermission implements Serializable { ...@@ -20,10 +20,7 @@ public class SysPermission implements Serializable {
* 名称. * 名称.
*/ */
private String name; private String name;
/**
* 资源类型
*/
private String resource_type;
/** /**
* 资源路径. * 资源路径.
*/ */
...@@ -33,19 +30,6 @@ public class SysPermission implements Serializable { ...@@ -33,19 +30,6 @@ public class SysPermission implements Serializable {
*/ */
private String permission; private String permission;
/**
* 父编号
*/
private Long parent_id;
/**
* 父编号列表
*/
private String parent_ids;
private byte available = 0; private byte available = 0;
@ManyToMany @ManyToMany
@JoinTable(name="SysRolePermission",joinColumns={@JoinColumn(name="permissionId")},inverseJoinColumns={@JoinColumn(name="roleId")}) @JoinTable(name="SysRolePermission",joinColumns={@JoinColumn(name="permissionId")},inverseJoinColumns={@JoinColumn(name="roleId")})
...@@ -67,22 +51,6 @@ public class SysPermission implements Serializable { ...@@ -67,22 +51,6 @@ public class SysPermission implements Serializable {
this.name = name; 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() { public String getUrl() {
return url; return url;
} }
...@@ -99,16 +67,6 @@ public class SysPermission implements Serializable { ...@@ -99,16 +67,6 @@ public class SysPermission implements Serializable {
this.permission = permission; 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() { public byte getAvailable() {
return available; return available;
} }
......
...@@ -4,7 +4,7 @@ import javax.persistence.*; ...@@ -4,7 +4,7 @@ import javax.persistence.*;
import java.util.List; import java.util.List;
/** /**
* @author zhangyusheng * @author liboyang
*/ */
@Entity @Entity
@Table(name="SYS_ROLE") @Table(name="SYS_ROLE")
...@@ -17,7 +17,7 @@ public class SysRole { ...@@ -17,7 +17,7 @@ public class SysRole {
private Integer id; private Integer id;
/** /**
* 角色标识程序中判断使用,如"admin",这个是唯一的: * 角色标识程序中判断使用,如"admin",这个是唯一的:
*/ */
private String role; private String role;
/** /**
* 角色描述,UI界面显示使用 * 角色描述,UI界面显示使用
...@@ -28,6 +28,8 @@ public class SysRole { ...@@ -28,6 +28,8 @@ public class SysRole {
*/ */
private byte available = 0; private byte available = 0;
private Integer process;
/** /**
* 角色 -- 权限关系:多对多关系; * 角色 -- 权限关系:多对多关系;
*/ */
...@@ -37,13 +39,13 @@ public class SysRole { ...@@ -37,13 +39,13 @@ public class SysRole {
/** /**
* 用户 - 角色关系定义; * 用户 - 角色关系定义;
*/ */
@ManyToMany @ManyToMany
@JoinTable(name="SysUserRole",joinColumns={@JoinColumn(name="roleId")},inverseJoinColumns={@JoinColumn(name="userId")}) @JoinTable(name="SysUserRole",joinColumns={@JoinColumn(name="roleId")},inverseJoinColumns={@JoinColumn(name="userId")})
/** /**
* 一个角色对应多个用户 * 一个角色对应多个用户
*/ */
private List<UserInfo> userInfos; private List<UserInfo> userInfos;
...@@ -94,4 +96,12 @@ public class SysRole { ...@@ -94,4 +96,12 @@ public class SysRole {
public void setUserInfos(List<UserInfo> userInfos) { public void setUserInfos(List<UserInfo> userInfos) {
this.userInfos = 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; ...@@ -5,7 +5,7 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* @author zhangyusheng * @author liboyang
*/ */
@Entity @Entity
@Table(name="USER_INFO") @Table(name="USER_INFO")
...@@ -19,7 +19,6 @@ public class UserInfo implements Serializable { ...@@ -19,7 +19,6 @@ public class UserInfo implements Serializable {
private String password; private String password;
private String salt; private String salt;
private byte state; private byte state;
private String workshop;
@ManyToMany(fetch= FetchType.EAGER) @ManyToMany(fetch= FetchType.EAGER)
@JoinTable(name = "SysUserRole", joinColumns = { @JoinColumn(name = "userId") }, inverseJoinColumns ={@JoinColumn(name = "roleId") }) @JoinTable(name = "SysUserRole", joinColumns = { @JoinColumn(name = "userId") }, inverseJoinColumns ={@JoinColumn(name = "roleId") })
private List<SysRole> roleList; private List<SysRole> roleList;
...@@ -80,11 +79,4 @@ public class UserInfo implements Serializable { ...@@ -80,11 +79,4 @@ public class UserInfo implements Serializable {
this.roleList = roleList; 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; ...@@ -2,8 +2,10 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.SysPermission; import com.yxproject.start.entity.SysPermission;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author Administrator * @author Administrator
...@@ -14,8 +16,8 @@ public interface SysPermissionMapper{ ...@@ -14,8 +16,8 @@ public interface SysPermissionMapper{
* 新增权限 * 新增权限
* @param sysPermission * @param sysPermission
*/ */
@Insert("INSERT INTO sys_permission (id,available,name,parent_id,parent_ids,permission,resource_type,url)\n" + @Insert("INSERT INTO sys_permission (id,available,name,permission,url)\n" +
"VALUES (PERMISSION_seq.nextval,0,#{name},'0','0/',#{permission},#{resource_type},#{url})") "VALUES (PERMISSION_seq.nextval,0,#{name},#{permission},#{url})")
public void addPermissionByMap(SysPermission sysPermission); public void addPermissionByMap(SysPermission sysPermission);
/** /**
...@@ -74,7 +76,7 @@ public interface SysPermissionMapper{ ...@@ -74,7 +76,7 @@ public interface SysPermissionMapper{
* 修改权限信息 * 修改权限信息
* @param sysPermission * @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}") "permission=#{permission} where id=#{id}")
public void updatePermission(SysPermission sysPermission); public void updatePermission(SysPermission sysPermission);
} }
...@@ -2,6 +2,7 @@ package com.yxproject.start.mapper; ...@@ -2,6 +2,7 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.SysRole; import com.yxproject.start.entity.SysRole;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -14,8 +15,8 @@ public interface SysRoleMapper { ...@@ -14,8 +15,8 @@ public interface SysRoleMapper {
* 添加角色 * 添加角色
* @param sysRole * @param sysRole
*/ */
@Insert("INSERT INTO SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE)\n" + @Insert("INSERT INTO SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE,PROCESS)\n" +
"VALUES(PERMISSION_seq.nextval,0,#{description},#{role})") "VALUES(PERMISSION_seq.nextval,0,#{description},#{role},#{process})")
@Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id") @Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id")
public void addRoleByMap(SysRole sysRole); public void addRoleByMap(SysRole sysRole);
...@@ -36,6 +37,7 @@ public interface SysRoleMapper { ...@@ -36,6 +37,7 @@ public interface SysRoleMapper {
@Result(property = "role",column = "role"), @Result(property = "role",column = "role"),
@Result(property = "description",column = "description"), @Result(property = "description",column = "description"),
@Result(property = "available",column = "available"), @Result(property = "available",column = "available"),
@Result(property = "process",column = "process"),
@Result(property = "permissions",javaType = List.class,column ="id", @Result(property = "permissions",javaType = List.class,column ="id",
many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))}) many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))})
public List<SysRole> selectAllRole(); public List<SysRole> selectAllRole();
...@@ -65,6 +67,7 @@ public interface SysRoleMapper { ...@@ -65,6 +67,7 @@ public interface SysRoleMapper {
@Result(property = "role",column = "role"), @Result(property = "role",column = "role"),
@Result(property = "description",column = "description"), @Result(property = "description",column = "description"),
@Result(property = "available",column = "available"), @Result(property = "available",column = "available"),
@Result(property = "process",column = "process"),
@Result(property = "permissions",javaType = List.class,column ="id", @Result(property = "permissions",javaType = List.class,column ="id",
many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))}) many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))})
List<SysRole> selectRoleAndPermissionByUserId(@Param("userId") Integer userId); List<SysRole> selectRoleAndPermissionByUserId(@Param("userId") Integer userId);
...@@ -102,6 +105,7 @@ public interface SysRoleMapper { ...@@ -102,6 +105,7 @@ public interface SysRoleMapper {
@Result(property = "role",column = "role"), @Result(property = "role",column = "role"),
@Result(property = "description",column = "description"), @Result(property = "description",column = "description"),
@Result(property = "available",column = "available"), @Result(property = "available",column = "available"),
@Result(property = "process",column = "process"),
@Result(property = "permissions",javaType = List.class,column ="id", @Result(property = "permissions",javaType = List.class,column ="id",
many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))}) many = @Many(select = "com.yxproject.start.mapper.SysPermissionMapper.selectPermissionByRoleId"))})
public SysRole selectRoleByRoleId(@Param("roleId") Integer roleId); public SysRole selectRoleByRoleId(@Param("roleId") Integer roleId);
......
This diff is collapsed.
...@@ -24,9 +24,9 @@ angular.module('AvatarCheck', [ ...@@ -24,9 +24,9 @@ angular.module('AvatarCheck', [
'AvatarCheck.packageLog', 'AvatarCheck.packageLog',
'AvatarCheck.tagPrint', 'AvatarCheck.tagPrint',
'tm.pagination' 'tm.pagination'
]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider', function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) { ]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider',function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) {
$locationProvider.hashPrefix('!'); $locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo: '/xmlAndSearch'}); $routeProvider.otherwise({redirectTo: '/createTaskList'});
localStorageServiceProvider.setPrefix('AvatarCheck') localStorageServiceProvider.setPrefix('AvatarCheck')
$qProvider.errorOnUnhandledRejections(false) $qProvider.errorOnUnhandledRejections(false)
}]) }])
...@@ -37,15 +37,21 @@ angular.module('AvatarCheck', [ ...@@ -37,15 +37,21 @@ angular.module('AvatarCheck', [
$rootScope.loginData = localStorageService.get('loginData') $rootScope.loginData = localStorageService.get('loginData')
if($rootScope.loginData == null){ if($rootScope.loginData == null){
$rootScope.loginData = {userid:'用户未登录', login:false}; $rootScope.loginData = {userid:'用户未登录', login:false};
} }
if($rootScope.loginData.login == false){ if($rootScope.loginData.login == false){
$location.path("/login"); $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") { if ($location.path() == "/excelAndSearch") {
$rootScope.tab = '/excelAndSearch'; $rootScope.tab = '/excelAndSearch';
} }
...@@ -118,7 +124,6 @@ angular.module('AvatarCheck', [ ...@@ -118,7 +124,6 @@ angular.module('AvatarCheck', [
} }
console.log($rootScope.tab) console.log($rootScope.tab)
$scope.getFocus = function (index) { $scope.getFocus = function (index) {
if(index=='/tagPrint'){ if(index=='/tagPrint'){
......
...@@ -24,19 +24,19 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -24,19 +24,19 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm
$('#datepicker1').datetimepicker({ $('#datepicker1').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: 'zh-CN',
format: 'yyyy-mm-dd', format: 'yyyyMMdd',
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1
}); });
$('#datepicker2').datetimepicker({ $('#datepicker2').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒 minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN', language: 'zh-CN',
format: 'yyyy-mm-dd', format: 'yyyyMMdd',
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1
}); });
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd"); $scope.choseDate = $filter("date")(new Date(), "yyyyMMdd");
$scope.paginationConf = { $scope.paginationConf = {
currentPage: 1, currentPage: 1,
...@@ -46,6 +46,7 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -46,6 +46,7 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm
$scope.paginationConf.totalItems = 50; $scope.paginationConf.totalItems = 50;
$scope.uploadExcel = function () { $scope.uploadExcel = function () {
console.log($("#datepicker1").val())
var fd = new FormData(); var fd = new FormData();
var files = document.querySelector('input#id_file_photo_for_check').files; var files = document.querySelector('input#id_file_photo_for_check').files;
fd.append("formStartTime",$("#datepicker1").val()); fd.append("formStartTime",$("#datepicker1").val());
......
...@@ -28,6 +28,38 @@ angular.module('AvatarCheck.login', ['ngRoute', 'AvatarCheck.http']) ...@@ -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.user = {};
$scope.doLogin = function(){ $scope.doLogin = function(){
...@@ -41,7 +73,9 @@ angular.module('AvatarCheck.login', ['ngRoute', 'AvatarCheck.http']) ...@@ -41,7 +73,9 @@ angular.module('AvatarCheck.login', ['ngRoute', 'AvatarCheck.http'])
$rootScope.loginData = resp.data.user; $rootScope.loginData = resp.data.user;
$rootScope.loginData.login =true; $rootScope.loginData.login =true;
localStorageService.set('loginData', resp.data.user); 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){ if(userAgent.indexOf('.NET')!=-1){
window.location.reload(); window.location.reload();
}else{ }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