Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
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
TCM
tcm-system
Commits
5192c828
Commit
5192c828
authored
Jul 15, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/role/tright 7.15
parent
9e37b133
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
131 additions
and
11 deletions
+131
-11
AuthorityDao.java
...ain/java/com/pangding/web/authority/dao/AuthorityDao.java
+5
-4
AuthorityDaoImpl.java
...com/pangding/web/authority/dao/impl/AuthorityDaoImpl.java
+27
-5
AuthorityServiceImpl.java
...ding/web/authority/service/impl/AuthorityServiceImpl.java
+32
-2
AuthorityAfterReqVo.java
.../pangding/web/authority/vo/reqvo/AuthorityAfterReqVo.java
+10
-0
AuthorityBetweenSortReqVo.java
...ing/web/authority/vo/reqvo/AuthorityBetweenSortReqVo.java
+47
-0
AuthorityGetReqVo.java
...om/pangding/web/authority/vo/reqvo/AuthorityGetReqVo.java
+10
-0
No files found.
src/main/java/com/pangding/web/authority/dao/AuthorityDao.java
View file @
5192c828
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.AuthorityAfterReqVo
;
import
com.pangding.web.authority.vo.reqvo.AuthorityGetReqVo
;
import
com.pangding.web.authority.vo.reqvo.AuthorityListReqVo
;
import
com.pangding.web.authority.vo.reqvo.ListAuthorityByPageReqVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
...
@@ -35,4 +32,8 @@ public interface AuthorityDao extends BaseDao {
List
<
AuthorityVo
>
after
(
AuthorityAfterReqVo
afterReqVo
);
List
<
AuthorityVo
>
listBySort
(
AuthorityGetReqVo
reqVo
);
List
<
AuthorityVo
>
getLessBetween
(
AuthorityBetweenSortReqVo
reqVo
);
List
<
AuthorityVo
>
getMoreBetween
(
AuthorityBetweenSortReqVo
reqVo
);
}
src/main/java/com/pangding/web/authority/dao/impl/AuthorityDaoImpl.java
View file @
5192c828
...
...
@@ -2,10 +2,7 @@ package com.pangding.web.authority.dao.impl;
import
com.pangding.web.authority.dao.AuthorityDao
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.AuthorityAfterReqVo
;
import
com.pangding.web.authority.vo.reqvo.AuthorityGetReqVo
;
import
com.pangding.web.authority.vo.reqvo.AuthorityListReqVo
;
import
com.pangding.web.authority.vo.reqvo.ListAuthorityByPageReqVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
...
...
@@ -23,6 +20,8 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao {
private
static
final
String
GET_LEVEL_ONE
=
"GET_LEVEL_ONE"
;
private
static
final
String
AFTER
=
"AFTER"
;
private
static
final
String
LIST_BY_SORT
=
"LIST_BY_SORT"
;
private
static
final
String
GET_LESS_BETWEEN
=
"GET_LESS_BETWEEN"
;
private
static
final
String
GET_MORE_BETWEEN
=
"GET_MORE_BETWEEN"
;
@Override
protected
void
init
()
{
...
...
@@ -42,10 +41,23 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao {
table
.
add
(
AFTER
,
"select * from pd_authority where 1=1 "
)
.
add
(
"pid"
,
"and pid = ? "
)
.
add
(
"sort"
,
"and sort >= ? "
);
.
add
(
"sort"
,
"and sort >= ? "
)
.
add
(
"attribute"
,
"and attribute = ?"
);
table
.
add
(
LIST_BY_SORT
,
"select * from pd_authority where 1=1 "
)
.
add
(
"pid"
,
"and pid = ? order by sort asc"
);
table
.
add
(
GET_LESS_BETWEEN
,
"select * from pd_authority where 1=1 "
)
.
add
(
"pid"
,
"and pid = ?"
)
.
add
(
"smallSort"
,
"and sort >= ?"
)
.
add
(
"bigSort"
,
"and sort < ?"
)
.
add
(
"attribute"
,
"and attribute = ?"
);
table
.
add
(
GET_MORE_BETWEEN
,
"select * from pd_authority where 1=1"
)
.
add
(
"pid"
,
"and pid = ?"
)
.
add
(
"smallSort"
,
"and sort > ?"
)
.
add
(
"bigSort"
,
"and sort <= ?"
)
.
add
(
"attribute"
,
"and attribute = ?"
);
}
/**
...
...
@@ -83,4 +95,14 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao {
public
List
<
AuthorityVo
>
listBySort
(
AuthorityGetReqVo
reqVo
)
{
return
this
.
query
(
AuthorityVo
.
class
,
LIST_BY_SORT
,
reqVo
);
}
@Override
public
List
<
AuthorityVo
>
getLessBetween
(
AuthorityBetweenSortReqVo
reqVo
)
{
return
this
.
query
(
AuthorityVo
.
class
,
GET_LESS_BETWEEN
,
reqVo
);
}
@Override
public
List
<
AuthorityVo
>
getMoreBetween
(
AuthorityBetweenSortReqVo
reqVo
)
{
return
this
.
query
(
AuthorityVo
.
class
,
GET_MORE_BETWEEN
,
reqVo
);
}
}
src/main/java/com/pangding/web/authority/service/impl/AuthorityServiceImpl.java
View file @
5192c828
...
...
@@ -75,6 +75,7 @@ public class AuthorityServiceImpl implements AuthorityService {
AuthorityGetReqVo
reqVo
=
new
AuthorityGetReqVo
();
reqVo
.
setPid
(
authorityVo
.
getPid
());
reqVo
.
setSort
(
authorityVo
.
getSort
());
reqVo
.
setAttribute
(
authorityVo
.
getAttribute
());
AuthorityVo
authorityVo1
=
authorityDao
.
load
(
reqVo
,
AuthorityVo
.
class
);
if
(
authorityVo1
!=
null
){
AuthorityAfterReqVo
afterReqVo
=
new
AuthorityAfterReqVo
();
...
...
@@ -119,14 +120,43 @@ public class AuthorityServiceImpl implements AuthorityService {
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
authorityVo
.
setPid
(
""
);
}
afterSub
(
authorityVo
);
afterPlus
(
authorityVo
);
updateSort
(
authorityVo
);
authorityDao
.
update
(
authorityVo
);
AuthorityListReqVo
reqVo
=
new
AuthorityListReqVo
();
reqVo
.
setLevelOne
(
"levelOne"
);
return
this
.
getListByLevel
(
reqVo
);
}
private
void
updateSort
(
AuthorityVo
authorityVo
)
{
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
authorityGetReqVo
.
setId
(
authorityVo
.
getId
());
AuthorityVo
old
=
authorityDao
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
if
(
old
.
getSort
()
>
authorityVo
.
getSort
())
{
AuthorityBetweenSortReqVo
reqVo
=
new
AuthorityBetweenSortReqVo
();
reqVo
.
setPid
(
authorityVo
.
getPid
());
reqVo
.
setSmallSort
(
authorityVo
.
getSort
());
reqVo
.
setBigSort
(
old
.
getSort
());
reqVo
.
setAttribute
(
authorityVo
.
getAttribute
());
List
<
AuthorityVo
>
authorityVoList
=
authorityDao
.
getLessBetween
(
reqVo
);
for
(
AuthorityVo
authorityVo1
:
authorityVoList
)
{
authorityVo1
.
setSort
(
authorityVo1
.
getSort
()
+
1
);
authorityDao
.
update
(
authorityVo1
);
}
}
if
(
old
.
getSort
()
<
authorityVo
.
getSort
()){
AuthorityBetweenSortReqVo
reqVo
=
new
AuthorityBetweenSortReqVo
();
reqVo
.
setPid
(
authorityVo
.
getPid
());
reqVo
.
setSmallSort
(
old
.
getSort
());
reqVo
.
setBigSort
(
authorityVo
.
getSort
());
reqVo
.
setAttribute
(
authorityVo
.
getAttribute
());
List
<
AuthorityVo
>
authorityVoList
=
authorityDao
.
getMoreBetween
(
reqVo
);
for
(
AuthorityVo
authorityVo1
:
authorityVoList
)
{
authorityVo1
.
setSort
(
authorityVo1
.
getSort
()
-
1
);
authorityDao
.
update
(
authorityVo1
);
}
}
}
/**
* 检查新建、修改的authorityVo对象是否合法
*
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/AuthorityAfterReqVo.java
View file @
5192c828
...
...
@@ -9,6 +9,16 @@ public class AuthorityAfterReqVo {
private
String
sort
;
private
Integer
attribute
;
public
Integer
getAttribute
()
{
return
attribute
;
}
public
void
setAttribute
(
Integer
attribute
)
{
this
.
attribute
=
attribute
;
}
public
String
getPid
()
{
return
pid
;
}
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/AuthorityBetweenSortReqVo.java
0 → 100644
View file @
5192c828
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/7/15 16:31
*/
public
class
AuthorityBetweenSortReqVo
{
private
String
pid
;
private
Integer
smallSort
;
private
Integer
bigSort
;
private
Integer
attribute
;
public
Integer
getAttribute
()
{
return
attribute
;
}
public
void
setAttribute
(
Integer
attribute
)
{
this
.
attribute
=
attribute
;
}
public
String
getPid
()
{
return
pid
;
}
public
void
setPid
(
String
pid
)
{
this
.
pid
=
pid
;
}
public
Integer
getSmallSort
()
{
return
smallSort
;
}
public
void
setSmallSort
(
Integer
smallSort
)
{
this
.
smallSort
=
smallSort
;
}
public
Integer
getBigSort
()
{
return
bigSort
;
}
public
void
setBigSort
(
Integer
bigSort
)
{
this
.
bigSort
=
bigSort
;
}
}
src/main/java/com/pangding/web/authority/vo/reqvo/AuthorityGetReqVo.java
View file @
5192c828
...
...
@@ -12,6 +12,16 @@ public class AuthorityGetReqVo {
private
Integer
sort
;
private
Integer
attribute
;
public
Integer
getAttribute
()
{
return
attribute
;
}
public
void
setAttribute
(
Integer
attribute
)
{
this
.
attribute
=
attribute
;
}
public
String
getReqId
()
{
return
reqId
;
}
...
...
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