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
2b866fbd
Commit
2b866fbd
authored
Jan 24, 2025
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置时间发送销售线索
parent
15dc9be6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
5 deletions
+47
-5
PotentialCustomerStaticsBO.java
...e/service/pojo/bo/content/PotentialCustomerStaticsBO.java
+4
-0
PotentialCustomerServiceImpl.java
...ce/service/content/impl/PotentialCustomerServiceImpl.java
+5
-1
InteractRecordMessageService.java
...service/content/message/InteractRecordMessageService.java
+19
-0
QywxGroupMsgTaskApiServiceImpl.java
...out/impl/content/task/QywxGroupMsgTaskApiServiceImpl.java
+19
-4
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/content/PotentialCustomerStaticsBO.java
View file @
2b866fbd
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
.
bo
.
content
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
...
...
@@ -11,6 +13,8 @@ import java.io.Serializable;
* @Version
**/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PotentialCustomerStaticsBO
implements
Serializable
{
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/PotentialCustomerServiceImpl.java
View file @
2b866fbd
...
...
@@ -279,16 +279,20 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
log
.
info
(
"处理企业{}下的销售线索通知"
,
context
.
getEnterpriseId
());
List
<
PotentialCustomerStaticsBO
>
customerStaticsBos
=
context
.
getCustomerStaticsBos
();
if
(
CollectionUtils
.
isEmpty
(
customerStaticsBos
))
{
// 根据企业id + 时间 循环查询时间段内的有新互动记录的导购id 去重
InteractRecordQO
searchQo
=
new
InteractRecordQO
();
searchQo
.
setEnterpriseId
(
context
.
getEnterpriseId
());
searchQo
.
setStartTime
(
context
.
getStartTime
());
searchQo
.
setEndTime
(
context
.
getEndTime
());
List
<
PotentialCustomerStaticsBO
>
customerStaticsBos
=
interactRecordService
.
staticsClerkNewInteractRecord
(
searchQo
);
customerStaticsBos
=
interactRecordService
.
staticsClerkNewInteractRecord
(
searchQo
);
if
(
CollectionUtils
.
isEmpty
(
customerStaticsBos
))
{
log
.
info
(
"企业下不存在新增线索的导购 {}"
,
JSON
.
toJSONString
(
context
));
return
;
}
}
context
.
setCustomerStaticsBos
(
customerStaticsBos
);
// 获取导购与成员关联关联关系
potentialCustomerNotifyBuilder
.
buildClerkRelations
(
context
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/message/InteractRecordMessageService.java
View file @
2b866fbd
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
message
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.content.api.dto.setting.ContentSettingDTO
;
import
com.gic.content.api.service.ContentSettingApiService
;
import
com.gic.haoban.manage.api.enums.content.MaterialInteractRecordEventType
;
import
com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.InteractRecordExtendInfoBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerStaticsBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.context.InteractRecordMessageContext
;
import
com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNotifyContext
;
import
com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO
;
import
com.gic.haoban.manage.service.service.content.InteractRecordService
;
import
com.gic.haoban.manage.service.service.content.PotentialCustomerService
;
import
com.gic.haoban.manage.service.service.content.adaptor.InteractRecordMessageBuilder
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.google.common.collect.Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -37,6 +43,8 @@ public class InteractRecordMessageService {
InteractRecordMessageBuilder
interactRecordMessageBuilder
;
@Autowired
PotentialCustomerService
potentialCustomerService
;
@Autowired
ContentSettingApiService
contentSettingApiService
;
/**
* 处理互动记录
...
...
@@ -156,6 +164,17 @@ public class InteractRecordMessageService {
potentialCustomerBO
.
setTimes
(
interactRecordBO
.
getTimes
());
potentialCustomerService
.
saveOrUpdatePotentialCustomer
(
potentialCustomerBO
);
}
ServiceResponse
<
ContentSettingDTO
>
response
=
contentSettingApiService
.
queryContentSettingInfo
(
interactRecordMessageBO
.
getEnterpriseId
());
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
)
{
Integer
potentialNotifyInterval
=
response
.
getResult
().
getPotentialNotifyInterval
();
if
(
potentialNotifyInterval
!=
null
&&
potentialNotifyInterval
<=
0
)
{
PotentialCustomerNotifyContext
notifyContext
=
PotentialCustomerNotifyContext
.
builder
()
.
enterpriseId
(
interactRecordMessageBO
.
getEnterpriseId
())
.
customerStaticsBos
(
Lists
.
newArrayList
(
new
PotentialCustomerStaticsBO
(
interactRecordBO
.
getClerkId
(),
1
)))
.
build
();
potentialCustomerService
.
sendPotentialCustomerNotice
(
notifyContext
);
}
}
}
finally
{
RedisUtil
.
unlock
(
recordKey
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/content/task/QywxGroupMsgTaskApiServiceImpl.java
View file @
2b866fbd
...
...
@@ -14,6 +14,8 @@ import com.gic.clerk.api.dto.ClerkDTO;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.content.api.dto.setting.ContentSettingDTO
;
import
com.gic.content.api.service.ContentSettingApiService
;
import
com.gic.enterprise.api.constant.EnterpriseServiceEnum
;
import
com.gic.enterprise.api.dto.enterprise.EnterpriseUsingStatusDTO
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
...
...
@@ -82,6 +84,8 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
PotentialCustomerService
potentialCustomerService
;
@Autowired
private
ContentSettingApiService
contentSettingApiService
;
@Autowired
private
EcommerceOrderOutputApiService
ecommerceOrderOutputApiService
;
...
...
@@ -267,7 +271,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
*/
@Override
public
ServiceResponse
<
Void
>
potentialCustomerJob
(
String
params
)
{
Date
now
=
new
Date
(
);
Date
now
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
beginOfSecond
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
date
()
);
log
.
info
(
"potentialCustomerJob 执行销售线索通知 {}"
,
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
now
,
"yyyy-MM-dd HH:mm:ss"
));
int
currentHour
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
hour
(
now
,
true
);
if
(
currentHour
>=
23
||
currentHour
<
8
)
{
...
...
@@ -279,7 +283,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
log
.
info
(
"开通内容权限的企业为空"
);
return
ServiceResponse
.
success
();
}
Date
startTime
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
now
,
-
30
).
toJdkDate
()
;
Date
startTime
=
null
;
// 如果是8点那次的执行 需要获取 23 ~ 8点的数据
if
(
checkIsTodayFirst
(
now
))
{
log
.
info
(
"本次执行为当天第一次执行 {}"
,
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
now
,
"yyyy-MM-dd HH:mm:ss"
));
...
...
@@ -294,6 +298,18 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
startTime
=
calendar
.
getTime
();
}
for
(
String
enterpriseId
:
enterpriseIds
)
{
Integer
potentialNotifyInterval
=
30
;
ServiceResponse
<
ContentSettingDTO
>
response
=
contentSettingApiService
.
queryContentSettingInfo
(
enterpriseId
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
)
{
potentialNotifyInterval
=
response
.
getResult
().
getPotentialNotifyInterval
();
}
if
(
potentialNotifyInterval
<=
0
||
cn
.
hutool
.
core
.
date
.
DateUtil
.
minute
(
now
)
%
potentialNotifyInterval
!=
0
)
{
continue
;
}
if
(
startTime
==
null
)
{
startTime
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
now
,
-
potentialNotifyInterval
).
toJdkDate
();
}
log
.
info
(
"销售线索执行eid:{},potentialNotifyInterval:{}"
,
enterpriseId
,
potentialNotifyInterval
);
PotentialCustomerNotifyContext
context
=
PotentialCustomerNotifyContext
.
builder
()
.
enterpriseId
(
enterpriseId
)
.
startTime
(
startTime
)
...
...
@@ -314,8 +330,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
int
hour_sec
=
30
*
60
;
private
boolean
checkIsTodayFirst
(
Date
now
)
{
DateTime
temp
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetSecond
(
now
,
-(
hour_sec
));
return
cn
.
hutool
.
core
.
date
.
DateUtil
.
hour
(
temp
,
true
)
<
8
;
return
cn
.
hutool
.
core
.
date
.
DateUtil
.
hour
(
now
,
true
)
==
8
&&
cn
.
hutool
.
core
.
date
.
DateUtil
.
minute
(
now
)
<
5
;
}
...
...
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