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
f2c2dcd4
Commit
f2c2dcd4
authored
May 27, 2025
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-recommend3' into developer
parents
003a0a80
c2f7ee25
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
7 deletions
+142
-7
ContactFollowTypeEnum.java
...aoban/manage/api/enums/contact/ContactFollowTypeEnum.java
+4
-0
pom.xml
haoban-manage3-service/pom.xml
+6
-0
ContactFollowServiceImpl.java
...ervice/service/contact/impl/ContactFollowServiceImpl.java
+131
-7
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+1
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/contact/ContactFollowTypeEnum.java
View file @
f2c2dcd4
...
@@ -4,6 +4,10 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -4,6 +4,10 @@ import org.apache.commons.lang3.StringUtils;
public
enum
ContactFollowTypeEnum
{
public
enum
ContactFollowTypeEnum
{
// 跟进表中不会有这两个类型
SMS
(-
1
,
"短信/彩信"
,
"系统向客户发送了营销短信/彩信"
,
null
),
AI
(-
2
,
"AI电话"
,
"客户接听了AI电话"
,
null
),
PRIVATE_PHONE
(
1
,
"私人电话"
,
"私人电话"
,
null
),
PRIVATE_PHONE
(
1
,
"私人电话"
,
"私人电话"
,
null
),
WECHAT_SESSION
(
2
,
"企微会话"
,
"企微会话"
,
null
),
WECHAT_SESSION
(
2
,
"企微会话"
,
"企微会话"
,
null
),
PRODUCT
(
3
,
"发送商品"
,
"商品"
,
ContactAutoTypeEnum
.
GOODS_RECOMMEND
.
getCode
()),
PRODUCT
(
3
,
"发送商品"
,
"商品"
,
ContactAutoTypeEnum
.
GOODS_RECOMMEND
.
getCode
()),
...
...
haoban-manage3-service/pom.xml
View file @
f2c2dcd4
...
@@ -142,6 +142,12 @@
...
@@ -142,6 +142,12 @@
<dependency>
<dependency>
<groupId>
com.gic
</groupId>
<groupId>
com.gic
</groupId>
<artifactId>
gic-marketing-pro-api
</artifactId>
<version>
${gic-marketing-pro-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-app-customer-api
</artifactId>
<artifactId>
haoban-app-customer-api
</artifactId>
<version>
${haoban-app-customer-api}
</version>
<version>
${haoban-app-customer-api}
</version>
</dependency>
</dependency>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/impl/ContactFollowServiceImpl.java
View file @
f2c2dcd4
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
contact
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
contact
.
impl
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.BasePageInfo
;
...
@@ -9,7 +11,6 @@ import com.gic.clerk.api.dto.ClerkDTO;
...
@@ -9,7 +11,6 @@ import com.gic.clerk.api.dto.ClerkDTO;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowGoodsDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowGoodsDTO
;
...
@@ -20,6 +21,10 @@ import com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO;
...
@@ -20,6 +21,10 @@ import com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO;
import
com.gic.haoban.manage.service.dao.mapper.contact.TabContactFollowMapper
;
import
com.gic.haoban.manage.service.dao.mapper.contact.TabContactFollowMapper
;
import
com.gic.haoban.manage.service.entity.contact.TabContactFollow
;
import
com.gic.haoban.manage.service.entity.contact.TabContactFollow
;
import
com.gic.haoban.manage.service.service.contact.ContactFollowService
;
import
com.gic.haoban.manage.service.service.contact.ContactFollowService
;
import
com.gic.marketing.api.dto.member.MemberSmsLogDTO
;
import
com.gic.marketing.api.service.SmsService
;
import
com.gic.marketing.pro.api.dto.ai.AiMemberLogListDTO
;
import
com.gic.marketing.pro.api.service.ai.AiMemberLogApiService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.store.goods.service.StoreGoodsService
;
import
com.gic.store.goods.service.StoreGoodsService
;
import
com.gic.store.goods.vo.StoreGoodsVO
;
import
com.gic.store.goods.vo.StoreGoodsVO
;
...
@@ -41,12 +46,18 @@ public class ContactFollowServiceImpl implements ContactFollowService {
...
@@ -41,12 +46,18 @@ public class ContactFollowServiceImpl implements ContactFollowService {
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ContactFollowService
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ContactFollowService
.
class
);
private
static
final
List
<
Integer
>
aiThirdStatus
=
Lists
.
newArrayList
(
0
,
1
,
6
,
8
);
@Autowired
@Autowired
private
TabContactFollowMapper
contactFollowMapper
;
private
TabContactFollowMapper
contactFollowMapper
;
@Autowired
@Autowired
private
StoreGoodsService
storeGoodsService
;
private
StoreGoodsService
storeGoodsService
;
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
private
AiMemberLogApiService
aiMemberLogApiService
;
@Autowired
private
SmsService
smsService
;
@Override
@Override
public
void
saveFollow
(
ContactFollowQDTO
qdto
)
{
public
void
saveFollow
(
ContactFollowQDTO
qdto
)
{
...
@@ -118,23 +129,136 @@ public class ContactFollowServiceImpl implements ContactFollowService {
...
@@ -118,23 +129,136 @@ public class ContactFollowServiceImpl implements ContactFollowService {
@Override
@Override
public
Page
<
ContactFollowDTO
>
pageFollow
(
String
enterpriseId
,
ContactFollowSearchQDTO
searchQDTO
,
BasePageInfo
pageInfo
)
{
public
Page
<
ContactFollowDTO
>
pageFollow
(
String
enterpriseId
,
ContactFollowSearchQDTO
searchQDTO
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
);
List
<
ContactFollowDTO
>
list
=
queryMarketingFollowLog
(
enterpriseId
,
searchQDTO
,
pageInfo
);
List
<
TabContactFollow
>
list
=
contactFollowMapper
.
pageFollow
(
enterpriseId
,
searchQDTO
);
Page
<
ContactFollowDTO
>
page
=
new
Page
<>();
Page
<
ContactFollowDTO
>
page
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
list
,
ContactFollowDTO
.
class
);
if
(
list
==
null
||
list
.
isEmpty
())
{
List
<
ContactFollowDTO
>
pageList
=
convertExtInfo
(
list
);
page
.
setCurrentPage
(
pageInfo
.
getPageNum
());
page
.
setPageSize
(
pageInfo
.
getPageSize
());
page
.
setTotalCount
(
0
);
page
.
setTotalPage
(
1
);
page
.
setResult
(
Collections
.
emptyList
());
return
page
;
}
int
totalCount
=
list
.
size
();
int
pageSize
=
pageInfo
.
getPageSize
();
int
pageNum
=
pageInfo
.
getPageNum
();
int
totalPage
=
(
int
)
Math
.
ceil
((
double
)
totalCount
/
pageSize
);
int
fromIndex
=
Math
.
max
((
pageNum
-
1
)
*
pageSize
,
0
);
int
toIndex
=
Math
.
min
(
fromIndex
+
pageSize
,
totalCount
);
List
<
ContactFollowDTO
>
pageList
=
list
.
subList
(
fromIndex
,
toIndex
);
page
.
setCurrentPage
(
pageNum
);
page
.
setPageSize
(
pageSize
);
page
.
setTotalCount
(
totalCount
);
page
.
setTotalPage
(
totalPage
);
page
.
setResult
(
pageList
);
page
.
setResult
(
pageList
);
return
page
;
return
page
;
}
}
private
List
<
ContactFollowDTO
>
queryMarketingFollowLog
(
String
enterpriseId
,
ContactFollowSearchQDTO
searchQDTO
,
BasePageInfo
pageInfo
)
{
List
<
ContactFollowDTO
>
list
=
new
ArrayList
<>();
ContactFollowDTO
followDTO
=
null
;
Integer
maxSize
=
500
;
int
sizeTotal
=
pageInfo
.
getPageNum
()
*
pageInfo
.
getPageSize
();
sizeTotal
=
Math
.
min
(
sizeTotal
,
maxSize
);
String
memberId
=
searchQDTO
.
getMemberId
();
Date
date
=
DateUtil
.
date
();
DateTime
startTime
=
DateUtil
.
offsetMonth
(
date
,
-
6
);
BasePageInfo
basePage
=
new
BasePageInfo
();
basePage
.
setPageNum
(
1
);
basePage
.
setPageNum
(
sizeTotal
);
ServiceResponse
<
Page
<
AiMemberLogListDTO
>>
aiRes
=
aiMemberLogApiService
.
pageAiMemberMarketingLog
(
memberId
,
""
,
aiThirdStatus
,
DateUtil
.
formatDate
(
startTime
),
DateUtil
.
formatDate
(
date
),
new
HashMap
<>(),
basePage
);
if
(
aiRes
!=
null
&&
aiRes
.
getResult
()
!=
null
&&
CollectionUtils
.
isNotEmpty
(
aiRes
.
getResult
().
getResult
()))
{
convertAiFollow
(
enterpriseId
,
aiRes
.
getResult
().
getResult
(),
list
);
}
Page
<
MemberSmsLogDTO
>
smsPage
=
new
Page
<>();
smsPage
.
setCurrentPage
(
1
);
smsPage
.
setPageSize
(
sizeTotal
);
Page
<
MemberSmsLogDTO
>
smsRes
=
smsService
.
memberSmsLogPage
(
enterpriseId
,
memberId
,
null
,
DateUtil
.
beginOfDay
(
startTime
),
DateUtil
.
endOfDay
(
date
),
smsPage
);
if
(
smsRes
!=
null
&&
CollectionUtils
.
isNotEmpty
(
smsRes
.
getResult
()))
{
convertSmsFollow
(
enterpriseId
,
smsRes
.
getResult
(),
list
);
}
PageHelper
.
startPage
(
basePage
);
List
<
TabContactFollow
>
followList
=
contactFollowMapper
.
pageFollow
(
enterpriseId
,
searchQDTO
);
if
(
CollectionUtils
.
isNotEmpty
(
followList
))
{
List
<
ContactFollowDTO
>
pageList
=
convertExtInfo
(
followList
);
list
.
addAll
(
pageList
);
}
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
=
list
.
stream
().
sorted
(
Comparator
.
comparing
(
ContactFollowDTO:
:
getFollowTime
,
Comparator
.
nullsLast
(
Comparator
.
reverseOrder
()))
.
thenComparing
(
ContactFollowDTO:
:
getFollowType
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
()))
.
thenComparing
(
ContactFollowDTO:
:
getClerkId
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
())))
.
limit
(
maxSize
)
.
collect
(
Collectors
.
toList
());
}
return
list
;
}
private
void
convertAiFollow
(
String
enterpriseId
,
List
<
AiMemberLogListDTO
>
aiList
,
List
<
ContactFollowDTO
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
aiList
))
{
return
;
}
ContactFollowDTO
followDTO
;
for
(
AiMemberLogListDTO
aiMemberLog
:
aiList
)
{
followDTO
=
new
ContactFollowDTO
();
followDTO
.
setMemberId
(
aiMemberLog
.
getMemberId
());
followDTO
.
setFollowType
(
ContactFollowTypeEnum
.
AI
.
getCode
());
followDTO
.
setFollowRemark
(
ContactFollowTypeEnum
.
AI
.
getDescription
());
followDTO
.
setFollowTime
(
aiMemberLog
.
getAiTime
());
followDTO
.
setEnterpriseId
(
enterpriseId
);
list
.
add
(
followDTO
);
}
}
private
void
convertSmsFollow
(
String
enterpriseId
,
List
<
MemberSmsLogDTO
>
smsList
,
List
<
ContactFollowDTO
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
smsList
))
{
return
;
}
ContactFollowDTO
followDTO
;
for
(
MemberSmsLogDTO
smsLog
:
smsList
)
{
followDTO
=
new
ContactFollowDTO
();
followDTO
.
setMemberId
(
smsLog
.
getMemberId
());
followDTO
.
setFollowType
(
ContactFollowTypeEnum
.
SMS
.
getCode
());
followDTO
.
setFollowRemark
(
ContactFollowTypeEnum
.
SMS
.
getDescription
());
followDTO
.
setFollowTime
(
smsLog
.
getCreateDate
());
followDTO
.
setEnterpriseId
(
enterpriseId
);
list
.
add
(
followDTO
);
}
}
@Override
@Override
public
Map
<
String
,
ContactFollowDTO
>
mapMemberLastFollow
(
String
enterpriseId
,
String
clerkId
,
List
<
String
>
memberIdList
)
{
public
Map
<
String
,
ContactFollowDTO
>
mapMemberLastFollow
(
String
enterpriseId
,
String
clerkId
,
List
<
String
>
memberIdList
)
{
if
(
CollectionUtils
.
isEmpty
(
memberIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
memberIdList
))
{
return
new
HashMap
<>();
return
new
HashMap
<>();
}
}
Date
date
=
DateUtil
.
date
();
DateTime
startTime
=
DateUtil
.
offsetMonth
(
date
,
-
6
);
List
<
TabContactFollow
>
list
=
contactFollowMapper
.
lastFollowByMemberId
(
enterpriseId
,
clerkId
,
memberIdList
);
List
<
TabContactFollow
>
list
=
contactFollowMapper
.
lastFollowByMemberId
(
enterpriseId
,
clerkId
,
memberIdList
);
List
<
ContactFollowDTO
>
followDTOList
=
convertExtInfo
(
list
);
List
<
ContactFollowDTO
>
followDTOList
=
convertExtInfo
(
list
);
Map
<
String
,
ContactFollowDTO
>
map
=
followDTOList
.
stream
().
collect
(
Collectors
.
toMap
(
ContactFollowDTO:
:
getMemberId
,
v
->
v
,
(
v1
,
v2
)
->
v1
));
ServiceResponse
<
List
<
AiMemberLogListDTO
>>
aiRes
=
aiMemberLogApiService
.
lastAiMemberMarketingLog
(
memberIdList
,
aiThirdStatus
,
DateUtil
.
formatDate
(
startTime
),
DateUtil
.
formatDate
(
date
),
new
HashMap
<>());
if
(
aiRes
!=
null
&&
aiRes
.
getResult
()
!=
null
)
{
convertAiFollow
(
enterpriseId
,
aiRes
.
getResult
(),
followDTOList
);
}
List
<
MemberSmsLogDTO
>
smsList
=
smsService
.
lastMemberSmsLog
(
enterpriseId
,
memberIdList
,
null
,
DateUtil
.
beginOfDay
(
startTime
),
DateUtil
.
endOfDay
(
date
),
new
HashMap
<>());
convertSmsFollow
(
enterpriseId
,
smsList
,
followDTOList
);
Map
<
String
,
ContactFollowDTO
>
map
=
followDTOList
.
stream
()
.
sorted
(
Comparator
.
comparing
(
ContactFollowDTO:
:
getFollowTime
,
Comparator
.
nullsLast
(
Comparator
.
reverseOrder
()))
.
thenComparing
(
ContactFollowDTO:
:
getFollowType
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
()))
.
thenComparing
(
ContactFollowDTO:
:
getClerkId
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
()))
).
collect
(
Collectors
.
toMap
(
ContactFollowDTO:
:
getMemberId
,
v
->
v
,
(
v1
,
v2
)
->
v1
,
LinkedHashMap:
:
new
));
return
map
;
return
map
;
}
}
...
...
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
f2c2dcd4
...
@@ -209,6 +209,7 @@
...
@@ -209,6 +209,7 @@
<dubbo:reference
interface=
"com.gic.marketing.api.service.SmsService"
id=
"smsService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.marketing.api.service.SmsService"
id=
"smsService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.marketing.api.service.AccountOverdueSmsSendService"
id=
"accountOverdueSmsSendService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.marketing.api.service.AccountOverdueSmsSendService"
id=
"accountOverdueSmsSendService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.marketing.api.service.CouponReferAlarmService"
id=
"couponReferAlarmService"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.marketing.api.service.CouponReferAlarmService"
id=
"couponReferAlarmService"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.marketing.pro.api.service.ai.AiMemberLogApiService"
id=
"aiMemberLogApiService"
retries=
"0"
check=
"false"
timeout=
"10000"
/>
<dubbo:reference
interface=
"com.gic.thirdparty.api.service.VoiceService"
id=
"voiceService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.thirdparty.api.service.VoiceService"
id=
"voiceService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.thirdparty.api.service.CommunicationService"
id=
"communicationService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.thirdparty.api.service.CommunicationService"
id=
"communicationService"
timeout=
"10000"
retries=
"0"
/>
...
...
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