Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
323edcd4
Commit
323edcd4
authored
Sep 29, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改我的接单状态
parent
ae0e72d1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
93 additions
and
12 deletions
+93
-12
DefaultKeyGenerator.java
...n/java/com/ace/cache/parser/impl/DefaultKeyGenerator.java
+3
-0
User.java
...n/java/com/github/wxiaoqi/security/admin/entity/User.java
+3
-1
UserRestInterface.java
.../wxiaoqi/security/admin/feign/rest/UserRestInterface.java
+4
-0
CompanyInfoBiz.java
...com/github/wxiaoqi/security/admin/biz/CompanyInfoBiz.java
+1
-0
UserBiz.java
...n/java/com/github/wxiaoqi/security/admin/biz/UserBiz.java
+32
-5
CurrentController.java
...github/wxiaoqi/security/admin/rest/CurrentController.java
+1
-0
ElementController.java
...github/wxiaoqi/security/admin/rest/ElementController.java
+2
-2
MenuController.java
...om/github/wxiaoqi/security/admin/rest/MenuController.java
+4
-2
PublicController.java
.../github/wxiaoqi/security/admin/rest/PublicController.java
+2
-0
ChwUserController.java
...ub/wxiaoqi/security/admin/rest/chw/ChwUserController.java
+36
-2
PermissionService.java
...wxiaoqi/security/admin/rpc/service/PermissionService.java
+4
-0
UserMapper.xml
...odules/ace-admin/src/main/resources/mapper/UserMapper.xml
+1
-0
No files found.
ace-common/src/main/java/com/ace/cache/parser/impl/DefaultKeyGenerator.java
View file @
323edcd4
...
@@ -53,6 +53,9 @@ public class DefaultKeyGenerator extends IKeyGenerator {
...
@@ -53,6 +53,9 @@ public class DefaultKeyGenerator extends IKeyGenerator {
if
(
express
.
length
>
1
)
{
if
(
express
.
length
>
1
)
{
String
field
=
express
[
1
];
String
field
=
express
[
1
];
value
=
ReflectionUtils
.
getFieldValue
(
value
,
field
);
value
=
ReflectionUtils
.
getFieldValue
(
value
,
field
);
if
(
value
==
null
||
value
.
equals
(
"null"
))
{
value
=
""
;
}
}
}
if
(
isFirst
)
{
if
(
isFirst
)
{
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/User.java
View file @
323edcd4
...
@@ -102,6 +102,9 @@ public class User {
...
@@ -102,6 +102,9 @@ public class User {
@Column
(
name
=
"biz_type"
)
@Column
(
name
=
"biz_type"
)
private
Integer
bizType
;
private
Integer
bizType
;
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
private
String
attr1
;
private
String
attr1
;
private
String
attr2
;
private
String
attr2
;
...
@@ -121,5 +124,4 @@ public class User {
...
@@ -121,5 +124,4 @@ public class User {
@Transient
@Transient
private
List
<
Integer
>
companyIds
;
private
List
<
Integer
>
companyIds
;
}
}
\ No newline at end of file
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/rest/UserRestInterface.java
View file @
323edcd4
...
@@ -51,6 +51,10 @@ public interface UserRestInterface {
...
@@ -51,6 +51,10 @@ public interface UserRestInterface {
}
}
}
}
default
UserDTO
getAdminUserInfoV2
()
{
return
getAdminUserInfoV2
(
Boolean
.
TRUE
);
}
default
void
checkAdminUser
(){
default
void
checkAdminUser
(){
if
(
null
==
getAdminUserInfo
())
{
if
(
null
==
getAdminUserInfo
())
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/CompanyInfoBiz.java
View file @
323edcd4
...
@@ -169,6 +169,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
...
@@ -169,6 +169,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
user
.
setPassword
(
password
);
user
.
setPassword
(
password
);
user
.
setStatus
(
1
);
user
.
setStatus
(
1
);
user
.
setCorporationId
(
branchId
);
user
.
setCorporationId
(
branchId
);
user
.
setCompanyId
(
companyInfo
.
getId
().
intValue
());
user
.
setDataAll
(
2
);
user
.
setDataAll
(
2
);
user
.
setDataCorporation
(
branchId
+
""
);
user
.
setDataCorporation
(
branchId
+
""
);
user
.
setAppUserId
(
appUserId
);
user
.
setAppUserId
(
appUserId
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBiz.java
View file @
323edcd4
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
...
@@ -33,6 +35,8 @@ import java.util.*;
...
@@ -33,6 +35,8 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -85,9 +89,20 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
...
@@ -85,9 +89,20 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
public
User
getUserByUsername
(
String
username
){
public
User
getUserByUsername
(
String
username
){
User
user
=
new
User
();
User
user
=
new
User
();
user
.
setUsername
(
username
);
user
.
setUsername
(
username
);
user
.
setIsDel
(
SYS_FALSE
);
return
mapper
.
selectOne
(
user
);
return
mapper
.
selectOne
(
user
);
}
}
// /**
// * 根据用户名获取用户信息
// * @param userId
// * @return
// */
// @Cache(key="user{1}")
// public User getUserByUserId(Integer userId){
// return mapper.selectByPrimaryKey(userId);
// }
public
TableResultResponse
<
BaseUserVo
>
selectPage
(
Query
query
,
User
currentUser
)
{
public
TableResultResponse
<
BaseUserVo
>
selectPage
(
Query
query
,
User
currentUser
)
{
List
<
BaseUserVo
>
userVos
=
new
ArrayList
<>();
List
<
BaseUserVo
>
userVos
=
new
ArrayList
<>();
List
<
User
>
list
=
new
ArrayList
<>();
List
<
User
>
list
=
new
ArrayList
<>();
...
@@ -180,11 +195,23 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
...
@@ -180,11 +195,23 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
return
mapper
.
select
(
user
);
return
mapper
.
select
(
user
);
}
}
public
List
<
User
>
getCountByUsernameBiz
(
String
username
,
Integer
bizType
){
public
List
<
User
>
getCountByUsernameBiz
(
String
username
,
Integer
bizType
,
String
mobilePhone
){
User
user
=
new
User
();
// User user = new User();
user
.
setUsername
(
username
);
// user.setUsername(username);
user
.
setBizType
(
bizType
);
// user.setBizType(bizType);
return
mapper
.
select
(
user
);
// user.setStatus(SYS_TRUE);
// user.setIsDel(SYS_FALSE);
// return mapper.select(user);
return
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
User:
:
getUsername
,
username
);
w
.
andEqualTo
(
User:
:
getBizType
,
bizType
);
w
.
andEqualTo
(
User:
:
getIsDel
,
SYS_FALSE
);
w
.
andEqualTo
(
User:
:
getStatus
,
SYS_TRUE
);
if
(
StrUtil
.
isNotBlank
(
mobilePhone
))
{
w
.
andEqualTo
(
User:
:
getMobilePhone
,
mobilePhone
);
}
return
w
;
});
}
}
public
User
getUserByUid
(
Integer
userId
){
public
User
getUserByUid
(
Integer
userId
){
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/CurrentController.java
View file @
323edcd4
...
@@ -46,6 +46,7 @@ public class CurrentController {
...
@@ -46,6 +46,7 @@ public class CurrentController {
public
@ResponseBody
public
@ResponseBody
BaseResponse
getGroups
()
throws
Exception
{
BaseResponse
getGroups
()
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
throw
new
Exception
();
throw
new
Exception
();
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/ElementController.java
View file @
323edcd4
...
@@ -46,7 +46,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
...
@@ -46,7 +46,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
Element
>
getAuthorityElement
(
String
menuId
)
{
public
ObjectRestResponse
<
Element
>
getAuthorityElement
(
String
menuId
)
{
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
,
menuId
);
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
,
menuId
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
}
}
...
@@ -54,7 +54,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
...
@@ -54,7 +54,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
@RequestMapping
(
value
=
"/user/menu"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/menu"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
Element
>
getAuthorityElement
()
{
public
ObjectRestResponse
<
Element
>
getAuthorityElement
()
{
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
);
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/MenuController.java
View file @
323edcd4
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.admin.biz.MenuBiz;
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.admin.biz.MenuBiz;
import
com.github.wxiaoqi.security.admin.biz.UserBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserBiz
;
import
com.github.wxiaoqi.security.admin.entity.Element
;
import
com.github.wxiaoqi.security.admin.entity.Element
;
import
com.github.wxiaoqi.security.admin.entity.Menu
;
import
com.github.wxiaoqi.security.admin.entity.Menu
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.vo.AuthorityMenuTree
;
import
com.github.wxiaoqi.security.admin.vo.AuthorityMenuTree
;
import
com.github.wxiaoqi.security.admin.vo.MenuTree
;
import
com.github.wxiaoqi.security.admin.vo.MenuTree
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
...
@@ -102,7 +103,8 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
...
@@ -102,7 +103,8 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
@RequestMapping
(
value
=
"/user/authorityTree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/authorityTree"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
List
<
MenuTree
>
listUserAuthorityMenu
(
Integer
parentId
){
public
List
<
MenuTree
>
listUserAuthorityMenu
(
Integer
parentId
){
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
try
{
try
{
if
(
parentId
==
null
)
{
if
(
parentId
==
null
)
{
parentId
=
this
.
getSystem
().
get
(
0
).
getId
();
parentId
=
this
.
getSystem
().
get
(
0
).
getId
();
...
@@ -116,7 +118,7 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
...
@@ -116,7 +118,7 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
@RequestMapping
(
value
=
"/user/system"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/system"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
List
<
Menu
>
listUserAuthoritySystem
()
{
public
List
<
Menu
>
listUserAuthoritySystem
()
{
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
return
baseBiz
.
getUserAuthoritySystemByUserId
(
userId
);
return
baseBiz
.
getUserAuthoritySystemByUserId
(
userId
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/PublicController.java
View file @
323edcd4
...
@@ -66,6 +66,7 @@ public class PublicController {
...
@@ -66,6 +66,7 @@ public class PublicController {
public
@ResponseBody
public
@ResponseBody
ObjectRestResponse
userinfoByToken
(
String
token
)
throws
Exception
{
ObjectRestResponse
userinfoByToken
(
String
token
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
}
}
...
@@ -80,6 +81,7 @@ public class PublicController {
...
@@ -80,6 +81,7 @@ public class PublicController {
public
@ResponseBody
public
@ResponseBody
ObjectRestResponse
userinfoByTokenV2
(
String
token
,
boolean
flag
)
throws
Exception
{
ObjectRestResponse
userinfoByTokenV2
(
String
token
,
boolean
flag
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/chw/ChwUserController.java
View file @
323edcd4
...
@@ -16,9 +16,13 @@ import com.github.wxiaoqi.security.admin.vo.MenuTree;
...
@@ -16,9 +16,13 @@ import com.github.wxiaoqi.security.admin.vo.MenuTree;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.util.ReflectionUtils
;
import
com.github.wxiaoqi.security.common.vo.DataInterBean
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -26,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -26,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_BUSINESS
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_BUSINESS
;
...
@@ -33,6 +38,7 @@ import static com.github.wxiaoqi.security.admin.entity.User.BIZ_TYPE_OPERATE;
...
@@ -33,6 +38,7 @@ import static com.github.wxiaoqi.security.admin.entity.User.BIZ_TYPE_OPERATE;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
util
.
process
.
ResultCode
.
PARAM_ILLEGAL_CODE
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -103,7 +109,7 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -103,7 +109,7 @@ public class ChwUserController extends CommonBaseController implements UserRestI
vo
.
setBizType
(
BIZ_TYPE_OPERATE
);
vo
.
setBizType
(
BIZ_TYPE_OPERATE
);
vo
.
setStatus
(
SYS_TRUE
);
vo
.
setStatus
(
SYS_TRUE
);
if
(
StringUtils
.
isNotBlank
(
username
))
{
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsernameBiz
(
username
,
BIZ_TYPE_OPERATE
);
List
<
User
>
list
=
userBiz
.
getCountByUsernameBiz
(
username
,
BIZ_TYPE_OPERATE
,
null
);
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
}
...
@@ -120,11 +126,16 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -120,11 +126,16 @@ public class ChwUserController extends CommonBaseController implements UserRestI
String
username
=
vo
.
getUsername
();
String
username
=
vo
.
getUsername
();
vo
.
setBizType
(
BIZ_TYPE_BUSINESS
);
vo
.
setBizType
(
BIZ_TYPE_BUSINESS
);
vo
.
setStatus
(
SYS_TRUE
);
vo
.
setStatus
(
SYS_TRUE
);
vo
.
setCorporationId
(
getAdminUserInfoV2
().
getCorporationId
());
vo
.
setCompanyId
(
getAdminUserInfoV2
().
getCompanyId
());
if
(
StringUtils
.
isNotBlank
(
username
))
{
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsernameBiz
(
username
,
BIZ_TYPE_BUSINESS
);
List
<
User
>
list
=
userBiz
.
getCountByUsernameBiz
(
username
,
BIZ_TYPE_BUSINESS
,
vo
.
getMobilePhone
()
);
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
}
}
else
{
throw
new
BaseException
(
"手机号已被使用"
,
PARAM_ILLEGAL_CODE
);
}
}
userBiz
.
insertSelective
(
vo
);
userBiz
.
insertSelective
(
vo
);
//添加权限关系
//添加权限关系
...
@@ -162,6 +173,15 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -162,6 +173,15 @@ public class ChwUserController extends CommonBaseController implements UserRestI
return
new
ObjectRestResponse
<
User
>();
return
new
ObjectRestResponse
<
User
>();
}
}
@RequestMapping
(
value
=
"/business/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
public
ObjectRestResponse
businessRemove
(
@PathVariable
int
id
)
{
del
(
new
User
(){{
setId
(
id
);
}});
return
new
ObjectRestResponse
<
User
>();
}
private
void
handleDataLimit
(
@RequestBody
UserController
.
UserVO
dto
)
{
private
void
handleDataLimit
(
@RequestBody
UserController
.
UserVO
dto
)
{
if
(
null
!=
dto
.
getDataLimit
())
{
if
(
null
!=
dto
.
getDataLimit
())
{
dto
.
setDataCompany
(
""
);
dto
.
setDataCompany
(
""
);
...
@@ -179,4 +199,18 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -179,4 +199,18 @@ public class ChwUserController extends CommonBaseController implements UserRestI
}
}
}
}
}
}
private
void
del
(
User
entity
)
{
Field
field
=
ReflectionUtils
.
getAccessibleField
(
entity
,
"isDel"
);
Field
field2
=
ReflectionUtils
.
getAccessibleField
(
entity
,
"delete"
);
if
(
null
!=
field
)
{
ReflectionUtils
.
setFieldValue
(
entity
,
"isDel"
,
1
);
}
if
(
null
!=
field2
)
{
ReflectionUtils
.
setFieldValue
(
entity
,
"delete"
,
1
);
}
userBiz
.
updateSelectiveById
(
entity
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/PermissionService.java
View file @
323edcd4
...
@@ -73,6 +73,7 @@ public class PermissionService {
...
@@ -73,6 +73,7 @@ public class PermissionService {
User
user
=
userBiz
.
selectOne
(
new
User
(){{
User
user
=
userBiz
.
selectOne
(
new
User
(){{
setUsername
(
username
);
setUsername
(
username
);
setBizType
(
bizType
);
setBizType
(
bizType
);
setIsDel
(
0
);
}});
}});
if
(
user
!=
null
){
if
(
user
!=
null
){
if
(
encoder
.
matches
(
password
,
user
.
getPassword
()))
{
if
(
encoder
.
matches
(
password
,
user
.
getPassword
()))
{
...
@@ -170,9 +171,11 @@ public class PermissionService {
...
@@ -170,9 +171,11 @@ public class PermissionService {
public
FrontUser
getUserInfo
(
String
token
)
throws
Exception
{
public
FrontUser
getUserInfo
(
String
token
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
null
;
return
null
;
}
}
// Integer userId = Integer.valueOf(userIdStr);
UserInfo
user
=
this
.
getUserByUsername
(
username
);
UserInfo
user
=
this
.
getUserByUsername
(
username
);
FrontUser
frontUser
=
new
FrontUser
();
FrontUser
frontUser
=
new
FrontUser
();
BeanUtils
.
copyProperties
(
user
,
frontUser
);
BeanUtils
.
copyProperties
(
user
,
frontUser
);
...
@@ -190,6 +193,7 @@ public class PermissionService {
...
@@ -190,6 +193,7 @@ public class PermissionService {
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
null
;
return
null
;
}
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/UserMapper.xml
View file @
323edcd4
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
LEFT JOIN company_info i ON c.company_id=i.id
LEFT JOIN company_info i ON c.company_id=i.id
LEFT JOIN company_info ci ON u.corporation_id=ci.id
LEFT JOIN company_info ci ON u.corporation_id=ci.id
<where>
<where>
u.is_del = 0
<if
test=
"bizType != null"
>
<if
test=
"bizType != null"
>
and u.biz_type = #{bizType}
and u.biz_type = #{bizType}
</if>
</if>
...
...
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