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
337efa91
Commit
337efa91
authored
Mar 06, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志
parent
eb9cc1fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
23 deletions
+20
-23
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+1
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+8
-11
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+11
-12
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
337efa91
...
...
@@ -43,4 +43,5 @@ public interface StaffApiService {
StaffDepartmentRelatedDTO
getDepartmentIdAndCode
(
String
departmentId
,
String
code
);
void
initWxUser
(
String
corpid
,
String
suiteid
,
String
wxEnterpriseId
,
Integer
wxDepartmentId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
337efa91
...
...
@@ -9,6 +9,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -49,32 +50,26 @@ import com.github.pagehelper.PageHelper;
public
class
DepartmentApiServiceImpl
implements
DepartmentApiService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DepartmentApiServiceImpl
.
class
);
@Autowired
private
DepartmentService
departmentService
;
@Autowired
private
StaffDepartmentRelatedService
staffDepartmentService
;
@Autowired
private
DepartmentMapper
departmentMapper
;
@Autowired
private
com
.
gic
.
enterprise
.
api
.
service
.
DepartmentService
gicDepartmentService
;
@Autowired
private
QywxDepartmentApiService
qywxDepartmentApiService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
StoreGroupService
storeGroupService
;
@Autowired
private
StaffApiService
staffApiService
;
@Override
...
...
@@ -480,12 +475,13 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listDepartment
(
corpid
,
suiteid
,
null
);
logger
.
info
(
"企业所有部门数据:{}"
,
JSON
.
toJSONString
(
list
));
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
this
.
addAllDepartment
(
list
,
0
,
wxEnterpriseId
);
this
.
addAllDepartment
(
list
,
0
,
wxEnterpriseId
,
corpid
,
suiteid
);
}
}
private
void
addAllDepartment
(
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
,
Integer
parentId
,
String
wxEnterpriseId
){
private
void
addAllDepartment
(
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
,
Integer
parentId
,
String
wxEnterpriseId
,
String
corpid
,
String
suiteid
){
int
level
=
1
;
String
chainId
=
"0"
;
String
chainName
=
"0"
;
...
...
@@ -515,7 +511,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
dto
.
setIsStore
(
0
);
this
.
departmentService
.
add
(
dto
);
}
this
.
addAllDepartment
(
list
,
departmentDTO
.
getId
(),
wxEnterpriseId
);
this
.
addAllDepartment
(
list
,
departmentDTO
.
getId
(),
wxEnterpriseId
,
corpid
,
suiteid
);
this
.
staffApiService
.
initWxUser
(
corpid
,
suiteid
,
wxEnterpriseId
,
departmentDTO
.
getId
());
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
337efa91
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -146,9 +147,6 @@ public class StaffApiServiceImpl implements StaffApiService {
wxUserId
=
staffId
;
}
}
if
(
StringUtils
.
isNotBlank
(
wxUserId
)){
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
string
:
departmentIdArr
)
{
...
...
@@ -165,9 +163,7 @@ public class StaffApiServiceImpl implements StaffApiService {
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信端新增失败"
);
}
hr
.
setResult
(
staffId
);
return
hr
;
}
...
...
@@ -179,7 +175,6 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
Page
<
StaffDTO
>
pageStaff
(
String
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
departmentId
);
Set
<
String
>
staffIds
=
new
HashSet
<
String
>();
for
(
TabHaobanStaffDepartmentRelated
tabHaobanStaffDepartmentRelated
:
list
)
{
...
...
@@ -204,7 +199,6 @@ public class StaffApiServiceImpl implements StaffApiService {
}
else
{
return
new
ArrayList
<
StaffDTO
>();
}
}
@Override
...
...
@@ -238,7 +232,6 @@ public class StaffApiServiceImpl implements StaffApiService {
staffEdit
(
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
),
departmentIds
);
}
}
}
@Override
...
...
@@ -290,10 +283,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
}
}
}
@Override
...
...
@@ -602,7 +592,6 @@ public class StaffApiServiceImpl implements StaffApiService {
}
this
.
staffEdit
(
staff
,
departmentIds
);
}
}
}
...
...
@@ -611,4 +600,14 @@ public class StaffApiServiceImpl implements StaffApiService {
return
EntityUtil
.
changeEntityByJSON
(
StaffDepartmentRelatedDTO
.
class
,
staffDepartmentRelatedMapper
.
getDepartmentIdAndCode
(
departmentId
,
code
));
}
@Override
public
void
initWxUser
(
String
corpid
,
String
suiteid
,
String
wxEnterpriseId
,
Integer
wxDepartmentId
)
{
List
<
UserDTO
>
list
=
this
.
qywxUserApiService
.
listDepartmentUser
(
corpid
,
suiteid
,
wxDepartmentId
.
toString
(),
0
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
UserDTO
dto
:
list
){
this
.
wxGetAdd
(
dto
.
getUserid
(),
wxEnterpriseId
);
}
}
}
}
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