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
55694e25
Commit
55694e25
authored
Sep 05, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签同步
parent
38233505
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
7 deletions
+92
-7
pom.xml
haoban-manage3-api/pom.xml
+6
-0
ExternalClerkRelatedApiService.java
...an/manage/api/service/ExternalClerkRelatedApiService.java
+4
-4
TabHaobanExternalClerkRelatedMapper.java
...rvice/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
+6
-0
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+59
-1
TabHaobanExternalClerkRelatedMapper.xml
.../resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
+17
-2
No files found.
haoban-manage3-api/pom.xml
View file @
55694e25
...
@@ -45,6 +45,12 @@
...
@@ -45,6 +45,12 @@
<artifactId>
gic-commons
</artifactId>
<artifactId>
gic-commons
</artifactId>
<version>
${gic-commons}
</version>
<version>
${gic-commons}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-app-customer-api
</artifactId>
<version>
3.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ExternalClerkRelatedApiService.java
View file @
55694e25
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.app.customer.dto.QywxTagSyncInfoDTO
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.ClerkStaffWxUserDTO
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO
;
import
com.gic.haoban.manage.api.dto.ExternalClerkRelatedShortInfoDTO
;
import
com.gic.haoban.manage.api.dto.FriendMemberStatusDTO
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -323,4 +321,6 @@ public interface ExternalClerkRelatedApiService {
...
@@ -323,4 +321,6 @@ public interface ExternalClerkRelatedApiService {
* @return
* @return
*/
*/
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
getMemberIdByExternalId
(
String
wxEnterpriseId
,
String
externalUserId
);
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
getMemberIdByExternalId
(
String
wxEnterpriseId
,
String
externalUserId
);
void
listMemberIdByEnterpriseId
(
QywxTagSyncInfoDTO
dto
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
View file @
55694e25
...
@@ -178,6 +178,12 @@ public interface TabHaobanExternalClerkRelatedMapper {
...
@@ -178,6 +178,12 @@ public interface TabHaobanExternalClerkRelatedMapper {
List
<
String
>
listMemberIdByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
List
<
String
>
listMemberIdByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
@Param
(
"enterpriseId"
)
String
enterpriseId
);
Integer
countByEnterpriseIdAndWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
List
<
String
>
getMemberIdList
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"num"
)
Integer
num
,
@Param
(
"size"
)
Integer
size
);
/**
/**
* 查询会员在企业下的好友关系memberIds 根据会员ids
* 查询会员在企业下的好友关系memberIds 根据会员ids
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
55694e25
...
@@ -11,8 +11,10 @@ import com.gic.commons.util.GICMQClientUtil;
...
@@ -11,8 +11,10 @@ import com.gic.commons.util.GICMQClientUtil;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.app.customer.dto.QywxTagSyncInfoDTO
;
import
com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum
;
import
com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum
;
import
com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum
;
import
com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum
;
import
com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon
;
import
com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon
;
...
@@ -25,7 +27,10 @@ import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
...
@@ -25,7 +27,10 @@ import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import
com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService
;
import
com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.*
;
import
com.gic.haoban.manage.service.dao.mapper.ExternalUseridLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO
;
import
com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO
;
...
@@ -54,7 +59,11 @@ import org.redisson.api.RateType;
...
@@ -54,7 +59,11 @@ import org.redisson.api.RateType;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -62,6 +71,7 @@ import java.util.stream.Collectors;
...
@@ -62,6 +71,7 @@ import java.util.stream.Collectors;
public
class
ExternalClerkRelatedApiServiceImpl
implements
ExternalClerkRelatedApiService
{
public
class
ExternalClerkRelatedApiServiceImpl
implements
ExternalClerkRelatedApiService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
ExternalClerkRelatedApiServiceImpl
.
class
);
private
static
final
Logger
log
=
LogManager
.
getLogger
(
ExternalClerkRelatedApiServiceImpl
.
class
);
private
static
final
int
availableProcessor
=
Runtime
.
getRuntime
().
availableProcessors
();
@Autowired
@Autowired
private
TabHaobanExternalClerkRelatedMapper
tabHaobanExternalClerkRelatedMapper
;
private
TabHaobanExternalClerkRelatedMapper
tabHaobanExternalClerkRelatedMapper
;
...
@@ -97,6 +107,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
...
@@ -97,6 +107,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
private
MemberService
memberService
;
private
MemberService
memberService
;
@Autowired
@Autowired
private
ExternalClerkRelatedService
externalClerkRelatedService
;
private
ExternalClerkRelatedService
externalClerkRelatedService
;
@Autowired
private
QywxTagSyncApiService
qywxTagSyncApiService
;
/**
/**
* 查询会员在企业下的好友关系
* 查询会员在企业下的好友关系
...
@@ -782,4 +794,50 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
...
@@ -782,4 +794,50 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
getMemberIdByExternalId
(
String
wxEnterpriseId
,
String
externalUserId
)
{
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
getMemberIdByExternalId
(
String
wxEnterpriseId
,
String
externalUserId
)
{
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
externalClerkRelatedService
.
getMemberIdByExternalId
(
wxEnterpriseId
,
externalUserId
));
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
externalClerkRelatedService
.
getMemberIdByExternalId
(
wxEnterpriseId
,
externalUserId
));
}
}
@Override
public
void
listMemberIdByEnterpriseId
(
QywxTagSyncInfoDTO
dto
)
{
if
(
null
==
dto
){
log
.
info
(
"参数不能为空"
);
return
;
}
log
.
info
(
"标签同步会员参数:{}"
,
JSON
.
toJSONString
(
dto
));
Integer
size
=
5000
;
String
wxEnterpriseId
=
dto
.
getWxEnterpriseId
();
String
enterpriseId
=
dto
.
getEnterpriseId
();
Integer
totalCount
=
tabHaobanExternalClerkRelatedMapper
.
countByEnterpriseIdAndWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
Integer
round
=
size
/
totalCount
+
1
;
List
<
String
>
result
=
new
LinkedList
<>();
// 程序计数器
final
CountDownLatch
count
=
new
CountDownLatch
(
round
);
// 创建线程
ExecutorService
executor
=
Executors
.
newFixedThreadPool
(
availableProcessor
);
// 分配数据
for
(
int
i
=
0
;
i
<
round
;
i
++)
{
//该线程的查询开始值
int
startLen
=
i
*
size
;
executor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
List
<
String
>
memberIdList
=
tabHaobanExternalClerkRelatedMapper
.
getMemberIdList
(
wxEnterpriseId
,
enterpriseId
,
startLen
,
size
);
result
.
addAll
(
memberIdList
);
// 计数器 -1(唤醒阻塞线程)
count
.
countDown
();
}
});
}
try
{
// 阻塞线程(主线程等待所有子线程 一起执行业务)
count
.
await
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
// 终止线程池
// 启动一次顺序关闭,执行以前提交的任务,但不接受新任务。若已经关闭,则调用没有其他作用。
executor
.
shutdown
();
}
dto
.
setMemberIds
(
result
);
qywxTagSyncApiService
.
tagSync
(
dto
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
View file @
55694e25
...
@@ -515,8 +515,23 @@
...
@@ -515,8 +515,23 @@
from tab_haoban_external_clerk_related
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and enterprise_id = #{enterpriseId}
and status_flag in (1, 3, 4)
and status_flag = 1
order by create_time
</select>
<select
id=
"countByEnterpriseIdAndWxEnterpriseId"
resultType=
"int"
>
select count(*)
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and status_flag = 1
</select>
<select
id=
"getMemberIdList"
resultType=
"String"
>
select member_id
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and status_flag = 1
limit ${num},${size}
</select>
</select>
<select
id=
"listMemberIdsByMemberIds"
resultType=
"String"
>
<select
id=
"listMemberIdsByMemberIds"
resultType=
"String"
>
...
...
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