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
5b793b16
Commit
5b793b16
authored
Dec 20, 2019
by
zuoyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
员工信息修改_APP用户列表联动更新
parent
74b0c84d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
35 deletions
+67
-35
AppUserDetailBiz.java
...m/github/wxiaoqi/security/admin/biz/AppUserDetailBiz.java
+32
-17
AppUserLoginBiz.java
...om/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
+1
-1
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+14
-10
AppUsersManageController.java
...wxiaoqi/security/admin/rest/AppUsersManageController.java
+20
-3
AppUserPositionController.java
.../security/admin/rest/admin/AppUserPositionController.java
+0
-4
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserDetailBiz.java
View file @
5b793b16
...
...
@@ -95,13 +95,13 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
AppUserDetail
entity
=
new
AppUserDetail
();
Example
example
=
new
Example
(
AppUserDetail
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userid"
,
userVo
.
getUserid
());
criteria
.
andEqualTo
(
"userid"
,
userVo
.
getUserid
());
try
{
BeanUtils
.
copyProperties
(
entity
,
userVo
);
if
(
entity
!=
null
)
{
entity
.
setUpdHost
(
AppPermissionService
.
getIp
());
entity
.
setUpdatetime
(
Instant
.
now
().
toEpochMilli
()
/
1000L
);
mapper
.
updateByExampleSelective
(
entity
,
example
);
mapper
.
updateByExampleSelective
(
entity
,
example
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -134,7 +134,7 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
@CacheClear
(
pre
=
"user{1}"
)
public
void
updateUserPositionByUserId
(
Integer
userId
,
Integer
positionId
)
{
mapper
.
updateUserPositionByUserId
(
userId
,
positionId
);
mapper
.
updateUserPositionByUserId
(
userId
,
positionId
);
}
public
AppUserInfoVo
findUserInfoByCode
(
String
code
)
{
...
...
@@ -144,31 +144,31 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
appUserDetail
.
setCode
(
code
);
AppUserDetail
userDetail
=
mapper
.
selectOne
(
appUserDetail
);
if
(
userDetail
==
null
)
{
if
(
userDetail
==
null
)
{
return
appUserInfoVo
;
}
appUserInfoVo
.
setHeadimgurl
(
userDetail
.
getHeadimgurl
());
appUserInfoVo
.
setHeadimgurl
(
userDetail
.
getHeadimgurl
());
appUserInfoVo
.
setNickname
(
userDetail
.
getNickname
());
return
appUserInfoVo
;
return
appUserInfoVo
;
}
public
List
<
Integer
>
getUserIdByUsername
(
String
keywords
)
{
return
mapper
.
getUserIdByUsername
(
keywords
);
}
public
void
updateByUserId
(
AccountBindDTO
accountBindDTO
,
Integer
userId
)
{
public
void
updateByUserId
(
AccountBindDTO
accountBindDTO
,
Integer
userId
)
{
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
if
(
accountBindDTO
.
getType
().
equals
(
"wx"
)){
if
(
accountBindDTO
.
getType
().
equals
(
"wx"
))
{
appUserDetail
.
setWxNickname
(
accountBindDTO
.
getNickName
());
}
if
(
accountBindDTO
.
getType
().
equals
(
"q"
))
{
if
(
accountBindDTO
.
getType
().
equals
(
"q"
))
{
appUserDetail
.
setQqNickname
(
accountBindDTO
.
getNickName
());
}
Example
example
=
new
Example
(
AppUserDetail
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userid"
,
userId
);
mapper
.
updateByExampleSelective
(
appUserDetail
,
example
);
criteria
.
andEqualTo
(
"userid"
,
userId
);
mapper
.
updateByExampleSelective
(
appUserDetail
,
example
);
}
public
List
<
AppUserVo
>
getUserByUserIds
(
List
<
Integer
>
ids
)
{
...
...
@@ -177,21 +177,21 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
public
List
<
UserStaffBo
>
findAllStaffs
()
{
List
<
UserStaffBo
>
userStaffBos
=
mapper
.
selectAllStaffs
();
return
CollectionUtils
.
isEmpty
(
userStaffBos
)
?
Collections
.
EMPTY_LIST
:
userStaffBos
;
return
CollectionUtils
.
isEmpty
(
userStaffBos
)
?
Collections
.
EMPTY_LIST
:
userStaffBos
;
}
public
List
<
AppUserVo
>
getUserByUserIdList
(
List
<
Integer
>
userIds
)
{
List
<
AppUserVo
>
appUserVos
=
mapper
.
getUserByUserIdList
(
userIds
);
return
CollectionUtils
.
isEmpty
(
appUserVos
)
?
Collections
.
EMPTY_LIST
:
appUserVos
;
List
<
AppUserVo
>
appUserVos
=
mapper
.
getUserByUserIdList
(
userIds
);
return
CollectionUtils
.
isEmpty
(
appUserVos
)
?
Collections
.
EMPTY_LIST
:
appUserVos
;
}
public
PageDataVO
<
UserStaffBo
>
findAllStaffsByCompanyIdAndPostionIdWithPage
(
StaffStatisticsFindDTO
staffStatisticsFindDTO
)
{
return
PageDataVO
.
pageInfo
(
staffStatisticsFindDTO
.
getPage
(),
staffStatisticsFindDTO
.
getLimit
(),()->
mapper
.
findAllStaffsByCompanyIdAndPostionId
(
staffStatisticsFindDTO
));
return
PageDataVO
.
pageInfo
(
staffStatisticsFindDTO
.
getPage
(),
staffStatisticsFindDTO
.
getLimit
(),
()
->
mapper
.
findAllStaffsByCompanyIdAndPostionId
(
staffStatisticsFindDTO
));
}
public
List
<
UserStaffBo
>
findStaffsByIdsAndCompanyAndPostion
(
StaffStatisticsFindDTO
staffStatisticsFindDTO
)
{
List
<
UserStaffBo
>
staffBos
=
mapper
.
findAllStaffsByCompanyIdAndPostionId
(
staffStatisticsFindDTO
);
return
CollectionUtils
.
isEmpty
(
staffBos
)
?
Collections
.
EMPTY_LIST
:
staffBos
;
return
CollectionUtils
.
isEmpty
(
staffBos
)
?
Collections
.
EMPTY_LIST
:
staffBos
;
}
public
AppUserVo
findByCode
(
String
code
)
{
...
...
@@ -199,7 +199,7 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
appUserDetail
.
setCode
(
code
);
appUserDetail
=
mapper
.
selectOne
(
appUserDetail
);
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
appUserDetail
,
appUserVo
);
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
appUserDetail
,
appUserVo
);
return
appUserVo
;
}
...
...
@@ -207,4 +207,19 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
return
mapper
.
getUser
(
userId
);
}
/**
* 判断员工是否是APP用户
*
* @return
*/
public
AppUserDetail
checkeIsAppUser
(
Integer
userid
)
{
Example
example
=
new
Example
(
AppUserDetail
.
class
);
example
.
createCriteria
().
andEqualTo
(
"userid"
,
userid
);
List
<
AppUserDetail
>
appUserDetailList
=
mapper
.
selectByExample
(
example
);
if
(
appUserDetailList
!=
null
&&
appUserDetailList
.
size
()
!=
0
)
{
return
appUserDetailList
.
get
(
0
);
}
return
null
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
View file @
5b793b16
...
...
@@ -478,7 +478,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
AppUserLogin
appUserLogin
=
selectById
(
userId
);
if
(
appUserLogin
!=
null
)
{
String
phone
=
appUserLogin
.
getUsername
();
appUserPositionTempBiz
.
findUserPositionTemp
(
phone
,
positionId
,
operatorId
);
appUserPositionTempBiz
.
findUserPositionTemp
(
userId
,
positionId
,
operatorId
);
}
appUserDetailBiz
.
updateUserPositionByUserId
(
userId
,
positionId
);
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
View file @
5b793b16
...
...
@@ -111,6 +111,11 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
}
//记录表插入
appUserPositionChangeRecordBiz
.
addJoinJobRecord
(
appUserPositionTempDTO
,
updUserId
);
//用户表更改其身份
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userPositionTemp
.
getUserId
());
if
(
appUserDetail
!=
null
)
{
loginBiz
.
updateUserPosition
(
appUserDetail
.
getId
(),
appUserPositionTempDTO
.
getPositionId
());
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -404,9 +409,9 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
appUserPositionChangeRecordBiz
.
addPositionChangeRecord
(
userPositionTemp
,
oldData
,
operatorId
,
appUserPositionTempDTO
.
getRelTime
());
}
//用户表更改其身份
AppUser
Login
userLogin
=
loginBiz
.
checkeUserLogin
(
userPositionTemp
.
getPhone
());
if
(
userLogin
!=
null
)
{
loginBiz
.
updateUserPosition
(
userLogin
.
getId
(),
appUserPositionTempDTO
.
getPositionId
());
AppUser
Detail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userPositionTemp
.
getUserId
());
if
(
appUserDetail
!=
null
)
{
loginBiz
.
updateUserPosition
(
appUserDetail
.
getId
(),
appUserPositionTempDTO
.
getPositionId
());
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -424,10 +429,9 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
userPositionTemp
.
setUpdTime
(
System
.
currentTimeMillis
());
appUserPositionChangeRecordBiz
.
andAddJoinJobRecord
(
appUserPositionTempDTO
,
operatorId
);
//用户表更改其身份
AppUserLogin
userLogin
=
loginBiz
.
checkeUserLogin
(
userPositionTemp
.
getPhone
());
if
(
userLogin
!=
null
)
{
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
loginBiz
.
updateUserPosition
(
userLogin
.
getId
(),
appUserPositionTempDTO
.
getPositionId
(),
operatorId
);
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userPositionTemp
.
getUserId
());
if
(
appUserDetail
!=
null
)
{
loginBiz
.
updateUserPosition
(
appUserDetail
.
getId
(),
appUserPositionTempDTO
.
getPositionId
());
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -445,13 +449,13 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
* zuoyh
* app用户表修改职位,员工记录表对应查询
*/
public
void
findUserPositionTemp
(
String
phone
,
Integer
positionId
,
Integer
operatorId
)
{
public
void
findUserPositionTemp
(
Integer
userId
,
Integer
positionId
,
Integer
operatorId
)
{
Timestamp
relTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
Example
example
=
new
Example
(
AppUserPositionTemp
.
class
);
example
.
createCriteria
().
andEqualTo
(
"
phone"
,
phone
);
example
.
createCriteria
().
andEqualTo
(
"
userId"
,
userId
);
List
<
AppUserPositionTemp
>
list
=
mapper
.
selectByExample
(
example
);
AppUserPositionTemp
newAppUserPositionTemp
=
new
AppUserPositionTemp
();
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
!=
0
)
{
newAppUserPositionTemp
=
list
.
get
(
0
);
if
(
newAppUserPositionTemp
!=
null
)
{
AppUserPositionTemp
odlAppUserPositionTemp
=
new
AppUserPositionTemp
();
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUsersManageController.java
View file @
5b793b16
...
...
@@ -12,19 +12,24 @@ import com.github.wxiaoqi.security.admin.entity.User;
import
com.github.wxiaoqi.security.admin.vo.AppUserManageVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Set
;
/**
* app用户管理类
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping
(
"appUsersManage"
)
public
class
AppUsersManageController
extends
BaseController
<
AppUserManageBiz
,
AppUserManage
>
{
...
...
@@ -44,6 +49,10 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
@Autowired
private
VehicleFeign
vehicleFeign
;
@Autowired
private
UserAuthUtil
userAuthUtil
;
private
Integer
ALL_PERMISSIONS
=
1
;
/**
* 查询所有
...
...
@@ -137,9 +146,17 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
}
@PutMapping
(
"/user_position"
)
public
ObjectRestResponse
<
Void
>
setUserPositionById
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"positionId"
)
Integer
positionId
){
appUserDetailBiz
.
updateUserPositionByUserId
(
id
,
positionId
);
return
ObjectRestResponse
.
succ
();
public
ObjectRestResponse
<
Void
>
setUserPositionById
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"positionId"
)
Integer
positionId
,
HttpServletRequest
request
)
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
Integer
operatorId
=
Integer
.
valueOf
(
infoFromToken
.
getId
());
appUserLoginBiz
.
updateUserPosition
(
id
,
positionId
,
operatorId
);
return
ObjectRestResponse
.
succ
();
}
catch
(
Exception
e
)
{
log
.
error
(
"修改失败【{}】"
,
e
);
throw
new
BaseException
(
"修改失败"
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/AppUserPositionController.java
View file @
5b793b16
...
...
@@ -146,10 +146,6 @@ public class AppUserPositionController {
}
}
/**
* 批量导入
* @param userPostionExcel
...
...
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