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
046938bd
Commit
046938bd
authored
Jul 20, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好友同步次数
parent
2360e01b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
14 deletions
+57
-14
QywxTagApiService.java
.../com/gic/haoban/manage/api/service/QywxTagApiService.java
+2
-1
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+18
-12
DealSyncTest.java
haoban-manage3-service/src/test/java/DealSyncTest.java
+19
-0
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+18
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/QywxTagApiService.java
View file @
046938bd
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.QywxTagCallbackDTO
;
import
com.gic.haoban.manage.api.dto.QywxTagInfoDTO
;
import
com.gic.haoban.manage.api.dto.QywxTagItemDTO
;
...
...
@@ -26,7 +27,7 @@ public interface QywxTagApiService {
* @param infoDTO 标签
* @param items 标签项
*/
public
void
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
);
public
ServiceResponse
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
);
/**
* 关闭同步
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
046938bd
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.QywxTagRelationTypeEnum
;
...
...
@@ -80,14 +81,16 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
@Override
public
void
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
)
{
public
ServiceResponse
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
)
{
ServiceResponse
ret
=
new
ServiceResponse
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
//调用企业微信接口保存
QywxGetCorpTagListDTO
resp
=
this
.
saveQywxTag
(
wxEnterpriseDTO
,
infoDTO
,
items
);
if
(
resp
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"同步失败:{}"
,
JSONObject
.
toJSONString
(
resp
));
return
;
ret
.
setCode
(
1
);
ret
.
setMessage
(
resp
.
getErrmsg
());
return
ret
;
}
//拉取保存所有标签
List
<
QywxTagGroupDTO
>
tagGroup
=
resp
.
getTagGroup
();
...
...
@@ -96,18 +99,21 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
Pair
<
TabQywxTag
,
List
<
TabQywxTagItem
>>
savePair
=
qywxTagService
.
saveQywxTagByQywxGroupKey
(
wxEnterpriseId
,
groupDTO
);
if
(
null
==
savePair
)
{
logger
.
info
(
"保存失败:{}"
,
JSONObject
.
toJSONString
(
groupDTO
));
return
;
ret
.
setCode
(
1
);
ret
.
setMessage
(
"保存企业微信标签失败"
);
return
ret
;
}
//保存关联关系
saveRelation
(
wxEnterpriseId
,
enterpriseId
,
infoDTO
,
items
,
savePair
);
String
taskId
=
dealSyncOperationApiService
.
createTagTask
(
wxEnterpriseId
,
"-1"
,
infoDTO
.
getMemberTagId
());
if
(
null
==
taskId
)
{
logger
.
info
(
"标签不能重复执行"
);
throw
new
RuntimeException
(
"标签不能重复执行:"
+
infoDTO
.
getQywxGroupName
());
}
List
<
String
>
tagItemIds
=
items
.
stream
().
map
(
dto
->
dto
.
getQywxTagItemId
()).
collect
(
Collectors
.
toList
());
dealSyncOperationApiService
.
dealTagTask
(
wxEnterpriseId
,
enterpriseId
,
tagItemIds
,
taskId
);
return
ret
;
// String taskId = dealSyncOperationApiService.createTagTask(wxEnterpriseId, "-1", infoDTO.getMemberTagId());
// if (null == taskId) {
// logger.info("标签不能重复执行");
// throw new RuntimeException("标签不能重复执行:" + infoDTO.getQywxGroupName());
// }
// List<String> tagItemIds = items.stream().map(dto -> dto.getQywxTagItemId()).collect(Collectors.toList());
// dealSyncOperationApiService.dealTagTask(wxEnterpriseId, enterpriseId, tagItemIds, taskId);
}
/**
...
...
haoban-manage3-service/src/test/java/DealSyncTest.java
View file @
046938bd
...
...
@@ -12,7 +12,10 @@ import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.TestService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.DepartmentDTO
;
import
com.gic.wechat.api.dto.qywx.QywxExternalcontactDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -51,6 +54,9 @@ public class DealSyncTest {
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
QywxDepartmentApiService
qywxDepartmentApiService
;
@Autowired
private
TestService
testService
;
@Autowired
...
...
@@ -94,4 +100,17 @@ public class DealSyncTest {
// countDownLatch.countDown();
}
@Test
public
void
test3
()
{
List
<
DepartmentDTO
>
department
=
qywxDepartmentApiService
.
listSelfDepartment
(
"wweac4ef962720aa12"
,
"GFu4FwkfcGFPue-qinB7ThEU4wR2SadbBH1yT5sLDzs"
,
null
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
department
));
}
@Test
public
void
test4
()
{
UserDTO
workWxUser
=
qywxUserApiService
.
getSelfWorkWxUser
(
"wweac4ef962720aa12"
,
"GFu4FwkfcGFPue-qinB7ThEU4wR2SadbBH1yT5sLDzs"
,
"WuXiangHong"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
workWxUser
));
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
046938bd
...
...
@@ -505,11 +505,28 @@ public class ClerkController extends WebBaseController{
*/
@HttpLimit
@RequestMapping
(
"/check-fresh-friend"
)
public
HaobanResponse
checkFreshFriend
(
String
staffId
,
String
storeId
,
String
wxEnterpriseId
)
{
public
HaobanResponse
checkFreshFriend
(
String
staffId
,
String
storeId
,
String
wxEnterpriseId
,
String
version
)
{
boolean
freshFriendSyncTask
=
dealSyncOperationApiService
.
getFreshFriendSyncTask
(
wxEnterpriseId
,
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
freshFriendSyncTask
);
}
/**
* 刷新好友状态
*
* @param staffId
* @param storeId
* @param wxEnterpriseId
* @return
*/
@HttpLimit
@RequestMapping
(
"/fresh-friend-count"
)
public
HaobanResponse
checkFreshFriend
(
String
staffId
,
String
storeId
,
String
wxEnterpriseId
)
{
String
yyyyMM
=
DateUtil
.
dateToStr
(
new
Date
(),
"yyyyMM"
);
String
key
=
"haoban_fresh_wx_friend"
+
yyyyMM
+
staffId
;
Integer
count
=
RedisUtil
.
getCache
(
key
)
==
null
?
0
:
(
Integer
)
RedisUtil
.
getCache
(
key
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
count
);
}
//获取门店详情
public
boolean
isEnterpriseOver
(
String
eid
)
{
...
...
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