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
d94a88e0
Commit
d94a88e0
authored
Mar 17, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-0323' into developer
parents
7ebf418a
8b49e6d2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
12 deletions
+37
-12
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+36
-11
StaffDepartmentRelatedMapper.xml
...rc/main/resources/mapper/StaffDepartmentRelatedMapper.xml
+0
-0
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
d94a88e0
...
@@ -83,6 +83,8 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -83,6 +83,8 @@ public class MessageApiServiceImpl implements MessageApiService {
private
SecretSettingService
secretSettingService
;
private
SecretSettingService
secretSettingService
;
@Autowired
@Autowired
private
DepartmentApiService
departmentApiService
;
private
DepartmentApiService
departmentApiService
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
@Override
@Override
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
...
@@ -277,15 +279,38 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -277,15 +279,38 @@ public class MessageApiServiceImpl implements MessageApiService {
*/
*/
private
void
dealDepartment
(
QywxCallBackDTO
qywxCallBackDTO
)
{
private
void
dealDepartment
(
QywxCallBackDTO
qywxCallBackDTO
)
{
log
.
info
(
"处理部门:{}"
,
qywxCallBackDTO
);
log
.
info
(
"处理部门:{}"
,
qywxCallBackDTO
);
Integer
wxDeptId
=
qywxCallBackDTO
.
getId
();
String
authCorpId
=
qywxCallBackDTO
.
getAuthCorpId
();
DepartmentDTO
departmentDTO
=
new
DepartmentDTO
();
DepartmentDTO
departmentDTO
=
new
DepartmentDTO
();
departmentDTO
.
setDepartmentName
(
qywxCallBackDTO
.
getDepartmentName
());
departmentDTO
.
setIsStore
(
0
);
departmentDTO
.
setIsStore
(
0
);
TabHaobanWxEnterprise
enterprise
=
this
.
enterpriseService
.
getEnterpriseBycorpId
(
qywxCallBackDTO
.
getAuthCorpId
());
TabHaobanWxEnterprise
enterprise
=
this
.
enterpriseService
.
getEnterpriseBycorpId
(
authCorpId
);
if
(
enterprise
==
null
)
{
log
.
info
(
"为查询到企业:authCorpId:{}"
,
authCorpId
);
return
;
}
String
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
log
.
info
(
"没有配置secret:{}"
,
wxEnterpriseId
);
return
;
}
String
corpid
=
""
;
String
secret
=
secretSetting
.
getSecretVal
();
if
(
authCorpId
.
length
()
>
20
)
{
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
3
);
if
(
application
!=
null
)
{
corpid
=
application
.
getCorpid
();
}
}
else
{
corpid
=
authCorpId
;
}
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
deptDetail
=
qywxDepartmentApiService
.
getSelfDepartmentById
(
corpid
,
secret
,
wxDeptId
);
departmentDTO
.
setDepartmentName
(
deptDetail
.
getName
());
TabHaobanDepartment
parentDepartment
=
new
TabHaobanDepartment
();
TabHaobanDepartment
parentDepartment
=
new
TabHaobanDepartment
();
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
parentDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getParentId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
parentDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getParentId
()
+
""
,
wxEnterpriseId
);
}
else
{
}
else
{
TabHaobanDepartment
oldDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
TabHaobanDepartment
oldDepartment
=
this
.
departmentService
.
getByWxId
(
wxDeptId
+
""
,
wxEnterpriseId
);
if
(
oldDepartment
!=
null
)
{
if
(
oldDepartment
!=
null
)
{
parentDepartment
=
departmentService
.
selectById
(
oldDepartment
.
getParentDepartmentId
());
parentDepartment
=
departmentService
.
selectById
(
oldDepartment
.
getParentDepartmentId
());
}
}
...
@@ -293,7 +318,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -293,7 +318,7 @@ public class MessageApiServiceImpl implements MessageApiService {
String
changeType
=
qywxCallBackDTO
.
getChangeType
();
String
changeType
=
qywxCallBackDTO
.
getChangeType
();
if
(!
changeType
.
equals
(
WxEditType
.
DELETE_DEPART
.
getCode
()))
{
if
(!
changeType
.
equals
(
WxEditType
.
DELETE_DEPART
.
getCode
()))
{
if
(
parentDepartment
==
null
)
{
if
(
parentDepartment
==
null
)
{
log
.
info
(
"
微信
同步父部门不存在"
);
log
.
info
(
"
企微
同步父部门不存在"
);
return
;
return
;
}
}
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
...
@@ -301,16 +326,16 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -301,16 +326,16 @@ public class MessageApiServiceImpl implements MessageApiService {
departmentDTO
.
setChainName
(
parentDepartment
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parentDepartment
.
getChainName
());
departmentDTO
.
setChainName
(
parentDepartment
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parentDepartment
.
getChainName
());
departmentDTO
.
setLevel
(
parentDepartment
.
getLevel
()
+
1
);
departmentDTO
.
setLevel
(
parentDepartment
.
getLevel
()
+
1
);
}
}
departmentDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
()
);
departmentDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
departmentDTO
.
setWxDepartmentId
(
qywxCallBackDTO
.
getId
()
+
""
);
departmentDTO
.
setWxDepartmentId
(
wxDeptId
+
""
);
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
list
Department
(
qywxCallBackDTO
.
getAuthCorpId
(),
qywxCallBackDTO
.
getSuiteId
()
,
qywxCallBackDTO
.
getParentId
());
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
list
SelfDepartment
(
corpid
,
secret
,
qywxCallBackDTO
.
getParentId
());
if
(
list
!=
null
)
{
if
(
list
!=
null
)
{
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
wxDepartmentDTO
:
list
)
{
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
wxDepartmentDTO
:
list
)
{
if
(
Convert
.
toStr
(
wxDepartmentDTO
.
getId
()).
equals
(
departmentDTO
.
getDepartmentId
()))
{
if
(
Convert
.
toStr
(
wxDepartmentDTO
.
getId
()).
equals
(
departmentDTO
.
getDepartmentId
()))
{
departmentDTO
.
setSort
(
qywxCallBackDTO
.
getOrder
());
departmentDTO
.
setSort
(
qywxCallBackDTO
.
getOrder
());
}
else
{
}
else
{
TabHaobanDepartment
tab
=
this
.
departmentService
.
getByWxId
(
wxDepartmentDTO
.
getId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
TabHaobanDepartment
tab
=
this
.
departmentService
.
getByWxId
(
wxDepartmentDTO
.
getId
()
+
""
,
wxEnterpriseId
);
if
(
tab
!=
null
)
{
if
(
tab
!=
null
)
{
tab
.
setSort
(
wxDepartmentDTO
.
getOrder
());
tab
.
setSort
(
wxDepartmentDTO
.
getOrder
());
this
.
departmentService
.
edit
(
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
));
this
.
departmentService
.
edit
(
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
));
...
@@ -324,7 +349,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -324,7 +349,7 @@ public class MessageApiServiceImpl implements MessageApiService {
this
.
departmentService
.
add
(
departmentDTO
);
this
.
departmentService
.
add
(
departmentDTO
);
}
else
if
(
changeType
.
equals
(
WxEditType
.
UPDATE_DEPART
.
getCode
()))
{
}
else
if
(
changeType
.
equals
(
WxEditType
.
UPDATE_DEPART
.
getCode
()))
{
log
.
info
(
"企微修改部门同步"
);
log
.
info
(
"企微修改部门同步"
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
wxDeptId
+
""
,
wxEnterpriseId
);
if
(
department
==
null
)
{
if
(
department
==
null
)
{
String
response
=
this
.
departmentService
.
add
(
departmentDTO
);
String
response
=
this
.
departmentService
.
add
(
departmentDTO
);
log
.
info
(
"企微同步新增部门:{}"
,
JSON
.
toJSONString
(
response
));
log
.
info
(
"企微同步新增部门:{}"
,
JSON
.
toJSONString
(
response
));
...
@@ -336,7 +361,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -336,7 +361,7 @@ public class MessageApiServiceImpl implements MessageApiService {
}
}
}
else
if
(
changeType
.
equals
(
WxEditType
.
DELETE_DEPART
.
getCode
()))
{
}
else
if
(
changeType
.
equals
(
WxEditType
.
DELETE_DEPART
.
getCode
()))
{
log
.
info
(
"企微删除部门同步"
);
log
.
info
(
"企微删除部门同步"
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
wxDeptId
+
""
,
wxEnterpriseId
);
if
(
department
==
null
)
{
if
(
department
==
null
)
{
log
.
info
(
"企微同步删除部门不存在"
);
log
.
info
(
"企微同步删除部门不存在"
);
}
else
{
}
else
{
...
...
haoban-manage3-service/src/main/resources/mapper/StaffDepartmentRelatedMapper.xml
View file @
d94a88e0
This diff is collapsed.
Click to expand it.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
d94a88e0
...
@@ -138,7 +138,7 @@ public class StaffController extends WebBaseController {
...
@@ -138,7 +138,7 @@ public class StaffController extends WebBaseController {
// 部门
// 部门
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
//
员工
//员工
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
);
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentIds
,
activeFlag
,
keyWord
,
pageInfo
,
relationFlag
);
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
logger
.
info
(
"pages={},totalPage={}"
,
page
.
getCurrentPage
(),
page
.
getTotalPage
());
...
...
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