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
a1ee3fbf
Commit
a1ee3fbf
authored
Sep 11, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签同步
parent
c08b10d1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
130 deletions
+0
-130
ExternalClerkRelatedApiService.java
...an/manage/api/service/ExternalClerkRelatedApiService.java
+0
-1
TabHaobanExternalClerkRelatedMapper.java
...rvice/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
+0
-6
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+0
-107
TabHaobanExternalClerkRelatedMapper.xml
.../resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
+0
-16
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ExternalClerkRelatedApiService.java
View file @
a1ee3fbf
...
...
@@ -321,5 +321,4 @@ public interface ExternalClerkRelatedApiService {
*/
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
getMemberIdByExternalId
(
String
wxEnterpriseId
,
String
externalUserId
);
void
listMemberIdByEnterpriseId
(
String
json
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
View file @
a1ee3fbf
...
...
@@ -178,12 +178,6 @@ public interface TabHaobanExternalClerkRelatedMapper {
List
<
String
>
listMemberIdByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@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
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
a1ee3fbf
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.dto.SubscribeMessageDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
...
...
@@ -13,7 +10,6 @@ import com.gic.commons.util.GICMQClientUtil;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.enterprise.api.dto.StoreDTO
;
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.QywxSyncTaskTypeEnum
;
import
com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService
;
...
...
@@ -62,14 +58,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
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.stream.Collectors
;
...
...
@@ -113,8 +102,6 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
private
MemberService
memberService
;
@Autowired
private
ExternalClerkRelatedService
externalClerkRelatedService
;
@Autowired
private
QywxTagSyncApiService
qywxTagSyncApiService
;
/**
* 查询会员在企业下的好友关系
...
...
@@ -800,98 +787,4 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
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
));
}
@Override
public
void
listMemberIdByEnterpriseId
(
String
json
){
if
(
null
==
json
){
log
.
info
(
"参数不能为空"
);
return
;
}
log
.
info
(
"标签同步会员参数:{}"
,
json
);
QywxTagSyncInfoDTO
dto
=
JSONObject
.
parseObject
(
json
,
QywxTagSyncInfoDTO
.
class
);
Integer
size
=
1000
;
String
wxEnterpriseId
=
dto
.
getWxEnterpriseId
();
String
enterpriseId
=
dto
.
getEnterpriseId
();
Integer
totalCount
=
0
;
/*Integer totalCount = tabHaobanExternalClerkRelatedMapper.countByEnterpriseIdAndWxEnterpriseId(wxEnterpriseId, enterpriseId);
if(0 == totalCount){
dto.setTotalCount(0);
qywxTagSyncApiService.tagSync(dto);
return;
}
dto.setTotalCount(totalCount);*/
Connection
conn
=
null
;
ResultSet
rs
=
null
;
PreparedStatement
pstat
=
null
;
List
<
String
>
result
=
new
LinkedList
<>();
try
{
String
excelDb
=
"devDs"
;
String
schema
=
"haoban3"
;
if
(
isProd
())
{
excelDb
=
"haobanDs"
;
schema
=
"haoban3.0"
;
}
conn
=
com
.
gic
.
privatedb
.
util
.
ConnectionUtil
.
createConnection
(
excelDb
,
schema
);
StringBuilder
sqlBuilder
=
new
StringBuilder
(
"select "
);
sqlBuilder
.
append
(
"member_id memberId"
)
.
append
(
" from tab_haoban_external_clerk_related where wx_enterprise_id ='"
)
.
append
(
wxEnterpriseId
).
append
(
"'"
)
.
append
(
" and enterprise_id ='"
).
append
(
enterpriseId
).
append
(
"'"
)
.
append
(
" and status_flag = 1"
);
String
sql
=
sqlBuilder
.
toString
();
log
.
info
(
"查询会员id执行的sql语句:{}"
,
sql
);
pstat
=
conn
.
prepareStatement
(
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
ResultSet
.
CONCUR_READ_ONLY
);
pstat
.
setFetchSize
(
Integer
.
MIN_VALUE
);
pstat
.
setFetchDirection
(
ResultSet
.
FETCH_REVERSE
);
rs
=
pstat
.
executeQuery
();
while
(
rs
.
next
())
{
String
memberId
=
rs
.
getString
(
"memberId"
);
result
.
add
(
memberId
);
if
(
result
.
size
()
==
size
){
totalCount
=
totalCount
+
size
;
dto
.
setMemberIds
(
result
);
dto
.
setTotalCount
(
totalCount
);
qywxTagSyncApiService
.
tagSync
(
dto
);
result
.
clear
();
}
}
if
(
CollUtil
.
isNotEmpty
(
result
)){
totalCount
=
totalCount
+
result
.
size
();
dto
.
setMemberIds
(
result
);
dto
.
setTotalCount
(
totalCount
);
qywxTagSyncApiService
.
tagSync
(
dto
);
result
.
clear
();
}
else
{
dto
.
setMemberIds
(
result
);
dto
.
setTotalCount
(
totalCount
);
qywxTagSyncApiService
.
tagSync
(
dto
);
}
}
catch
(
Exception
e
){
log
.
warn
(
"异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
rs
)
{
rs
.
close
();
rs
=
null
;
}
if
(
null
!=
pstat
)
{
pstat
.
close
();
pstat
=
null
;
}
if
(
null
!=
conn
)
{
conn
.
close
();
conn
=
null
;
}
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
private
boolean
isProd
()
{
com
.
ctrip
.
framework
.
apollo
.
Config
config
=
ConfigService
.
getConfig
(
"COMMON.gic-properties"
);
String
env
=
config
.
getProperty
(
"environment.value"
,
""
)
;
log
.
info
(
"feile env={}"
,
env
);
return
"prod"
.
equals
(
env
)
;
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
View file @
a1ee3fbf
...
...
@@ -517,22 +517,6 @@
and enterprise_id = #{enterpriseId}
and status_flag = 1
</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
id=
"listMemberIdsByMemberIds"
resultType=
"String"
>
select
...
...
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