Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
e19e5146
Commit
e19e5146
authored
Apr 16, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加员工钉钉同步userId
parent
dd2beae4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
35 deletions
+12
-35
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
...com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
+10
-5
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+0
-28
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+2
-2
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
View file @
e19e5146
...
@@ -113,7 +113,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
...
@@ -113,7 +113,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
}
}
data
.
put
(
"id"
,
userEntity
.
getId
());
data
.
put
(
"id"
,
userEntity
.
getId
());
if
(
userEntity
!=
null
)
{
if
(
userEntity
!=
null
)
{
StaffEntity
staffEntity
=
null
;
StaffEntity
staffEntity
=
null
;
if
(
userEntity
.
getCustomerId
()
!=
null
)
{
if
(
userEntity
.
getCustomerId
()
!=
null
)
{
staffEntity
=
staffService
.
getCache
(
userEntity
.
getCustomerId
().
toString
());
staffEntity
=
staffService
.
getCache
(
userEntity
.
getCustomerId
().
toString
());
...
@@ -190,14 +190,19 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
...
@@ -190,14 +190,19 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
if
(
ObjectUtils
.
isEmpty
(
userEntity
))
if
(
ObjectUtils
.
isEmpty
(
userEntity
))
throw
new
AppException
(
String
.
format
(
"员工未与系统用户绑定,staffId:%s"
,
staffEntity
.
getId
()));
throw
new
AppException
(
String
.
format
(
"员工未与系统用户绑定,staffId:%s"
,
staffEntity
.
getId
()));
userEntity
.
setDingUserId
(
req
.
getOpenId
());
userEntity
.
setDingUserId
(
req
.
getOpenId
());
userEntity
.
setLoginName
(
req
.
getUserName
());
// userService.update(userEntity);
// userService.update(userEntity);
Map
<
String
,
Object
>
condition
=
new
HashMap
<>(
1
);
Map
<
String
,
Object
>
condition
=
new
HashMap
<>(
1
);
condition
.
put
(
"id"
,
userEntity
.
getId
());
condition
.
put
(
"id"
,
userEntity
.
getId
());
Map
<
String
,
Object
>
data1
=
new
HashMap
<>(
1
);
/* Map<String, Object> data1 = new HashMap<>(1);
data1
.
put
(
"dingUserId"
,
req
.
getOpenId
());
data1.put("dingUserId", req.getOpenId());*/
userService
.
getUserDao
().
update
(
data1
,
condition
);
UserEntity
userData
=
new
UserEntity
();
userData
.
setDingUserId
(
req
.
getOpenId
());
userData
.
setLoginName
(
req
.
getUserName
());
userService
.
getUserDao
().
update
(
userData
,
condition
);
JSONObject
data
=
new
JSONObject
();
JSONObject
data
=
new
JSONObject
();
...
@@ -239,7 +244,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
...
@@ -239,7 +244,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
String
token
=
authTokenService
.
getToken
(
request
);
String
token
=
authTokenService
.
getToken
(
request
);
data
.
put
(
"id"
,
user
.
getId
());
data
.
put
(
"id"
,
user
.
getId
());
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
if
(
userEntity
!=
null
)
{
if
(
userEntity
!=
null
)
{
StaffEntity
staffEntity
=
null
;
StaffEntity
staffEntity
=
null
;
if
(
userEntity
.
getCustomerId
()
!=
null
)
{
if
(
userEntity
.
getCustomerId
()
!=
null
)
{
staffEntity
=
staffService
.
getCache
(
userEntity
.
getCustomerId
().
toString
());
staffEntity
=
staffService
.
getCache
(
userEntity
.
getCustomerId
().
toString
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
e19e5146
...
@@ -150,34 +150,6 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -150,34 +150,6 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
}
}
}
}
private
void
syncDingDingLocalUserIds
()
{
try
{
List
<
UserEntity
>
userList
=
userService
.
getCacheList
().
stream
()
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
f
.
getCustomerId
()))
.
filter
(
f
->
ObjectUtils
.
isEmpty
(
f
.
getDingUserId
())).
collect
(
Collectors
.
toList
());
List
<
UserEntity
>
updateUserList
=
userList
.
stream
().
map
(
item
->
{
UserEntity
userEntity
=
new
UserEntity
();
userEntity
.
setId
(
item
.
getId
());
StaffEntity
staffCache
=
staffService
.
getCache
(
item
.
getCustomerId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
staffCache
))
{
userEntity
.
setDingUserId
(
staffCache
.
getWorkNum
());
}
userEntity
.
setUpdateTime
(
new
Date
());
userEntity
.
setUpdateUserId
(
1L
);
return
userEntity
;
}).
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
f
.
getDingUserId
())).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
updateUserList
))
{
log
.
info
(
"更新用户钉钉id信息数量:{}"
,
updateUserList
.
size
());
userService
.
getUserDao
().
updateBatch
(
updateUserList
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"同步钉钉usreId失败"
);
}
}
@Override
@Override
public
void
stopTask
(
ITask
task
)
throws
AppException
{
public
void
stopTask
(
ITask
task
)
throws
AppException
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
e19e5146
...
@@ -398,7 +398,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -398,7 +398,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
protected
void
updateAfter
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateAfter
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateAfter
(
entity
,
context
);
super
.
updateAfter
(
entity
,
context
);
//更新登录名
/*
//更新登录名
UserQuery userQuery = new UserQuery();
UserQuery userQuery = new UserQuery();
userQuery.setCustomerId(entity.getId());
userQuery.setCustomerId(entity.getId());
...
@@ -412,7 +412,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -412,7 +412,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
user.setLoginName(PinYinUtils.getHanziPinYin(entity.getName()));
user.setLoginName(PinYinUtils.getHanziPinYin(entity.getName()));
userService.getUserDao().update(user, condition);
userService.getUserDao().update(user, condition);
}
}
*/
}
}
@Override
@Override
...
...
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