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
2489727d
Commit
2489727d
authored
Feb 21, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
10f47373
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+51
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
2489727d
...
...
@@ -13,21 +13,31 @@ import org.springframework.stereotype.Service;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
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.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.github.pagehelper.PageHelper
;
@Service
...
...
@@ -42,6 +52,15 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired
private
StaffDepartmentRelatedMapper
staffDepartmentRelatedMapper
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Autowired
private
DepartmentService
departmentService
;
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
TabHaobanStaff
staff
=
staffService
.
selectById
(
staffId
);
...
...
@@ -63,6 +82,38 @@ public class StaffApiServiceImpl implements StaffApiService {
String
staffId
=
staffService
.
add
(
tab
);
//调接口获取
String
wxUserId
=
""
;
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
staff
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
staff
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
List
<
Integer
>
wxDepartmentIdArrIntegers
=
new
ArrayList
<
Integer
>();
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
string
:
departmentIdArr
)
{
TabHaobanDepartment
tabs
=
departmentService
.
selectById
(
string
);
wxDepartmentIdArrIntegers
.
add
(
Integer
.
parseInt
(
tabs
.
getWxDepartmentId
()));
}
userDTO
.
setDepartment
((
Integer
[])
wxDepartmentIdArrIntegers
.
toArray
());
userDTO
.
setGender
(
"女"
);
userDTO
.
setMobile
(
staff
.
getPhoneNumber
());
userDTO
.
setName
(
staff
.
getStaffName
());
userDTO
.
setUserid
(
staffId
);
if
(
activeFlag
==
1
)
{
userDTO
.
setTo_invite
(
true
);
}
JSONResponse
jp
=
qywxUserApiService
.
createWorkWxUser
(
userDTO
,
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
());
if
(
jp
.
getErrorCode
()
!=
1
)
{
hr
.
setErrorCode
(
0
);
hr
.
setDetailError
(
"微信新增失败"
);
return
hr
;
}
wxUserId
=
jp
.
getResult
().
toString
();
}
}
if
(
StringUtils
.
isNotBlank
(
wxUserId
)){
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
string
:
departmentIdArr
)
{
...
...
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