Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
4b1c0742
提交
4b1c0742
authored
11月 02, 2022
作者:
gh
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
0e6ca380
8f37100e
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
99 行增加
和
40 行删除
+99
-40
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+9
-2
CrowdPackageCommonConstant.java
...oyaozw/customer/constants/CrowdPackageCommonConstant.java
+2
-0
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+1
-1
CrowdPackageController.java
.../yaoyaozw/customer/controller/CrowdPackageController.java
+6
-2
CrowdPackage.java
src/main/java/com/yaoyaozw/customer/entity/CrowdPackage.java
+21
-1
KanbanCommonMapper.java
...java/com/yaoyaozw/customer/mapper/KanbanCommonMapper.java
+0
-5
MaterialCommonMapper.java
...va/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
+6
-0
SchedulingTask.java
...java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
+1
-3
CrowdPackageService.java
...va/com/yaoyaozw/customer/service/CrowdPackageService.java
+4
-1
CrowdPackageServiceImpl.java
...oyaozw/customer/service/impl/CrowdPackageServiceImpl.java
+3
-3
CustomerDelayTextServiceImpl.java
...w/customer/service/impl/CustomerDelayTextServiceImpl.java
+4
-3
CustomerGraphicsDelayServiceImpl.java
...stomer/service/impl/CustomerGraphicsDelayServiceImpl.java
+11
-4
CrowdPackageDetailVO.java
.../com/yaoyaozw/customer/vo/crowd/CrowdPackageDetailVO.java
+18
-3
KanbanCommonMapper.xml
src/main/resources/mapper/KanbanCommonMapper.xml
+0
-12
MaterialCommonMapper.xml
src/main/resources/mapper/MaterialCommonMapper.xml
+13
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
4b1c0742
...
...
@@ -403,6 +403,8 @@ public class CustomerServiceCommonAsyncComponent {
// 遍历处理客服链接
int
idx
=
1
;
boolean
normal
=
true
;
boolean
needLink
=
true
;
for
(
ReferralEntity
sourceReferralEntity
:
sourceReferralList
)
{
// 生成新的链接数据
ReferralEntity
targetReferralEntity
=
new
ReferralEntity
();
...
...
@@ -431,12 +433,16 @@ public class CustomerServiceCommonAsyncComponent {
// 常用链接
generateDelayUsualLink
(
dateStr
,
targetReferralEntity
,
targetAuthInfo
);
}
else
{
needLink
=
false
;
LOCAL_LOG
.
info
(
"newsType: {}, 不需要获取链接"
,
newsType
);
}
targetReferralEntityList
.
add
(
targetReferralEntity
);
// 图文主表只有一个素材链接,文本主表不需要存素材链接
String
referral
=
targetReferralEntity
.
getReferral
();
if
(
needLink
&&
StringUtils
.
isBlank
(
referral
))
{
normal
=
false
;
}
targetCustomerGraphics
.
setSourceUrl
(
referral
);
if
(
type
.
equals
(
CustomerCommonConstant
.
CUSTOMER_TYPE_VALUE_TEXT
))
{
// 文本类型替换h5链接
...
...
@@ -457,8 +463,8 @@ public class CustomerServiceCommonAsyncComponent {
idx
+=
1
;
}
}
targetCustomerGraphics
.
setSendStatus
(
normal
?
CustomerCommonConstant
.
SEND_STATUS_ACTIVE
:
CustomerCommonConstant
.
SEND_STATUS_LINK_ERROR
);
targetCustomerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_ACTIVE
);
if
(
StringUtils
.
isNotBlank
(
h5Context
))
{
targetCustomerGraphics
.
setContent
(
h5Context
.
toString
().
replace
(
CustomerCommonConstant
.
H5_STYLE_CODE
,
""
));
}
...
...
@@ -548,7 +554,7 @@ public class CustomerServiceCommonAsyncComponent {
* 以下是公有方法
*/
public
void
getCopyReferral
(
String
dateStr
,
AuthInfoVO
authInfoVo
,
ReferralEntity
referralEntity
)
{
//
ygAccessLimit(true, authInfoVo.getStoreType());
ygAccessLimit
(
true
,
authInfoVo
.
getStoreType
());
referralEntity
.
setStoreType
(
authInfoVo
.
getStoreType
());
// 非常用链接类型的name需要处理
String
name
=
referralEntity
.
getName
();
...
...
@@ -649,6 +655,7 @@ public class CustomerServiceCommonAsyncComponent {
@RabbitListener
(
queues
=
RabbitCommonNameConstant
.
YG_LIMIT_DEATH_QUEUE
)
public
void
listener
()
{
LOCAL_LOG
.
info
(
"消费"
);
redisTemplate
.
opsForValue
().
decrement
(
CustomerCommonConstant
.
YANG_GUANG_ACCESS_LIMIT_REDIS_KEY
);
}
...
...
src/main/java/com/yaoyaozw/customer/constants/CrowdPackageCommonConstant.java
浏览文件 @
4b1c0742
...
...
@@ -37,4 +37,6 @@ public class CrowdPackageCommonConstant {
public
static
final
Pattern
NUMBER_COMPILE
=
Pattern
.
compile
(
"[\\d]"
);
public
static
final
Long
HOUR_TO_MILLION_RATE
=
60
*
60
*
1000L
;
}
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
4b1c0742
...
...
@@ -63,7 +63,7 @@ public class CustomerCommonConstant {
public
final
static
Integer
SEND_STATUS_ACTIVE
=
9
;
public
final
static
Integer
SEND_STATUS_
SENT_SUCCESS
=
3
;
public
final
static
Integer
SEND_STATUS_
LINK_ERROR
=
3
;
public
final
static
Integer
SEND_STATUS_SENT_FAIL
=
4
;
...
...
src/main/java/com/yaoyaozw/customer/controller/CrowdPackageController.java
浏览文件 @
4b1c0742
...
...
@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -28,8 +29,11 @@ public class CrowdPackageController {
@ApiOperation
(
"新增人群包"
)
@GetMapping
(
"/insertPackage"
)
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
@RequestParam
(
required
=
false
)
Long
id
,
@RequestParam
(
required
=
false
)
String
name
)
{
return
crowdPackageService
.
insertCrowdPackage
(
id
,
name
);
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
@RequestParam
(
required
=
false
)
Long
id
,
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
Double
activeTimeMin
,
@RequestParam
(
required
=
false
)
Double
activeTimeMax
)
{
return
crowdPackageService
.
insertCrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
);
}
@ApiOperation
(
"向人群包内新增条件"
)
...
...
src/main/java/com/yaoyaozw/customer/entity/CrowdPackage.java
浏览文件 @
4b1c0742
...
...
@@ -3,9 +3,11 @@ package com.yaoyaozw.customer.entity;
import
java.io.Serializable
;
import
java.util.Date
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.Id
;
...
...
@@ -34,6 +36,18 @@ public class CrowdPackage implements Serializable {
private
String
packageName
;
/**
* 活跃时间左边界
*/
@TableField
(
"active_time_min"
)
private
Long
activeTimeMin
;
/**
* 活跃时间右边界
*/
@TableField
(
"active_time_max"
)
private
Long
activeTimeMax
;
/**
* 人群包用户人数
*/
@TableField
(
"crowd_num"
)
...
...
@@ -71,9 +85,15 @@ public class CrowdPackage implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
public
CrowdPackage
(
Long
id
,
String
packageName
)
{
public
CrowdPackage
(
Long
id
,
String
packageName
,
Double
activeTimeMin
,
Double
activeTimeMax
)
{
this
.
id
=
id
;
this
.
packageName
=
packageName
;
if
(
ObjectUtil
.
isNotNull
(
activeTimeMin
))
{
this
.
activeTimeMin
=
activeTimeMin
.
longValue
()
*
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
}
if
(
ObjectUtil
.
isNotNull
(
activeTimeMax
))
{
this
.
activeTimeMax
=
activeTimeMax
.
longValue
()
*
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
}
}
public
void
handleInfo
(
Date
now
,
Long
userId
,
Boolean
isCreate
)
{
...
...
src/main/java/com/yaoyaozw/customer/mapper/KanbanCommonMapper.java
浏览文件 @
4b1c0742
...
...
@@ -51,11 +51,6 @@ public interface KanbanCommonMapper {
*/
List
<
CommonOptionResponseVO
>
getStoreTypeEntity
(
@Param
(
"storeKeySet"
)
Set
<
String
>
storeKeySet
);
/**
* @param appId 应用程序id
* @return {@link String}
*/
String
getStoreTypeNameByAppId
(
@Param
(
"appId"
)
String
appId
);
...
...
src/main/java/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
浏览文件 @
4b1c0742
...
...
@@ -57,4 +57,10 @@ public interface MaterialCommonMapper {
*/
List
<
CustomerCommonLink
>
getCommonLinkMapping
(
@Param
(
"currentKey"
)
String
currentKey
);
/**
* @param appId 应用程序id
* @return {@link String}
*/
String
getStoreTypeNameByAppId
(
@Param
(
"appId"
)
String
appId
);
}
src/main/java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
浏览文件 @
4b1c0742
...
...
@@ -38,8 +38,6 @@ public class SchedulingTask {
private
CustomerDelayPublishService
customerDelayPublishService
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
CrowdPackageServiceImpl
crowdPackageService
;
...
...
@@ -127,7 +125,7 @@ public class SchedulingTask {
/**
* 从redis中更新人群包人数
*/
//
@Scheduled(cron = "0 0/15 * * * ?")
@Scheduled
(
cron
=
"0 0/15 * * * ?"
)
public
void
updateCrowdPackageNumFromRedis
()
{
crowdPackageService
.
updateCrowdPackageNumFromRedis
();
}
...
...
src/main/java/com/yaoyaozw/customer/service/CrowdPackageService.java
浏览文件 @
4b1c0742
...
...
@@ -7,6 +7,7 @@ import com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -20,9 +21,11 @@ public interface CrowdPackageService extends IService<CrowdPackage> {
*
* @param id 人群包id
* @param name 人群包名
* @param activeTimeMin 活跃时间左边界
* @param activeTimeMax 活跃时间右边界
* @return {@link BaseResult}
*/
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
Long
id
,
String
name
);
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
Long
id
,
String
name
,
Double
activeTimeMin
,
Double
activeTimeMax
);
/**
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CrowdPackageServiceImpl.java
浏览文件 @
4b1c0742
...
...
@@ -65,12 +65,12 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
@Override
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
Long
id
,
String
name
)
{
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
Long
id
,
String
name
,
Double
activeTimeMin
,
Double
activeTimeMax
)
{
// 根据是否传了主键判断是创建还是更新
boolean
isCreate
=
ObjectUtil
.
isNull
(
id
);
// 获取操作人
Long
userId
=
tokenManager
.
getUserIdFromToken
();
CrowdPackage
crowdPackage
=
new
CrowdPackage
(
id
,
name
);
CrowdPackage
crowdPackage
=
new
CrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
);
crowdPackage
.
handleInfo
(
new
Date
(),
userId
,
isCreate
);
if
(
ObjectUtil
.
isNotNull
(
name
))
{
// 判断是否有重名
...
...
@@ -128,7 +128,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
if
(
ObjectUtil
.
isNull
(
byId
))
{
return
new
GenericsResult
<>(
false
,
"无法获取主体数据"
);
}
CrowdPackageDetailVO
vo
=
new
CrowdPackageDetailVO
(
id
,
byId
.
getPackageName
()
);
CrowdPackageDetailVO
vo
=
new
CrowdPackageDetailVO
(
byId
);
// 获取条件数据
List
<
CrowdPackageConditionMatch
>
conditionMatchList
=
matchService
.
list
(
new
QueryWrapper
<
CrowdPackageConditionMatch
>().
eq
(
"package_id"
,
id
));
JSONArray
jsonArray
=
JSONUtil
.
parseArray
(
conditionMatchList
);
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerDelayTextServiceImpl.java
浏览文件 @
4b1c0742
...
...
@@ -18,6 +18,7 @@ import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
import
com.yaoyaozw.customer.service.AuthorizerInfoService
;
import
com.yaoyaozw.customer.service.CustomerDelayTextService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsDelayService
;
...
...
@@ -56,9 +57,9 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
@Autowired
private
CustomerServiceCommonAsyncComponent
commonAsyncComponent
;
@Autowired
private
KanbanCommonMapper
kanbanCommonMapper
;
@Autowired
private
CustomerGraphicsDelayService
graphicsDelayService
;
@Autowired
private
MaterialCommonMapper
materialCommonMapper
;
@Override
public
GenericsResult
<
String
>
insertCustomerDelay
(
CustomerDelayTextSaveDTO
saveDto
)
{
...
...
@@ -113,7 +114,7 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
referralEntity
.
setName
(
nameModel
);
}
String
storeTypeName
=
kanban
CommonMapper
.
getStoreTypeNameByAppId
(
referralDto
.
getAppId
());
String
storeTypeName
=
material
CommonMapper
.
getStoreTypeNameByAppId
(
referralDto
.
getAppId
());
referralEntity
.
setStoreTypeName
(
storeTypeName
);
// 获取链接
// 日期
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsDelayServiceImpl.java
浏览文件 @
4b1c0742
...
...
@@ -21,6 +21,7 @@ import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.MaterialCommonMapper
;
import
com.yaoyaozw.customer.service.AuthorizerInfoService
;
import
com.yaoyaozw.customer.service.CustomerDelayTextService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsDelayService
;
...
...
@@ -66,6 +67,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
private
KanbanCommonMapper
kanbanCommonMapper
;
@Autowired
private
CustomerServiceCommonAsyncComponent
commonAsyncComponent
;
@Autowired
private
MaterialCommonMapper
materialCommonMapper
;
@Override
...
...
@@ -122,6 +125,8 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
localLog
.
info
(
"获取链接name模板: {}"
,
linkNameModel
);
referralEntity
.
setName
(
linkNameModel
);
}
String
storeTypeName
=
materialCommonMapper
.
getStoreTypeNameByAppId
(
customerGraphicsDelay
.
getAppId
());
referralEntity
.
setStoreTypeName
(
storeTypeName
);
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
);
String
dateStr
=
dateFormat
.
format
(
new
Date
());
...
...
@@ -136,16 +141,18 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
return
new
BaseResult
().
error
(
"获取链接异常"
+
e
.
getMessage
());
}
}
customerGraphicsDelay
.
setSourceUrl
(
referralEntity
.
getReferral
());
try
{
customerGraphicsDelay
.
setSourceUrl
(
referralEntity
.
getReferral
());
}
catch
(
Exception
e
)
{
return
new
BaseResult
().
error
(
e
.
getMessage
());
}
boolean
mainResult
=
super
.
saveOrUpdate
(
customerGraphicsDelay
);
if
(!
mainResult
)
{
localLog
.
info
(
"主体数据生成异常"
);
return
new
BaseResult
().
error
(
"新增/更新 主体数据异常"
);
}
String
storeTypeName
=
kanbanCommonMapper
.
getStoreTypeNameByAppId
(
customerGraphicsDelay
.
getAppId
());
referralEntity
.
setStoreTypeName
(
storeTypeName
);
boolean
referralResult
=
referralEntityService
.
saveOrUpdate
(
referralEntity
);
if
(!
referralResult
)
{
return
new
BaseResult
().
error
(
"新增/更新 链接数据异常"
);
...
...
src/main/java/com/yaoyaozw/customer/vo/crowd/CrowdPackageDetailVO.java
浏览文件 @
4b1c0742
package
com
.
yaoyaozw
.
customer
.
vo
.
crowd
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -26,11 +29,23 @@ public class CrowdPackageDetailVO implements Serializable {
@ApiModelProperty
(
"人群包名"
)
private
String
packageName
;
@ApiModelProperty
(
"活跃时间左边界"
)
private
Double
activeTimeMin
;
@ApiModelProperty
(
"活跃时间右边界"
)
private
Double
activeTimeMax
;
@ApiModelProperty
(
"已配置的人群包条件"
)
private
List
<
CrowdPackageConditionMatchVO
>
conditionList
;
public
CrowdPackageDetailVO
(
Long
packageId
,
String
packageName
)
{
this
.
packageId
=
packageId
;
this
.
packageName
=
packageName
;
public
CrowdPackageDetailVO
(
CrowdPackage
byId
)
{
this
.
packageId
=
byId
.
getId
();
this
.
packageName
=
byId
.
getPackageName
();
if
(
ObjectUtil
.
isNotNull
(
byId
.
getActiveTimeMin
()))
{
this
.
activeTimeMin
=
byId
.
getActiveTimeMin
().
doubleValue
()
/
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
}
if
(
ObjectUtil
.
isNotNull
(
byId
.
getActiveTimeMax
()))
{
this
.
activeTimeMax
=
byId
.
getActiveTimeMax
().
doubleValue
()
/
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
}
}
}
src/main/resources/mapper/KanbanCommonMapper.xml
浏览文件 @
4b1c0742
...
...
@@ -51,15 +51,4 @@
</select>
<select
id=
"getStoreTypeNameByAppId"
resultType=
"java.lang.String"
>
select
se.store_name
from account_entity ae
left join store_entity se
on ae.store_id = se.id
where ae.app_id = #{appId}
and is_active = 1
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/MaterialCommonMapper.xml
浏览文件 @
4b1c0742
...
...
@@ -51,4 +51,16 @@
where dict_current_key = #{currentKey}
</if>
</select>
<select
id=
"getStoreTypeNameByAppId"
resultType=
"java.lang.String"
>
select
b.explanation
from authorizer_info a
left join account_dictionary b
on b.type = 'StoreType'
and a.store_type = b.`value`
where a.appid = #{appId}
limit 1
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论