Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YX_IDENT_beijing_auxiliary_YD
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangyusheng
YX_IDENT_beijing_auxiliary_YD
Commits
604096b5
Commit
604096b5
authored
Mar 05, 2019
by
liboyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
792d505b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
76 additions
and
78 deletions
+76
-78
AdminApi.java
src/main/java/com/yxproject/start/api/AdminApi.java
+2
-10
SysPermission.java
src/main/java/com/yxproject/start/entity/SysPermission.java
+2
-44
SysRole.java
src/main/java/com/yxproject/start/entity/SysRole.java
+12
-1
UserInfo.java
src/main/java/com/yxproject/start/entity/UserInfo.java
+1
-10
SysPermissionMapper.java
.../java/com/yxproject/start/mapper/SysPermissionMapper.java
+5
-3
SysRoleMapper.java
src/main/java/com/yxproject/start/mapper/SysRoleMapper.java
+6
-2
index.html
src/main/resources/static/index.html
+0
-0
app.js
src/main/resources/static/js/app.js
+9
-4
excelAndSearch.js
...n/resources/static/views/excelAndSearch/excelAndSearch.js
+4
-3
login.js
src/main/resources/static/views/login/login.js
+35
-1
No files found.
src/main/java/com/yxproject/start/api/AdminApi.java
View file @
604096b5
...
...
@@ -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
;
}
}
}
src/main/java/com/yxproject/start/entity/SysPermission.java
View file @
604096b5
...
...
@@ -5,7 +5,7 @@ import java.io.Serializable;
import
java.util.List
;
/**
* @author
zhangyushe
ng
* @author
liboya
ng
*/
@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
;
}
...
...
src/main/java/com/yxproject/start/entity/SysRole.java
View file @
604096b5
...
...
@@ -4,7 +4,7 @@ import javax.persistence.*;
import
java.util.List
;
/**
* @author
zhangyushe
ng
* @author
liboya
ng
*/
@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
src/main/java/com/yxproject/start/entity/UserInfo.java
View file @
604096b5
...
...
@@ -5,7 +5,7 @@ import java.io.Serializable;
import
java.util.List
;
/**
* @author
zhangyushe
ng
* @author
liboya
ng
*/
@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
src/main/java/com/yxproject/start/mapper/SysPermissionMapper.java
View file @
604096b5
...
...
@@ -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,p
arent_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,p
ermission
,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
);
}
src/main/java/com/yxproject/start/mapper/SysRoleMapper.java
View file @
604096b5
...
...
@@ -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
);
...
...
src/main/resources/static/index.html
View file @
604096b5
This diff is collapsed.
Click to expand it.
src/main/resources/static/js/app.js
View file @
604096b5
...
...
@@ -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'
){
...
...
src/main/resources/static/views/excelAndSearch/excelAndSearch.js
View file @
604096b5
...
...
@@ -24,19 +24,19 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm
$
(
'#datepicker1'
).
datetimepicker
({
minView
:
"month"
,
//选择日期后,不会再跳转去选择时分秒
language
:
'zh-CN'
,
format
:
'yyyy
-mm-
dd'
,
format
:
'yyyy
MM
dd'
,
todayBtn
:
1
,
autoclose
:
1
});
$
(
'#datepicker2'
).
datetimepicker
({
minView
:
"month"
,
//选择日期后,不会再跳转去选择时分秒
language
:
'zh-CN'
,
format
:
'yyyy
-mm-
dd'
,
format
:
'yyyy
MM
dd'
,
todayBtn
:
1
,
autoclose
:
1
});
$scope
.
choseDate
=
$filter
(
"date"
)(
new
Date
(),
"yyyy
-MM-
dd"
);
$scope
.
choseDate
=
$filter
(
"date"
)(
new
Date
(),
"yyyy
MM
dd"
);
$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
());
...
...
src/main/resources/static/views/login/login.js
View file @
604096b5
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment