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
b3deb6ac
Commit
b3deb6ac
authored
Apr 16, 2025
by
廖旭伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/qionglai' into qionglai
parents
fbacf05f
e7290ffa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
38 deletions
+22
-38
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
...com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
+20
-6
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
-4
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
View file @
b3deb6ac
...
...
@@ -113,7 +113,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
}
data
.
put
(
"id"
,
userEntity
.
getId
());
if
(
userEntity
!=
null
)
{
if
(
userEntity
!=
null
)
{
StaffEntity
staffEntity
=
null
;
if
(
userEntity
.
getCustomerId
()
!=
null
)
{
staffEntity
=
staffService
.
getCache
(
userEntity
.
getCustomerId
().
toString
());
...
...
@@ -181,23 +181,37 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
if
(
ObjectUtils
.
isEmpty
(
req
.
getOpenId
()))
throw
new
AppException
(
"openId不能为空!"
);
StaffEntity
staffEntity
=
staffService
.
selectOne
(
new
StaffQuery
().
phoneNumber
(
req
.
getPhone
())
.
name
(
req
.
getUserName
())
);
StaffEntity
staffEntity
=
staffService
.
selectOne
(
new
StaffQuery
().
phoneNumber
(
req
.
getPhone
()));
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
throw
new
AppException
(
String
.
format
(
"系统未找到当前用户,姓名:%s,手机:%s,请联系管理员!"
,
req
.
getUserName
(),
req
.
getPhone
()));
UserQuery
userQuery
=
new
UserQuery
();
userQuery
.
setLoginName
(
req
.
getUserName
());
userEntity
=
userService
.
selectOne
(
userQuery
);
if
(!
ObjectUtils
.
isEmpty
(
userEntity
))
throw
new
AppException
(
String
.
format
(
"登录用户名已经存在!"
));
userQuery
=
new
UserQuery
();
userQuery
.
setCustomerId
(
staffEntity
.
getId
());
userEntity
=
userService
.
selectOne
(
userQuery
);
if
(
ObjectUtils
.
isEmpty
(
userEntity
))
throw
new
AppException
(
String
.
format
(
"员工未与系统用户绑定,staffId:%s"
,
staffEntity
.
getId
()));
userEntity
.
setDingUserId
(
req
.
getOpenId
());
userEntity
.
setLoginName
(
req
.
getUserName
());
// userService.update(userEntity);
Map
<
String
,
Object
>
condition
=
new
HashMap
<>(
1
);
condition
.
put
(
"id"
,
userEntity
.
getId
());
Map
<
String
,
Object
>
data1
=
new
HashMap
<>(
1
);
data1
.
put
(
"dingUserId"
,
req
.
getOpenId
());
userService
.
getUserDao
().
update
(
data1
,
condition
);
/* Map<String, Object> data1 = new HashMap<>(1);
data1.put("dingUserId", req.getOpenId());*/
UserEntity
userData
=
new
UserEntity
();
userData
.
setDingUserId
(
req
.
getOpenId
());
userData
.
setLoginName
(
req
.
getUserName
());
userService
.
getUserDao
().
update
(
userData
,
condition
);
JSONObject
data
=
new
JSONObject
();
...
...
@@ -239,7 +253,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
String
token
=
authTokenService
.
getToken
(
request
);
data
.
put
(
"id"
,
user
.
getId
());
data
.
put
(
"token"
,
token
);
if
(
userEntity
!=
null
)
{
if
(
userEntity
!=
null
)
{
StaffEntity
staffEntity
=
null
;
if
(
userEntity
.
getCustomerId
()
!=
null
)
{
staffEntity
=
staffService
.
getCache
(
userEntity
.
getCustomerId
().
toString
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
b3deb6ac
...
...
@@ -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
public
void
stopTask
(
ITask
task
)
throws
AppException
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
b3deb6ac
...
...
@@ -398,7 +398,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
protected
void
updateAfter
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateAfter
(
entity
,
context
);
//更新登录名
/*
//更新登录名
UserQuery userQuery = new UserQuery();
userQuery.setCustomerId(entity.getId());
...
...
@@ -412,7 +412,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
user.setLoginName(PinYinUtils.getHanziPinYin(entity.getName()));
userService.getUserDao().update(user, condition);
}
*/
}
@Override
...
...
@@ -772,9 +772,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
});
}
}
log
.
info
(
"部门{}获取人员信息:{}"
,
deptCode
,
JSON
.
toJSONString
(
collect
));
}
...
...
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