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
ce2811a4
Commit
ce2811a4
authored
Sep 24, 2024
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2024-09-23' into 'master'
Feature 2024 09 23 See merge request
!2160
parents
76561474
9e20fcec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
36 deletions
+80
-36
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+73
-29
QywxDeptSyncOperation.java
...gic/haoban/manage/service/task/QywxDeptSyncOperation.java
+5
-6
CustomSwitcher.java
...va/com/gic/haoban/manage/service/util/CustomSwitcher.java
+2
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
ce2811a4
...
@@ -545,46 +545,90 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
...
@@ -545,46 +545,90 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
unlockTask
(
wxEnterpriseId
);
unlockTask
(
wxEnterpriseId
);
return
"没有配置secret"
;
return
"没有配置secret"
;
}
}
Map
<
String
,
Integer
>
map
=
CustomSwitcher
.
haoban_department_id
;
Map
<
String
,
String
>
map
=
CustomSwitcher
.
haoban_department_id
;
int
id
=
1
;
int
syncId
=
1
;
List
<
Integer
>
ids
=
new
ArrayList
<>();
if
(
null
!=
map
&&
null
!=
map
.
get
(
wxEnterpriseId
))
{
if
(
null
!=
map
&&
null
!=
map
.
get
(
wxEnterpriseId
))
{
id
=
map
.
get
(
wxEnterpriseId
)
;
String
rootIdsStr
=
map
.
get
(
wxEnterpriseId
);
List
<
Integer
>
rootIds
=
Arrays
.
stream
(
rootIdsStr
.
split
(
","
)).
filter
(
mid
->
mid
!=
null
).
map
(
mid
->
Integer
.
valueOf
(
mid
)).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
rootIds
))
{
logger
.
info
(
"apollo部门配置异常"
);
return
"同步部门配置异常"
;
}
ids
.
addAll
(
rootIds
);
}
else
{
ids
.
add
(
syncId
);
}
}
logger
.
info
(
"id={}"
,
id
);
List
<
TabHaobanPreDealLog
>
dealLogList
=
new
ArrayList
<>(
);
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
qywxDepartmentApiService
.
listSelfDepartment
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
id
,
qwDTO
.
getUrlHost
())
;
String
rootPid
=
"0"
;
if
(
CollectionUtils
.
isEmpty
(
list
)
)
{
if
(
ids
.
size
()>
1
)
{
logger
.
info
(
"企微部门数量0,退出同步"
)
;
rootPid
=
"-999"
;
sync
TaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
exception_close
.
getVal
()
);
sync
Id
=
Integer
.
valueOf
(
rootPid
);
unlockTask
(
wxEnterprise
Id
);
TabHaobanPreDealLog
dealLog
=
getRootDept
(
wxEnterpriseId
,
rootPid
,
task
Id
);
return
"没有数据同步或权限没设置全部"
;
dealLogList
.
add
(
dealLog
)
;
}
}
logger
.
info
(
"企微部门数={}"
,
list
.
size
());
for
(
Integer
id:
ids
)
{
final
int
_id
=
id
;
logger
.
info
(
"id={}"
,
id
);
syncTaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
group_sync
.
getVal
());
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
qywxDepartmentApiService
.
listSelfDepartment
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
id
,
qwDTO
.
getUrlHost
());
List
<
TabHaobanPreDealLog
>
dealLogList
=
list
.
stream
().
map
(
dto
->
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
logger
.
info
(
"企微部门数量0,退出同步"
);
dealLog
.
setDataId
(
dto
.
getId
().
toString
());
syncTaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
exception_close
.
getVal
());
if
(
dto
.
getId
().
toString
().
equals
(
_id
+
""
))
{
unlockTask
(
wxEnterpriseId
);
dealLog
.
setpDataId
(
"0"
);
return
"没有数据同步或权限没设置全部"
;
dto
.
setParentid
(
0
);
}
else
{
dealLog
.
setpDataId
(
dto
.
getParentid
().
toString
());
}
}
dealLog
.
setDataType
(
0
);
logger
.
info
(
"企微部门数={}"
,
list
.
size
());
dealLog
.
setStatusFlag
(
0
);
final
int
_id
=
id
;
dealLog
.
setTaskId
(
taskId
);
syncTaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
group_sync
.
getVal
());
dealLog
.
setDataContent
(
JSONObject
.
toJSONString
(
dto
));
String
finalRootPid
=
rootPid
;
dealLog
.
setWxEnterpriseId
(
wxEnterpriseId
);
List
<
TabHaobanPreDealLog
>
dealLogListMid
=
list
.
stream
().
map
(
dto
->
{
return
dealLog
;
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
}).
collect
(
Collectors
.
toList
());
dealLog
.
setDataId
(
dto
.
getId
().
toString
());
if
(
dto
.
getId
().
toString
().
equals
(
_id
+
""
))
{
dealLog
.
setpDataId
(
finalRootPid
);
dto
.
setParentid
(
Integer
.
valueOf
(
finalRootPid
));
}
else
{
dealLog
.
setpDataId
(
dto
.
getParentid
().
toString
());
}
dealLog
.
setDataType
(
0
);
dealLog
.
setStatusFlag
(
0
);
dealLog
.
setTaskId
(
taskId
);
dealLog
.
setDataContent
(
JSONObject
.
toJSONString
(
dto
));
dealLog
.
setWxEnterpriseId
(
wxEnterpriseId
);
return
dealLog
;
}).
collect
(
Collectors
.
toList
());
dealLogList
.
addAll
(
dealLogListMid
);
}
// 保存部门数据
// 保存部门数据
preDealService
.
insert
(
dealLogList
);
preDealService
.
insert
(
dealLogList
);
HashSet
<
String
>
hashSet
=
new
HashSet
<>();
HashSet
<
String
>
hashSet
=
new
HashSet
<>();
hashSet
.
add
(
""
+
i
d
);
hashSet
.
add
(
""
+
syncI
d
);
sendToMq
(
taskId
,
hashSet
,
SyncTaskStatusEnum
.
group_sync
,
"departmentSyncDealMq2"
);
sendToMq
(
taskId
,
hashSet
,
SyncTaskStatusEnum
.
group_sync
,
"departmentSyncDealMq2"
);
return
null
;
return
null
;
}
}
private
TabHaobanPreDealLog
getRootDept
(
String
wxEnterpriseId
,
String
rootPid
,
String
taskId
)
{
WxEnterpriseDTO
wxEnterpriseDTO
=
this
.
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
=
new
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
();
departmentDTO
.
setName
(
wxEnterpriseDTO
.
getCorpName
());
departmentDTO
.
setParentid
(
0
);
departmentDTO
.
setOrder
(
0L
);
departmentDTO
.
setId
(
Integer
.
valueOf
(
rootPid
));
departmentDTO
.
setCorpid
(
""
);
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
dealLog
.
setDataId
(
rootPid
);
dealLog
.
setpDataId
(
"0"
);
dealLog
.
setDataType
(
0
);
dealLog
.
setStatusFlag
(
0
);
dealLog
.
setTaskId
(
taskId
);
dealLog
.
setDataContent
(
JSONObject
.
toJSONString
(
departmentDTO
));
dealLog
.
setWxEnterpriseId
(
wxEnterpriseId
);
return
dealLog
;
}
@Override
@Override
public
void
cleanDiffrence
(
String
wxEnterpriseId
,
String
taskId
)
{
public
void
cleanDiffrence
(
String
wxEnterpriseId
,
String
taskId
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/QywxDeptSyncOperation.java
View file @
ce2811a4
package
com
.
gic
.
haoban
.
manage
.
service
.
task
;
package
com
.
gic
.
haoban
.
manage
.
service
.
task
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
...
@@ -179,11 +177,12 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
...
@@ -179,11 +177,12 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
private
String
getStaff
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
wxEnterpriseId
,
SecretSettingDTO
secretSetting
,
WxEnterpriseQwDTO
qwDTO
)
{
private
String
getStaff
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
wxEnterpriseId
,
SecretSettingDTO
secretSetting
,
WxEnterpriseQwDTO
qwDTO
)
{
logger
.
info
(
"getstaff={}"
,
dataId
);
logger
.
info
(
"getstaff={}"
,
dataId
);
String
id
=
"1"
;
String
id
=
"1"
;
Map
<
String
,
Integer
>
map
=
CustomSwitcher
.
haoban_department_id
;
Map
<
String
,
String
>
map
=
CustomSwitcher
.
haoban_department_id
;
if
(
null
!=
map
&&
null
!=
map
.
get
(
wxEnterpriseId
))
{
if
(
null
!=
map
&&
null
!=
map
.
get
(
wxEnterpriseId
))
{
id
=
map
.
get
(
wxEnterpriseId
)
+
""
;
id
=
map
.
get
(
wxEnterpriseId
)
;
}
}
if
(
id
.
equals
(
dataId
))
{
List
<
String
>
ids
=
Arrays
.
stream
(
id
.
split
(
","
)).
collect
(
Collectors
.
toList
());
if
(
ids
.
contains
(
dataId
))
{
List
<
UserDTO
>
list
=
null
;
List
<
UserDTO
>
list
=
null
;
if
(
qwDTO
.
getWxSecurityType
()==
4
)
{
if
(
qwDTO
.
getWxSecurityType
()==
4
)
{
list
=
this
.
qywxUserApiService
.
listDepartmentUser
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
dataId
,
1
)
;
list
=
this
.
qywxUserApiService
.
listDepartmentUser
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
dataId
,
1
)
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/CustomSwitcher.java
View file @
ce2811a4
...
@@ -21,6 +21,6 @@ public class CustomSwitcher {
...
@@ -21,6 +21,6 @@ public class CustomSwitcher {
public
static
String
haoban_one_bind_many
;
public
static
String
haoban_one_bind_many
;
@Switcher
@Switcher
public
static
Map
<
String
,
Integer
>
haoban_department_id
;
public
static
Map
<
String
,
String
>
haoban_department_id
;
}
}
\ No newline at end of file
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