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
1
Merge Requests
1
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
f5ccce52
Commit
f5ccce52
authored
Apr 16, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ca2850ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
32 deletions
+36
-32
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+36
-32
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
f5ccce52
...
...
@@ -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, 0);
//
logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
0
);
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
);
}
...
...
@@ -556,36 +556,40 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
}
if
(
level
==
4
){
return
;
}
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
:
list
)
{
//
insertMQ(departmentDTO.getParentid(),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);
insertMQ
(
departmentDTO
.
getParentid
(),
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
;
}
}
...
...
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