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
027a95c0
Commit
027a95c0
authored
Mar 02, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:刷新好友bug修改
parent
ea73ea12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
FriendSyncNewOperation.java
...an/manage/service/task/friend/FriendSyncNewOperation.java
+3
-9
SelfFriendSyncNewOperation.java
...anage/service/task/friend/SelfFriendSyncNewOperation.java
+12
-2
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/FriendSyncNewOperation.java
View file @
027a95c0
...
...
@@ -101,6 +101,7 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
reason
=
"员工不存在"
;
return
;
}
String
staffId
=
tabHaobanStaff
.
getStaffId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
info
(
"没有存在企业关联:wxEnterpriseId:{}"
,
wxEnterpriseId
);
...
...
@@ -108,15 +109,8 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
reason
=
"没有关联企业"
;
return
;
}
String
corpid
=
wxEnterpriseDTO
.
getCorpid
();
//wxUserId 兼容
if
(
corpid
.
length
()
>
20
)
{
wxUserId
=
tabHaobanStaff
.
getWxOpenUseId
();
}
else
{
wxUserId
=
tabHaobanStaff
.
getWxUserId
();
}
//relationkey
relationKey
=
SecureUtil
.
md5
(
wxUser
Id
+
"_"
+
externalUserDTO
.
getName
()
+
"_"
+
externalUserDTO
.
getAddCreateTime
());
relationKey
=
SecureUtil
.
md5
(
staff
Id
+
"_"
+
externalUserDTO
.
getName
()
+
"_"
+
externalUserDTO
.
getAddCreateTime
());
logger
.
info
(
"relationKey:{},{}"
,
relationKey
,
externalUserDTO
.
getExternalUserId
());
// 根据关联键relationkey查看自建应用 是否有数据
TabHaobanPreDealLog
selfPre
=
preDealService
.
getByRelationKey
(
taskId
,
PreDealTypeEnum
.
self_friend
.
getVal
(),
relationKey
);
...
...
@@ -336,7 +330,7 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
try
{
clientInstance
.
sendBatchMessages
(
"departmentSyncDealMq"
,
ret
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送失败:{}"
,
taskId
,
e
);
logger
.
info
(
"发送失败:{}"
,
taskId
,
e
);
e
.
printStackTrace
();
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/SelfFriendSyncNewOperation.java
View file @
027a95c0
package
com
.
gic
.
haoban
.
manage
.
service
.
task
.
friend
;
import
cn.hutool.crypto.SecureUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.manage.api.dto.DealParamMqDTO
;
...
...
@@ -11,8 +10,10 @@ import com.gic.haoban.manage.api.enums.PreDealTypeEnum;
import
com.gic.haoban.manage.api.enums.SyncTaskStatusEnum
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.exception.WxApiLimitException
;
import
com.gic.haoban.manage.service.service.PreDealService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
import
com.gic.haoban.manage.service.task.BaseSyncOperation
;
import
com.gic.mq.sdk.GicMQClient
;
...
...
@@ -44,6 +45,8 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
private
SyncTaskService
syncTaskService
;
@Autowired
private
FriendClerkSyncNewOperation
friendClerkSyncNewOperation
;
@Autowired
private
StaffService
staffService
;
private
static
final
String
TRY_AGAIN
=
"haoban_fresh_wx_friend_again_"
;
...
...
@@ -64,6 +67,13 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
dealException
(
taskId
,
dataPre
.
getDataId
(),
null
,
"好友不存在"
);
return
;
}
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
tabHaobanStaff
==
null
)
{
dealFlag
=
false
;
reason
=
"员工不存在"
;
return
;
}
String
staffId
=
tabHaobanStaff
.
getStaffId
();
//自有应用信息
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"name"
,
pojo
.
getName
());
...
...
@@ -73,7 +83,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
json
.
put
(
"addCreateTime"
,
pojo
.
getAddCreateTime
());
//relationkey
String
relationKey
=
SecureUtil
.
md5
(
wxUser
Id
+
"_"
+
pojo
.
getName
()
+
"_"
+
pojo
.
getAddCreateTime
());
String
relationKey
=
SecureUtil
.
md5
(
staff
Id
+
"_"
+
pojo
.
getName
()
+
"_"
+
pojo
.
getAddCreateTime
());
//更新状态
preDealService
.
updateFriendStatusByDataId
(
taskId
,
dataPre
.
getDataId
(),
PreDealStatusEnum
.
computed
.
getVal
(),
reason
,
json
.
toJSONString
(),
relationKey
);
dealSuccess
(
taskId
,
dataPre
.
getDataId
(),
null
,
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