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
33defe4c
Commit
33defe4c
authored
Mar 24, 2020
by
tangf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改权限管理查询逻辑
修改余额常量字段
parent
12d57f00
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
363 additions
and
238 deletions
+363
-238
RoleAuthorityDao.java
...java/com/pangding/web/authority/dao/RoleAuthorityDao.java
+0
-3
UserRoleDao.java
...main/java/com/pangding/web/authority/dao/UserRoleDao.java
+3
-0
RoleAuthorityDaoImpl.java
...pangding/web/authority/dao/impl/RoleAuthorityDaoImpl.java
+9
-1
UserRoleDaoImpl.java
.../com/pangding/web/authority/dao/impl/UserRoleDaoImpl.java
+14
-2
AuthorityServiceImpl.java
...ding/web/authority/service/impl/AuthorityServiceImpl.java
+168
-124
CompanyServiceImpl.java
...ngding/web/authority/service/impl/CompanyServiceImpl.java
+6
-5
RegisterServiceImpl.java
...gding/web/authority/service/impl/RegisterServiceImpl.java
+93
-90
RoleServiceImpl.java
.../pangding/web/authority/service/impl/RoleServiceImpl.java
+13
-12
IRoleAuthorityVo.java
.../java/com/pangding/web/authority/vo/IRoleAuthorityVo.java
+14
-0
RoleAuthorityGetReqVo.java
...angding/web/authority/vo/reqvo/RoleAuthorityGetReqVo.java
+20
-0
UserRoleGetReqVo.java
...com/pangding/web/authority/vo/reqvo/UserRoleGetReqVo.java
+12
-0
AuthorityListByLevelResVo.java
...ing/web/authority/vo/resvo/AuthorityListByLevelResVo.java
+3
-1
AuthorityListResVo.java
...m/pangding/web/authority/vo/resvo/AuthorityListResVo.java
+8
-0
No files found.
src/main/java/com/pangding/web/authority/dao/RoleAuthorityDao.java
View file @
33defe4c
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.vo.reqvo.RoleAuthorityGetReqVo
;
import
com.pangding.web.authority.vo.RoleAuthorityVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
java.util.List
;
/**
* @author zhangjinyao
...
...
src/main/java/com/pangding/web/authority/dao/UserRoleDao.java
View file @
33defe4c
...
...
@@ -2,6 +2,7 @@ package com.pangding.web.authority.dao;
import
com.pangding.web.authority.vo.reqvo.UserRoleGetReqVo
;
import
com.pangding.web.authority.vo.UserRoleVo
;
import
com.pangding.web.authority.vo.resvo.WebRoleResVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
java.util.List
;
...
...
@@ -19,4 +20,6 @@ public interface UserRoleDao extends BaseDao {
*/
List
<
UserRoleVo
>
getUserRoleList
(
UserRoleGetReqVo
reqVo
);
List
<
WebRoleResVo
>
getUserNum
(
UserRoleGetReqVo
reqVo
);
}
src/main/java/com/pangding/web/authority/dao/impl/RoleAuthorityDaoImpl.java
View file @
33defe4c
...
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.dao.impl;
import
com.pangding.web.authority.dao.RoleAuthorityDao
;
import
com.pangding.web.authority.vo.reqvo.RoleAuthorityGetReqVo
;
import
com.pangding.web.authority.vo.RoleAuthorityVo
;
import
com.yanzuoguang.dao.DaoConst
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -16,9 +17,16 @@ public class RoleAuthorityDaoImpl extends BaseDaoImpl implements RoleAuthorityDa
@Override
protected
void
init
()
{
register
(
RoleAuthorityVo
.
class
);
getSql
(
DaoConst
.
LOAD
).
setSql
(
"select ra.role_id,a.* from pd_authority a "
+
"LEFT JOIN pd_role_authority ra on ra.authority_id = a.id {INNER} "
+
"where 1=1 {WHERE} ORDER BY a.pid,a.sort"
)
.
add
(
"userId"
,
"AND b.user_id = @userId"
,
"{INNER}"
,
"INNER JOIN pd_user_role AS b ON ra.role_id = b.role_id"
)
.
add
(
"role"
,
" AND ra.role_id = @role"
)
;
}
}
src/main/java/com/pangding/web/authority/dao/impl/UserRoleDaoImpl.java
View file @
33defe4c
...
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.dao.impl;
import
com.pangding.web.authority.dao.UserRoleDao
;
import
com.pangding.web.authority.vo.reqvo.UserRoleGetReqVo
;
import
com.pangding.web.authority.vo.UserRoleVo
;
import
com.pangding.web.authority.vo.resvo.WebRoleResVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -16,14 +17,20 @@ public class UserRoleDaoImpl extends BaseDaoImpl implements UserRoleDao {
private
static
final
String
GET_USER_ROLE_LIST
=
"GET_USER_ROLE_LIST"
;
private
static
final
String
GET_ROLE_USER_NUMBER
=
"GET_ROLE_USER_NUMBER"
;
@Override
protected
void
init
()
{
register
(
UserRoleVo
.
class
);
table
.
add
(
GET_USER_ROLE_LIST
,
"select * from pd_user_role where 1=1 "
)
.
add
(
"userId"
,
"and user_id = ?"
)
.
add
(
"roleId"
,
"and role_id = ?"
);
.
add
(
"userId"
,
"and user_id = ? "
)
.
add
(
"roleId"
,
"and role_id = ? "
);
table
.
add
(
GET_ROLE_USER_NUMBER
,
"select count(*),role_id from pd_user_role where 1=1 {WHERE} group by role_id "
)
.
add
(
"userId"
,
"and user_id = ? "
)
.
add
(
"roleIds"
,
"and role_id in ? "
);
}
...
...
@@ -32,4 +39,9 @@ public class UserRoleDaoImpl extends BaseDaoImpl implements UserRoleDao {
return
this
.
query
(
UserRoleVo
.
class
,
GET_USER_ROLE_LIST
,
reqVo
);
}
@Override
public
List
<
WebRoleResVo
>
getUserNum
(
UserRoleGetReqVo
reqVo
)
{
return
this
.
query
(
WebRoleResVo
.
class
,
GET_ROLE_USER_NUMBER
,
reqVo
);
}
}
src/main/java/com/pangding/web/authority/service/impl/AuthorityServiceImpl.java
View file @
33defe4c
This diff is collapsed.
Click to expand it.
src/main/java/com/pangding/web/authority/service/impl/CompanyServiceImpl.java
View file @
33defe4c
...
...
@@ -13,6 +13,7 @@ import com.pangding.web.authority.util.RsaConstant;
import
com.pangding.web.authority.vo.*
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.vo.resvo.*
;
import
com.pangding.web.constant.OrderConstant
;
import
com.pangding.web.util.RSAUtils
;
import
com.pangding.web.vo.system.req.company.CompanyMoneyDetailReqVo
;
import
com.pangding.web.vo.system.req.company.CompanyMoneyUpdateReqVo
;
...
...
@@ -977,14 +978,14 @@ public class CompanyServiceImpl implements CompanyService {
// req = new UpdateCompanyMoneyReqVo();
// req.setCompanyId(companyVo.getId());
if
(
CompanyConstant
.
MONEY_TYPE_FZ
==
req
.
getMoneyType
()
||
CompanyConstant
.
MONEY_TYPE_ZZ
==
req
.
getMoneyType
()
||
CompanyConstant
.
MONEY_TYPE_CZ
==
req
.
getMoneyType
())
{
if
(
OrderConstant
.
CATEGORY_ENTRY
==
req
.
getMoneyType
()
||
OrderConstant
.
CATEGORY_DIVIDEND
==
req
.
getMoneyType
()
||
OrderConstant
.
CATEGORY_RECHARGE
==
req
.
getMoneyType
())
{
// 分账 转账 充值
companyMoney
+=
req
.
getMoney
();
}
if
(
CompanyConstant
.
MONEY_TYPE
_REFUND
==
req
.
getMoneyType
()
||
CompanyConstant
.
MONEY_TYPE_TX
==
req
.
getMoneyType
())
{
if
(
OrderConstant
.
CATEGORY
_REFUND
==
req
.
getMoneyType
()
||
OrderConstant
.
CATEGORY_WITHDRAWAL
==
req
.
getMoneyType
())
{
// 退款 提现
companyMoney
-=
req
.
getMoney
();
}
...
...
src/main/java/com/pangding/web/authority/service/impl/RegisterServiceImpl.java
View file @
33defe4c
This diff is collapsed.
Click to expand it.
src/main/java/com/pangding/web/authority/service/impl/RoleServiceImpl.java
View file @
33defe4c
...
...
@@ -178,9 +178,10 @@ public class RoleServiceImpl implements RoleService {
List
<
WebRoleResVo
>
webRoleResVoList
=
new
ArrayList
();
for
(
RoleVo
roleVo
:
roleVoList
)
{
WebRoleResVo
resVo
=
new
WebRoleResVo
();
List
<
AuthorityVo
>
authorityVoList
=
this
.
getAuthorityListByRoleId
(
roleVo
.
getId
());
ObjectHelper
.
writeWithFrom
(
resVo
,
roleVo
);
resVo
.
setAuthorityList
(
authorityVoList
);
// List<AuthorityVo> authorityVoList = this.getAuthorityListByRoleId(roleVo.getId());
// resVo.setAuthorityList(authorityVoList);
CountByRoleReqVo
countByRoleReqVo
=
new
CountByRoleReqVo
();
countByRoleReqVo
.
setCompanyId
(
req
.
getCompanyId
());
...
...
@@ -237,17 +238,17 @@ public class RoleServiceImpl implements RoleService {
@Override
public
List
<
AuthorityVo
>
getAuthorityListByRoleId
(
String
roleId
)
{
RoleAuthorityGetReqVo
reqVo
=
new
RoleAuthorityGetReqVo
();
reqVo
.
setRole
Id
(
roleId
);
List
<
RoleAuthorityVo
>
roleAuthorityRelationList
=
roleAuthorityDaoImpl
.
loadList
(
reqVo
,
Role
AuthorityVo
.
class
);
reqVo
.
setRole
(
roleId
);
List
<
AuthorityVo
>
roleAuthorityRelationList
=
roleAuthorityDaoImpl
.
loadList
(
reqVo
,
AuthorityVo
.
class
);
if
(
roleAuthorityRelationList
!=
null
&&
!
roleAuthorityRelationList
.
isEmpty
())
{
List
<
AuthorityVo
>
authorityList
=
new
ArrayList
(
roleAuthorityRelationList
.
size
());
for
(
RoleAuthorityVo
roleAuthorityRelation
:
roleAuthorityRelationList
)
{
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
authorityGetReqVo
.
setId
(
roleAuthorityRelation
.
getAuthorityId
());
AuthorityVo
authorityVo
=
authorityDaoImpl
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
authorityList
.
add
(
authorityVo
);
}
return
authority
List
;
//
List<AuthorityVo> authorityList = new ArrayList(roleAuthorityRelationList.size());
//
for (RoleAuthorityVo roleAuthorityRelation : roleAuthorityRelationList) {
//
AuthorityGetReqVo authorityGetReqVo = new AuthorityGetReqVo();
//
authorityGetReqVo.setId(roleAuthorityRelation.getAuthorityId());
//
AuthorityVo authorityVo = authorityDaoImpl.load(authorityGetReqVo, AuthorityVo.class);
//
authorityList.add(authorityVo);
//
}
return
roleAuthorityRelation
List
;
}
return
null
;
}
...
...
src/main/java/com/pangding/web/authority/vo/IRoleAuthorityVo.java
0 → 100644
View file @
33defe4c
package
com
.
pangding
.
web
.
authority
.
vo
;
import
java.util.List
;
public
interface
IRoleAuthorityVo
<
T
extends
IRoleAuthorityVo
>
{
String
getId
();
String
getPid
();
List
<
T
>
getChildList
();
}
src/main/java/com/pangding/web/authority/vo/reqvo/RoleAuthorityGetReqVo.java
View file @
33defe4c
...
...
@@ -11,6 +11,18 @@ public class RoleAuthorityGetReqVo {
private
String
roleId
;
private
String
role
;
private
String
userId
;
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getReqId
()
{
return
reqId
;
}
...
...
@@ -34,4 +46,12 @@ public class RoleAuthorityGetReqVo {
public
void
setAuthorityId
(
String
authorityId
)
{
this
.
authorityId
=
authorityId
;
}
public
String
getRole
()
{
return
role
;
}
public
void
setRole
(
String
role
)
{
this
.
role
=
role
;
}
}
src/main/java/com/pangding/web/authority/vo/reqvo/UserRoleGetReqVo.java
View file @
33defe4c
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
java.util.List
;
/**
* @Author zhangjinyao
* @create 2019/5/11 15:37
...
...
@@ -11,6 +13,8 @@ public class UserRoleGetReqVo {
private
String
userId
;
private
List
<
String
>
roleIds
;
public
String
getReqId
()
{
return
reqId
;
}
...
...
@@ -34,4 +38,12 @@ public class UserRoleGetReqVo {
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
List
<
String
>
getRoleIds
()
{
return
roleIds
;
}
public
void
setRoleIds
(
List
<
String
>
roleIds
)
{
this
.
roleIds
=
roleIds
;
}
}
src/main/java/com/pangding/web/authority/vo/resvo/AuthorityListByLevelResVo.java
View file @
33defe4c
package
com
.
pangding
.
web
.
authority
.
vo
.
resvo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.IRoleAuthorityVo
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -10,7 +12,7 @@ import java.util.List;
*/
public
class
AuthorityListByLevelResVo
extends
AuthorityVo
{
List
<
AuthorityListByLevelResVo
>
childList
;
List
<
AuthorityListByLevelResVo
>
childList
=
new
ArrayList
<>()
;
public
List
<
AuthorityListByLevelResVo
>
getChildList
()
{
return
childList
;
...
...
src/main/java/com/pangding/web/authority/vo/resvo/AuthorityListResVo.java
View file @
33defe4c
...
...
@@ -28,4 +28,12 @@ public class AuthorityListResVo {
public
void
setAuthorityListByRole
(
List
<
AuthorityVo
>
authorityListByRole
)
{
this
.
authorityListByRole
=
authorityListByRole
;
}
// public List<AuthorityListByLevelResVo> getAuthorityListByRole() {
// return authorityListByRole;
// }
//
// public void setAuthorityListByRole(List<AuthorityListByLevelResVo> authorityListByRole) {
// this.authorityListByRole = authorityListByRole;
// }
}
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