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
QianQiXiang
haoban-manage3.0
Commits
0e0d1655
Commit
0e0d1655
authored
Apr 16, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
fb5f0e9a
9dee53a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
33 deletions
+44
-33
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+44
-33
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
0e0d1655
...
...
@@ -508,12 +508,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
// this.addSon(subList, wxEnterpriseId, parent,corpid,suiteid);
RedisUtil
.
lock
(
"init_enterprise_"
+
wxEnterpriseId
,
60
*
60L
);
String
taskId
=
StringUtil
.
randomUUID
();
//
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, 1);
//
logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
1
);
logger
.
info
(
"企业所有部门数据:{}"
,
JSON
.
toJSONString
(
list
));
// if(CollectionUtils.isNotEmpty(list)){
// this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId);
// }
insertMQ
(
0
,
wxEnterpriseId
,
corpid
,
contactSecret
,
taskId
);
//
insertMQ(0,wxEnterpriseId, corpid,contactSecret,taskId);
RedisUtil
.
unlock
(
"init_enterprise_"
+
wxEnterpriseId
);
}
...
...
@@ -547,6 +547,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
parentId
);
String
chainId
=
"0"
;
String
chainName
=
"0"
;
String
pid
=
"0"
;
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
handerList
=
new
ArrayList
<>();
if
(
parentId
==
0
){
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
:
list
)
{
...
...
@@ -564,6 +565,16 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
level
=
parent
.
getLevel
()
+
1
;
chainId
=
parent
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
parent
.
getDepartmentId
();
chainName
=
parent
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parent
.
getDepartmentName
();
pid
=
parent
.
getParentDepartmentId
();
}
else
{
TabHaobanSyncErrorLog
tab
=
new
TabHaobanSyncErrorLog
();
tab
.
setDataId
(
parentId
+
""
);
tab
.
setDataType
(
0
);
tab
.
setLogType
(
0
);
tab
.
setReason
(
"父部门不存在"
);
tab
.
setTaskId
(
taskId
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
syncErrorLogService
.
add
(
tab
);
}
}
if
(
handerList
==
null
||
handerList
.
isEmpty
()){
...
...
@@ -571,36 +582,36 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
logger
.
info
(
"【mq同步】parentId={}"
,
parentId
);
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
:
handerList
)
{
// insertMQ(departmentDTO.getId(),wxEnterpriseId, corpid,contactSecret,taskId);
// try {
// TabHaobanDepartment exist = this.departmentService.getByWxId(departmentDTO.getId() + "", wxEnterpriseId
);
// logger.info("分组是否存在:{}", JSON.toJSONString(exist));
// if(exist == null){
// com.gic.haoban.manage.api.dto.DepartmentDTO dto = new com.gic.haoban.manage.api.dto.DepartmentDTO(
);
// dto.setDepartmentName(departmentDTO.getName()
);
// dto.setLevel(level
);
// dto.setWxEnterpriseId(wxEnterpriseId
);
// dto.setWxDepartmentId(departmentDTO.getId()+""
);
// dto.setParentDepartmentId(parentId + ""
);
// dto.setChainId(chainId
);
// dto.setChainName(chainName
);
// dto.setSort(departmentDTO.getOrder()
);
// dto.setIsStore(0
);
// this.departmentService.add(dto);
// }
//
} catch (Exception e) {
//
TabHaobanSyncErrorLog tab = new TabHaobanSyncErrorLog();
//
tab.setDataId(departmentDTO.getId()+"");
//
tab.setDataType(0);
//
tab.setLogType(0);
//
tab.setReason(e.getMessage());
//
tab.setTaskId(taskId);
//
tab.setWxEnterpriseId(wxEnterpriseId);
//
syncErrorLogService.add(tab);
//
}
//
//this.addAllDepartment(list, departmentDTO.getId(), wxEnterpriseId, corpid, contactSecret,taskId);
//
this.staffApiService.initWxUser(corpid, contactSecret, wxEnterpriseId, departmentDTO.getId(),taskId);
return
;
try
{
TabHaobanDepartment
exist
=
this
.
departmentService
.
getByWxId
(
departmentDTO
.
getId
()
+
""
,
wxEnterpriseId
);
logger
.
info
(
"分组是否存在:{}"
,
JSON
.
toJSONString
(
exist
)
);
if
(
exist
==
null
){
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
DepartmentDTO
dto
=
new
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
DepartmentDTO
();
dto
.
setDepartmentName
(
departmentDTO
.
getName
()
);
dto
.
setLevel
(
level
);
dto
.
setWxEnterpriseId
(
wxEnterpriseId
);
dto
.
setWxDepartmentId
(
departmentDTO
.
getId
()+
""
);
dto
.
setParentDepartmentId
(
pid
);
dto
.
setChainId
(
chainId
);
dto
.
setChainName
(
chainName
);
dto
.
setSort
(
departmentDTO
.
getOrder
()
);
dto
.
setIsStore
(
0
);
this
.
departmentService
.
add
(
dto
);
}
insertMQ
(
departmentDTO
.
getId
(),
wxEnterpriseId
,
corpid
,
contactSecret
,
taskId
);
}
catch
(
Exception
e
)
{
TabHaobanSyncErrorLog
tab
=
new
TabHaobanSyncErrorLog
();
tab
.
setDataId
(
departmentDTO
.
getId
()+
""
);
tab
.
setDataType
(
0
);
tab
.
setLogType
(
0
);
tab
.
setReason
(
e
.
getMessage
());
tab
.
setTaskId
(
taskId
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
syncErrorLogService
.
add
(
tab
);
}
//this.addAllDepartment(list, departmentDTO.getId(), wxEnterpriseId, corpid, contactSecret,taskId);
this
.
staffApiService
.
initWxUser
(
corpid
,
contactSecret
,
wxEnterpriseId
,
departmentDTO
.
getId
(),
taskId
);
//
return;
}
}
...
...
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