Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
Overview
Overview
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
首航-临时账号
api
Commits
d3a23d6f
Commit
d3a23d6f
authored
Dec 22, 2017
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:1、用户登出席位,恢复用户席位手机号为用户手机号
2、用户设置席位手机号为空时,设置为用户手机号
parent
23b74bb0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
12 deletions
+51
-12
UserDao.xml
resources/mapper/modules/user/UserDao.xml
+6
-0
UserController.java
src/com/ejweb/modules/user/api/UserController.java
+37
-10
UserSeatMobileBean.java
src/com/ejweb/modules/user/bean/UserSeatMobileBean.java
+1
-1
UserDao.java
src/com/ejweb/modules/user/dao/UserDao.java
+3
-1
UserService.java
src/com/ejweb/modules/user/service/UserService.java
+4
-0
No files found.
resources/mapper/modules/user/UserDao.xml
View file @
d3a23d6f
...
@@ -331,6 +331,12 @@
...
@@ -331,6 +331,12 @@
AND st.status = '1'
AND st.status = '1'
AND t.status = '1'
AND t.status = '1'
</select>
</select>
<!--获取用户的席位信息-->
<select
id=
"getUserSeatMobileBean"
resultType=
"com.ejweb.modules.user.bean.UserSeatMobileBean"
>
SELECT * FROM foc_user2seat WHERE user_id=#{userId} AND seat_id=#{seatId}
</select>
<!-- 获取用户的席位列表 -->
<!-- 获取用户的席位列表 -->
<select
id=
"getUserSeatByUserCode"
resultType=
"com.ejweb.modules.user.entity.UserSeatEntity"
>
<select
id=
"getUserSeatByUserCode"
resultType=
"com.ejweb.modules.user.entity.UserSeatEntity"
>
SELECT d.user_id,
SELECT d.user_id,
...
...
src/com/ejweb/modules/user/api/UserController.java
View file @
d3a23d6f
...
@@ -18,10 +18,7 @@ import com.ejweb.modules.role.entity.InformationEntity;
...
@@ -18,10 +18,7 @@ import com.ejweb.modules.role.entity.InformationEntity;
import
com.ejweb.modules.role.entity.UserRolesEntity
;
import
com.ejweb.modules.role.entity.UserRolesEntity
;
import
com.ejweb.modules.role.service.UserRolesService
;
import
com.ejweb.modules.role.service.UserRolesService
;
import
com.ejweb.modules.user.bean.*
;
import
com.ejweb.modules.user.bean.*
;
import
com.ejweb.modules.user.entity.LoginUserEntity
;
import
com.ejweb.modules.user.entity.*
;
import
com.ejweb.modules.user.entity.UserEntity
;
import
com.ejweb.modules.user.entity.UserLoginLogEntity
;
import
com.ejweb.modules.user.entity.UserSeatEntity
;
import
com.ejweb.modules.user.service.UserService
;
import
com.ejweb.modules.user.service.UserService
;
import
com.jdair.util.http.client.HTTPClientUtil
;
import
com.jdair.util.http.client.HTTPClientUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -556,13 +553,33 @@ public class UserController {
...
@@ -556,13 +553,33 @@ public class UserController {
if
(
message
==
null
)
{
if
(
message
==
null
)
{
if
(
StringUtils
.
isNotBlank
(
bean
.
getSeatId
())){
if
(
StringUtils
.
isNotBlank
(
bean
.
getSeatId
())){
SeatLoginBean
seatLoginBean
=
new
SeatLoginBean
();
SeatLoginBean
seatLoginBean
=
new
SeatLoginBean
();
seatLoginBean
.
setUserId
(
bean
.
getUserId
());
seatLoginBean
.
setUserId
(
bean
.
getUserId
());
seatLoginBean
.
setSeatId
(
bean
.
getSeatId
());
seatLoginBean
.
setSeatId
(
bean
.
getSeatId
());
userService
.
updateSeatUserLogout
(
seatLoginBean
);
userService
.
updateSeatUserLogout
(
seatLoginBean
);
}
}
//退出登录检测该用户席位手机号是否和系统中存储的用户手机号相同,不同则修改为系统手机号
SeatLoginBean
seatLoginBean
=
new
SeatLoginBean
();
seatLoginBean
.
setUserId
(
bean
.
getUserId
());
seatLoginBean
.
setSeatId
(
bean
.
getSeatId
());
//查询用户席位(主要用于获取用户席位手机号)
UserSeatMobileBean
seatMobileBean
=
userService
.
getUserSeatMobileBean
(
seatLoginBean
);
UserEntity
userEntity
=
new
UserEntity
();
userEntity
.
setUsercode
(
bean
.
getUserId
());
User
user
=
userService
.
getUserByUserCode
(
userEntity
);
if
(
StringUtils
.
isNotEmpty
(
user
.
getMobile
())
&&
StringUtils
.
isNotEmpty
(
seatMobileBean
.
getSeatMobile
())){
if
(!
user
.
getMobile
().
equals
(
seatMobileBean
.
getSeatMobile
())){
seatMobileBean
.
setSeatMobile
(
user
.
getMobile
());
seatMobileBean
.
setSeatMobileNumber
(
Util
.
formatedMobile
(
user
.
getMobile
()));
userService
.
updateUserSeatMobile
(
seatMobileBean
);
}
}
String
clientip
=
StringUtils
.
isEmpty
(
bean
.
getClientip
())
?
Util
.
getOnlineIP
(
request
)
:
bean
.
getClientip
();
String
clientip
=
StringUtils
.
isEmpty
(
bean
.
getClientip
())
?
Util
.
getOnlineIP
(
request
)
:
bean
.
getClientip
();
UserLoginLogEntity
logoutDeviceInfoEntity
=
new
UserLoginLogEntity
();
UserLoginLogEntity
logoutDeviceInfoEntity
=
new
UserLoginLogEntity
();
logoutDeviceInfoEntity
.
setUserId
(
bean
.
getUserId
());
logoutDeviceInfoEntity
.
setUserId
(
bean
.
getUserId
());
...
@@ -909,10 +926,20 @@ public class UserController {
...
@@ -909,10 +926,20 @@ public class UserController {
UserSeatMobileBean
loginBean
=
requestBean
.
getObjectBean
(
UserSeatMobileBean
.
class
);
UserSeatMobileBean
loginBean
=
requestBean
.
getObjectBean
(
UserSeatMobileBean
.
class
);
message
=
userService
.
validate
(
loginBean
);
message
=
userService
.
validate
(
loginBean
);
if
(
message
==
null
)
{
if
(
message
==
null
)
{
String
seatMobilePhone
=
""
;
loginBean
.
setSeatMobileNumber
(
Util
.
formatedMobile
(
loginBean
.
getSeatMobile
()));
//修改允许席位手机号为空,如果为空,则修改席位手机号为用户手机号
userService
.
updateUserSeatMobile
(
loginBean
);
if
(
StringUtils
.
isEmpty
(
loginBean
.
getSeatMobile
())){
UserEntity
userEntity
=
new
UserEntity
();
userEntity
.
setUsercode
(
loginBean
.
getUserId
());
User
user
=
userService
.
getUserByUserCode
(
userEntity
);
seatMobilePhone
=
user
.
getMobile
();
}
if
(
StringUtils
.
isNotEmpty
(
seatMobilePhone
)){
loginBean
.
setSeatMobile
(
seatMobilePhone
);
loginBean
.
setSeatMobileNumber
(
Util
.
formatedMobile
(
seatMobilePhone
));
userService
.
updateUserSeatMobile
(
loginBean
);
}
responseBean
.
setData
(
loginBean
);
responseBean
.
setData
(
loginBean
);
responseBean
.
setMessage
(
GConstants
.
OK
);
responseBean
.
setMessage
(
GConstants
.
OK
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2000
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2000
);
...
...
src/com/ejweb/modules/user/bean/UserSeatMobileBean.java
View file @
d3a23d6f
...
@@ -23,7 +23,7 @@ public class UserSeatMobileBean extends GenericBean {
...
@@ -23,7 +23,7 @@ public class UserSeatMobileBean extends GenericBean {
@JSONField
(
name
=
"seatCode"
)
@JSONField
(
name
=
"seatCode"
)
private
String
seatId
;
private
String
seatId
;
@NotEmpty
(
message
=
"seatMobile不能为NULL"
)
//
@NotEmpty(message = "seatMobile不能为NULL")
@JSONField
(
name
=
"seatMobile"
)
@JSONField
(
name
=
"seatMobile"
)
private
String
seatMobile
;
private
String
seatMobile
;
@JSONField
(
deserialize
=
false
)
@JSONField
(
deserialize
=
false
)
...
...
src/com/ejweb/modules/user/dao/UserDao.java
View file @
d3a23d6f
...
@@ -47,7 +47,9 @@ public interface UserDao extends CurdDao<UserEntity> {
...
@@ -47,7 +47,9 @@ public interface UserDao extends CurdDao<UserEntity> {
public
Integer
updateUserSeatLoginEmpty
(
SeatLoginBean
bean
);
public
Integer
updateUserSeatLoginEmpty
(
SeatLoginBean
bean
);
public
UserSeatEntity
getUserSeat
(
SeatLoginBean
seatloginBean
);
public
UserSeatEntity
getUserSeat
(
SeatLoginBean
seatloginBean
);
public
UserSeatMobileBean
getUserSeatMobileBean
(
SeatLoginBean
seatloginBean
);
public
List
<
UserListEntity
>
findtUserByOffice
(
OfficeBean
officeBean
);
public
List
<
UserListEntity
>
findtUserByOffice
(
OfficeBean
officeBean
);
public
List
<
UserSeatEntity
>
getUserSeatByUserCode
(
LoginUserEntity
entity
);
public
List
<
UserSeatEntity
>
getUserSeatByUserCode
(
LoginUserEntity
entity
);
...
...
src/com/ejweb/modules/user/service/UserService.java
View file @
d3a23d6f
...
@@ -304,6 +304,10 @@ public class UserService extends CurdService<UserDao, UserEntity> {
...
@@ -304,6 +304,10 @@ public class UserService extends CurdService<UserDao, UserEntity> {
return
dao
.
getUserSeat
(
seatloginBean
);
return
dao
.
getUserSeat
(
seatloginBean
);
}
}
public
UserSeatMobileBean
getUserSeatMobileBean
(
SeatLoginBean
seatloginBean
){
return
dao
.
getUserSeatMobileBean
(
seatloginBean
);
}
public
List
<
UserListEntity
>
findtUserByOffice
(
OfficeBean
officeBean
)
{
public
List
<
UserListEntity
>
findtUserByOffice
(
OfficeBean
officeBean
)
{
return
dao
.
findtUserByOffice
(
officeBean
);
return
dao
.
findtUserByOffice
(
officeBean
);
}
}
...
...
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