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
4c1487ae
Commit
4c1487ae
authored
Jun 18, 2025
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-recommend3' into 'master'
Feature recommend3 See merge request
!2997
parents
b87a06cf
e5ffdfd3
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
2661 additions
and
167 deletions
+2661
-167
Manage3Constants.java
...com/gic/haoban/manage/api/constants/Manage3Constants.java
+13
-0
ContactConfigDTO.java
...m/gic/haoban/manage/api/dto/contact/ContactConfigDTO.java
+78
-0
ContactFollowDTO.java
...m/gic/haoban/manage/api/dto/contact/ContactFollowDTO.java
+1
-1
ContactLogDTO.java
.../com/gic/haoban/manage/api/dto/contact/ContactLogDTO.java
+51
-0
DealQwSendDTO.java
...ava/com/gic/haoban/manage/api/dto/send/DealQwSendDTO.java
+16
-0
ContactAutoTypeEnum.java
.../haoban/manage/api/enums/contact/ContactAutoTypeEnum.java
+36
-0
ContactBizTypeEnum.java
...c/haoban/manage/api/enums/contact/ContactBizTypeEnum.java
+89
-0
ContactFollowTypeEnum.java
...aoban/manage/api/enums/contact/ContactFollowTypeEnum.java
+18
-6
ContactFollowBatchQDTO.java
...aoban/manage/api/qdto/contact/ContactFollowBatchQDTO.java
+75
-1
ContactFollowQDTO.java
...gic/haoban/manage/api/qdto/contact/ContactFollowQDTO.java
+45
-1
ContactLogCheckQDTO.java
...c/haoban/manage/api/qdto/contact/ContactLogCheckQDTO.java
+58
-0
ContactLogQDTO.java
...om/gic/haoban/manage/api/qdto/contact/ContactLogQDTO.java
+136
-0
ContactOrderSearchQDTO.java
...aoban/manage/api/qdto/contact/ContactOrderSearchQDTO.java
+16
-0
ContactConfigApiService.java
...n/manage/api/service/contact/ContactConfigApiService.java
+23
-0
ContactLogApiService.java
...oban/manage/api/service/contact/ContactLogApiService.java
+27
-0
TabContactConfigDao.xml
...ion-web/src/main/resources/mapper/TabContactConfigDao.xml
+152
-0
pom.xml
haoban-manage3-service/pom.xml
+12
-0
TabContactConfigMapper.java
...ge/service/dao/mapper/contact/TabContactConfigMapper.java
+40
-0
TabContactFollowMapper.java
...ge/service/dao/mapper/contact/TabContactFollowMapper.java
+19
-0
TabContactLogMapper.java
...anage/service/dao/mapper/contact/TabContactLogMapper.java
+1
-1
TabContactConfig.java
...aoban/manage/service/entity/contact/TabContactConfig.java
+120
-0
TabContactFollow.java
...aoban/manage/service/entity/contact/TabContactFollow.java
+41
-1
TabContactLog.java
...c/haoban/manage/service/entity/contact/TabContactLog.java
+78
-0
TabContactOrder.java
...haoban/manage/service/entity/contact/TabContactOrder.java
+37
-0
listFollowCheckBO.java
...ban/manage/service/pojo/bo/contact/listFollowCheckBO.java
+55
-0
GroupChatPlanServiceImpl.java
...e/service/service/chat/impl/GroupChatPlanServiceImpl.java
+5
-1
ContactConfigService.java
.../manage/service/service/contact/ContactConfigService.java
+22
-0
ContactLogService.java
...ban/manage/service/service/contact/ContactLogService.java
+35
-3
ContactAdaptor.java
...anage/service/service/contact/adaptor/ContactAdaptor.java
+2
-0
ContactConfigServiceImpl.java
...ervice/service/contact/impl/ContactConfigServiceImpl.java
+75
-0
ContactFollowServiceImpl.java
...ervice/service/contact/impl/ContactFollowServiceImpl.java
+184
-11
ContactLogServiceImpl.java
...e/service/service/contact/impl/ContactLogServiceImpl.java
+368
-34
ContactOrderServiceImpl.java
...service/service/contact/impl/ContactOrderServiceImpl.java
+76
-34
EnterpriseAdaptor.java
...ge/service/service/content/adaptor/EnterpriseAdaptor.java
+12
-0
LicenceOrderServiceImpl.java
...service/service/licence/impl/LicenceOrderServiceImpl.java
+0
-1
RouterApiServiceImpl.java
...service/service/out/impl/common/RouterApiServiceImpl.java
+2
-1
ContactConfigApiServiceImpl.java
...service/out/impl/contact/ContactConfigApiServiceImpl.java
+27
-0
ContactFollowApiServiceImpl.java
...service/out/impl/contact/ContactFollowApiServiceImpl.java
+4
-0
ContactLogApiServiceImpl.java
...ce/service/out/impl/contact/ContactLogApiServiceImpl.java
+61
-0
ContactOrderApiServiceImpl.java
.../service/out/impl/contact/ContactOrderApiServiceImpl.java
+3
-2
QywxGroupMsgTaskApiServiceImpl.java
...out/impl/content/task/QywxGroupMsgTaskApiServiceImpl.java
+4
-9
QwSendMsgServiceImpl.java
...anage/service/service/send/impl/QwSendMsgServiceImpl.java
+64
-8
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+6
-0
TabContactConfigMapper.xml
.../main/resources/mapper/contact/TabContactConfigMapper.xml
+70
-0
TabContactFollowMapper.xml
.../main/resources/mapper/contact/TabContactFollowMapper.xml
+69
-6
TabContactLogMapper.xml
...src/main/resources/mapper/contact/TabContactLogMapper.xml
+67
-9
TabContactOrderMapper.xml
...c/main/resources/mapper/contact/TabContactOrderMapper.xml
+13
-4
ContactTest.java
...an-manage3-service/src/test/java/contact/ContactTest.java
+18
-1
ContactController.java
...oban/manage/web/controller/contact/ContactController.java
+62
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+1
-0
ClerkMaterialShareController.java
.../web/controller/content/ClerkMaterialShareController.java
+12
-27
ContactController.java
...an/manage/web/controller/potential/ContactController.java
+37
-4
ContactFollowQO.java
...com/gic/haoban/manage/web/qo/contact/ContactFollowQO.java
+1
-1
ContactLogCheckQO.java
...m/gic/haoban/manage/web/qo/contact/ContactLogCheckQO.java
+58
-0
ContactLogQO.java
...va/com/gic/haoban/manage/web/qo/contact/ContactLogQO.java
+43
-0
ContactLogCheckVO.java
...m/gic/haoban/manage/web/vo/contact/ContactLogCheckVO.java
+22
-0
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+1
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/constants/Manage3Constants.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
constants
;
package
com
.
gic
.
haoban
.
manage
.
api
.
constants
;
import
java.util.Date
;
/**
/**
* @author mozhu
* @author mozhu
* @date 2022/4/19 15:12
* @date 2022/4/19 15:12
...
@@ -25,4 +27,15 @@ public class Manage3Constants {
...
@@ -25,4 +27,15 @@ public class Manage3Constants {
* 企微最大分页
* 企微最大分页
*/
*/
public
static
final
Integer
QW_LIMIT
=
1000
;
public
static
final
Integer
QW_LIMIT
=
1000
;
/**
* 建联未转化限制时间天数
*/
public
static
final
Integer
CONTACT_ORDER_LIMIT_DAY
=
30
;
/**
* 建联未转化时间调整发布时间
*/
public
static
final
Date
CONTACT_FIX_RELEASE_DATE
=
new
Date
(
"2025/06/18 23:00:00"
);
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/contact/ContactConfigDTO.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
contact
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
ContactConfigDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 配置主键ID
*/
private
Long
configId
;
/**
* 自动建联类型 10话务任务 20企微群发 30发送商品 40发送素材
*/
private
List
<
Integer
>
contactAutoList
;
/**
* 是否自动备注(0 否 1 是)
*/
private
Integer
remarkFlag
;
/**
* 备注内容
*/
private
List
<
String
>
remarkContentList
;
/**
* 企业ID
*/
private
String
enterpriseId
;
public
Long
getConfigId
()
{
return
configId
;
}
public
void
setConfigId
(
Long
configId
)
{
this
.
configId
=
configId
;
}
public
Integer
getRemarkFlag
()
{
return
remarkFlag
;
}
public
void
setRemarkFlag
(
Integer
remarkFlag
)
{
this
.
remarkFlag
=
remarkFlag
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
List
<
Integer
>
getContactAutoList
()
{
return
contactAutoList
;
}
public
void
setContactAutoList
(
List
<
Integer
>
contactAutoList
)
{
this
.
contactAutoList
=
contactAutoList
;
}
public
List
<
String
>
getRemarkContentList
()
{
return
remarkContentList
;
}
public
void
setRemarkContentList
(
List
<
String
>
remarkContentList
)
{
this
.
remarkContentList
=
remarkContentList
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/contact/ContactFollowDTO.java
View file @
4c1487ae
...
@@ -20,7 +20,7 @@ public class ContactFollowDTO implements Serializable {
...
@@ -20,7 +20,7 @@ public class ContactFollowDTO implements Serializable {
private
String
clerkCode
;
private
String
clerkCode
;
/**
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
6自动建联 7营销素材
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
*/
private
Integer
followType
;
private
Integer
followType
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/contact/ContactLogDTO.java
View file @
4c1487ae
...
@@ -60,6 +60,25 @@ public class ContactLogDTO implements Serializable {
...
@@ -60,6 +60,25 @@ public class ContactLogDTO implements Serializable {
*/
*/
private
Date
potentialTime
;
private
Date
potentialTime
;
/**
/**
* 来源日志id
*/
private
Long
sourceLogId
;
/**
* 来源类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
sourceType
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
bizType
;
/**
* 跟进记录组
*/
private
String
followTypes
;
/**
* 企业id
* 企业id
*/
*/
private
String
enterpriseId
;
private
String
enterpriseId
;
...
@@ -168,4 +187,35 @@ public class ContactLogDTO implements Serializable {
...
@@ -168,4 +187,35 @@ public class ContactLogDTO implements Serializable {
this
.
enterpriseId
=
enterpriseId
;
this
.
enterpriseId
=
enterpriseId
;
}
}
public
Long
getSourceLogId
()
{
return
sourceLogId
;
}
public
void
setSourceLogId
(
Long
sourceLogId
)
{
this
.
sourceLogId
=
sourceLogId
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
String
getFollowTypes
()
{
return
followTypes
;
}
public
void
setFollowTypes
(
String
followTypes
)
{
this
.
followTypes
=
followTypes
;
}
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/send/DealQwSendDTO.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
send
;
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
send
;
import
com.gic.haoban.manage.api.dto.anaylsis.ClerkShareGoodsLogDTO
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* Created by wangzubo on 2025/3/25.
* Created by wangzubo on 2025/3/25.
...
@@ -60,6 +63,11 @@ public class DealQwSendDTO implements Serializable {
...
@@ -60,6 +63,11 @@ public class DealQwSendDTO implements Serializable {
*/
*/
private
String
enterpriseId
;
private
String
enterpriseId
;
/**
* 商品分享信息
*/
private
List
<
ClerkShareGoodsLogDTO
>
shareGoodsList
;
public
FinishQwSendBO
()
{
public
FinishQwSendBO
()
{
}
}
...
@@ -119,6 +127,14 @@ public class DealQwSendDTO implements Serializable {
...
@@ -119,6 +127,14 @@ public class DealQwSendDTO implements Serializable {
public
void
setEnterpriseId
(
String
enterpriseId
)
{
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
this
.
enterpriseId
=
enterpriseId
;
}
}
public
List
<
ClerkShareGoodsLogDTO
>
getShareGoodsList
()
{
return
shareGoodsList
;
}
public
void
setShareGoodsList
(
List
<
ClerkShareGoodsLogDTO
>
shareGoodsList
)
{
this
.
shareGoodsList
=
shareGoodsList
;
}
}
}
public
static
class
QwSendMsgBO
implements
Serializable
{
public
static
class
QwSendMsgBO
implements
Serializable
{
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/contact/ContactAutoTypeEnum.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
enums
.
contact
;
public
enum
ContactAutoTypeEnum
{
// 自动建联类型 10话务任务 20企微群发 30发送商品 40发送素材
CALL_TASK
(
10
,
"专属导购通过话务任务成功触达客户"
),
QW_TASK
(
20
,
"专属导购通过企微群发任务成功触达了客户"
),
GOODS_RECOMMEND
(
30
,
"专属导购通过\"智能选款\"或\"意向客户\"给客户发送了商品"
),
MATERIAL
(
40
,
"专属导购通过\"聊天工具栏\"或\"企微群发\"给客户发送了营销素材"
);
private
final
int
code
;
private
final
String
description
;
public
int
getCode
()
{
return
code
;
}
public
String
getDescription
()
{
return
description
;
}
ContactAutoTypeEnum
(
int
code
,
String
description
)
{
this
.
code
=
code
;
this
.
description
=
description
;
}
public
static
ContactAutoTypeEnum
fromCode
(
int
code
)
{
for
(
ContactAutoTypeEnum
type
:
values
())
{
if
(
type
.
code
==
code
)
{
return
type
;
}
}
return
null
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/contact/ContactBizTypeEnum.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
enums
.
contact
;
import
cn.hutool.core.date.DateUtil
;
import
com.gic.haoban.manage.api.dto.contact.ContactLogDTO
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
public
enum
ContactBizTypeEnum
{
// 业务类型 1潜客(0001)2机会人群(0010)
POTENTIAL_CUSTOMER
(
"10"
,
1
,
"潜客"
),
OPPORTUNITY_CUSTOMER
(
"20"
,
2
,
"机会人群"
);
private
final
String
codePre
;
private
final
int
type
;
private
final
String
description
;
public
String
getCodePre
()
{
return
codePre
;
}
public
int
getType
()
{
return
type
;
}
public
String
getDescription
()
{
return
description
;
}
public
Long
getEsClerkContactTime
(
Long
contactTime
)
{
if
(
Objects
.
equals
(
contactTime
,
-
1L
))
{
return
null
;
}
return
Long
.
parseLong
(
this
.
getCodePre
()
+
contactTime
);
}
public
static
List
<
Long
>
getEsClerkContactTimeList
(
List
<
ContactLogDTO
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
ArrayList
<>();
}
list
=
list
.
stream
().
sorted
(
Comparator
.
comparing
(
ContactLogDTO:
:
getBizType
))
.
collect
(
Collectors
.
toList
());
List
<
Long
>
clerkContactTimeList
=
Lists
.
newArrayList
();
Long
maxContactTime
=
null
;
for
(
ContactLogDTO
contactLogDTO
:
list
)
{
Date
contactTime
=
contactLogDTO
.
getContactTime
();
ContactBizTypeEnum
bizTypeEnum
=
ContactBizTypeEnum
.
fromType
(
contactLogDTO
.
getBizType
());
Long
orginalContactTimeLong
=
Long
.
parseLong
(
DateUtil
.
format
(
contactTime
,
"yyyyMMddHHmmss"
));
Long
contactTimeLong
=
bizTypeEnum
.
getEsClerkContactTime
(
orginalContactTimeLong
);
clerkContactTimeList
.
add
(
contactTimeLong
);
if
(
maxContactTime
==
null
||
orginalContactTimeLong
>
maxContactTime
)
{
maxContactTime
=
orginalContactTimeLong
;
}
}
if
(
maxContactTime
!=
null
)
{
clerkContactTimeList
.
add
(
maxContactTime
);
}
return
clerkContactTimeList
;
}
ContactBizTypeEnum
(
String
codePre
,
int
type
,
String
description
)
{
this
.
codePre
=
codePre
;
this
.
type
=
type
;
this
.
description
=
description
;
}
public
static
ContactBizTypeEnum
fromCode
(
String
code
)
{
for
(
ContactBizTypeEnum
type
:
values
())
{
if
(
Objects
.
equals
(
type
.
codePre
,
code
))
{
return
type
;
}
}
return
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
;
}
public
static
ContactBizTypeEnum
fromType
(
int
type
)
{
for
(
ContactBizTypeEnum
bizTypeEnum
:
values
())
{
if
(
bizTypeEnum
.
type
==
type
)
{
return
bizTypeEnum
;
}
}
return
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/contact/ContactFollowTypeEnum.java
View file @
4c1487ae
...
@@ -4,20 +4,28 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -4,20 +4,28 @@ import org.apache.commons.lang3.StringUtils;
public
enum
ContactFollowTypeEnum
{
public
enum
ContactFollowTypeEnum
{
PRIVATE_PHONE
(
1
,
"私人电话"
,
"私人电话"
),
// 跟进表中不会有这两个类型
WECHAT_SESSION
(
2
,
"企微会话"
,
"企微会话"
),
SMS
(-
1
,
"短信/彩信"
,
"系统向客户发送了营销短信/彩信"
,
null
),
PRODUCT
(
3
,
"发送商品"
,
"商品"
),
AI
(-
2
,
"AI电话"
,
"客户接听了AI电话"
,
null
),
WECHAT_GROUP_SEND
(
4
,
"企微群发"
,
"企微群发"
),
CONTACT
(
5
,
"标记建联"
,
"标记了建联"
);
PRIVATE_PHONE
(
1
,
"私人电话"
,
"私人电话"
,
null
),
WECHAT_SESSION
(
2
,
"企微会话"
,
"企微会话"
,
null
),
PRODUCT
(
3
,
"发送商品"
,
"商品"
,
ContactAutoTypeEnum
.
GOODS_RECOMMEND
.
getCode
()),
WECHAT_GROUP_SEND
(
4
,
"企微群发"
,
"企微群发"
,
null
),
CONTACT
(
5
,
"标记建联"
,
"标记了建联"
,
null
),
AUTO_CONTACT
(
6
,
"系统自动标记"
,
"系统自动标记"
,
null
),
MATERIAL
(
7
,
"营销素材"
,
"营销素材"
,
ContactAutoTypeEnum
.
MATERIAL
.
getCode
());
private
final
int
code
;
private
final
int
code
;
private
final
String
description
;
private
final
String
description
;
private
final
String
textMatch
;
private
final
String
textMatch
;
private
final
Integer
contactAutoType
;
ContactFollowTypeEnum
(
int
code
,
String
description
,
String
textMatch
)
{
ContactFollowTypeEnum
(
int
code
,
String
description
,
String
textMatch
,
Integer
contactAutoType
)
{
this
.
code
=
code
;
this
.
code
=
code
;
this
.
description
=
description
;
this
.
description
=
description
;
this
.
textMatch
=
textMatch
;
this
.
textMatch
=
textMatch
;
this
.
contactAutoType
=
contactAutoType
;
}
}
public
String
getTextMatch
()
{
public
String
getTextMatch
()
{
...
@@ -32,6 +40,10 @@ public enum ContactFollowTypeEnum {
...
@@ -32,6 +40,10 @@ public enum ContactFollowTypeEnum {
return
description
;
return
description
;
}
}
public
Integer
getContactAutoType
()
{
return
contactAutoType
;
}
public
static
ContactFollowTypeEnum
fromCode
(
int
code
)
{
public
static
ContactFollowTypeEnum
fromCode
(
int
code
)
{
for
(
ContactFollowTypeEnum
type
:
values
())
{
for
(
ContactFollowTypeEnum
type
:
values
())
{
if
(
type
.
code
==
code
)
{
if
(
type
.
code
==
code
)
{
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/contact/ContactFollowBatchQDTO.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,15 +23,36 @@ public class ContactFollowBatchQDTO implements Serializable {
...
@@ -21,15 +23,36 @@ public class ContactFollowBatchQDTO implements Serializable {
private
String
clerkId
;
private
String
clerkId
;
/**
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
6自动建联 7营销素材
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
*/
private
Integer
followType
;
private
Integer
followType
;
/**
* 业务id(建联日志id)
*/
private
String
bizId
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
=
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
();
/**
* 来源类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
sourceType
;
/**
/**
* 跟进记录
* 跟进记录
*/
*/
private
String
followRemark
;
private
String
followRemark
;
/**
* 关联商品信息
*/
private
List
<
String
>
goodsInfoList
;
public
String
getEnterpriseId
()
{
public
String
getEnterpriseId
()
{
return
enterpriseId
;
return
enterpriseId
;
}
}
...
@@ -62,6 +85,30 @@ public class ContactFollowBatchQDTO implements Serializable {
...
@@ -62,6 +85,30 @@ public class ContactFollowBatchQDTO implements Serializable {
this
.
followType
=
followType
;
this
.
followType
=
followType
;
}
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
String
getFollowRemark
()
{
public
String
getFollowRemark
()
{
return
followRemark
;
return
followRemark
;
}
}
...
@@ -70,6 +117,14 @@ public class ContactFollowBatchQDTO implements Serializable {
...
@@ -70,6 +117,14 @@ public class ContactFollowBatchQDTO implements Serializable {
this
.
followRemark
=
followRemark
;
this
.
followRemark
=
followRemark
;
}
}
public
List
<
String
>
getGoodsInfoList
()
{
return
goodsInfoList
;
}
public
void
setGoodsInfoList
(
List
<
String
>
goodsInfoList
)
{
this
.
goodsInfoList
=
goodsInfoList
;
}
public
static
class
MemberFollow
implements
Serializable
{
public
static
class
MemberFollow
implements
Serializable
{
/**
/**
...
@@ -78,6 +133,11 @@ public class ContactFollowBatchQDTO implements Serializable {
...
@@ -78,6 +133,11 @@ public class ContactFollowBatchQDTO implements Serializable {
private
String
memberId
;
private
String
memberId
;
/**
/**
* 外部联系人id
*/
private
String
externalUserId
;
/**
* 跟进时间
* 跟进时间
*/
*/
private
Date
followTime
;
private
Date
followTime
;
...
@@ -90,6 +150,12 @@ public class ContactFollowBatchQDTO implements Serializable {
...
@@ -90,6 +150,12 @@ public class ContactFollowBatchQDTO implements Serializable {
this
.
followTime
=
followTime
;
this
.
followTime
=
followTime
;
}
}
public
MemberFollow
(
String
memberId
,
String
externalUserId
,
Date
followTime
)
{
this
.
memberId
=
memberId
;
this
.
externalUserId
=
externalUserId
;
this
.
followTime
=
followTime
;
}
public
String
getMemberId
()
{
public
String
getMemberId
()
{
return
memberId
;
return
memberId
;
}
}
...
@@ -98,6 +164,14 @@ public class ContactFollowBatchQDTO implements Serializable {
...
@@ -98,6 +164,14 @@ public class ContactFollowBatchQDTO implements Serializable {
this
.
memberId
=
memberId
;
this
.
memberId
=
memberId
;
}
}
public
String
getExternalUserId
()
{
return
externalUserId
;
}
public
void
setExternalUserId
(
String
externalUserId
)
{
this
.
externalUserId
=
externalUserId
;
}
public
Date
getFollowTime
()
{
public
Date
getFollowTime
()
{
return
followTime
;
return
followTime
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/contact/ContactFollowQDTO.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,10 +21,28 @@ public class ContactFollowQDTO implements Serializable {
...
@@ -19,10 +21,28 @@ public class ContactFollowQDTO implements Serializable {
*/
*/
private
String
clerkCode
;
private
String
clerkCode
;
/**
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
6自动建联 7营销素材
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
*/
private
Integer
followType
;
private
Integer
followType
;
/**
* 业务id(建联日志id)
*/
private
String
bizId
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
=
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
();
/**
* 来源类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
sourceType
;
/**
/**
* 跟进记录
* 跟进记录
*/
*/
...
@@ -76,6 +96,30 @@ public class ContactFollowQDTO implements Serializable {
...
@@ -76,6 +96,30 @@ public class ContactFollowQDTO implements Serializable {
this
.
followType
=
followType
;
this
.
followType
=
followType
;
}
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
String
getFollowRemark
()
{
public
String
getFollowRemark
()
{
return
followRemark
;
return
followRemark
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/contact/ContactLogCheckQDTO.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
import
java.io.Serializable
;
public
class
ContactLogCheckQDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
973688857967269973L
;
/**
* 会员id
*/
private
String
memberId
;
/**
* 导购id
*/
private
String
clerkId
;
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)null为都校验
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
;
public
String
getMemberId
()
{
return
memberId
;
}
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
memberId
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/contact/ContactLogQDTO.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
import
com.gic.haoban.manage.api.enums.contact.ContactAutoTypeEnum
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
public
class
ContactLogQDTO
implements
Serializable
{
public
class
ContactLogQDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
973688857967269973L
;
private
static
final
long
serialVersionUID
=
973688857967269973L
;
...
@@ -22,6 +27,64 @@ public class ContactLogQDTO implements Serializable {
...
@@ -22,6 +27,64 @@ public class ContactLogQDTO implements Serializable {
*/
*/
private
String
enterpriseId
;
private
String
enterpriseId
;
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联 6自动建联 7营销素材
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
private
Integer
followType
=
ContactFollowTypeEnum
.
CONTACT
.
getCode
();
/**
* 跟进记录
*/
private
String
followRemark
;
/**
* 跟进上传素材,数组格式
*/
private
List
<
String
>
followMaterialList
;
/**
* 自动建联类型
* @see ContactAutoTypeEnum
*/
private
Integer
contactAutoType
;
/**
* 是否同步建联
*/
private
Integer
syncContactType
;
/**
* 同步建联时间
*/
private
Date
syncContactTime
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
=
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
();
/**
* 来源类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
sourceType
;
/**
* 来源建联id
*/
private
Long
sourceLogId
;
public
ContactLogQDTO
()
{
}
public
ContactLogQDTO
(
String
enterpriseId
,
String
memberId
,
String
clerkId
,
String
storeId
,
Integer
contactAutoType
)
{
this
.
memberId
=
memberId
;
this
.
clerkId
=
clerkId
;
this
.
storeId
=
storeId
;
this
.
enterpriseId
=
enterpriseId
;
this
.
contactAutoType
=
contactAutoType
;
}
public
String
getMemberId
()
{
public
String
getMemberId
()
{
return
memberId
;
return
memberId
;
}
}
...
@@ -53,4 +116,76 @@ public class ContactLogQDTO implements Serializable {
...
@@ -53,4 +116,76 @@ public class ContactLogQDTO implements Serializable {
public
void
setEnterpriseId
(
String
enterpriseId
)
{
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
this
.
enterpriseId
=
enterpriseId
;
}
}
public
Integer
getFollowType
()
{
return
followType
;
}
public
void
setFollowType
(
Integer
followType
)
{
this
.
followType
=
followType
;
}
public
String
getFollowRemark
()
{
return
followRemark
;
}
public
void
setFollowRemark
(
String
followRemark
)
{
this
.
followRemark
=
followRemark
;
}
public
List
<
String
>
getFollowMaterialList
()
{
return
followMaterialList
;
}
public
void
setFollowMaterialList
(
List
<
String
>
followMaterialList
)
{
this
.
followMaterialList
=
followMaterialList
;
}
public
Integer
getContactAutoType
()
{
return
contactAutoType
;
}
public
void
setContactAutoType
(
Integer
contactAutoType
)
{
this
.
contactAutoType
=
contactAutoType
;
}
public
Integer
getSyncContactType
()
{
return
syncContactType
;
}
public
void
setSyncContactType
(
Integer
syncContactType
)
{
this
.
syncContactType
=
syncContactType
;
}
public
Date
getSyncContactTime
()
{
return
syncContactTime
;
}
public
void
setSyncContactTime
(
Date
syncContactTime
)
{
this
.
syncContactTime
=
syncContactTime
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
Long
getSourceLogId
()
{
return
sourceLogId
;
}
public
void
setSourceLogId
(
Long
sourceLogId
)
{
this
.
sourceLogId
=
sourceLogId
;
}
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/contact/ContactOrderSearchQDTO.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
.
contact
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -43,6 +44,12 @@ public class ContactOrderSearchQDTO implements Serializable {
...
@@ -43,6 +44,12 @@ public class ContactOrderSearchQDTO implements Serializable {
*/
*/
private
Date
endTime
;
private
Date
endTime
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
=
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
();
public
String
getMemberId
()
{
public
String
getMemberId
()
{
return
memberId
;
return
memberId
;
}
}
...
@@ -102,4 +109,12 @@ public class ContactOrderSearchQDTO implements Serializable {
...
@@ -102,4 +109,12 @@ public class ContactOrderSearchQDTO implements Serializable {
this
.
endTime
=
DateUtil
.
endOfDay
(
endTime
);
this
.
endTime
=
DateUtil
.
endOfDay
(
endTime
);
}
}
}
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/contact/ContactConfigApiService.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
api
.
service
.
contact
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
public
interface
ContactConfigApiService
{
/**
* 保存建联配置
*
* @param contactConfig
*/
ServiceResponse
<
Void
>
saveContactConfig
(
ContactConfigDTO
contactConfig
);
/**
* 获取建联配置
* @param enterpriseId
* @return
*/
ServiceResponse
<
ContactConfigDTO
>
getContactConfig
(
String
enterpriseId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/contact/ContactLogApiService.java
View file @
4c1487ae
...
@@ -2,8 +2,11 @@ package com.gic.haoban.manage.api.service.contact;
...
@@ -2,8 +2,11 @@ package com.gic.haoban.manage.api.service.contact;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.contact.ContactLogDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactLogDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogCheckQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
java.util.List
;
public
interface
ContactLogApiService
{
public
interface
ContactLogApiService
{
/**
/**
...
@@ -11,13 +14,37 @@ public interface ContactLogApiService {
...
@@ -11,13 +14,37 @@ public interface ContactLogApiService {
* @param memberId
* @param memberId
* @return
* @return
*/
*/
@Deprecated
ServiceResponse
<
ContactLogDTO
>
getClerkContactTime
(
String
memberId
);
ServiceResponse
<
ContactLogDTO
>
getClerkContactTime
(
String
memberId
);
/**
/**
* 获取每个业务最近一条有效建联记录
* @param memberId
* @return
*/
ServiceResponse
<
List
<
ContactLogDTO
>>
getClerkContactTimeList
(
String
memberId
);
/**
* 保存建联记录
* 保存建联记录
* @param qdto
* @param qdto
* @return
* @return
*/
*/
ServiceResponse
<
Void
>
saveContactLog
(
ContactLogQDTO
qdto
);
ServiceResponse
<
Void
>
saveContactLog
(
ContactLogQDTO
qdto
);
/**
* 消息队列异步自动建联
* @param message
* @return
*/
ServiceResponse
<
Void
>
autoContactLogForMQ
(
String
message
);
/**
* 是否可以建联校验
* @param checkQDTO
* @return
*/
ServiceResponse
<
Boolean
>
contactCheck
(
ContactLogCheckQDTO
checkQDTO
)
;
}
}
haoban-manage3-operation-web/src/main/resources/mapper/TabContactConfigDao.xml
0 → 100644
View file @
4c1487ae
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
".dao.TabContactConfigDao"
>
<resultMap
type=
".entity.TabContactConfig"
id=
"TabContactConfigMap"
>
<result
property=
"configId"
column=
"config_id"
jdbcType=
"INTEGER"
/>
<result
property=
"contactAuto"
column=
"contact_auto"
jdbcType=
"VARCHAR"
/>
<result
property=
"remarkFlag"
column=
"remark_flag"
jdbcType=
"INTEGER"
/>
<result
property=
"remarkContent"
column=
"remark_content"
jdbcType=
"VARCHAR"
/>
<result
property=
"enterpriseId"
column=
"enterprise_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
jdbcType=
"INTEGER"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"TabContactConfigMap"
>
select
config_idcontact_autoremark_flagremark_contententerprise_iddelete_flagcreate_timeupdate_time
from tab_contact_config
where config_id = #{configId}
</select>
<!--查询指定行数据-->
<select
id=
"queryAllByLimit"
resultMap=
"TabContactConfigMap"
>
select
config_idcontact_autoremark_flagremark_contententerprise_iddelete_flagcreate_timeupdate_time
from tab_contact_config
<where>
<if
test=
"configId != null"
>
and config_id = #{configId}
</if>
<if
test=
"contactAuto != null and contactAuto != ''"
>
and contact_auto = #{contactAuto}
</if>
<if
test=
"remarkFlag != null"
>
and remark_flag = #{remarkFlag}
</if>
<if
test=
"remarkContent != null and remarkContent != ''"
>
and remark_content = #{remarkContent}
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"deleteFlag != null"
>
and delete_flag = #{deleteFlag}
</if>
<if
test=
"createTime != null"
>
and create_time = #{createTime}
</if>
<if
test=
"updateTime != null"
>
and update_time = #{updateTime}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select
id=
"count"
resultType=
"java.lang.Long"
>
select count(1)
from tab_contact_config
<where>
<if
test=
"configId != null"
>
and config_id = #{configId}
</if>
<if
test=
"contactAuto != null and contactAuto != ''"
>
and contact_auto = #{contactAuto}
</if>
<if
test=
"remarkFlag != null"
>
and remark_flag = #{remarkFlag}
</if>
<if
test=
"remarkContent != null and remarkContent != ''"
>
and remark_content = #{remarkContent}
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"deleteFlag != null"
>
and delete_flag = #{deleteFlag}
</if>
<if
test=
"createTime != null"
>
and create_time = #{createTime}
</if>
<if
test=
"updateTime != null"
>
and update_time = #{updateTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"configId"
useGeneratedKeys=
"true"
>
insert into
tab_contact_config(contact_autoremark_flagremark_contententerprise_iddelete_flagcreate_timeupdate_time)
values (#{contactAuto}#{remarkFlag}#{remarkContent}#{enterpriseId}#{deleteFlag}#{createTime}#{updateTime})
</insert>
<insert
id=
"insertBatch"
keyProperty=
"configId"
useGeneratedKeys=
"true"
>
insert into
tab_contact_config(contact_autoremark_flagremark_contententerprise_iddelete_flagcreate_timeupdate_time)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.contactAuto}#{entity.remarkFlag}#{entity.remarkContent}#{entity.enterpriseId}#{entity.deleteFlag}#{entity.createTime}#{entity.updateTime})
</foreach>
</insert>
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"configId"
useGeneratedKeys=
"true"
>
insert into
tab_contact_config(contact_autoremark_flagremark_contententerprise_iddelete_flagcreate_timeupdate_time)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.contactAuto}#{entity.remarkFlag}#{entity.remarkContent}#{entity.enterpriseId}#{entity.deleteFlag}#{entity.createTime}#{entity.updateTime})
</foreach>
on duplicate key update
contact_auto = values(contact_auto)remark_flag = values(remark_flag)remark_content =
values(remark_content)enterprise_id = values(enterprise_id)delete_flag = values(delete_flag)create_time =
values(create_time)update_time = values(update_time)
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
update tab_contact_config
<set>
<if
test=
"contactAuto != null and contactAuto != ''"
>
contact_auto = #{contactAuto},
</if>
<if
test=
"remarkFlag != null"
>
remark_flag = #{remarkFlag},
</if>
<if
test=
"remarkContent != null and remarkContent != ''"
>
remark_content = #{remarkContent},
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
enterprise_id = #{enterpriseId},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</set>
where config_id = #{configId}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
delete from tab_contact_config where config_id = #{configId}
</delete>
</mapper>
haoban-manage3-service/pom.xml
View file @
4c1487ae
...
@@ -93,6 +93,12 @@
...
@@ -93,6 +93,12 @@
<dependency>
<dependency>
<groupId>
com.gic
</groupId>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-app-performance-api
</artifactId>
<version>
${haoban-app-performance-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-enterprise-api
</artifactId>
<artifactId>
gic-enterprise-api
</artifactId>
<version>
${gic-enterprise-api}
</version>
<version>
${gic-enterprise-api}
</version>
<exclusions>
<exclusions>
...
@@ -142,6 +148,12 @@
...
@@ -142,6 +148,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/dao/mapper/contact/TabContactConfigMapper.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
.
contact
;
import
com.gic.haoban.manage.service.entity.contact.TabContactConfig
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabContactConfigMapper
{
/**
* 根据主键查询
*/
TabContactConfig
queryById
(
@Param
(
"configId"
)
Long
configId
);
/**
* 根据 enterpriseId 查询配置
*/
TabContactConfig
queryByEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 插入单条数据
*/
int
insert
(
TabContactConfig
tabContactConfig
);
/**
* 批量插入
*/
int
insertBatch
(
@Param
(
"list"
)
List
<
TabContactConfig
>
list
);
/**
* 更新数据
*/
int
update
(
TabContactConfig
tabContactConfig
);
/**
* 根据主键删除
*/
int
deleteById
(
@Param
(
"configId"
)
Long
configId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/contact/TabContactFollowMapper.java
View file @
4c1487ae
...
@@ -3,8 +3,10 @@ package com.gic.haoban.manage.service.dao.mapper.contact;
...
@@ -3,8 +3,10 @@ package com.gic.haoban.manage.service.dao.mapper.contact;
import
com.gic.haoban.manage.api.qdto.chat.GroupChatActivitySearchQDTO
;
import
com.gic.haoban.manage.api.qdto.chat.GroupChatActivitySearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.service.entity.contact.TabContactFollow
;
import
com.gic.haoban.manage.service.entity.contact.TabContactFollow
;
import
com.gic.haoban.manage.service.pojo.bo.contact.listFollowCheckBO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -31,6 +33,8 @@ public interface TabContactFollowMapper {
...
@@ -31,6 +33,8 @@ public interface TabContactFollowMapper {
List
<
TabContactFollow
>
pageFollow
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
List
<
TabContactFollow
>
pageFollow
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"search"
)
ContactFollowSearchQDTO
searchQDTO
);
@Param
(
"search"
)
ContactFollowSearchQDTO
searchQDTO
);
List
<
String
>
listFollowCheck
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"list"
)
List
<
listFollowCheckBO
>
list
);
/**
/**
* 通过memberId查询最后一次跟进记录
* 通过memberId查询最后一次跟进记录
* @param enterpriseId
* @param enterpriseId
...
@@ -50,6 +54,21 @@ public interface TabContactFollowMapper {
...
@@ -50,6 +54,21 @@ public interface TabContactFollowMapper {
List
<
TabContactFollow
>
queryByIds
(
@Param
(
"followIds"
)
List
<
Long
>
followIds
);
List
<
TabContactFollow
>
queryByIds
(
@Param
(
"followIds"
)
List
<
Long
>
followIds
);
/**
/**
* 获取时间段内跟进类型
* @param enterpriseId
* @param clerkId
* @param memberId
* @param beginTime
* @param endTime
* @return
*/
String
getFollowTypes
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkId"
)
String
clerkId
,
@Param
(
"memberId"
)
String
memberId
,
@Param
(
"beginTime"
)
Date
beginTime
,
@Param
(
"endTime"
)
Date
endTime
);
/**
* 统计总行数
* 统计总行数
*
*
* @param tabContactFollow 查询条件
* @param tabContactFollow 查询条件
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/contact/TabContactLogMapper.java
View file @
4c1487ae
...
@@ -35,7 +35,7 @@ public interface TabContactLogMapper {
...
@@ -35,7 +35,7 @@ public interface TabContactLogMapper {
* @param clerkId
* @param clerkId
* @return
* @return
*/
*/
TabContactLog
queryLastLog
(
@Param
(
"memberId"
)
String
memberId
,
@Param
(
"clerkId"
)
String
clerkId
,
@Param
(
"beginTime"
)
Date
beginTime
,
@Param
(
"endTime"
)
Date
endTime
);
List
<
TabContactLog
>
queryLastLog
(
@Param
(
"memberId"
)
String
memberId
,
@Param
(
"clerkId"
)
String
clerkId
,
@Param
(
"beginTime"
)
Date
beginTime
,
@Param
(
"endTime"
)
Date
endTime
);
/**
/**
* 统计总行数
* 统计总行数
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/contact/TabContactConfig.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
.
contact
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 建联配置表(TabContactConfig)实体类
*
* @author TONGYI Lingma
* @since 2025-05-26 16:09:38
*/
public
class
TabContactConfig
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 配置主键ID
*/
private
Long
configId
;
/**
* 自动建联类型 10话务任务 20企微群发 30发送商品 40发送素材
*/
private
String
contactAuto
;
/**
* 是否自动备注(0 否 1 是)
*/
private
Integer
remarkFlag
;
/**
* 备注内容
*/
private
String
remarkContent
;
/**
* 企业ID
*/
private
String
enterpriseId
;
/**
* 是否删除(0 正常 1 删除)
*/
private
Integer
deleteFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
public
Long
getConfigId
()
{
return
configId
;
}
public
void
setConfigId
(
Long
configId
)
{
this
.
configId
=
configId
;
}
public
String
getContactAuto
()
{
return
contactAuto
;
}
public
void
setContactAuto
(
String
contactAuto
)
{
this
.
contactAuto
=
contactAuto
;
}
public
Integer
getRemarkFlag
()
{
return
remarkFlag
;
}
public
void
setRemarkFlag
(
Integer
remarkFlag
)
{
this
.
remarkFlag
=
remarkFlag
;
}
public
String
getRemarkContent
()
{
return
remarkContent
;
}
public
void
setRemarkContent
(
String
remarkContent
)
{
this
.
remarkContent
=
remarkContent
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/contact/TabContactFollow.java
View file @
4c1487ae
...
@@ -28,7 +28,7 @@ public class TabContactFollow implements Serializable {
...
@@ -28,7 +28,7 @@ public class TabContactFollow implements Serializable {
*/
*/
private
String
clerkCode
;
private
String
clerkCode
;
/**
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
6自动建联 7营销素材
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
*/
private
Integer
followType
;
private
Integer
followType
;
...
@@ -48,6 +48,22 @@ public class TabContactFollow implements Serializable {
...
@@ -48,6 +48,22 @@ public class TabContactFollow implements Serializable {
* 跟进时间
* 跟进时间
*/
*/
private
Date
followTime
;
private
Date
followTime
;
/**
* 来源类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
sourceType
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
bizType
;
/**
* 业务id(建联日志id)
*/
private
String
bizId
;
/**
/**
* 企业id
* 企业id
*/
*/
...
@@ -137,6 +153,30 @@ public class TabContactFollow implements Serializable {
...
@@ -137,6 +153,30 @@ public class TabContactFollow implements Serializable {
this
.
followTime
=
followTime
;
this
.
followTime
=
followTime
;
}
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
String
getEnterpriseId
()
{
public
String
getEnterpriseId
()
{
return
enterpriseId
;
return
enterpriseId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/contact/TabContactLog.java
View file @
4c1487ae
...
@@ -59,6 +59,36 @@ public class TabContactLog implements Serializable {
...
@@ -59,6 +59,36 @@ public class TabContactLog implements Serializable {
* 成为潜客时间
* 成为潜客时间
*/
*/
private
Date
potentialTime
;
private
Date
potentialTime
;
/**
* 潜客分
*/
private
Integer
potentialScore
;
/**
* 来源日志id
*/
private
Long
sourceLogId
;
/**
* 来源类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
sourceType
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
bizType
;
/**
* 业务冗余数据
*/
private
String
bizData
;
/**
* 跟进记录组
*/
private
String
followTypes
;
/**
/**
* 企业id
* 企业id
*/
*/
...
@@ -172,6 +202,54 @@ public class TabContactLog implements Serializable {
...
@@ -172,6 +202,54 @@ public class TabContactLog implements Serializable {
this
.
potentialTime
=
potentialTime
;
this
.
potentialTime
=
potentialTime
;
}
}
public
Integer
getPotentialScore
()
{
return
potentialScore
;
}
public
void
setPotentialScore
(
Integer
potentialScore
)
{
this
.
potentialScore
=
potentialScore
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
Long
getSourceLogId
()
{
return
sourceLogId
;
}
public
void
setSourceLogId
(
Long
sourceLogId
)
{
this
.
sourceLogId
=
sourceLogId
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
String
getBizData
()
{
return
bizData
;
}
public
void
setBizData
(
String
bizData
)
{
this
.
bizData
=
bizData
;
}
public
String
getFollowTypes
()
{
return
followTypes
;
}
public
void
setFollowTypes
(
String
followTypes
)
{
this
.
followTypes
=
followTypes
;
}
public
String
getEnterpriseId
()
{
public
String
getEnterpriseId
()
{
return
enterpriseId
;
return
enterpriseId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/contact/TabContactOrder.java
View file @
4c1487ae
...
@@ -88,6 +88,19 @@ public class TabContactOrder implements Serializable {
...
@@ -88,6 +88,19 @@ public class TabContactOrder implements Serializable {
*/
*/
private
Integer
potentialScore
;
private
Integer
potentialScore
;
/**
/**
* 金字塔分层信息
*/
private
String
groupInfo
;
/**
* 来源类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
sourceType
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
*/
private
Integer
bizType
;
/**
* 是否删除
* 是否删除
*/
*/
private
Integer
deleteFlag
;
private
Integer
deleteFlag
;
...
@@ -256,6 +269,30 @@ public class TabContactOrder implements Serializable {
...
@@ -256,6 +269,30 @@ public class TabContactOrder implements Serializable {
this
.
potentialScore
=
potentialScore
;
this
.
potentialScore
=
potentialScore
;
}
}
public
String
getGroupInfo
()
{
return
groupInfo
;
}
public
void
setGroupInfo
(
String
groupInfo
)
{
this
.
groupInfo
=
groupInfo
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
Integer
getDeleteFlag
()
{
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
return
deleteFlag
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/contact/listFollowCheckBO.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
.
bo
.
contact
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
listFollowCheckBO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
973688857967269974L
;
/**
* 会员id
*/
private
String
memberId
;
/**
* 导购id
*/
private
String
clerkId
;
/**
* 互动时间
*/
private
Date
followTime
;
public
listFollowCheckBO
()
{
}
public
listFollowCheckBO
(
String
memberId
,
String
clerkId
,
Date
followTime
)
{
this
.
memberId
=
memberId
;
this
.
clerkId
=
clerkId
;
this
.
followTime
=
followTime
;
}
public
String
getMemberId
()
{
return
memberId
;
}
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
memberId
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
Date
getFollowTime
()
{
return
followTime
;
}
public
void
setFollowTime
(
Date
followTime
)
{
this
.
followTime
=
followTime
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatPlanServiceImpl.java
View file @
4c1487ae
...
@@ -914,13 +914,17 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
...
@@ -914,13 +914,17 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
if
(
qwDTO
.
needOpenUserId3th
())
{
if
(
qwDTO
.
needOpenUserId3th
())
{
wxUserId
=
staff
.
getWxOpenUseId
()
;
wxUserId
=
staff
.
getWxOpenUseId
()
;
}
}
Long
sendTimeSec
=
sendTime
.
getTime
()
/
1000
;
// 发送到群
// 发送到群
List
<
QywxGroupMessageInfoDTO
>
msgList
=
this
.
queryGroupMsg
(
groupMsgChatType
,
startTime
,
endTime
,
qwDTO
,
wxUserId
);
List
<
QywxGroupMessageInfoDTO
>
msgList
=
this
.
queryGroupMsg
(
groupMsgChatType
,
startTime
,
endTime
,
qwDTO
,
wxUserId
);
if
(
CollectionUtils
.
isNotEmpty
(
msgList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
msgList
))
{
if
(
msgList
.
size
()==
0
)
{
if
(
msgList
.
size
()==
0
)
{
return
msgList
.
get
(
0
).
getMsgId
()
;
return
msgList
.
get
(
0
).
getMsgId
()
;
}
else
{
}
else
{
return
msgList
.
get
(
msgList
.
size
()-
1
).
getMsgId
()
;
return
msgList
.
stream
()
.
min
(
Comparator
.
comparingLong
(
msg
->
Math
.
abs
(
msg
.
getCreateTime
()
-
sendTimeSec
)))
.
map
(
QywxGroupMessageInfoDTO:
:
getMsgId
)
.
orElse
(
null
);
}
}
}
}
return
null
;
return
null
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/ContactConfigService.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
contact
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
public
interface
ContactConfigService
{
/**
* 保存建联配置
*
* @param contactConfig
*/
void
saveContactConfig
(
ContactConfigDTO
contactConfig
);
/**
* 获取建联配置
* @param enterpriseId
* @return
*/
ContactConfigDTO
getContactConfig
(
String
enterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/ContactLogService.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
contact
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.service.entity.contact.TabContactLog
;
import
com.gic.haoban.manage.service.entity.contact.TabContactLog
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ContactLogService
{
public
interface
ContactLogService
{
/**
* 是否可以建联判断
* @param enterpriseId
* @param memberId
* @param clerkDTO
* @return
*/
Integer
contactCheck
(
String
enterpriseId
,
String
memberId
,
ClerkDTO
clerkDTO
,
Integer
bizType
)
;
/**
/**
* 保存建联记录
* 保存建联记录
...
@@ -17,12 +28,24 @@ public interface ContactLogService {
...
@@ -17,12 +28,24 @@ public interface ContactLogService {
void
saveContactLog
(
ContactLogQDTO
qdto
)
throws
BusinessException
;
void
saveContactLog
(
ContactLogQDTO
qdto
)
throws
BusinessException
;
/**
/**
* 自动建联
* @param qdto
*/
void
autoContactLog
(
ContactLogQDTO
qdto
);
/**
* 同步建联
* @param qdto
*/
void
syncContactLog
(
ContactLogQDTO
qdto
);
/**
* 清除建联状态
* 清除建联状态
*
*
* @param memberId
* @param memberId
* @param clearType 1 消费清除 2 换绑主导购
* @param clearType 1 消费清除 2 换绑主导购
*/
*/
void
clearContactLog
(
String
memberId
,
Integer
clearType
,
String
clerkId
);
void
clearContactLog
(
String
enterpriseId
,
String
memberId
,
Integer
clearType
,
String
clerkId
);
/**
/**
* 获取最近一条有效建联记录
* 获取最近一条有效建联记录
...
@@ -33,10 +56,19 @@ public interface ContactLogService {
...
@@ -33,10 +56,19 @@ public interface ContactLogService {
TabContactLog
getClerkContactTime
(
String
memberId
);
TabContactLog
getClerkContactTime
(
String
memberId
);
/**
/**
* 根据时间获取最近一条建联记录
* 获取每个业务最近一条有效建联记录
* @param memberId
* @return
*/
List
<
TabContactLog
>
getClerkContactTimeList
(
String
memberId
);
/**
* 获取最近一条建联记录
* @param memberId
* @param memberId
* @param clerkId
* @param beginTime
* @param beginTime
* @param endTime
* @return
* @return
*/
*/
TabContactLog
getLastByTime
(
String
memberId
,
Date
beginTime
,
Date
endTime
);
Map
<
Integer
,
TabContactLog
>
getLastByTime
(
String
memberId
,
String
clerkId
,
Date
beginTime
,
Date
endTime
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/adaptor/ContactAdaptor.java
View file @
4c1487ae
...
@@ -23,6 +23,7 @@ import com.gic.haoban.app.customer.dto.contact.ContactParamDTO;
...
@@ -23,6 +23,7 @@ import com.gic.haoban.app.customer.dto.contact.ContactParamDTO;
import
com.gic.haoban.app.customer.dto.contact.ContactSumDTO
;
import
com.gic.haoban.app.customer.dto.contact.ContactSumDTO
;
import
com.gic.haoban.app.customer.service.api.service.CustomerApiService
;
import
com.gic.haoban.app.customer.service.api.service.CustomerApiService
;
import
com.gic.haoban.common.utils.DateUtil
;
import
com.gic.haoban.common.utils.DateUtil
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
com.gic.haoban.manage.service.dao.mapper.content.holo.HoloDataSource
;
import
com.gic.haoban.manage.service.dao.mapper.content.holo.HoloDataSource
;
import
com.gic.haoban.manage.service.pojo.bo.contact.ContactDataBO
;
import
com.gic.haoban.manage.service.pojo.bo.contact.ContactDataBO
;
import
com.gic.store.goods.dto.potential.PlatformPotentialCustomerOutDTO
;
import
com.gic.store.goods.dto.potential.PlatformPotentialCustomerOutDTO
;
...
@@ -178,6 +179,7 @@ public class ContactAdaptor {
...
@@ -178,6 +179,7 @@ public class ContactAdaptor {
ContactParamDTO
contact
=
new
ContactParamDTO
();
ContactParamDTO
contact
=
new
ContactParamDTO
();
contact
.
setRuleJSON
(
JSON
.
toJSONString
(
result
));
contact
.
setRuleJSON
(
JSON
.
toJSONString
(
result
));
contact
.
setContactType
(
0
);
contact
.
setContactType
(
0
);
contact
.
setBizType
(
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
());
params
.
setStoreId
(
storeId
);
params
.
setStoreId
(
storeId
);
params
.
setClerkId
(
clerkId
);
params
.
setClerkId
(
clerkId
);
params
.
setClerkType
(
clerkTypeStr
);
params
.
setClerkType
(
clerkTypeStr
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/impl/ContactConfigServiceImpl.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
contact
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
import
com.gic.haoban.manage.service.dao.mapper.contact.TabContactConfigMapper
;
import
com.gic.haoban.manage.service.entity.contact.TabContactConfig
;
import
com.gic.haoban.manage.service.service.contact.ContactConfigService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
@Service
(
"contactConfigService"
)
public
class
ContactConfigServiceImpl
implements
ContactConfigService
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ContactConfigService
.
class
);
@Autowired
private
TabContactConfigMapper
contactConfigMapper
;
@Override
public
void
saveContactConfig
(
ContactConfigDTO
contactConfig
)
{
logger
.
info
(
"保存联系配置信息:{}"
,
JSON
.
toJSONString
(
contactConfig
));
if
(
contactConfig
.
getContactAutoList
()
==
null
)
{
contactConfig
.
setContactAutoList
(
Collections
.
emptyList
());
}
if
(
contactConfig
.
getRemarkContentList
()
==
null
)
{
contactConfig
.
setRemarkContentList
(
Collections
.
emptyList
());
}
String
enterpriseId
=
contactConfig
.
getEnterpriseId
();
TabContactConfig
config
=
contactConfigMapper
.
queryByEnterpriseId
(
enterpriseId
);
if
(
config
!=
null
)
{
config
.
setRemarkFlag
(
contactConfig
.
getRemarkFlag
());
config
.
setContactAuto
(
contactConfig
.
getContactAutoList
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
config
.
setRemarkContent
(
JSON
.
toJSONString
(
contactConfig
.
getRemarkContentList
()));
contactConfigMapper
.
update
(
config
);
}
else
{
config
=
EntityUtil
.
changeEntityNew
(
TabContactConfig
.
class
,
contactConfig
);
config
.
setConfigId
(
UniqueIdUtils
.
uniqueLong
());
config
.
setContactAuto
(
contactConfig
.
getContactAutoList
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
config
.
setRemarkContent
(
JSON
.
toJSONString
(
contactConfig
.
getRemarkContentList
()));
contactConfigMapper
.
insert
(
config
);
}
}
@Override
public
ContactConfigDTO
getContactConfig
(
String
enterpriseId
)
{
TabContactConfig
config
=
contactConfigMapper
.
queryByEnterpriseId
(
enterpriseId
);
if
(
config
==
null
)
{
return
null
;
}
ContactConfigDTO
contactConfigDTO
=
EntityUtil
.
changeEntityNew
(
ContactConfigDTO
.
class
,
config
);
List
<
Integer
>
contactAutoList
=
Optional
.
ofNullable
(
config
.
getContactAuto
())
.
filter
(
StringUtils:
:
isNotBlank
)
.
map
(
s
->
Arrays
.
stream
(
s
.
split
(
","
)).
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
()))
.
orElse
(
Collections
.
emptyList
());
contactConfigDTO
.
setContactAutoList
(
contactAutoList
);
List
<
String
>
remarkContentList
=
Optional
.
ofNullable
(
config
.
getRemarkContent
())
.
filter
(
StringUtils:
:
isNotBlank
)
.
map
(
x
->
JSONArray
.
parseArray
(
x
,
String
.
class
))
.
orElse
(
Collections
.
emptyList
());
contactConfigDTO
.
setRemarkContentList
(
remarkContentList
);
return
contactConfigDTO
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/impl/ContactFollowServiceImpl.java
View file @
4c1487ae
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
;
...
@@ -8,16 +10,23 @@ import com.gic.api.base.commons.ServiceResponse;
...
@@ -8,16 +10,23 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.clerk.api.dto.ClerkDTO
;
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.
PageHelperUtils
;
import
com.gic.commons.util.
GICMQClientUtil
;
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
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
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.pojo.bo.contact.listFollowCheckBO
;
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.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
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
...
@@ -38,12 +47,18 @@ public class ContactFollowServiceImpl implements ContactFollowService {
...
@@ -38,12 +47,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
)
{
...
@@ -60,6 +75,8 @@ public class ContactFollowServiceImpl implements ContactFollowService {
...
@@ -60,6 +75,8 @@ public class ContactFollowServiceImpl implements ContactFollowService {
if
(
CollectionUtils
.
isEmpty
(
clerks
))
{
if
(
CollectionUtils
.
isEmpty
(
clerks
))
{
return
;
return
;
}
}
String
enterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
Integer
followType
=
list
.
get
(
0
).
getFollowType
();
Map
<
String
,
ClerkDTO
>
clerkMap
=
clerks
.
stream
().
collect
(
Collectors
.
toMap
(
ClerkDTO:
:
getClerkId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
Map
<
String
,
ClerkDTO
>
clerkMap
=
clerks
.
stream
().
collect
(
Collectors
.
toMap
(
ClerkDTO:
:
getClerkId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
List
<
TabContactFollow
>
followList
=
list
.
stream
().
map
(
follow
->
{
List
<
TabContactFollow
>
followList
=
list
.
stream
().
map
(
follow
->
{
TabContactFollow
contactFollow
=
EntityUtil
.
changeEntityNew
(
TabContactFollow
.
class
,
follow
);
TabContactFollow
contactFollow
=
EntityUtil
.
changeEntityNew
(
TabContactFollow
.
class
,
follow
);
...
@@ -76,36 +93,192 @@ public class ContactFollowServiceImpl implements ContactFollowService {
...
@@ -76,36 +93,192 @@ public class ContactFollowServiceImpl implements ContactFollowService {
contactFollow
.
setGoodsInfo
(
JSON
.
toJSONString
(
follow
.
getGoodsInfoList
()));
contactFollow
.
setGoodsInfo
(
JSON
.
toJSONString
(
follow
.
getGoodsInfoList
()));
}
}
// 兼容不传followType的老版本
// 兼容不传followType的老版本
Integer
followType
=
contactFollow
.
getFollowType
();
Integer
followType
Old
=
contactFollow
.
getFollowType
();
if
(
followType
==
null
)
{
if
(
followType
Old
==
null
)
{
ContactFollowTypeEnum
followTypeEnum
=
ContactFollowTypeEnum
.
fromTextMatch
(
contactFollow
.
getFollowRemark
());
ContactFollowTypeEnum
followTypeEnum
=
ContactFollowTypeEnum
.
fromTextMatch
(
contactFollow
.
getFollowRemark
());
followType
=
Optional
.
ofNullable
(
followTypeEnum
).
map
(
ContactFollowTypeEnum:
:
getCode
).
orElse
(
ContactFollowTypeEnum
.
CONTACT
.
getCode
());
followType
Old
=
Optional
.
ofNullable
(
followTypeEnum
).
map
(
ContactFollowTypeEnum:
:
getCode
).
orElse
(
ContactFollowTypeEnum
.
CONTACT
.
getCode
());
contactFollow
.
setFollowType
(
followType
);
contactFollow
.
setFollowType
(
followType
Old
);
}
}
return
contactFollow
;
return
contactFollow
;
}).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
}).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
// 解决企微群发重复调用问题
if
(
Objects
.
equals
(
followType
,
ContactFollowTypeEnum
.
WECHAT_GROUP_SEND
.
getCode
()))
{
logger
.
info
(
"企微群发重复调用校验"
);
List
<
listFollowCheckBO
>
checkList
=
followList
.
stream
().
map
(
x
->
new
listFollowCheckBO
(
x
.
getMemberId
(),
x
.
getClerkId
(),
x
.
getFollowTime
())).
collect
(
Collectors
.
toList
());
List
<
String
>
checkMemberIdList
=
contactFollowMapper
.
listFollowCheck
(
enterpriseId
,
checkList
);
logger
.
info
(
"企微群发重复调用:{}"
,
JSON
.
toJSONString
(
checkMemberIdList
));
if
(
CollectionUtils
.
isNotEmpty
(
checkMemberIdList
))
{
followList
=
followList
.
stream
().
filter
(
x
->
checkMemberIdList
.
contains
(
x
.
getMemberId
())).
collect
(
Collectors
.
toList
());
}
}
if
(
CollectionUtils
.
isEmpty
(
followList
))
{
return
;
}
contactFollowMapper
.
insertBatch
(
followList
);
contactFollowMapper
.
insertBatch
(
followList
);
// 部分跟进发送自动建联
autoContactSend
(
followList
);
}
private
void
autoContactSend
(
List
<
TabContactFollow
>
followList
)
{
// 自动建联
Integer
followType
=
followList
.
get
(
0
).
getFollowType
();
Integer
contactAutoType
=
ContactFollowTypeEnum
.
fromCode
(
followType
).
getContactAutoType
();
if
(
contactAutoType
!=
null
)
{
List
<
String
>
message
=
followList
.
stream
().
map
(
x
->
{
ContactLogQDTO
contactLogQDTO
=
new
ContactLogQDTO
();
contactLogQDTO
.
setMemberId
(
x
.
getMemberId
());
contactLogQDTO
.
setClerkId
(
x
.
getClerkId
());
contactLogQDTO
.
setEnterpriseId
(
x
.
getEnterpriseId
());
contactLogQDTO
.
setContactAutoType
(
contactAutoType
);
contactLogQDTO
.
setBizType
(
x
.
getSourceType
());
contactLogQDTO
.
setSourceType
(
x
.
getSourceType
());
return
JSON
.
toJSONString
(
contactLogQDTO
);
}).
collect
(
Collectors
.
toList
());
String
routerName
=
"autoContactLogForMQ"
;
try
{
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
clientInstance
.
sendBatchMessages
(
routerName
,
message
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送错误!路由规则名称:"
+
routerName
+
",message:"
+
message
,
e
);
}
message
.
clear
();
}
}
}
@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
=
500
;
int
pageSize
=
pageInfo
.
getPageSize
();
int
pageNum
=
pageInfo
.
getPageNum
();
int
totalPage
=
(
int
)
Math
.
ceil
((
double
)
totalCount
/
pageSize
);
int
fromIndex
=
Math
.
max
((
pageNum
-
1
)
*
pageSize
,
0
);
fromIndex
=
Math
.
min
(
fromIndex
,
list
.
size
());
int
toIndex
=
Math
.
min
(
fromIndex
+
pageSize
,
totalCount
);
toIndex
=
Math
.
min
(
toIndex
,
list
.
size
());
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
.
setPageSize
(
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
).
toJdkDate
(),
DateUtil
.
endOfDay
(
date
).
toJdkDate
(),
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
.
getTextMatch
());
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
.
getTextMatch
());
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
).
toJdkDate
(),
DateUtil
.
endOfDay
(
date
).
toJdkDate
(),
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/java/com/gic/haoban/manage/service/service/contact/impl/ContactLogServiceImpl.java
View file @
4c1487ae
...
@@ -3,35 +3,59 @@ package com.gic.haoban.manage.service.service.contact.impl;
...
@@ -3,35 +3,59 @@ package com.gic.haoban.manage.service.service.contact.impl;
import
cn.hutool.core.date.*
;
import
cn.hutool.core.date.*
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.Constant
;
import
com.gic.api.base.commons.Constant
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
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.GICMQClientUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.constant.EnterpriseServiceEnum
;
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.CustomerDTO
;
import
com.gic.haoban.app.customer.dto.MemberInfoListParamsDTO
;
import
com.gic.haoban.app.customer.dto.contact.ContactParamDTO
;
import
com.gic.haoban.app.customer.dto.contact.ContactSumDTO
;
import
com.gic.haoban.app.customer.service.api.service.CustomerApiService
;
import
com.gic.haoban.app.objectives.api.service.ObjectivesManageApiService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactLogDTO
;
import
com.gic.haoban.manage.api.enums.contact.ContactAutoTypeEnum
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
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.dao.mapper.contact.TabContactLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.contact.TabContactLogMapper
;
import
com.gic.haoban.manage.service.entity.contact.TabContactFollow
;
import
com.gic.haoban.manage.service.entity.contact.TabContactLog
;
import
com.gic.haoban.manage.service.entity.contact.TabContactLog
;
import
com.gic.haoban.manage.service.service.ESMemberInfoService
;
import
com.gic.haoban.manage.service.service.contact.ContactConfigService
;
import
com.gic.haoban.manage.service.service.contact.ContactFollowService
;
import
com.gic.haoban.manage.service.service.contact.ContactFollowService
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.content.adaptor.EnterpriseAdaptor
;
import
com.gic.member.api.dto.MemberStoreClerkDTO
;
import
com.gic.member.api.dto.MemberStoreClerkDTO
;
import
com.gic.member.api.dto.MemberStoreDTO
;
import
com.gic.member.api.dto.es.MemberDataDTO
;
import
com.gic.member.api.service.MemberService
;
import
com.gic.member.api.service.MemberService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.search.engine.api.dto.ESResponse
;
import
com.gic.search.engine.api.dto.ESResponse
;
import
com.gic.search.engine.api.dto.dynamic.DynamicDocDTO
;
import
com.gic.search.engine.api.dto.dynamic.DynamicDocDTO
;
import
com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService
;
import
com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService
;
import
com.gic.store.goods.service.StoreGoodsService
;
import
com.gic.store.goods.service.StoreGoodsService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
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
java.util.Date
;
import
java.util.*
;
import
java.util.Objects
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
@Service
(
"contactLogService"
)
@Service
(
"contactLogService"
)
public
class
ContactLogServiceImpl
implements
ContactLogService
{
public
class
ContactLogServiceImpl
implements
ContactLogService
{
...
@@ -41,6 +65,12 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -41,6 +65,12 @@ public class ContactLogServiceImpl implements ContactLogService {
@Autowired
@Autowired
private
TabContactLogMapper
contactLogMapper
;
private
TabContactLogMapper
contactLogMapper
;
@Autowired
@Autowired
private
TabContactFollowMapper
contactFollowMapper
;
@Autowired
private
ContactConfigService
contactConfigService
;
@Autowired
private
ContactFollowService
contactFollowService
;
@Autowired
private
StoreGoodsService
storeGoodsService
;
private
StoreGoodsService
storeGoodsService
;
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
...
@@ -49,17 +79,105 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -49,17 +79,105 @@ public class ContactLogServiceImpl implements ContactLogService {
@Autowired
@Autowired
private
MemberService
memberService
;
private
MemberService
memberService
;
@Autowired
@Autowired
private
CustomerApiService
customerApiService
;
@Autowired
private
ObjectivesManageApiService
objectivesManageApiService
;
@Autowired
private
ESDataDynamicOperationApiService
esDataDynamicOperationApiService
;
private
ESDataDynamicOperationApiService
esDataDynamicOperationApiService
;
@Autowired
private
ESMemberInfoService
esMemberInfoService
;
@Autowired
private
EnterpriseAdaptor
enterpriseAdaptor
;
@Override
public
Integer
contactCheck
(
String
enterpriseId
,
String
memberId
,
ClerkDTO
clerkDTO
,
Integer
bizType
)
{
if
(
clerkDTO
==
null
)
{
return
null
;
}
CustomerDTO
params
=
new
CustomerDTO
();
int
clerkType
=
clerkDTO
.
getClerkType
();
if
(
clerkType
>=
2
)
{
return
null
;
}
String
clerkId
=
clerkDTO
.
getClerkId
();
String
storeId
=
""
;
if
(
clerkType
==
0
||
clerkType
==
1
)
{
storeId
=
clerkDTO
.
getStoreId
();
}
params
.
setClerkType
(
clerkType
+
""
);
params
.
setSearchParams
(
""
);
params
.
setStoreId
(
storeId
);
params
.
setClerkId
(
clerkId
);
params
.
setEnterpriseId
(
enterpriseId
);
if
(
bizType
!=
null
&&
!
Objects
.
equals
(
bizType
,-
1
))
{
boolean
checkPotential
=
checkPotential
(
memberId
,
params
,
bizType
);
return
!
checkPotential
?
null
:
bizType
;
}
else
{
boolean
checkPotential
=
checkPotential
(
memberId
,
params
,
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
());
if
(
checkPotential
)
{
return
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
();
}
checkPotential
=
checkPotential
(
memberId
,
params
,
ContactBizTypeEnum
.
OPPORTUNITY_CUSTOMER
.
getType
());
if
(
checkPotential
)
{
return
ContactBizTypeEnum
.
OPPORTUNITY_CUSTOMER
.
getType
();
}
}
return
null
;
}
private
boolean
checkPotential
(
String
memberId
,
CustomerDTO
params
,
Integer
bizType
)
{
boolean
hasRight
=
enterpriseAdaptor
.
checkEnterpriseHasRightByContactBizType
(
params
.
getEnterpriseId
(),
bizType
);
if
(!
hasRight
)
{
return
false
;
}
ContactParamDTO
contact
=
new
ContactParamDTO
();
// 搜索信息
MemberInfoListParamsDTO
memberInfoListParamsDTO
=
com
.
gic
.
haoban
.
common
.
utils
.
StringUtil
.
getBean
(
"{}"
,
MemberInfoListParamsDTO
.
class
);
if
(
Objects
.
equals
(
bizType
,
ContactBizTypeEnum
.
OPPORTUNITY_CUSTOMER
.
getType
()))
{
memberInfoListParamsDTO
.
setCrowdClerkId
(
params
.
getClerkId
());
memberInfoListParamsDTO
.
setCrowdType
(-
1
);
memberInfoListParamsDTO
.
setMemberType
(
4
);
}
memberInfoListParamsDTO
.
setMemberId
(
memberId
);
contact
.
setContactType
(
0
);
contact
.
setBizType
(
bizType
);
params
.
setContactParamDTO
(
contact
);
ServiceResponse
<
ContactSumDTO
>
noContactResponse
=
customerApiService
.
contactMemberSum
(
new
BasePageInfo
(),
params
,
memberInfoListParamsDTO
);
if
(
noContactResponse
.
isSuccess
()
&&
noContactResponse
.
getResult
()
!=
null
)
{
if
(
noContactResponse
.
getResult
().
getTotalCount
()
>
0
)
{
return
true
;
}
}
contact
.
setContactType
(
1
);
params
.
setContactParamDTO
(
contact
);
ServiceResponse
<
ContactSumDTO
>
contactResponse
=
customerApiService
.
contactMemberSum
(
new
BasePageInfo
(),
params
,
memberInfoListParamsDTO
);
if
(
contactResponse
.
isSuccess
()
&&
contactResponse
.
getResult
()
!=
null
)
{
if
(
contactResponse
.
getResult
().
getTotalCount
()
>
0
)
{
return
true
;
}
}
return
false
;
}
@Override
@Override
public
void
saveContactLog
(
ContactLogQDTO
qdto
)
throws
BusinessException
{
public
void
saveContactLog
(
ContactLogQDTO
qdto
)
throws
BusinessException
{
logger
.
info
(
"保存建联记录:{}"
,
JSON
.
toJSONString
(
qdto
));
logger
.
info
(
"保存建联记录:{}"
,
JSON
.
toJSONString
(
qdto
));
String
enterpriseId
=
qdto
.
getEnterpriseId
();
String
enterpriseId
=
qdto
.
getEnterpriseId
();
boolean
hasRight
=
enterpriseAdaptor
.
checkEnterpriseHasRightByContactBizType
(
qdto
.
getEnterpriseId
(),
qdto
.
getBizType
());
if
(!
hasRight
)
{
logger
.
info
(
"无服务权限"
);
throw
new
BusinessException
(
"-1"
,
"无服务权限"
);
}
String
storeId
=
qdto
.
getStoreId
();
String
storeId
=
qdto
.
getStoreId
();
String
clerkId
=
qdto
.
getClerkId
();
String
clerkId
=
qdto
.
getClerkId
();
String
memberId
=
qdto
.
getMemberId
();
String
memberId
=
qdto
.
getMemberId
();
DateTime
date
=
DateUtil
.
date
();
Integer
contactAutoType
=
qdto
.
getContactAutoType
();
Integer
followType
=
qdto
.
getFollowType
();
Integer
bizType
=
qdto
.
getBizType
();
Integer
sourceType
=
qdto
.
getSourceType
();
Long
sourceLogId
=
qdto
.
getSourceLogId
();
Date
date
=
qdto
.
getSyncContactTime
()
!=
null
?
qdto
.
getSyncContactTime
()
:
DateUtil
.
date
();
MemberStoreClerkDTO
memberStoreClerk
=
memberService
.
getMemberStoreClerk
(
memberId
);
MemberStoreClerkDTO
memberStoreClerk
=
memberService
.
getMemberStoreClerk
(
memberId
);
if
(
memberStoreClerk
==
null
)
{
if
(
memberStoreClerk
==
null
)
{
logger
.
info
(
"无专属导购无法建联"
);
logger
.
info
(
"无专属导购无法建联"
);
...
@@ -70,14 +188,25 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -70,14 +188,25 @@ public class ContactLogServiceImpl implements ContactLogService {
logger
.
info
(
"非专属导购无法建联"
);
logger
.
info
(
"非专属导购无法建联"
);
throw
new
BusinessException
(
"-1"
,
"非专属导购无法建联"
);
throw
new
BusinessException
(
"-1"
,
"非专属导购无法建联"
);
}
}
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
// 建联校验
Integer
contactCheck
=
contactCheck
(
enterpriseId
,
memberId
,
clerkDTO
,
bizType
);
logger
.
info
(
"非未建联或建联未转化:{}"
,
contactCheck
);
if
(
contactCheck
==
null
)
{
throw
new
BusinessException
(
"-1"
,
"非未建联或建联未转化,无法建联"
);
}
bizType
=
contactCheck
;
// 是否周期内首次建联 同周期内是否有记录
// 是否周期内首次建联 同周期内是否有记录
Integer
contactCycle
=
1
;
Integer
contactCycle
=
1
;
// 建联周期 14天内同周期/14天以上周期+1
// 建联周期 14天内同周期/14天以上周期+1
Integer
contactCycleFirst
=
Constant
.
FLAG_TRUE
;
Integer
contactCycleFirst
=
Constant
.
FLAG_TRUE
;
TabContactLog
lastContactLog
=
contactLogMapper
.
queryLastLog
(
memberId
,
clerkId
,
null
,
null
);
Map
<
Integer
,
TabContactLog
>
contactLogMap
=
getLastByTime
(
memberId
,
clerkId
,
null
,
null
);
TabContactLog
lastContactLog
=
contactLogMap
.
get
(
bizType
);
Date
lastContactTime
=
null
;
if
(
lastContactLog
!=
null
)
{
if
(
lastContactLog
!=
null
)
{
Date
contactTime
=
lastContactLog
.
getContactTime
();
lastContactTime
=
lastContactLog
.
getContactTime
();
if
(
DateUtil
.
between
(
date
,
contactTime
,
DateUnit
.
SECOND
)
>
14
*
24
*
60
*
60
)
{
Integer
contactOrderLimitDay
=
getContactOrderLimitDay
(
lastContactTime
);
if
(
DateUtil
.
between
(
date
,
lastContactTime
,
DateUnit
.
SECOND
)
>
contactOrderLimitDay
*
24
*
60
*
60
)
{
contactCycle
=
lastContactLog
.
getContactCycle
()
+
1
;
contactCycle
=
lastContactLog
.
getContactCycle
()
+
1
;
}
else
{
}
else
{
contactCycle
=
lastContactLog
.
getContactCycle
();
contactCycle
=
lastContactLog
.
getContactCycle
();
...
@@ -85,14 +214,18 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -85,14 +214,18 @@ public class ContactLogServiceImpl implements ContactLogService {
}
}
}
}
logger
.
info
(
"建联周期:{},是否周期内首次:{}"
,
contactCycle
,
contactCycleFirst
);
logger
.
info
(
"建联周期:{},是否周期内首次:{}"
,
contactCycle
,
contactCycleFirst
);
// 获取当前建联时间和上一次建联时间之间的跟进类型
String
followTypes
=
contactFollowMapper
.
getFollowTypes
(
enterpriseId
,
clerkId
,
memberId
,
lastContactTime
,
date
);
TabContactLog
contactLog
=
new
TabContactLog
();
TabContactLog
contactLog
=
new
TabContactLog
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
contactLog
.
setFollowTypes
(
followTypes
);
contactLog
.
setClerkId
(
clerkId
);
contactLog
.
setClerkId
(
clerkId
);
contactLog
.
setStoreId
(
storeId
);
contactLog
.
setStoreId
(
storeId
);
if
(
clerkDTO
!=
null
)
{
if
(
clerkDTO
!=
null
)
{
storeId
=
clerkDTO
.
getStoreId
();
contactLog
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
contactLog
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
contactLog
.
setClerkName
(
clerkDTO
.
getClerkName
());
contactLog
.
setClerkName
(
clerkDTO
.
getClerkName
());
contactLog
.
setStoreId
(
storeId
);
}
}
if
(
StringUtils
.
isNotBlank
(
storeId
))
{
if
(
StringUtils
.
isNotBlank
(
storeId
))
{
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
...
@@ -100,7 +233,13 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -100,7 +233,13 @@ public class ContactLogServiceImpl implements ContactLogService {
contactLog
.
setStoreCode
(
store
.
getStoreCode
());
contactLog
.
setStoreCode
(
store
.
getStoreCode
());
}
}
}
}
contactLog
.
setLogId
(
UniqueIdUtils
.
uniqueLong
());
JSONObject
jsonObject
=
esMemberInfoService
.
queryDataSingle
(
enterpriseId
,
memberId
,
"potentialScore"
);
if
(
jsonObject
!=
null
&&
jsonObject
.
getInteger
(
"potentialScore"
)
!=
null
)
{
contactLog
.
setPotentialScore
(
jsonObject
.
getInteger
(
"potentialScore"
));
}
Long
logId
=
UniqueIdUtils
.
uniqueLong
();
Long
bizId
=
qdto
.
getSourceLogId
()
!=
null
?
qdto
.
getSourceLogId
()
:
logId
;
contactLog
.
setLogId
(
logId
);
contactLog
.
setMemberId
(
memberId
);
contactLog
.
setMemberId
(
memberId
);
contactLog
.
setContactStatus
(
Constant
.
FLAG_TRUE
);
contactLog
.
setContactStatus
(
Constant
.
FLAG_TRUE
);
contactLog
.
setContactTime
(
date
);
contactLog
.
setContactTime
(
date
);
...
@@ -108,45 +247,199 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -108,45 +247,199 @@ public class ContactLogServiceImpl implements ContactLogService {
contactLog
.
setContactCycleFirst
(
contactCycleFirst
);
contactLog
.
setContactCycleFirst
(
contactCycleFirst
);
// 成为潜客时间 无用暂不写
// 成为潜客时间 无用暂不写
contactLog
.
setPotentialTime
(
null
);
contactLog
.
setPotentialTime
(
null
);
contactLog
.
setSourceType
(
sourceType
==
null
?
bizType
:
sourceType
);
contactLog
.
setBizType
(
bizType
);
contactLog
.
setEnterpriseId
(
enterpriseId
);
contactLog
.
setEnterpriseId
(
enterpriseId
);
contactLog
.
setSourceLogId
(
sourceLogId
);
contactLogMapper
.
insert
(
contactLog
);
contactLogMapper
.
insert
(
contactLog
);
// 刷新es建联时间
// 刷新es建联时间
Long
clerkContactTime
=
Long
.
parseLong
(
DateUtil
.
format
(
date
,
DatePattern
.
PURE_DATETIME_PATTERN
));
Long
clerkContactTime
=
Long
.
parseLong
(
DateUtil
.
format
(
date
,
DatePattern
.
PURE_DATETIME_PATTERN
));
refreshContactTime
(
enterpriseId
,
memberId
,
clerkContactTime
);
refreshContactTime
(
enterpriseId
,
memberId
);
// 建联跟进记录
String
followRemark
=
qdto
.
getFollowRemark
();
if
(
StringUtils
.
isNotBlank
(
followRemark
))
{
ContactFollowQDTO
followQDTO
=
EntityUtil
.
changeEntityNew
(
ContactFollowQDTO
.
class
,
qdto
);
followQDTO
.
setFollowType
(
followType
);
followQDTO
.
setFollowTime
(
date
);
followQDTO
.
setBizId
(
String
.
valueOf
(
bizId
));
contactFollowService
.
saveFollow
(
followQDTO
);
}
// 同步建联
if
(!
Objects
.
equals
(
qdto
.
getSyncContactType
(),
Constant
.
FLAG_TRUE
))
{
syncContactSend
(
contactLog
,
followRemark
);
}
// 冗余机会人群数据
if
(
Objects
.
equals
(
bizType
,
ContactBizTypeEnum
.
OPPORTUNITY_CUSTOMER
.
getType
()))
{
modifyBizData
(
memberId
,
clerkId
,
enterpriseId
,
logId
);
}
}
/**
* 冗余机会人群数据
* @param memberId
* @param clerkId
* @param enterpriseId
* @param logId
*/
private
void
modifyBizData
(
String
memberId
,
String
clerkId
,
String
enterpriseId
,
Long
logId
)
{
try
{
ServiceResponse
<
List
<
String
>>
crowdTypeResponse
=
objectivesManageApiService
.
getMemberCrowdType
(
memberId
,
clerkId
,
enterpriseId
);
List
<
String
>
result
=
crowdTypeResponse
.
getResult
();
String
jsonString
=
JSON
.
toJSONString
(
result
);
logger
.
info
(
"机会人群数据:{}"
,
jsonString
);
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
TabContactLog
modifyContactLog
=
new
TabContactLog
();
modifyContactLog
.
setLogId
(
logId
);
modifyContactLog
.
setBizData
(
jsonString
);
contactLogMapper
.
update
(
modifyContactLog
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"冗余人群数据错误!"
,
e
);
}
}
private
void
syncContactSend
(
TabContactLog
contactLog
,
String
followRemark
)
{
// 同步建联
ContactLogQDTO
contactLogQDTO
=
EntityUtil
.
changeEntityNew
(
ContactLogQDTO
.
class
,
contactLog
);
contactLogQDTO
.
setSyncContactType
(
Constant
.
FLAG_TRUE
);
contactLogQDTO
.
setSyncContactTime
(
contactLog
.
getContactTime
());
contactLogQDTO
.
setContactAutoType
(
null
);
contactLogQDTO
.
setFollowRemark
(
followRemark
);
contactLogQDTO
.
setSourceLogId
(
contactLog
.
getLogId
());
String
message
=
JSON
.
toJSONString
(
contactLogQDTO
);
String
routerName
=
"autoContactLogForMQ"
;
try
{
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
clientInstance
.
sendMessage
(
routerName
,
message
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送错误!路由规则名称:"
+
routerName
+
",message:"
+
message
,
e
);
}
}
/**
* 历史数据超过14天建联未转化的按14天周期
* @param contactTime
* @return
*/
private
Integer
getContactOrderLimitDay
(
Date
contactTime
)
{
Integer
contactOrderLimitDay
=
Manage3Constants
.
CONTACT_ORDER_LIMIT_DAY
;
if
(
DateUtil
.
compare
(
Manage3Constants
.
CONTACT_FIX_RELEASE_DATE
,
contactTime
)
>
0
&&
DateUtil
.
between
(
Manage3Constants
.
CONTACT_FIX_RELEASE_DATE
,
contactTime
,
DateUnit
.
SECOND
)
>
14
*
24
*
60
*
60
)
{
contactOrderLimitDay
=
14
;
}
logger
.
info
(
"建联未转化计算天数:{}"
,
contactOrderLimitDay
);
return
contactOrderLimitDay
;
}
}
@Override
@Override
public
void
clearContactLog
(
String
memberId
,
Integer
clearType
,
String
clerkId
)
{
public
void
autoContactLog
(
ContactLogQDTO
qdto
)
{
logger
.
info
(
"清除建联状态:{},clearType:{},clerkId:{}"
,
memberId
,
clearType
,
clerkId
);
if
(
qdto
==
null
)
{
TabContactLog
lastContactLog
=
contactLogMapper
.
queryLastLog
(
memberId
,
null
,
null
,
null
);
if
(
lastContactLog
==
null
)
{
return
;
return
;
}
}
// clearType 1 消费清除 2 换绑主导购(不清除表建联状态)
String
enterpriseId
=
qdto
.
getEnterpriseId
();
if
(
Objects
.
equals
(
clearType
,
1
))
{
Integer
contactAutoType
=
qdto
.
getContactAutoType
();
TabContactLog
update
=
new
TabContactLog
();
ContactConfigDTO
contactConfig
=
contactConfigService
.
getContactConfig
(
enterpriseId
);
update
.
setLogId
(
lastContactLog
.
getLogId
());
if
(
contactConfig
==
null
)
{
update
.
setContactStatus
(
Constant
.
FLAG_FALSE
);
return
;
contactLogMapper
.
update
(
update
);
}
}
else
if
(
Objects
.
equals
(
clearType
,
2
))
{
List
<
Integer
>
contactAutoList
=
contactConfig
.
getContactAutoList
();
String
lastClerkId
=
lastContactLog
.
getClerkId
();
if
(
CollectionUtils
.
isEmpty
(
contactAutoList
)
||
!
contactAutoList
.
contains
(
contactAutoType
))
{
if
(
Objects
.
equals
(
lastClerkId
,
clerkId
))
{
logger
.
info
(
"无法自动建联:{},{}"
,
contactAutoType
,
contactAutoList
);
logger
.
info
(
"最后一次建联和换绑导购一致则不清除建联"
);
return
;
return
;
}
logger
.
info
(
"自动建联:{}"
,
JSON
.
toJSONString
(
qdto
));
for
(
ContactBizTypeEnum
bizTypeEnum
:
ContactBizTypeEnum
.
values
())
{
try
{
qdto
.
setBizType
(
bizTypeEnum
.
getType
());
qdto
.
setFollowType
(
ContactFollowTypeEnum
.
AUTO_CONTACT
.
getCode
());
qdto
.
setFollowRemark
(
"因"
+
ContactAutoTypeEnum
.
fromCode
(
contactAutoType
).
getDescription
()
+
",系统自动标记了建联"
);
saveContactLog
(
qdto
);
}
catch
(
BusinessException
e
)
{
logger
.
info
(
"自动建联异常:{}"
,
e
.
getMessage
());
}
return
;
}
}
@Override
public
void
syncContactLog
(
ContactLogQDTO
qdto
)
{
if
(
qdto
==
null
)
{
return
;
}
Integer
sourceType
=
qdto
.
getSourceType
();
if
(
Objects
.
isNull
(
sourceType
))
{
return
;
}
logger
.
info
(
"同步建联:{}"
,
JSON
.
toJSONString
(
qdto
));
Integer
bizType
=
qdto
.
getBizType
();
for
(
ContactBizTypeEnum
bizTypeEnum
:
ContactBizTypeEnum
.
values
())
{
Integer
syncBizType
=
bizTypeEnum
.
getType
();
if
(
Objects
.
equals
(
bizType
,
syncBizType
))
{
continue
;
}
ContactLogQDTO
syncQdto
=
EntityUtil
.
changeEntityNew
(
ContactLogQDTO
.
class
,
qdto
);
syncQdto
.
setSyncContactType
(
Constant
.
FLAG_TRUE
);
syncQdto
.
setBizType
(
syncBizType
);
syncQdto
.
setSourceType
(
sourceType
);
try
{
saveContactLog
(
syncQdto
);
}
catch
(
BusinessException
e
)
{
logger
.
info
(
"同步建联异常:{}"
,
e
.
getMessage
());
}
}
}
}
// 清除es建联时间 -1
refreshContactTime
(
lastContactLog
.
getEnterpriseId
(),
memberId
,
-
1L
);
}
}
private
void
refreshContactTime
(
String
enterpriseId
,
String
memberId
,
Long
contactTime
)
{
@Override
public
void
clearContactLog
(
String
enterpriseId
,
String
memberId
,
Integer
clearType
,
String
clerkId
)
{
logger
.
info
(
"清除建联状态:{},clearType:{},clerkId:{}"
,
memberId
,
clearType
,
clerkId
);
Map
<
Integer
,
TabContactLog
>
contactLogMap
=
getLastByTime
(
memberId
,
null
,
null
,
null
);
if
(
contactLogMap
==
null
||
contactLogMap
.
isEmpty
())
{
return
;
}
contactLogMap
.
forEach
((
k
,
v
)->{
// clearType 1 消费清除 2 换绑主导购(不清除表建联状态)
if
(
Objects
.
equals
(
clearType
,
1
))
{
TabContactLog
update
=
new
TabContactLog
();
update
.
setLogId
(
v
.
getLogId
());
update
.
setContactStatus
(
Constant
.
FLAG_FALSE
);
contactLogMapper
.
update
(
update
);
}
else
if
(
Objects
.
equals
(
clearType
,
2
))
{
String
lastClerkId
=
v
.
getClerkId
();
if
(
Objects
.
equals
(
lastClerkId
,
clerkId
))
{
logger
.
info
(
"最后一次建联和换绑导购一致则不清除建联"
);
return
;
}
}
// 清除es建联时间
refreshContactTime
(
enterpriseId
,
memberId
);
});
}
private
void
refreshContactTime
(
String
enterpriseId
,
String
memberId
)
{
JSONObject
memberJO
=
esMemberInfoService
.
queryDataSingle
(
enterpriseId
,
memberId
,
"clerkChannelContactTime"
);
if
(
memberJO
==
null
)
{
return
;
}
List
<
Long
>
clerkContactTimeList
=
memberJO
.
getObject
(
"clerkChannelContactTime"
,
new
TypeReference
<
List
<
Long
>>(){});
if
(
clerkContactTimeList
==
null
)
{
clerkContactTimeList
=
new
ArrayList
<>();
}
List
<
TabContactLog
>
list
=
getClerkContactTimeList
(
memberId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
ContactLogDTO
>
dtos
=
EntityUtil
.
changeEntityListNew
(
ContactLogDTO
.
class
,
list
);
clerkContactTimeList
=
ContactBizTypeEnum
.
getEsClerkContactTimeList
(
dtos
);
}
else
{
clerkContactTimeList
=
new
ArrayList
<>();
}
logger
.
info
(
"刷新建联时间:{},memberId:{}"
,
clerkContactTimeList
,
memberId
);
DynamicDocDTO
dynamicDocDTO
=
new
DynamicDocDTO
();
DynamicDocDTO
dynamicDocDTO
=
new
DynamicDocDTO
();
dynamicDocDTO
.
setEnterpriseId
(
enterpriseId
);
dynamicDocDTO
.
setEnterpriseId
(
enterpriseId
);
dynamicDocDTO
.
setColumnCategoryCode
(
"member"
);
dynamicDocDTO
.
setColumnCategoryCode
(
"member"
);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"id"
,
memberId
);
jsonObject
.
put
(
"id"
,
memberId
);
jsonObject
.
put
(
"memberId"
,
memberId
);
jsonObject
.
put
(
"memberId"
,
memberId
);
jsonObject
.
put
(
"clerkC
ontactTime"
,
contactTime
);
jsonObject
.
put
(
"clerkC
hannelContactTime"
,
clerkContactTimeList
);
dynamicDocDTO
.
setDocJson
(
jsonObject
);
dynamicDocDTO
.
setDocJson
(
jsonObject
);
dynamicDocDTO
.
setRefresh
(
Constant
.
FLAG_TRUE
);
dynamicDocDTO
.
setRefresh
(
Constant
.
FLAG_TRUE
);
ESResponse
res
=
esDataDynamicOperationApiService
.
updateDataSingle
(
dynamicDocDTO
,
false
);
ESResponse
res
=
esDataDynamicOperationApiService
.
updateDataSingle
(
dynamicDocDTO
,
false
);
...
@@ -155,7 +448,11 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -155,7 +448,11 @@ public class ContactLogServiceImpl implements ContactLogService {
@Override
@Override
public
TabContactLog
getClerkContactTime
(
String
memberId
)
{
public
TabContactLog
getClerkContactTime
(
String
memberId
)
{
TabContactLog
lastContactLog
=
contactLogMapper
.
queryLastLog
(
memberId
,
null
,
null
,
null
);
Map
<
Integer
,
TabContactLog
>
contactMap
=
getLastByTime
(
memberId
,
null
,
null
,
null
);
if
(
contactMap
==
null
||
contactMap
.
isEmpty
())
{
return
null
;
}
TabContactLog
lastContactLog
=
contactMap
.
get
(
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
());
if
(
lastContactLog
==
null
)
{
if
(
lastContactLog
==
null
)
{
return
null
;
return
null
;
}
}
...
@@ -173,14 +470,51 @@ public class ContactLogServiceImpl implements ContactLogService {
...
@@ -173,14 +470,51 @@ public class ContactLogServiceImpl implements ContactLogService {
if
(!
Objects
.
equals
(
clerkId
,
memberStoreClerk
.
getClerkId
()))
{
if
(!
Objects
.
equals
(
clerkId
,
memberStoreClerk
.
getClerkId
()))
{
return
null
;
return
null
;
}
}
if
(
DateUtil
.
compare
(
contactTime
,
DateUtil
.
date
().
offset
(
DateField
.
DAY_OF_MONTH
,
-
14
))
<
0
)
{
Integer
contactOrderLimitDay
=
getContactOrderLimitDay
(
contactTime
);
if
(
DateUtil
.
compare
(
contactTime
,
DateUtil
.
date
().
offset
(
DateField
.
DAY_OF_MONTH
,
-
contactOrderLimitDay
))
<
0
)
{
return
null
;
return
null
;
}
}
return
lastContactLog
;
return
lastContactLog
;
}
}
@Override
@Override
public
TabContactLog
getLastByTime
(
String
memberId
,
Date
beginTime
,
Date
endTime
)
{
public
List
<
TabContactLog
>
getClerkContactTimeList
(
String
memberId
)
{
return
contactLogMapper
.
queryLastLog
(
memberId
,
null
,
beginTime
,
endTime
);
Map
<
Integer
,
TabContactLog
>
contactMap
=
getLastByTime
(
memberId
,
null
,
null
,
null
);
if
(
contactMap
==
null
||
contactMap
.
isEmpty
())
{
return
null
;
}
logger
.
info
(
"获取最近一条建联记录:{}"
,
JSON
.
toJSONString
(
contactMap
));
List
<
TabContactLog
>
list
=
new
ArrayList
<>();
contactMap
.
forEach
((
k
,
lastContactLog
)->{
Integer
contactStatus
=
lastContactLog
.
getContactStatus
();
if
(
Objects
.
equals
(
contactStatus
,
Constant
.
FLAG_FALSE
))
{
return
;
}
String
clerkId
=
lastContactLog
.
getClerkId
();
Date
contactTime
=
lastContactLog
.
getContactTime
();
MemberStoreClerkDTO
memberStoreClerk
=
memberService
.
getMemberStoreClerk
(
memberId
);
if
(
memberStoreClerk
==
null
)
{
return
;
}
logger
.
info
(
"建联导购id:{},专属导购id:{}"
,
clerkId
,
memberStoreClerk
.
getClerkId
());
if
(!
Objects
.
equals
(
clerkId
,
memberStoreClerk
.
getClerkId
()))
{
return
;
}
Integer
contactOrderLimitDay
=
getContactOrderLimitDay
(
contactTime
);
if
(
DateUtil
.
compare
(
contactTime
,
DateUtil
.
date
().
offset
(
DateField
.
DAY_OF_MONTH
,
-
contactOrderLimitDay
))
<
0
)
{
return
;
}
list
.
add
(
lastContactLog
);
});
return
list
;
}
@Override
public
Map
<
Integer
,
TabContactLog
>
getLastByTime
(
String
memberId
,
String
clerkId
,
Date
beginTime
,
Date
endTime
)
{
List
<
TabContactLog
>
list
=
contactLogMapper
.
queryLastLog
(
memberId
,
clerkId
,
beginTime
,
endTime
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
HashMap
<>();
}
return
list
.
stream
().
collect
(
Collectors
.
toMap
(
TabContactLog:
:
getBizType
,
v
->
v
,
(
e
,
x
)
->
e
));
}
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/contact/impl/ContactOrderServiceImpl.java
View file @
4c1487ae
...
@@ -23,6 +23,9 @@ import com.gic.haoban.manage.service.service.ESMemberInfoService;
...
@@ -23,6 +23,9 @@ import com.gic.haoban.manage.service.service.ESMemberInfoService;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.contact.ContactOrderService
;
import
com.gic.haoban.manage.service.service.contact.ContactOrderService
;
import
com.gic.member.api.dto.es.MemberDataDTO
;
import
com.gic.member.api.dto.es.MemberDataDTO
;
import
com.gic.member.tag.api.dto.MemberTagGroupDetailDTO
;
import
com.gic.member.tag.api.dto.MemberTagGroupSimpleDTO
;
import
com.gic.member.tag.api.service.MemberTagGroupApiService
;
import
com.gic.order.api.dto.resp.OrderInfoResp
;
import
com.gic.order.api.dto.resp.OrderInfoResp
;
import
com.gic.order.api.dto.resp.OrderItemResp
;
import
com.gic.order.api.dto.resp.OrderItemResp
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
...
@@ -49,6 +52,8 @@ public class ContactOrderServiceImpl implements ContactOrderService {
...
@@ -49,6 +52,8 @@ public class ContactOrderServiceImpl implements ContactOrderService {
@Autowired
@Autowired
private
ESMemberInfoService
esMemberInfoService
;
private
ESMemberInfoService
esMemberInfoService
;
@Autowired
@Autowired
private
MemberTagGroupApiService
memberTagGroupApiService
;
@Autowired
private
StoreService
storeService
;
private
StoreService
storeService
;
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
...
@@ -70,6 +75,11 @@ public class ContactOrderServiceImpl implements ContactOrderService {
...
@@ -70,6 +75,11 @@ public class ContactOrderServiceImpl implements ContactOrderService {
logger
.
info
(
"订单不是销售单"
);
logger
.
info
(
"订单不是销售单"
);
return
false
;
return
false
;
}
}
long
noGiveCount
=
orderInfoResp
.
getOrderItems
().
stream
().
filter
(
x
->
!
Objects
.
equals
(
x
.
getProType
(),
2
)).
count
();
if
(
noGiveCount
==
0
)
{
logger
.
info
(
"都是赠品订单:{}"
,
orderId
);
return
false
;
}
String
enterpriseId
=
orderInfoResp
.
getEnterpriseId
();
String
enterpriseId
=
orderInfoResp
.
getEnterpriseId
();
String
memberId
=
orderInfoResp
.
getMemberId
();
String
memberId
=
orderInfoResp
.
getMemberId
();
logger
.
info
(
"建联处理订单:{},memberId:{}"
,
orderId
,
memberId
);
logger
.
info
(
"建联处理订单:{},memberId:{}"
,
orderId
,
memberId
);
...
@@ -86,47 +96,79 @@ public class ContactOrderServiceImpl implements ContactOrderService {
...
@@ -86,47 +96,79 @@ public class ContactOrderServiceImpl implements ContactOrderService {
contactBeginTime
=
DateUtil
.
offsetDay
(
receiptsDate
,
-
1
);
contactBeginTime
=
DateUtil
.
offsetDay
(
receiptsDate
,
-
1
);
}
}
TabContactLog
lastContactLog
=
contactLogService
.
getLastByTime
(
memberId
,
contactBeginTime
,
receiptsDate
);
Map
<
Integer
,
TabContactLog
>
contactMap
=
contactLogService
.
getLastByTime
(
memberId
,
null
,
contactBeginTime
,
receiptsDate
);
if
(
lastContactLog
==
null
)
{
if
(
contactMap
==
null
||
contactMap
.
isEmpty
()
)
{
return
false
;
return
false
;
}
}
logger
.
info
(
"建联转化订单建联信息:{}"
,
JSON
.
toJSONString
(
lastContactLog
));
for
(
Map
.
Entry
<
Integer
,
TabContactLog
>
entry
:
contactMap
.
entrySet
())
{
TabContactOrder
contactOrder
=
new
TabContactOrder
();
Integer
key
=
entry
.
getKey
();
contactOrder
.
setOrderId
(
orderId
);
TabContactLog
lastContactLog
=
entry
.
getValue
();
contactOrder
.
setMemberId
(
memberId
);
if
(
lastContactLog
==
null
)
{
contactOrder
.
setOrderNumber
(
orderInfoResp
.
getOrderNo
());
continue
;
Double
paidAmount
=
orderInfoResp
.
getPayAmount
();
}
if
(
Objects
.
equals
(
PlatformChannelEnum
.
C_WECHAT_MINI
.
getChannelCode
(),
channelCode
))
{
logger
.
info
(
"建联转化订单建联信息:{}"
,
JSON
.
toJSONString
(
lastContactLog
));
paidAmount
=
paidAmount
+
(
Objects
.
isNull
(
orderInfoResp
.
getDeliveryPaymentAmount
())
?
0.0
:
orderInfoResp
.
getDeliveryPaymentAmount
());
TabContactOrder
contactOrder
=
new
TabContactOrder
();
}
contactOrder
.
setOrderId
(
orderId
);
contactOrder
.
setPaidAmount
(
paidAmount
);
contactOrder
.
setMemberId
(
memberId
);
contactOrder
.
setProductCount
(
orderInfoResp
.
getGoodsCount
());
contactOrder
.
setOrderNumber
(
orderInfoResp
.
getOrderNo
());
contactOrder
.
setPayTime
(
orderInfoResp
.
getReceiptsDate
());
Double
paidAmount
=
orderInfoResp
.
getPayAmount
();
contactOrder
.
setReceiptsDate
(
orderInfoResp
.
getReceiptsDate
());
if
(
Objects
.
equals
(
PlatformChannelEnum
.
C_WECHAT_MINI
.
getChannelCode
(),
channelCode
))
{
List
<
OrderItemResp
>
orderItems
=
orderInfoResp
.
getOrderItems
();
paidAmount
=
paidAmount
+
(
Objects
.
isNull
(
orderInfoResp
.
getDeliveryPaymentAmount
())
?
0.0
:
orderInfoResp
.
getDeliveryPaymentAmount
());
if
(
CollectionUtils
.
isNotEmpty
(
orderItems
))
{
}
List
<
ContactOrderGoodsInfoDTO
>
goodsInfoDTOS
=
JSONObject
.
parseArray
(
JSON
.
toJSONString
(
orderItems
),
ContactOrderGoodsInfoDTO
.
class
);
contactOrder
.
setPaidAmount
(
paidAmount
);
contactOrder
.
setGoodsInfo
(
JSON
.
toJSONString
(
goodsInfoDTOS
));
contactOrder
.
setProductCount
(
orderInfoResp
.
getGoodsCount
());
}
contactOrder
.
setPayTime
(
orderInfoResp
.
getReceiptsDate
());
contactOrder
.
setChannelCode
(
channelCode
);
contactOrder
.
setReceiptsDate
(
orderInfoResp
.
getReceiptsDate
());
contactOrder
.
setChannelType
(
channelType
);
List
<
OrderItemResp
>
orderItems
=
orderInfoResp
.
getOrderItems
();
contactOrder
.
setClerkId
(
lastContactLog
.
getClerkId
());
if
(
CollectionUtils
.
isNotEmpty
(
orderItems
))
{
contactOrder
.
setClerkCode
(
lastContactLog
.
getClerkCode
());
List
<
ContactOrderGoodsInfoDTO
>
goodsInfoDTOS
=
JSONObject
.
parseArray
(
JSON
.
toJSONString
(
orderItems
),
ContactOrderGoodsInfoDTO
.
class
);
contactOrder
.
setClerkName
(
lastContactLog
.
getClerkName
());
contactOrder
.
setGoodsInfo
(
JSON
.
toJSONString
(
goodsInfoDTOS
));
contactOrder
.
setStoreId
(
lastContactLog
.
getStoreId
());
}
contactOrder
.
setContactLogId
(
lastContactLog
.
getLogId
());
contactOrder
.
setChannelCode
(
channelCode
);
contactOrder
.
setContactTime
(
lastContactLog
.
getContactTime
());
contactOrder
.
setChannelType
(
channelType
);
contactOrder
.
setPotentialTime
(
lastContactLog
.
getPotentialTime
());
contactOrder
.
setClerkId
(
lastContactLog
.
getClerkId
());
contactOrder
.
setEnterpriseId
(
lastContactLog
.
getEnterpriseId
());
contactOrder
.
setClerkCode
(
lastContactLog
.
getClerkCode
());
contactOrder
.
setClerkName
(
lastContactLog
.
getClerkName
());
contactOrder
.
setStoreId
(
lastContactLog
.
getStoreId
());
contactOrder
.
setContactLogId
(
lastContactLog
.
getLogId
());
contactOrder
.
setContactTime
(
lastContactLog
.
getContactTime
());
contactOrder
.
setPotentialTime
(
lastContactLog
.
getPotentialTime
());
contactOrder
.
setSourceType
(
lastContactLog
.
getSourceType
());
contactOrder
.
setBizType
(
lastContactLog
.
getBizType
());
contactOrder
.
setEnterpriseId
(
lastContactLog
.
getEnterpriseId
());
JSONObject
jsonObject
=
esMemberInfoService
.
queryDataSingle
(
enterpriseId
,
memberId
,
"potentialScore"
);
JSONObject
jsonObject
=
esMemberInfoService
.
queryDataSingle
(
enterpriseId
,
memberId
,
"potentialScore"
);
if
(
jsonObject
!=
null
&&
jsonObject
.
getInteger
(
"potentialScore"
)
!=
null
)
{
if
(
jsonObject
!=
null
&&
jsonObject
.
getInteger
(
"potentialScore"
)
!=
null
)
{
contactOrder
.
setPotentialScore
(
jsonObject
.
getInteger
(
"potentialScore"
));
contactOrder
.
setPotentialScore
(
jsonObject
.
getInteger
(
"potentialScore"
));
}
String
groupInfo
=
convertGroupInfo
(
enterpriseId
,
memberId
);
contactOrder
.
setGroupInfo
(
groupInfo
);
contactOrderMapper
.
insert
(
contactOrder
);
}
}
contactOrderMapper
.
insert
(
contactOrder
);
return
true
;
return
true
;
}
}
private
String
convertGroupInfo
(
String
enterpriseId
,
String
memberId
)
{
JSONObject
jo
=
new
JSONObject
();
try
{
MemberTagGroupDetailDTO
memberTagGroupDetail
=
memberTagGroupApiService
.
getMemberTagGroupDetail
(
enterpriseId
,
memberId
,
"1"
);
if
(
memberTagGroupDetail
==
null
)
{
return
jo
.
toJSONString
();
}
MemberTagGroupSimpleDTO
allChannelMemberGradeGroup
=
memberTagGroupDetail
.
getAllChannelMemberGradeGroup
();
if
(
allChannelMemberGradeGroup
!=
null
)
{
jo
.
put
(
"allChannelMemberGradeGroup"
,
allChannelMemberGradeGroup
.
getGroupName
());
}
MemberTagGroupSimpleDTO
memberGradeGroup
=
memberTagGroupDetail
.
getMemberGradeGroup
();
if
(
memberGradeGroup
!=
null
)
{
jo
.
put
(
"memberGradeGroup"
,
memberGradeGroup
.
getGroupName
());
}
}
catch
(
Exception
e
)
{
logger
.
info
(
"获取金字塔分层信息异常"
,
e
);
}
return
jo
.
toJSONString
();
}
@Override
@Override
public
Page
<
ContactOrderDetailDTO
>
pageContactOrder
(
String
enterpriseId
,
ContactOrderSearchQDTO
searchQDTO
,
BasePageInfo
pageInfo
)
{
public
Page
<
ContactOrderDetailDTO
>
pageContactOrder
(
String
enterpriseId
,
ContactOrderSearchQDTO
searchQDTO
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
);
PageHelper
.
startPage
(
pageInfo
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/EnterpriseAdaptor.java
View file @
4c1487ae
...
@@ -6,6 +6,7 @@ import com.gic.enterprise.api.constant.EnterpriseServiceEnum;
...
@@ -6,6 +6,7 @@ import com.gic.enterprise.api.constant.EnterpriseServiceEnum;
import
com.gic.enterprise.api.dto.EnterpriseUsingPermissionDto
;
import
com.gic.enterprise.api.dto.EnterpriseUsingPermissionDto
;
import
com.gic.enterprise.api.dto.enterprise.EnterpriseUsingStatusDTO
;
import
com.gic.enterprise.api.dto.enterprise.EnterpriseUsingStatusDTO
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -134,6 +135,17 @@ public class EnterpriseAdaptor {
...
@@ -134,6 +135,17 @@ public class EnterpriseAdaptor {
return
StringUtils
.
equals
(
cache
,
"1"
);
return
StringUtils
.
equals
(
cache
,
"1"
);
}
}
public
boolean
checkEnterpriseHasRightByContactBizType
(
String
enterpriseId
,
Integer
contactBizType
)
{
if
(
Objects
.
equals
(
contactBizType
,
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
()))
{
return
checkEnterpriseHasRights
(
enterpriseId
,
Lists
.
newArrayList
(
EnterpriseServiceEnum
.
POTENTIAL
.
getRightMenuCode
()));
}
else
if
(
Objects
.
equals
(
contactBizType
,
ContactBizTypeEnum
.
OPPORTUNITY_CUSTOMER
.
getType
()))
{
return
checkEnterpriseHasRights
(
enterpriseId
,
Lists
.
newArrayList
(
EnterpriseServiceEnum
.
OBJECTIVES
.
getRightMenuCode
()));
}
else
{
return
checkEnterpriseHasRights
(
enterpriseId
,
Lists
.
newArrayList
(
EnterpriseServiceEnum
.
POTENTIAL
.
getRightMenuCode
()))
||
checkEnterpriseHasRights
(
enterpriseId
,
Lists
.
newArrayList
(
EnterpriseServiceEnum
.
OBJECTIVES
.
getRightMenuCode
()));
}
}
public
boolean
checkEnterpriseHasRight
(
String
enterpriseId
,
String
rightMenuCode
)
{
public
boolean
checkEnterpriseHasRight
(
String
enterpriseId
,
String
rightMenuCode
)
{
return
checkEnterpriseHasRights
(
enterpriseId
,
Lists
.
newArrayList
(
rightMenuCode
));
return
checkEnterpriseHasRights
(
enterpriseId
,
Lists
.
newArrayList
(
rightMenuCode
));
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/licence/impl/LicenceOrderServiceImpl.java
View file @
4c1487ae
...
@@ -32,7 +32,6 @@ import com.github.pagehelper.PageHelper;
...
@@ -32,7 +32,6 @@ import com.github.pagehelper.PageHelper;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.checkerframework.checker.units.qual.A
;
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
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/common/RouterApiServiceImpl.java
View file @
4c1487ae
...
@@ -31,12 +31,13 @@ public class RouterApiServiceImpl implements RouterApiService {
...
@@ -31,12 +31,13 @@ public class RouterApiServiceImpl implements RouterApiService {
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
ClerkAddEventParam
clerkAddEventParam
=
JSONObject
.
parseObject
(
params
,
ClerkAddEventParam
.
class
);
ClerkAddEventParam
clerkAddEventParam
=
JSONObject
.
parseObject
(
params
,
ClerkAddEventParam
.
class
);
String
enterpriseId
=
clerkAddEventParam
.
getEnterpriseId
();
String
memberId
=
clerkAddEventParam
.
getMemberId
();
String
memberId
=
clerkAddEventParam
.
getMemberId
();
Integer
changeType
=
clerkAddEventParam
.
getChangeType
();
Integer
changeType
=
clerkAddEventParam
.
getChangeType
();
String
clerkId
=
clerkAddEventParam
.
getClerkId
();
String
clerkId
=
clerkAddEventParam
.
getClerkId
();
if
(
Objects
.
equals
(
changeType
,
1
))
{
if
(
Objects
.
equals
(
changeType
,
1
))
{
// 换绑主导购清除建联状态
// 换绑主导购清除建联状态
contactLogService
.
clearContactLog
(
memberId
,
2
,
clerkId
);
contactLogService
.
clearContactLog
(
enterpriseId
,
memberId
,
2
,
clerkId
);
}
}
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/contact/ContactConfigApiServiceImpl.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
contact
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
import
com.gic.haoban.manage.api.service.contact.ContactConfigApiService
;
import
com.gic.haoban.manage.service.service.contact.ContactConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
(
"contactConfigApiService"
)
public
class
ContactConfigApiServiceImpl
implements
ContactConfigApiService
{
@Autowired
private
ContactConfigService
contactConfigService
;
@Override
public
ServiceResponse
<
Void
>
saveContactConfig
(
ContactConfigDTO
contactConfig
)
{
contactConfigService
.
saveContactConfig
(
contactConfig
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
ContactConfigDTO
>
getContactConfig
(
String
enterpriseId
)
{
ContactConfigDTO
config
=
contactConfigService
.
getContactConfig
(
enterpriseId
);
return
ServiceResponse
.
success
(
config
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/contact/ContactFollowApiServiceImpl.java
View file @
4c1487ae
...
@@ -2,12 +2,14 @@ package com.gic.haoban.manage.service.service.out.impl.contact;
...
@@ -2,12 +2,14 @@ package com.gic.haoban.manage.service.service.out.impl.contact;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Constant
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.enterprise.api.constant.EnterpriseServiceEnum
;
import
com.gic.enterprise.api.constant.EnterpriseServiceEnum
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowBatchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowBatchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
...
@@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
...
@@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -74,6 +77,7 @@ public class ContactFollowApiServiceImpl implements ContactFollowApiService {
...
@@ -74,6 +77,7 @@ public class ContactFollowApiServiceImpl implements ContactFollowApiService {
followQDTO
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
followQDTO
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
followQDTO
.
setFollowRemark
(
clerkDTO
.
getClerkName
()
+
qdto
.
getFollowRemark
());
followQDTO
.
setFollowRemark
(
clerkDTO
.
getClerkName
()
+
qdto
.
getFollowRemark
());
followQDTO
.
setFollowTime
(
x
.
getFollowTime
());
followQDTO
.
setFollowTime
(
x
.
getFollowTime
());
followQDTO
.
setGoodsInfoList
(
qdto
.
getGoodsInfoList
());
followQDTO
.
setEnterpriseId
(
clerkDTO
.
getEnterpriseId
());
followQDTO
.
setEnterpriseId
(
clerkDTO
.
getEnterpriseId
());
return
followQDTO
;
return
followQDTO
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/contact/ContactLogApiServiceImpl.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
contact
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.manage.api.dto.contact.ContactLogDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactLogDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogCheckQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.api.service.contact.ContactLogApiService
;
import
com.gic.haoban.manage.api.service.contact.ContactLogApiService
;
import
com.gic.haoban.manage.service.entity.contact.TabContactLog
;
import
com.gic.haoban.manage.service.entity.contact.TabContactLog
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.member.api.dto.MemberStoreClerkDTO
;
import
com.gic.member.api.service.MemberService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
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
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
/**
* Created by wangzubo on 2022/11/1.
* Created by wangzubo on 2022/11/1.
*/
*/
@Slf4j
@Service
(
"contactLogApiService"
)
@Service
(
"contactLogApiService"
)
public
class
ContactLogApiServiceImpl
implements
ContactLogApiService
{
public
class
ContactLogApiServiceImpl
implements
ContactLogApiService
{
@Autowired
@Autowired
private
ContactLogService
contactLogService
;
private
ContactLogService
contactLogService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
MemberService
memberService
;
@Override
@Override
public
ServiceResponse
<
ContactLogDTO
>
getClerkContactTime
(
String
memberId
)
{
public
ServiceResponse
<
ContactLogDTO
>
getClerkContactTime
(
String
memberId
)
{
...
@@ -28,6 +45,16 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
...
@@ -28,6 +45,16 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
}
}
@Override
@Override
public
ServiceResponse
<
List
<
ContactLogDTO
>>
getClerkContactTimeList
(
String
memberId
)
{
List
<
TabContactLog
>
list
=
contactLogService
.
getClerkContactTimeList
(
memberId
);
if
(
list
==
null
)
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
}
List
<
ContactLogDTO
>
dtos
=
EntityUtil
.
changeEntityListNew
(
ContactLogDTO
.
class
,
list
);
return
ServiceResponse
.
success
(
dtos
);
}
@Override
public
ServiceResponse
<
Void
>
saveContactLog
(
ContactLogQDTO
qdto
)
{
public
ServiceResponse
<
Void
>
saveContactLog
(
ContactLogQDTO
qdto
)
{
try
{
try
{
contactLogService
.
saveContactLog
(
qdto
);
contactLogService
.
saveContactLog
(
qdto
);
...
@@ -37,4 +64,38 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
...
@@ -37,4 +64,38 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
@Override
public
ServiceResponse
<
Void
>
autoContactLogForMQ
(
String
message
)
{
if
(
StringUtils
.
isBlank
(
message
))
{
return
ServiceResponse
.
success
();
}
ContactLogQDTO
contactLogQDTO
=
JSONObject
.
parseObject
(
message
,
ContactLogQDTO
.
class
);
Integer
contactAutoType
=
contactLogQDTO
.
getContactAutoType
();
if
(
contactAutoType
!=
null
)
{
contactLogService
.
autoContactLog
(
contactLogQDTO
);
}
else
{
contactLogService
.
syncContactLog
(
contactLogQDTO
);
}
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Boolean
>
contactCheck
(
ContactLogCheckQDTO
checkQDTO
)
{
ClerkDTO
clerkDTO
=
clerkService
.
getclerkById
(
checkQDTO
.
getClerkId
());
if
(
clerkDTO
==
null
)
{
return
ServiceResponse
.
success
(
Boolean
.
FALSE
);
}
MemberStoreClerkDTO
memberStoreClerk
=
memberService
.
getMemberStoreClerk
(
checkQDTO
.
getMemberId
());
if
(
memberStoreClerk
==
null
)
{
log
.
info
(
"无专属导购无法建联"
);
return
ServiceResponse
.
success
(
Boolean
.
FALSE
);
}
String
mainClerkId
=
memberStoreClerk
.
getClerkId
();
if
(!
Objects
.
equals
(
mainClerkId
,
checkQDTO
.
getClerkId
()))
{
log
.
info
(
"非专属导购无法建联"
);
return
ServiceResponse
.
success
(
Boolean
.
FALSE
);
}
Integer
contactCheck
=
contactLogService
.
contactCheck
(
checkQDTO
.
getEnterpriseId
(),
checkQDTO
.
getMemberId
(),
clerkDTO
,
checkQDTO
.
getBizType
());
return
ServiceResponse
.
success
(
contactCheck
!=
null
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/contact/ContactOrderApiServiceImpl.java
View file @
4c1487ae
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.contact.ContactOrderDetailDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactOrderDetailDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactOrderQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactOrderQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactOrderSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactOrderSearchQDTO
;
...
@@ -47,12 +48,12 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService {
...
@@ -47,12 +48,12 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService {
}
}
OrderInfoResp
result
=
serviceResponse
.
getResult
();
OrderInfoResp
result
=
serviceResponse
.
getResult
();
boolean
clearFlag
=
CollectionUtils
.
isNotEmpty
(
result
.
getOrderItems
())
&&
result
.
getPaidAmount
()
>
0
boolean
clearFlag
=
CollectionUtils
.
isNotEmpty
(
result
.
getOrderItems
())
&&
result
.
getPaidAmount
()
>
0
&&
(
result
.
getReceiptsDate
()
!=
null
&&
DateUtil
.
compare
(
DateUtil
.
offsetDay
(
new
Date
(),
-
14
),
result
.
getReceiptsDate
())
<=
0
);
&&
(
result
.
getReceiptsDate
()
!=
null
&&
DateUtil
.
compare
(
DateUtil
.
offsetDay
(
new
Date
(),
-
Manage3Constants
.
CONTACT_ORDER_LIMIT_DAY
),
result
.
getReceiptsDate
())
<=
0
);
log
.
info
(
"获取订单时间,orderId:{},单据时间:{},应收:{}"
,
result
.
getOrderId
(),
result
.
getReceiptsDate
(),
result
.
getPaidAmount
());
log
.
info
(
"获取订单时间,orderId:{},单据时间:{},应收:{}"
,
result
.
getOrderId
(),
result
.
getReceiptsDate
(),
result
.
getPaidAmount
());
boolean
contactOrder
=
contactOrderService
.
saveContactOrder
(
result
);
boolean
contactOrder
=
contactOrderService
.
saveContactOrder
(
result
);
log
.
info
(
"clearFlag:{},contactOrder:{}"
,
clearFlag
,
contactOrder
);
log
.
info
(
"clearFlag:{},contactOrder:{}"
,
clearFlag
,
contactOrder
);
if
(
clearFlag
||
contactOrder
)
{
if
(
clearFlag
||
contactOrder
)
{
contactLogService
.
clearContactLog
(
memberId
,
1
,
""
);
contactLogService
.
clearContactLog
(
enterpriseId
,
memberId
,
1
,
""
);
}
}
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/content/task/QywxGroupMsgTaskApiServiceImpl.java
View file @
4c1487ae
...
@@ -54,13 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -54,13 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Calendar
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -281,11 +275,12 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
...
@@ -281,11 +275,12 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
log
.
info
(
"当前时间处于消息禁发时间, 忽略{}"
,
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
now
,
"yyyy-MM-dd HH:mm:ss"
));
log
.
info
(
"当前时间处于消息禁发时间, 忽略{}"
,
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
now
,
"yyyy-MM-dd HH:mm:ss"
));
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
List
<
String
>
enterpriseIds
=
groupMessageService
.
hasMaterialRightEnterprise
(
EnterpriseAdaptor
.
MaterialLevel
.
LOW
.
getCode
()
);
Map
<
String
,
List
<
String
>>
map
=
groupMessageService
.
weekMonthEnterprise
(
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseIds
))
{
if
(
MapUtil
.
isEmpty
(
map
))
{
log
.
info
(
"开通内容权限的企业为空"
);
log
.
info
(
"开通内容权限的企业为空"
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
Set
<
String
>
enterpriseIds
=
map
.
keySet
();
Date
startTime
=
null
;
Date
startTime
=
null
;
// 如果是8点那次的执行 需要获取 23 ~ 8点的数据
// 如果是8点那次的执行 需要获取 23 ~ 8点的数据
if
(
checkIsTodayFirst
(
now
))
{
if
(
checkIsTodayFirst
(
now
))
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/send/impl/QwSendMsgServiceImpl.java
View file @
4c1487ae
...
@@ -5,31 +5,36 @@ import com.alibaba.fastjson.JSON;
...
@@ -5,31 +5,36 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.BusinessException
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.content.api.utils.MqUtils
;
import
com.gic.content.api.utils.MqUtils
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.dto.anaylsis.ClerkShareGoodsLogDTO
;
import
com.gic.haoban.manage.api.dto.send.DealQwSendDTO
;
import
com.gic.haoban.manage.api.dto.send.DealQwSendDTO
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowBatchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowBatchQDTO
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.MessageApiService
;
import
com.gic.haoban.manage.api.service.MessageApiService
;
import
com.gic.haoban.manage.api.service.content.MaterialShareLogApiService
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.send.QwSendLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.send.QwSendLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.send.QwSendMsgMapper
;
import
com.gic.haoban.manage.service.dao.mapper.send.QwSendMsgMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.send.TabQwSendLog
;
import
com.gic.haoban.manage.service.entity.send.TabQwSendLog
;
import
com.gic.haoban.manage.service.entity.send.TabQwSendMsg
;
import
com.gic.haoban.manage.service.entity.send.TabQwSendMsg
;
import
com.gic.haoban.manage.service.pojo.bo.send.FinishQwSendBO
;
import
com.gic.haoban.manage.service.pojo.bo.send.GroupSendResultBO
;
import
com.gic.haoban.manage.service.pojo.bo.send.GroupSendResultBO
;
import
com.gic.haoban.manage.service.service.chat.GroupChatPlanService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatPlanService
;
import
com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImpl
;
import
com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImpl
;
import
com.gic.haoban.manage.service.service.send.QwSendMsgService
;
import
com.gic.haoban.manage.service.service.send.QwSendMsgService
;
import
com.gic.member.api.constant.MemberExtKeyEnum
;
import
com.gic.member.api.dto.member.req.MemberExtraPropertyReq
;
import
com.gic.member.api.service.extra.MemberExtraPropertyApiService
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.util.CollectionUtils
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -55,6 +60,10 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
...
@@ -55,6 +60,10 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
private
MemberUnionidRelatedApiService
memberUnionidRelatedApiService
;
private
MemberUnionidRelatedApiService
memberUnionidRelatedApiService
;
@Autowired
@Autowired
private
MessageApiService
messageApiService
;
private
MessageApiService
messageApiService
;
@Autowired
private
MaterialShareLogApiService
materialShareLogApiService
;
@Autowired
private
MemberExtraPropertyApiService
memberExtraPropertyApiService
;
@Override
@Override
public
void
finishQwSend
(
DealQwSendDTO
.
FinishQwSendBO
finishQwSendBO
,
Integer
tryCount
)
{
public
void
finishQwSend
(
DealQwSendDTO
.
FinishQwSendBO
finishQwSendBO
,
Integer
tryCount
)
{
...
@@ -83,7 +92,8 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
...
@@ -83,7 +92,8 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
dealQwSendDTO
.
setRefreshType
(
2
);
dealQwSendDTO
.
setRefreshType
(
2
);
DealQwSendDTO
.
QwSendMsgBO
qwSendMsgBO
=
EntityUtil
.
changeEntityByJSON
(
DealQwSendDTO
.
QwSendMsgBO
.
class
,
qwSendMsg
);
DealQwSendDTO
.
QwSendMsgBO
qwSendMsgBO
=
EntityUtil
.
changeEntityByJSON
(
DealQwSendDTO
.
QwSendMsgBO
.
class
,
qwSendMsg
);
dealQwSendDTO
.
setQwSendMsg
(
qwSendMsgBO
);
dealQwSendDTO
.
setQwSendMsg
(
qwSendMsgBO
);
MqUtils
.
sendMessageToMQ
(
"qwSendRefreshByMQ"
,
JSON
.
toJSONString
(
dealQwSendDTO
),
60
);
dealQwSendDTO
.
setFinishQwSend
(
finishQwSendBO
);
MqUtils
.
sendMessageToMQ
(
"qwSendRefreshByMQ"
,
JSON
.
toJSONString
(
dealQwSendDTO
),
30
);
}
else
{
}
else
{
if
(
tryCount
!=
null
&&
tryCount
>=
5
)
{
if
(
tryCount
!=
null
&&
tryCount
>=
5
)
{
return
;
return
;
...
@@ -166,9 +176,9 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
...
@@ -166,9 +176,9 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
if
(
StringUtils
.
isBlank
(
log
.
getMemberId
()))
{
if
(
StringUtils
.
isBlank
(
log
.
getMemberId
()))
{
return
;
return
;
}
}
memberList
.
add
(
new
ContactFollowBatchQDTO
.
MemberFollow
(
log
.
getMemberId
(),
log
.
getSendTime
()));
memberList
.
add
(
new
ContactFollowBatchQDTO
.
MemberFollow
(
log
.
getMemberId
(),
log
.
get
ExternalUserId
(),
log
.
get
SendTime
()));
});
});
saveFollowMQ
(
qwSendMsg
.
getEnterpriseId
(),
qwSendMsg
.
getClerkId
(),
memberList
);
saveFollowMQ
(
qwSendMsg
.
getEnterpriseId
(),
qwSendMsg
.
getClerkId
(),
memberList
,
dealQwSendDTO
.
getFinishQwSend
()
);
}
}
entities
.
clear
();
entities
.
clear
();
}
}
...
@@ -245,16 +255,62 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
...
@@ -245,16 +255,62 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
return
EntityUtil
.
changeEntityListByJSON
(
GroupSendResultBO
.
class
,
list
);
return
EntityUtil
.
changeEntityListByJSON
(
GroupSendResultBO
.
class
,
list
);
}
}
private
void
saveFollowMQ
(
String
enterpriseId
,
String
clerkId
,
List
<
ContactFollowBatchQDTO
.
MemberFollow
>
memberList
)
{
private
void
saveFollowMQ
(
String
enterpriseId
,
String
clerkId
,
List
<
ContactFollowBatchQDTO
.
MemberFollow
>
memberList
,
DealQwSendDTO
.
FinishQwSendBO
finishQwSendBO
)
{
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isEmpty
(
memberList
))
{
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isEmpty
(
memberList
))
{
return
;
return
;
}
}
if
(
finishQwSendBO
==
null
)
{
return
;
}
Integer
followType
=
null
;
String
followRemark
=
null
;
Integer
bizType
=
finishQwSendBO
.
getBizType
();
List
<
ClerkShareGoodsLogDTO
>
shareGoodsList
=
finishQwSendBO
.
getShareGoodsList
();
List
<
String
>
goodsInfoList
=
null
;
if
(
Objects
.
equals
(
bizType
,
1
))
{
followType
=
ContactFollowTypeEnum
.
MATERIAL
.
getCode
();
followRemark
=
"向客户发送了营销素材"
;
}
else
if
(
Objects
.
equals
(
bizType
,
2
))
{
followType
=
ContactFollowTypeEnum
.
PRODUCT
.
getCode
();
followRemark
=
"向客户发送了"
+
shareGoodsList
.
size
()
+
"款商品"
;
goodsInfoList
=
shareGoodsList
.
stream
().
map
(
ClerkShareGoodsLogDTO:
:
getBizId
).
collect
(
Collectors
.
toList
());
}
else
{
return
;
}
ContactFollowBatchQDTO
batchQDTO
=
new
ContactFollowBatchQDTO
();
ContactFollowBatchQDTO
batchQDTO
=
new
ContactFollowBatchQDTO
();
batchQDTO
.
setEnterpriseId
(
enterpriseId
);
batchQDTO
.
setEnterpriseId
(
enterpriseId
);
batchQDTO
.
setMemberList
(
memberList
);
batchQDTO
.
setMemberList
(
memberList
);
batchQDTO
.
setClerkId
(
clerkId
);
batchQDTO
.
setClerkId
(
clerkId
);
batchQDTO
.
setFollowType
(
ContactFollowTypeEnum
.
WECHAT_GROUP_SEND
.
getCode
());
batchQDTO
.
setFollowType
(
followType
);
batchQDTO
.
setFollowRemark
(
"通过企微群发向客户发送了消息"
);
batchQDTO
.
setFollowRemark
(
followRemark
);
batchQDTO
.
setGoodsInfoList
(
goodsInfoList
);
MqUtils
.
sendMessageToMQ
(
"saveBatchFollowForMQ"
,
JSON
.
toJSONString
(
batchQDTO
));
MqUtils
.
sendMessageToMQ
(
"saveBatchFollowForMQ"
,
JSON
.
toJSONString
(
batchQDTO
));
if
(
Objects
.
equals
(
bizType
,
2
))
{
saveShareMaterialLog
(
enterpriseId
,
shareGoodsList
,
memberList
);
}
}
private
void
saveShareMaterialLog
(
String
enterpriseId
,
List
<
ClerkShareGoodsLogDTO
>
shareGoodsList
,
List
<
ContactFollowBatchQDTO
.
MemberFollow
>
memberList
)
{
List
<
ClerkShareGoodsLogDTO
>
list
=
Lists
.
newArrayList
();
for
(
ContactFollowBatchQDTO
.
MemberFollow
memberInfo
:
memberList
)
{
for
(
ClerkShareGoodsLogDTO
goodsLogDTO
:
shareGoodsList
)
{
ClerkShareGoodsLogDTO
temp
=
EntityUtil
.
changeEntityByJSON
(
ClerkShareGoodsLogDTO
.
class
,
goodsLogDTO
);
temp
.
setExternalUserId
(
memberInfo
.
getExternalUserId
());
temp
.
setMemberId
(
memberInfo
.
getMemberId
());
list
.
add
(
temp
);
}
//更新会员推荐时间更新
MemberExtraPropertyReq
memberExtraPropertyReq
=
new
MemberExtraPropertyReq
();
memberExtraPropertyReq
.
setEnterpriseId
(
enterpriseId
);
memberExtraPropertyReq
.
setMemberId
(
memberInfo
.
getMemberId
());
memberExtraPropertyReq
.
setExtraKey
(
MemberExtKeyEnum
.
MEMBER_GOODS_SUGGEST_TIME
.
key
());
memberExtraPropertyReq
.
setExtraValue
(
memberInfo
.
getFollowTime
().
getTime
());
try
{
memberExtraPropertyApiService
.
updateMemberExtraProperty
(
memberExtraPropertyReq
);
}
catch
(
Exception
e
)
{
log
.
info
(
"更新会员推荐时间更新异常,"
,
e
);
}
}
materialShareLogApiService
.
saveClerkShareRecommendLog
(
list
);
}
}
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
4c1487ae
...
@@ -147,6 +147,7 @@
...
@@ -147,6 +147,7 @@
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactFollowApiService"
ref=
"contactFollowApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactFollowApiService"
ref=
"contactFollowApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactLogApiService"
ref=
"contactLogApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactLogApiService"
ref=
"contactLogApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactOrderApiService"
ref=
"contactOrderApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactOrderApiService"
ref=
"contactOrderApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.contact.ContactConfigApiService"
ref=
"contactConfigApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.send.QwSendApiService"
ref=
"qwSendApiService"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.send.QwSendApiService"
ref=
"qwSendApiService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.DepartmentService"
id=
"gicDepartmentService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.DepartmentService"
id=
"gicDepartmentService"
/>
...
@@ -179,6 +180,9 @@
...
@@ -179,6 +180,9 @@
<dubbo:reference
id=
"customerApiService"
<dubbo:reference
id=
"customerApiService"
interface=
"com.gic.haoban.app.customer.service.api.service.CustomerApiService"
timeout=
"10000"
interface=
"com.gic.haoban.app.customer.service.api.service.CustomerApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"objectivesManageApiService"
interface=
"com.gic.haoban.app.objectives.api.service.ObjectivesManageApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"qywxTagSyncApiService"
<dubbo:reference
id=
"qywxTagSyncApiService"
interface=
"com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService"
timeout=
"10000"
interface=
"com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService"
timeout=
"10000"
...
@@ -208,6 +212,7 @@
...
@@ -208,6 +212,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"
/>
...
@@ -256,6 +261,7 @@
...
@@ -256,6 +261,7 @@
<dubbo:reference
interface=
"com.gic.clerk.api.service.MenuApiService"
id=
"menuApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.MenuApiService"
id=
"menuApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.ext.api.service.MemberGrowthWriteApiService"
id=
"memberGrowthWriteApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.ext.api.service.MemberGrowthWriteApiService"
id=
"memberGrowthWriteApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.integral.IntegralWriteApiService"
id=
"integralWriteApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.integral.IntegralWriteApiService"
id=
"integralWriteApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"memberExtraPropertyApiService"
interface=
"com.gic.member.api.service.extra.MemberExtraPropertyApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"memberTagEsApiService"
interface=
"com.gic.member.tag.api.service.MemberTagEsApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"memberTagEsApiService"
interface=
"com.gic.member.tag.api.service.MemberTagEsApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"memberCrowdApiService"
interface=
"com.gic.member.ext.api.service.MemberCrowdApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"memberCrowdApiService"
interface=
"com.gic.member.ext.api.service.MemberCrowdApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
...
...
haoban-manage3-service/src/main/resources/mapper/contact/TabContactConfigMapper.xml
0 → 100644
View file @
4c1487ae
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.contact.TabContactConfigMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.contact.TabContactConfig"
>
<id
column=
"config_id"
property=
"configId"
/>
<result
column=
"contact_auto"
property=
"contactAuto"
/>
<result
column=
"remark_flag"
property=
"remarkFlag"
/>
<result
column=
"remark_content"
property=
"remarkContent"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
config_id, contact_auto, remark_flag, remark_content, enterprise_id, delete_flag, create_time, update_time
</sql>
<select
id=
"queryById"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM tab_contact_config
WHERE config_id = #{configId}
</select>
<select
id=
"queryByEnterpriseId"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM tab_contact_config
WHERE enterprise_id = #{enterpriseId}
AND delete_flag = 0
</select>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"configId"
>
INSERT INTO tab_contact_config (
config_id, contact_auto, remark_flag, remark_content, enterprise_id
)
VALUES (
#{configId}, #{contactAuto}, #{remarkFlag}, #{remarkContent}, #{enterpriseId}
)
</insert>
<insert
id=
"insertBatch"
>
INSERT INTO tab_contact_config (
config_id, contact_auto, remark_flag, remark_content, enterprise_id, delete_flag, create_time, update_time
)
VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.configId}, #{item.contactAuto}, #{item.remarkFlag}, #{item.remarkContent}, #{item.enterpriseId}, #{item.deleteFlag}, #{item.createTime}, #{item.updateTime})
</foreach>
</insert>
<update
id=
"update"
>
UPDATE tab_contact_config
<set>
<if
test=
"contactAuto != null"
>
contact_auto = #{contactAuto},
</if>
<if
test=
"remarkFlag != null"
>
remark_flag = #{remarkFlag},
</if>
<if
test=
"remarkContent != null"
>
remark_content = #{remarkContent},
</if>
</set>
WHERE config_id = #{configId}
</update>
<delete
id=
"deleteById"
>
DELETE FROM tab_contact_config
WHERE config_id = #{configId}
</delete>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/contact/TabContactFollowMapper.xml
View file @
4c1487ae
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
<result
column=
"follow_material"
property=
"followMaterial"
/>
<result
column=
"follow_material"
property=
"followMaterial"
/>
<result
column=
"goods_info"
property=
"goodsInfo"
/>
<result
column=
"goods_info"
property=
"goodsInfo"
/>
<result
column=
"follow_time"
property=
"followTime"
/>
<result
column=
"follow_time"
property=
"followTime"
/>
<result
column=
"source_type"
property=
"sourceType"
/>
<result
column=
"biz_type"
property=
"bizType"
/>
<result
column=
"biz_id"
property=
"bizId"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
...
@@ -21,10 +24,10 @@
...
@@ -21,10 +24,10 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
follow_id, member_id, clerk_id, clerk_code, follow_type,follow_remark, follow_material, goods_info, follow_time, enterprise_id, delete_flag, create_time, update_time
follow_id, member_id, clerk_id, clerk_code, follow_type,follow_remark, follow_material, goods_info, follow_time,
source_type,biz_type,biz_id,
enterprise_id, delete_flag, create_time, update_time
</sql>
</sql>
<sql
id=
"Alias_Base_Column_List"
>
<sql
id=
"Alias_Base_Column_List"
>
t.follow_id, t.member_id, t.clerk_id, t.clerk_code, t.follow_type,t.follow_remark, t.follow_material, t.goods_info, t.follow_time, t.enterprise_id, t.delete_flag, t.create_time, t.update_time
t.follow_id, t.member_id, t.clerk_id, t.clerk_code, t.follow_type,t.follow_remark, t.follow_material, t.goods_info, t.follow_time,
t.source_type,t.biz_type,t.biz_id,
t.enterprise_id, t.delete_flag, t.create_time, t.update_time
</sql>
</sql>
<select
id=
"queryById"
resultMap=
"BaseResultMap"
>
<select
id=
"queryById"
resultMap=
"BaseResultMap"
>
...
@@ -44,6 +47,29 @@
...
@@ -44,6 +47,29 @@
</foreach>
</foreach>
</select>
</select>
<select
id=
"getFollowTypes"
resultType=
"java.lang.String"
>
SELECT
GROUP_CONCAT(DISTINCT follow_type)
FROM tab_contact_follow
<where>
enterprise_id = #{enterpriseId}
AND follow_type not in (5,6)
<if
test=
"memberId != null"
>
AND member_id = #{memberId}
</if>
<if
test=
"clerkId != null"
>
AND clerk_id = #{clerkId}
</if>
<if
test=
"beginTime != null"
>
AND follow_time > #{beginTime}
</if>
<if
test=
"endTime != null"
>
AND follow_time
<![CDATA[<=]]>
#{endTime}
</if>
</where>
group by member_id
</select>
<select
id=
"count"
resultType=
"long"
>
<select
id=
"count"
resultType=
"long"
>
SELECT COUNT(*)
SELECT COUNT(*)
FROM tab_contact_follow
FROM tab_contact_follow
...
@@ -79,6 +105,29 @@
...
@@ -79,6 +105,29 @@
ORDER BY follow_time DESC,follow_id DESC
ORDER BY follow_time DESC,follow_id DESC
</select>
</select>
<select
id=
"listFollowCheck"
resultType=
"java.lang.String"
>
SELECT
member_id
FROM tab_contact_follow
<where>
enterprise_id = #{enterpriseId}
AND delete_flag = 0
AND follow_time >= NOW() - INTERVAL 6 MONTH
<if
test=
"list != null and list.size() > 0"
>
AND (
<foreach
collection=
"list"
item=
"item"
separator=
" OR "
>
(
member_id = #{item.memberId}
AND follow_time = #{item.followTime}
AND clerk_id = #{item.clerkId}
AND follow_type = 4
)
</foreach>
)
</if>
</where>
</select>
<select
id=
"lastFollowByMemberId"
resultMap=
"BaseResultMap"
>
<select
id=
"lastFollowByMemberId"
resultMap=
"BaseResultMap"
>
SELECT
SELECT
<include
refid=
"Alias_Base_Column_List"
/>
<include
refid=
"Alias_Base_Column_List"
/>
...
@@ -109,16 +158,27 @@
...
@@ -109,16 +158,27 @@
</select>
</select>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"followId"
>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"followId"
>
INSERT INTO tab_contact_follow (member_id, clerk_id, clerk_code,follow_type, follow_remark, follow_material, goods_info, follow_time, enterprise_id, delete_flag, create_time, update_time)
INSERT INTO tab_contact_follow (member_id, clerk_id, clerk_code,follow_type, follow_remark, follow_material, goods_info, follow_time,
source_type,biz_type,biz_id,
enterprise_id, delete_flag, create_time, update_time)
VALUES (#{memberId}, #{clerkId}, #{clerkCode},#{followType}, #{followRemark}, #{followMaterial}, #{goodsInfo}, #{followTime}, #{enterpriseId}, #{deleteFlag}, #{createTime}, #{updateTime})
VALUES (#{memberId}, #{clerkId}, #{clerkCode},#{followType}, #{followRemark}, #{followMaterial}, #{goodsInfo}, #{followTime},
#{sourceType},#{bizType},#{bizId},
#{enterpriseId}, #{deleteFlag}, #{createTime}, #{updateTime})
</insert>
</insert>
<insert
id=
"insertBatch"
>
<insert
id=
"insertBatch"
>
INSERT INTO tab_contact_follow (follow_id,member_id, clerk_id, clerk_code,follow_type, follow_remark, follow_material, goods_info, follow_time, enterprise_id)
INSERT INTO tab_contact_follow (
follow_id, member_id, clerk_id, clerk_code,
follow_type, follow_remark, follow_material,
goods_info, follow_time, source_type, biz_type, biz_id, enterprise_id
)
VALUES
VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.followId},#{item.memberId}, #{item.clerkId}, #{item.clerkCode}, #{item.followType},#{item.followRemark}, #{item.followMaterial}, #{item.goodsInfo}, #{item.followTime}, #{item.enterpriseId})
(#{item.followId}, #{item.memberId}, #{item.clerkId}, #{item.clerkCode},
#{item.followType}, #{item.followRemark}, #{item.followMaterial},
#{item.goodsInfo}, #{item.followTime}, #{item.sourceType}, #{item.bizType}, #{item.bizId}, #{item.enterpriseId})
</foreach>
</foreach>
ON DUPLICATE KEY UPDATE
biz_type = CASE
WHEN VALUES(biz_id) IS NOT NULL THEN biz_type + VALUES(biz_type)
ELSE biz_type
END
</insert>
</insert>
<update
id=
"update"
>
<update
id=
"update"
>
...
@@ -132,6 +192,9 @@
...
@@ -132,6 +192,9 @@
<if
test=
"followMaterial != null"
>
follow_material = #{followMaterial},
</if>
<if
test=
"followMaterial != null"
>
follow_material = #{followMaterial},
</if>
<if
test=
"goodsInfo != null"
>
goods_info = #{goodsInfo},
</if>
<if
test=
"goodsInfo != null"
>
goods_info = #{goodsInfo},
</if>
<if
test=
"followTime != null"
>
follow_time = #{followTime},
</if>
<if
test=
"followTime != null"
>
follow_time = #{followTime},
</if>
<if
test=
"bizType != null"
>
biz_type = #{bizType},
</if>
<if
test=
"bizId != null"
>
biz_id = #{bizId},
</if>
<if
test=
"source_type != null"
>
source_type = #{sourceType},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag},
</if>
update_time = #{updateTime}
update_time = #{updateTime}
...
...
haoban-manage3-service/src/main/resources/mapper/contact/TabContactLogMapper.xml
View file @
4c1487ae
...
@@ -14,6 +14,12 @@
...
@@ -14,6 +14,12 @@
<result
property=
"contactCycle"
column=
"contact_cycle"
jdbcType=
"INTEGER"
/>
<result
property=
"contactCycle"
column=
"contact_cycle"
jdbcType=
"INTEGER"
/>
<result
property=
"contactCycleFirst"
column=
"contact_cycle_first"
jdbcType=
"INTEGER"
/>
<result
property=
"contactCycleFirst"
column=
"contact_cycle_first"
jdbcType=
"INTEGER"
/>
<result
property=
"potentialTime"
column=
"potential_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"potentialTime"
column=
"potential_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"potentialScore"
column=
"potential_score"
jdbcType=
"INTEGER"
/>
<result
property=
"sourceType"
column=
"source_type"
jdbcType=
"INTEGER"
/>
<result
property=
"sourceLogId"
column=
"source_log_id"
jdbcType=
"BIGINT"
/>
<result
property=
"bizType"
column=
"biz_type"
jdbcType=
"INTEGER"
/>
<result
property=
"bizData"
column=
"biz_data"
jdbcType=
"VARCHAR"
/>
<result
property=
"followTypes"
column=
"follow_types"
jdbcType=
"VARCHAR"
/>
<result
property=
"enterpriseId"
column=
"enterprise_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"enterpriseId"
column=
"enterprise_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
jdbcType=
"INTEGER"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
jdbcType=
"INTEGER"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
...
@@ -39,19 +45,41 @@
...
@@ -39,19 +45,41 @@
</select>
</select>
<select
id=
"queryLastLog"
resultMap=
"TabContactLogMap"
>
<select
id=
"queryLastLog"
resultMap=
"TabContactLogMap"
>
select *
SELECT t1.*
from tab_contact_log
FROM tab_contact_log t1
where delete_flag = 0 and member_id = #{memberId}
INNER JOIN (
SELECT biz_type, MAX(contact_time) AS max_contact_time
FROM tab_contact_log
WHERE delete_flag = 0
<if
test=
"memberId != null"
>
AND member_id = #{memberId}
</if>
<if
test=
"clerkId!=null and clerkId!=''"
>
AND clerk_id = #{clerkId}
</if>
<if
test=
"beginTime != null"
>
AND contact_time >= #{beginTime}
</if>
<if
test=
"endTime != null"
>
AND contact_time
<![CDATA[<=]]>
#{endTime}
</if>
GROUP BY biz_type
) t2
ON t1.biz_type = t2.biz_type AND t1.contact_time = t2.max_contact_time
WHERE t1.delete_flag = 0
<if
test=
"memberId != null"
>
AND t1.member_id = #{memberId}
</if>
<if
test=
"clerkId!=null and clerkId!=''"
>
<if
test=
"clerkId!=null and clerkId!=''"
>
and
clerk_id = #{clerkId}
AND t1.
clerk_id = #{clerkId}
</if>
</if>
<if
test=
"beginTime
!=null
"
>
<if
test=
"beginTime
!= null
"
>
and
contact_time >= #{beginTime}
AND t1.
contact_time >= #{beginTime}
</if>
</if>
<if
test=
"endTime
!=null
"
>
<if
test=
"endTime
!= null
"
>
and
contact_time
<![CDATA[<=]]>
#{endTime}
AND t1.
contact_time
<![CDATA[<=]]>
#{endTime}
</if>
</if>
order by contact_time desc,log_id desc limit 1
ORDER BY t1.biz_type ASC,t1.contact_time desc,t1.log_id desc
</select>
</select>
<!--查询列表-->
<!--查询列表-->
...
@@ -128,6 +156,12 @@
...
@@ -128,6 +156,12 @@
contact_cycle,
contact_cycle,
contact_cycle_first,
contact_cycle_first,
potential_time,
potential_time,
potential_score,
source_type,
source_log_id,
biz_type,
biz_data,
follow_types,
enterprise_id
enterprise_id
)
)
values (
values (
...
@@ -143,6 +177,12 @@
...
@@ -143,6 +177,12 @@
#{contactCycle},
#{contactCycle},
#{contactCycleFirst},
#{contactCycleFirst},
#{potentialTime},
#{potentialTime},
#{potentialScore},
#{sourceType},
#{sourceLogId},
#{bizType},
#{bizData},
#{followTypes},
#{enterpriseId})
#{enterpriseId})
</insert>
</insert>
...
@@ -183,6 +223,24 @@
...
@@ -183,6 +223,24 @@
<if
test=
"potentialTime != null"
>
<if
test=
"potentialTime != null"
>
potential_time = #{potentialTime},
potential_time = #{potentialTime},
</if>
</if>
<if
test=
"potentialScore != null"
>
potential_score = #{potentialScore},
</if>
<if
test=
"sourceType != null"
>
source_type = #{sourceType},
</if>
<if
test=
"sourceLogId != null"
>
source_log_id = #{sourceLogId},
</if>
<if
test=
"bizType != null"
>
biz_type = #{bizType},
</if>
<if
test=
"bizData != null"
>
biz_data = #{bizData},
</if>
<if
test=
"followTypes != null"
>
follow_types = #{followTypes},
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
enterprise_id = #{enterpriseId},
enterprise_id = #{enterpriseId},
</if>
</if>
...
...
haoban-manage3-service/src/main/resources/mapper/contact/TabContactOrderMapper.xml
View file @
4c1487ae
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
<result
column=
"contact_time"
property=
"contactTime"
/>
<result
column=
"contact_time"
property=
"contactTime"
/>
<result
column=
"potential_time"
property=
"potentialTime"
/>
<result
column=
"potential_time"
property=
"potentialTime"
/>
<result
column=
"potential_score"
property=
"potentialScore"
/>
<result
column=
"potential_score"
property=
"potentialScore"
/>
<result
column=
"group_info"
property=
"groupInfo"
/>
<result
column=
"source_type"
property=
"sourceType"
/>
<result
column=
"biz_type"
property=
"bizType"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
...
@@ -31,7 +34,7 @@
...
@@ -31,7 +34,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time, potential_score, delete_flag, enterprise_id, create_time, update_time
id, order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time, potential_score,
group_info,source_type,biz_type,
delete_flag, enterprise_id, create_time, update_time
</sql>
</sql>
<select
id=
"queryById"
resultMap=
"BaseResultMap"
>
<select
id=
"queryById"
resultMap=
"BaseResultMap"
>
...
@@ -45,7 +48,7 @@
...
@@ -45,7 +48,7 @@
SELECT
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
FROM tab_contact_order
FROM tab_contact_order
WHERE order_id = #{orderId} and delete_flag = 0
WHERE order_id = #{orderId} and delete_flag = 0
limit 1
</select>
</select>
<select
id=
"queryByIds"
resultMap=
"BaseResultMap"
>
<select
id=
"queryByIds"
resultMap=
"BaseResultMap"
>
...
@@ -74,6 +77,9 @@
...
@@ -74,6 +77,9 @@
<if
test=
"search.channelType != null"
>
<if
test=
"search.channelType != null"
>
AND channel_type = #{search.channelType}
AND channel_type = #{search.channelType}
</if>
</if>
<if
test=
"search.bizType != null"
>
AND biz_type = #{search.bizType}
</if>
<if
test=
"search.storeIdList != null and search.storeIdList.size() > 0"
>
<if
test=
"search.storeIdList != null and search.storeIdList.size() > 0"
>
AND store_id IN
AND store_id IN
<foreach
item=
"storeId"
index=
"index"
collection=
"search.storeIdList"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"storeId"
index=
"index"
collection=
"search.storeIdList"
open=
"("
separator=
","
close=
")"
>
...
@@ -109,8 +115,8 @@
...
@@ -109,8 +115,8 @@
</select>
</select>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO tab_contact_order (order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time,potential_score,
enterprise_id)
INSERT INTO tab_contact_order (order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time,potential_score,
group_info, source_type,biz_type,
enterprise_id)
VALUES (#{orderId}, #{memberId}, #{orderNumber}, #{paidAmount}, #{productCount}, #{goodsInfo}, #{payTime}, #{receiptsDate}, #{channelCode}, #{channelType}, #{clerkId}, #{clerkCode},#{clerkName}, #{storeId}, #{contactLogId}, #{contactTime}, #{potentialTime}, #{potentialScore},
#{enterpriseId})
VALUES (#{orderId}, #{memberId}, #{orderNumber}, #{paidAmount}, #{productCount}, #{goodsInfo}, #{payTime}, #{receiptsDate}, #{channelCode}, #{channelType}, #{clerkId}, #{clerkCode},#{clerkName}, #{storeId}, #{contactLogId}, #{contactTime}, #{potentialTime}, #{potentialScore},
#{groupInfo}, #{sourceType},#{bizType},
#{enterpriseId})
</insert>
</insert>
<update
id=
"update"
>
<update
id=
"update"
>
...
@@ -133,6 +139,9 @@
...
@@ -133,6 +139,9 @@
<if
test=
"contactTime != null"
>
contact_time = #{contactTime},
</if>
<if
test=
"contactTime != null"
>
contact_time = #{contactTime},
</if>
<if
test=
"potentialTime != null"
>
potential_time = #{potentialTime},
</if>
<if
test=
"potentialTime != null"
>
potential_time = #{potentialTime},
</if>
<if
test=
"potentialScore != null"
>
potential_score = #{potentialScore},
</if>
<if
test=
"potentialScore != null"
>
potential_score = #{potentialScore},
</if>
<if
test=
"groupInfo != null"
>
group_info = #{groupInfo},
</if>
<if
test=
"bizType != null"
>
biz_type = #{bizType},
</if>
<if
test=
"source_type != null"
>
source_type = #{sourceType},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId},
</if>
update_time = #{updateTime}
update_time = #{updateTime}
...
...
haoban-manage3-service/src/test/java/contact/ContactTest.java
View file @
4c1487ae
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
...
@@ -13,6 +14,7 @@ import com.gic.haoban.manage.api.qdto.contact.ContactOrderQDTO;
...
@@ -13,6 +14,7 @@ import com.gic.haoban.manage.api.qdto.contact.ContactOrderQDTO;
import
com.gic.haoban.manage.api.service.contact.ContactOrderApiService
;
import
com.gic.haoban.manage.api.service.contact.ContactOrderApiService
;
import
com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO
;
import
com.gic.haoban.manage.service.pojo.bo.potential.MemberLastInteractBO
;
import
com.gic.haoban.manage.service.pojo.bo.potential.MemberLastInteractBO
;
import
com.gic.haoban.manage.service.service.contact.ContactConfigService
;
import
com.gic.haoban.manage.service.service.contact.ContactFollowService
;
import
com.gic.haoban.manage.service.service.contact.ContactFollowService
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.contact.ContactLogService
;
import
com.gic.haoban.manage.service.service.contact.ContactOrderService
;
import
com.gic.haoban.manage.service.service.contact.ContactOrderService
;
...
@@ -39,6 +41,8 @@ public class ContactTest {
...
@@ -39,6 +41,8 @@ public class ContactTest {
@Autowired
@Autowired
private
ContactLogService
contactLogService
;
private
ContactLogService
contactLogService
;
@Autowired
@Autowired
private
ContactConfigService
contactConfigService
;
@Autowired
private
ContactOrderApiService
contactOrderApiService
;
private
ContactOrderApiService
contactOrderApiService
;
@Autowired
@Autowired
private
InteractRecordService
interactRecordService
;
private
InteractRecordService
interactRecordService
;
...
@@ -98,7 +102,7 @@ public class ContactTest {
...
@@ -98,7 +102,7 @@ public class ContactTest {
@Test
@Test
public
void
clearContactLog
()
throws
Exception
{
public
void
clearContactLog
()
throws
Exception
{
contactLogService
.
clearContactLog
(
memberId
,
1
,
""
);
contactLogService
.
clearContactLog
(
eid
,
memberId
,
1
,
""
);
}
}
@Test
@Test
...
@@ -129,4 +133,17 @@ public class ContactTest {
...
@@ -129,4 +133,17 @@ public class ContactTest {
orderQDTO
.
setOnlineOrder
(
true
);
orderQDTO
.
setOnlineOrder
(
true
);
contactOrderApiService
.
saveContactOrder
(
orderQDTO
);
contactOrderApiService
.
saveContactOrder
(
orderQDTO
);
}
}
@Test
public
void
saveContactConfig
()
throws
Exception
{
ContactConfigDTO
contactConfigDTO
=
new
ContactConfigDTO
();
contactConfigDTO
.
setRemarkFlag
(
1
);
contactConfigDTO
.
setEnterpriseId
(
eid
);
contactConfigDTO
.
setContactAutoList
(
Lists
.
newArrayList
(
10
,
20
,
30
));
contactConfigDTO
.
setRemarkContentList
(
Lists
.
newArrayList
(
"微信邀约了客户"
,
"电话邀约了客户"
));
contactConfigService
.
saveContactConfig
(
contactConfigDTO
);
ContactConfigDTO
contactConfig
=
contactConfigService
.
getContactConfig
(
eid
);
System
.
out
.
println
(
JSON
.
toJSONString
(
contactConfig
));
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/contact/ContactController.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
contact
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
import
com.gic.haoban.manage.api.service.contact.ContactConfigApiService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 建联配置
*/
@RestController
@RequestMapping
(
"/contact"
)
public
class
ContactController
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
ContactController
.
class
);
@Autowired
private
ContactConfigApiService
contactConfigApiService
;
/**
* 建联配置
*
* @return RestResponse
*/
@RequestMapping
(
"get"
)
@ResponseBody
public
RestResponse
<
ContactConfigDTO
>
get
()
{
WebLoginDTO
user
=
AuthWebRequestUtil
.
getLoginUser
();
ServiceResponse
<
ContactConfigDTO
>
response
=
contactConfigApiService
.
getContactConfig
(
user
.
getEnterpriseId
());
if
(!
response
.
isSuccess
())
{
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
return
RestResponse
.
successResult
(
response
.
getResult
());
}
/**
* 保存建联配置
*
* @return RestResponse
*/
@RequestMapping
(
"save"
)
@ResponseBody
public
RestResponse
<
Void
>
save
(
@RequestBody
ContactConfigDTO
configDTO
)
{
WebLoginDTO
user
=
AuthWebRequestUtil
.
getLoginUser
();
configDTO
.
setEnterpriseId
(
user
.
getEnterpriseId
());
ServiceResponse
<
Void
>
response
=
contactConfigApiService
.
saveContactConfig
(
configDTO
);
if
(!
response
.
isSuccess
())
{
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
return
RestResponse
.
successResult
();
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
4c1487ae
...
@@ -144,6 +144,7 @@
...
@@ -144,6 +144,7 @@
<dubbo:reference
id=
"appOrderApiService"
interface=
"com.gic.haoban.manage.api.service.licence.AppOrderApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"appOrderApiService"
interface=
"com.gic.haoban.manage.api.service.licence.AppOrderApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"couponCardService"
interface=
"com.gic.marketing.api.service.CouponCardService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"couponCardService"
interface=
"com.gic.marketing.api.service.CouponCardService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"qwMomentApiService"
interface=
"com.gic.haoban.manage.api.service.moment.QwMomentApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"qwMomentApiService"
interface=
"com.gic.haoban.manage.api.service.moment.QwMomentApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"contactConfigApiService"
interface=
"com.gic.haoban.manage.api.service.contact.ContactConfigApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
</beans>
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ClerkMaterialShareController.java
View file @
4c1487ae
...
@@ -130,21 +130,12 @@ public class ClerkMaterialShareController {
...
@@ -130,21 +130,12 @@ public class ClerkMaterialShareController {
log
.
info
(
"saveClerkShareMaterialLog 保存导购分享推荐商品日志 clerkId:{}, recommendShareLogQO{}"
,
recommendShareLogQO
.
getClerkId
(),
JSON
.
toJSONString
(
recommendShareLogQO
));
log
.
info
(
"saveClerkShareMaterialLog 保存导购分享推荐商品日志 clerkId:{}, recommendShareLogQO{}"
,
recommendShareLogQO
.
getClerkId
(),
JSON
.
toJSONString
(
recommendShareLogQO
));
List
<
ClerkShareGoodsLogDTO
>
list
=
Lists
.
newArrayList
();
List
<
ClerkShareGoodsLogDTO
>
list
=
Lists
.
newArrayList
();
List
<
String
>
memberIdList
=
Lists
.
newArrayList
();
List
<
String
>
goodsIdList
=
recommendShareLogQO
.
getGoodsIdList
();
List
<
String
>
goodsIdList
=
recommendShareLogQO
.
getGoodsIdList
();
List
<
RecommendShareLogQO
.
MemberInfo
>
externalUserIdList
=
recommendShareLogQO
.
getMemberInfoList
();
for
(
String
goodsId
:
goodsIdList
)
{
for
(
RecommendShareLogQO
.
MemberInfo
memberInfo
:
externalUserIdList
)
{
for
(
String
goodsId
:
goodsIdList
)
{
ClerkShareGoodsLogDTO
temp
=
new
ClerkShareGoodsLogDTO
();
ClerkShareGoodsLogDTO
temp
=
new
ClerkShareGoodsLogDTO
();
temp
.
setEnterpriseId
(
recommendShareLogQO
.
getEnterpriseId
());
temp
.
setEnterpriseId
(
recommendShareLogQO
.
getEnterpriseId
());
temp
.
setWxEnterpriseId
(
recommendShareLogQO
.
getWxEnterpriseId
());
temp
.
setWxEnterpriseId
(
recommendShareLogQO
.
getWxEnterpriseId
());
temp
.
setClerkId
(
recommendShareLogQO
.
getClerkId
());
temp
.
setClerkId
(
recommendShareLogQO
.
getClerkId
());
temp
.
setExternalUserId
(
memberInfo
.
getExternalUserId
());
temp
.
setMemberId
(
memberInfo
.
getMemberId
());
if
(
StringUtils
.
isNotEmpty
(
memberInfo
.
getMemberId
())){
memberIdList
.
add
(
memberInfo
.
getMemberId
());
}
temp
.
setBizId
(
goodsId
);
temp
.
setBizId
(
goodsId
);
temp
.
setBizType
(
ShareBizType
.
GOODS
.
getCode
());
temp
.
setBizType
(
ShareBizType
.
GOODS
.
getCode
());
temp
.
setStoreId
(
recommendShareLogQO
.
getStoreId
());
temp
.
setStoreId
(
recommendShareLogQO
.
getStoreId
());
...
@@ -152,25 +143,20 @@ public class ClerkMaterialShareController {
...
@@ -152,25 +143,20 @@ public class ClerkMaterialShareController {
temp
.
setStaffId
(
recommendShareLogQO
.
getStaffId
());
temp
.
setStaffId
(
recommendShareLogQO
.
getStaffId
());
temp
.
setWxaLinkId
(
recommendShareLogQO
.
getWxaLinkId
());
temp
.
setWxaLinkId
(
recommendShareLogQO
.
getWxaLinkId
());
list
.
add
(
temp
);
list
.
add
(
temp
);
}
}
}
ServiceResponse
<
Long
>
serviceResponse
=
materialShareLogApiService
.
saveClerkShareRecommendLog
(
list
);
// 改为查询企微是否真正发送成功
DealQwSendDTO
.
FinishQwSendBO
finishQwSendBO
=
new
DealQwSendDTO
.
FinishQwSendBO
(
recommendShareLogQO
.
getClerkId
(),
recommendShareLogQO
.
getStaffId
(),
DateUtil
.
date
(),
2
,
recommendShareLogQO
.
getWxEnterpriseId
(),
recommendShareLogQO
.
getEnterpriseId
());
finishQwSendBO
.
setShareGoodsList
(
list
);
dealQwSendMsg
(
finishQwSendBO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
"-701"
,
"系统异常"
);
}
//更新会员推荐时间更新
if
(
CollectionUtils
.
isNotEmpty
(
memberIdList
)){
for
(
String
memberId
:
memberIdList
)
{
MemberExtraPropertyReq
memberExtraPropertyReq
=
new
MemberExtraPropertyReq
();
memberExtraPropertyReq
.
setEnterpriseId
(
recommendShareLogQO
.
getEnterpriseId
());
memberExtraPropertyReq
.
setMemberId
(
memberId
);
memberExtraPropertyReq
.
setExtraKey
(
MemberExtKeyEnum
.
MEMBER_GOODS_SUGGEST_TIME
.
key
());
memberExtraPropertyReq
.
setExtraValue
(
new
Date
().
getTime
());
memberExtraPropertyApiService
.
updateMemberExtraProperty
(
memberExtraPropertyReq
);
}
}
if
(
StringUtils
.
isNotBlank
(
recommendShareLogQO
.
getWxaLinkId
()))
{
if
(
StringUtils
.
isNotBlank
(
recommendShareLogQO
.
getWxaLinkId
()))
{
enterpriseWxaLinkService
.
updateTimeById
(
recommendShareLogQO
.
getWxaLinkId
());
enterpriseWxaLinkService
.
updateTimeById
(
recommendShareLogQO
.
getWxaLinkId
());
}
}
...
@@ -179,7 +165,6 @@ public class ClerkMaterialShareController {
...
@@ -179,7 +165,6 @@ public class ClerkMaterialShareController {
}
}
private
void
dealQwSendMsg
(
DealQwSendDTO
.
FinishQwSendBO
finishQwSend
)
{
private
void
dealQwSendMsg
(
DealQwSendDTO
.
FinishQwSendBO
finishQwSend
)
{
// 商品分享暂时不记,记录的是发送商品的类型而不是企微群发
DealQwSendDTO
dealQwSendDTO
=
new
DealQwSendDTO
();
DealQwSendDTO
dealQwSendDTO
=
new
DealQwSendDTO
();
dealQwSendDTO
.
setEnterpriseId
(
finishQwSend
.
getEnterpriseId
());
dealQwSendDTO
.
setEnterpriseId
(
finishQwSend
.
getEnterpriseId
());
dealQwSendDTO
.
setRefreshType
(
1
);
dealQwSendDTO
.
setRefreshType
(
1
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/potential/ContactController.java
View file @
4c1487ae
...
@@ -7,16 +7,17 @@ import com.gic.api.base.commons.Page;
...
@@ -7,16 +7,17 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.manage.api.dto.contact.ContactConfigDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.dto.contact.ContactFollowDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogCheckQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO
;
import
com.gic.haoban.manage.api.service.contact.ContactConfigApiService
;
import
com.gic.haoban.manage.api.service.contact.ContactFollowApiService
;
import
com.gic.haoban.manage.api.service.contact.ContactFollowApiService
;
import
com.gic.haoban.manage.api.service.contact.ContactLogApiService
;
import
com.gic.haoban.manage.api.service.contact.ContactLogApiService
;
import
com.gic.haoban.manage.web.qo.contact.ContactFollowPageQO
;
import
com.gic.haoban.manage.web.qo.contact.*
;
import
com.gic.haoban.manage.web.qo.contact.ContactFollowQO
;
import
com.gic.haoban.manage.web.vo.contact.ContactLogCheckVO
;
import
com.gic.haoban.manage.web.qo.contact.ContactLastFollowQO
;
import
com.gic.haoban.manage.web.qo.contact.ContactLogQO
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -40,6 +41,8 @@ public class ContactController {
...
@@ -40,6 +41,8 @@ public class ContactController {
private
ContactFollowApiService
contactFollowApiService
;
private
ContactFollowApiService
contactFollowApiService
;
@Autowired
@Autowired
private
ContactLogApiService
contactLogApiService
;
private
ContactLogApiService
contactLogApiService
;
@Autowired
private
ContactConfigApiService
contactConfigApiService
;
/**
/**
* 添加跟进记录
* 添加跟进记录
...
@@ -117,6 +120,7 @@ public class ContactController {
...
@@ -117,6 +120,7 @@ public class ContactController {
@RequestMapping
(
path
=
"/log"
)
@RequestMapping
(
path
=
"/log"
)
public
RestResponse
<
Void
>
saveLog
(
@RequestBody
ContactLogQO
contactLogQO
)
{
public
RestResponse
<
Void
>
saveLog
(
@RequestBody
ContactLogQO
contactLogQO
)
{
ContactLogQDTO
logQDTO
=
EntityUtil
.
changeEntityNew
(
ContactLogQDTO
.
class
,
contactLogQO
);
ContactLogQDTO
logQDTO
=
EntityUtil
.
changeEntityNew
(
ContactLogQDTO
.
class
,
contactLogQO
);
logQDTO
.
setSourceType
(
contactLogQO
.
getBizType
());
ServiceResponse
<
Void
>
serviceResponse
=
contactLogApiService
.
saveContactLog
(
logQDTO
);
ServiceResponse
<
Void
>
serviceResponse
=
contactLogApiService
.
saveContactLog
(
logQDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
...
@@ -124,4 +128,33 @@ public class ContactController {
...
@@ -124,4 +128,33 @@ public class ContactController {
return
RestResponse
.
successResult
();
return
RestResponse
.
successResult
();
}
}
/**
* 是否可以建联校验
* @param contactLogCheckQO
* @return
*/
@RequestMapping
(
path
=
"/check"
)
public
RestResponse
<
ContactLogCheckVO
>
check
(
@RequestBody
ContactLogCheckQO
contactLogCheckQO
)
{
ContactLogCheckQDTO
logCheckQDTO
=
EntityUtil
.
changeEntityNew
(
ContactLogCheckQDTO
.
class
,
contactLogCheckQO
);
ServiceResponse
<
Boolean
>
serviceResponse
=
contactLogApiService
.
contactCheck
(
logCheckQDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
return
RestResponse
.
successResult
(
new
ContactLogCheckVO
(
serviceResponse
.
getResult
()));
}
/**
* 建联配置
* @param enterpriseId
* @return
*/
@RequestMapping
(
path
=
"/config"
)
public
RestResponse
<
ContactConfigDTO
>
config
(
String
enterpriseId
)
{
ServiceResponse
<
ContactConfigDTO
>
serviceResponse
=
contactConfigApiService
.
getContactConfig
(
enterpriseId
);
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/contact/ContactFollowQO.java
View file @
4c1487ae
...
@@ -18,7 +18,7 @@ public class ContactFollowQO {
...
@@ -18,7 +18,7 @@ public class ContactFollowQO {
private
String
clerkId
;
private
String
clerkId
;
/**
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
6自动建联 7营销素材
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
*/
private
Integer
followType
;
private
Integer
followType
;
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/contact/ContactLogCheckQO.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
.
contact
;
import
java.io.Serializable
;
public
class
ContactLogCheckQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
973688857967269973L
;
/**
* 会员id
*/
private
String
memberId
;
/**
* 导购id
*/
private
String
clerkId
;
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)null为都校验
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
;
public
String
getMemberId
()
{
return
memberId
;
}
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
memberId
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
}
\ No newline at end of file
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/contact/ContactLogQO.java
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
.
contact
;
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
.
contact
;
import
com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
ContactLogQO
implements
Serializable
{
public
class
ContactLogQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
973688857967269973L
;
private
static
final
long
serialVersionUID
=
973688857967269973L
;
...
@@ -21,6 +24,21 @@ public class ContactLogQO implements Serializable {
...
@@ -21,6 +24,21 @@ public class ContactLogQO implements Serializable {
*/
*/
private
String
enterpriseId
;
private
String
enterpriseId
;
/**
* 业务类型 1潜客(0001)2机会人群(0010)
* @see com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum
*/
private
Integer
bizType
=
ContactBizTypeEnum
.
POTENTIAL_CUSTOMER
.
getType
();
/**
* 跟进记录
*/
private
String
followRemark
;
/**
* 跟进上传素材,数组格式
*/
private
List
<
String
>
followMaterialList
;
public
String
getMemberId
()
{
public
String
getMemberId
()
{
return
memberId
;
return
memberId
;
}
}
...
@@ -52,4 +70,28 @@ public class ContactLogQO implements Serializable {
...
@@ -52,4 +70,28 @@ public class ContactLogQO implements Serializable {
public
void
setEnterpriseId
(
String
enterpriseId
)
{
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
this
.
enterpriseId
=
enterpriseId
;
}
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
public
String
getFollowRemark
()
{
return
followRemark
;
}
public
void
setFollowRemark
(
String
followRemark
)
{
this
.
followRemark
=
followRemark
;
}
public
List
<
String
>
getFollowMaterialList
()
{
return
followMaterialList
;
}
public
void
setFollowMaterialList
(
List
<
String
>
followMaterialList
)
{
this
.
followMaterialList
=
followMaterialList
;
}
}
}
\ No newline at end of file
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/contact/ContactLogCheckVO.java
0 → 100644
View file @
4c1487ae
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
contact
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ContactLogCheckVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
973688857967269973L
;
/**
* 是否可以建联
*/
private
Boolean
check
;
public
ContactLogCheckVO
()
{
}
public
ContactLogCheckVO
(
Boolean
check
)
{
this
.
check
=
check
;
}
}
\ No newline at end of file
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
4c1487ae
...
@@ -141,6 +141,7 @@
...
@@ -141,6 +141,7 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactFollowApiService"
id=
"contactFollowApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactFollowApiService"
id=
"contactFollowApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactLogApiService"
id=
"contactLogApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactLogApiService"
id=
"contactLogApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactOrderApiService"
id=
"contactOrderApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactOrderApiService"
id=
"contactOrderApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.contact.ContactConfigApiService"
id=
"contactConfigApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.content.PotentialCustomerApiService"
id=
"potentialCustomerApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.content.PotentialCustomerApiService"
id=
"potentialCustomerApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.content.InteractRecordApiService"
id=
"interactRecordApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.content.InteractRecordApiService"
id=
"interactRecordApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
...
...
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