Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
13330710
Commit
13330710
authored
Oct 08, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查看成员详情如果成员部门为空,修复部门数据
parent
f91ed8c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+21
-9
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
13330710
...
...
@@ -57,7 +57,6 @@ import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.SecretSettingService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
...
...
@@ -67,7 +66,6 @@ import com.gic.haoban.manage.service.service.StaffService;
import
com.gic.haoban.manage.service.service.StoreRangeService
;
import
com.gic.haoban.manage.service.service.SyncErrorLogService
;
import
com.gic.haoban.manage.service.service.UserLoginLogService
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -117,8 +115,6 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired
private
StaffPrivacyUseLogService
staffPrivacyUseLogService
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Autowired
private
StoreWidgetService
storeWidgetService
;
@Autowired
private
PowerService
powerService
;
...
...
@@ -150,6 +146,24 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listStaffDepartmentByStaffId
(
staffId
);
// 如果成员部门为空,修复部门数据
if
(
CollectionUtils
.
isEmpty
(
list
))
{
TabHaobanStaff
staff
=
this
.
staffMapper
.
selectByPrimaryKey
(
staffId
)
;
String
wxEnterpriseId
=
staff
.
getWxEnterpriseId
()
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
String
wxUserId
=
staff
.
getWxUserId
()
;
if
(
qwDTO
.
needOpenUserIdDk
())
{
wxUserId
=
staff
.
getWxOpenUseId
()
;
}
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
qwDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
if
(
null
!=
secretSetting
&&
StringUtils
.
isNotBlank
(
secretSetting
.
getSecretVal
()))
{
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
logger
.
info
(
"成员详情(代开)={}"
,
JSON
.
toJSONString
(
user
))
;
if
(
null
!=
user
.
getDepartment
())
{
this
.
staffDepartChange
(
staff
,
wxEnterpriseId
,
user
.
getDepartment
());
;
}
}
}
return
EntityUtil
.
changeEntityListByJSON
(
StaffDepartmentRelatedDTO
.
class
,
list
);
}
...
...
@@ -277,7 +291,7 @@ public class StaffApiServiceImpl implements StaffApiService {
staffService
.
updateByPrimaryKey
(
staff
);
}
logger
.
info
(
"staff变更保存:{}"
,
JSONObject
.
toJSONString
(
user
));
staffDepartChange
(
staff
,
wxEnterpriseId
,
user
);
staffDepartChange
(
staff
,
wxEnterpriseId
,
user
.
getDepartment
()
);
// 返回结果带上员工姓名
res
.
setResult
(
staff
.
getStaffName
());
return
res
;
...
...
@@ -347,9 +361,8 @@ public class StaffApiServiceImpl implements StaffApiService {
return
arr
;
}
private
void
staffDepartChange
(
TabHaobanStaff
staff
,
String
wxEnterpriseId
,
UserDTO
user
)
{
private
void
staffDepartChange
(
TabHaobanStaff
staff
,
String
wxEnterpriseId
,
Integer
[]
departmentIds
)
{
//更新部门
Integer
[]
departmentIds
=
user
.
getDepartment
();
List
<
String
>
wxDepartIds
=
new
ArrayList
<>();
for
(
Integer
wDId
:
departmentIds
)
{
wxDepartIds
.
add
(
wDId
.
toString
());
...
...
@@ -375,12 +388,11 @@ public class StaffApiServiceImpl implements StaffApiService {
StaffDepartmentRelatedDTO
dto
=
new
StaffDepartmentRelatedDTO
();
dto
.
setPhoneNumber
(
staff
.
getPhoneNumber
());
dto
.
setStaffId
(
staff
.
getStaffId
());
dto
.
setStaffName
(
user
.
get
Name
());
dto
.
setStaffName
(
staff
.
getStaff
Name
());
dto
.
setWxEnterpriseId
(
wxEnterpriseId
);
dto
.
setStatusFlag
(
1
);
dto
.
setDepartmentId
(
departmentDTO
.
getDepartmentId
());
dto
.
setNationCode
(
staff
.
getNationCode
());
dto
.
setStaffName
(
user
.
getName
());
staffDepartmentRelatedService
.
add
(
dto
);
}
}
...
...
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