Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
c4b72ec8
提交
c4b72ec8
authored
6月 20, 2025
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
人群包新增开始日期和结束日期字段
上级
a9fff3b4
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
164 行增加
和
29 行删除
+164
-29
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+52
-0
CrowdPackageController.java
.../yaoyaozw/customer/controller/CrowdPackageController.java
+4
-10
CrowdPackageSaveDTO.java
.../com/yaoyaozw/customer/dto/crowd/CrowdPackageSaveDTO.java
+2
-0
CrowdPackage.java
src/main/java/com/yaoyaozw/customer/entity/CrowdPackage.java
+55
-1
SchedulingTask.java
...java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
+1
-1
CrowdPackageService.java
...va/com/yaoyaozw/customer/service/CrowdPackageService.java
+3
-7
CrowdPackageServiceImpl.java
...oyaozw/customer/service/impl/CrowdPackageServiceImpl.java
+9
-8
CrowdPackageDetailVO.java
.../com/yaoyaozw/customer/vo/crowd/CrowdPackageDetailVO.java
+29
-0
CrowdPackageUserVO.java
...com/yaoyaozw/customer/vo/customer/CrowdPackageUserVO.java
+2
-0
MaterialCrowdPackageMapper.xml
src/main/resources/mapper/MaterialCrowdPackageMapper.xml
+5
-1
RegisterUserEntityMapper.xml
src/main/resources/mapper/RegisterUserEntityMapper.xml
+2
-1
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
c4b72ec8
...
@@ -2,6 +2,7 @@ package com.yaoyaozw.customer.components;
...
@@ -2,6 +2,7 @@ package com.yaoyaozw.customer.components;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
...
@@ -78,12 +79,30 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -78,12 +79,30 @@ public class CustomerServiceCommonAsyncComponent {
private
RabbitTemplate
rabbitTemplate
;
private
RabbitTemplate
rabbitTemplate
;
@Resource
@Resource
private
CompanyAcquisitionLinkService
companyAcquisitionLinkService
;
private
CompanyAcquisitionLinkService
companyAcquisitionLinkService
;
@Autowired
private
CrowdPackageService
crowdPackageService
;
@Async
(
"myExecutor"
)
@Async
(
"myExecutor"
)
public
void
addMatchUserIntoPackage
(
Long
packageId
,
Boolean
needRemove
)
{
public
void
addMatchUserIntoPackage
(
Long
packageId
,
Boolean
needRemove
)
{
// 获取人群包信息
CrowdPackage
crowdPackage
=
crowdPackageService
.
getById
(
packageId
);
if
(
crowdPackage
==
null
)
{
LOCAL_LOG
.
warn
(
"人群包ID {} 不存在"
,
packageId
);
return
;
}
// 获取符合人群包条件的用户列表
// 获取符合人群包条件的用户列表
List
<
CrowdPackageUserVO
>
userList
=
matchService
.
getUserListFromPackage
(
packageId
,
null
);
List
<
CrowdPackageUserVO
>
userList
=
matchService
.
getUserListFromPackage
(
packageId
,
null
);
// 根据关注时间范围过滤用户
if
(
crowdPackage
.
getFollowDateStart
()
!=
null
||
crowdPackage
.
getFollowDateEnd
()
!=
null
)
{
userList
=
userList
.
stream
()
.
filter
(
item
->
isUserInFollowDateRange
(
item
,
crowdPackage
.
getFollowDateStart
(),
crowdPackage
.
getFollowDateEnd
()))
.
collect
(
Collectors
.
toList
());
LOCAL_LOG
.
info
(
"人群包ID: {} 根据关注时间范围过滤后用户数量: {}"
,
packageId
,
userList
.
size
());
}
redisTemplate
.
opsForHash
().
put
(
CustomerCommonConstant
.
CROWD_HUMAN_NUN_REDIS_KEY
,
packageId
.
toString
(),
userList
.
size
());
redisTemplate
.
opsForHash
().
put
(
CustomerCommonConstant
.
CROWD_HUMAN_NUN_REDIS_KEY
,
packageId
.
toString
(),
userList
.
size
());
long
startTime
=
System
.
currentTimeMillis
();
long
startTime
=
System
.
currentTimeMillis
();
String
packIdStr
=
packageId
.
toString
();
String
packIdStr
=
packageId
.
toString
();
...
@@ -689,5 +708,38 @@ public class CustomerServiceCommonAsyncComponent {
...
@@ -689,5 +708,38 @@ public class CustomerServiceCommonAsyncComponent {
redisTemplate
.
opsForValue
().
decrement
(
CustomerCommonConstant
.
YANG_GUANG_ACCESS_LIMIT_REDIS_KEY
);
redisTemplate
.
opsForValue
().
decrement
(
CustomerCommonConstant
.
YANG_GUANG_ACCESS_LIMIT_REDIS_KEY
);
}
}
/**
* 判断用户是否在关注时间范围内
* @param user 用户信息
* @param followDateStart 关注开始日期
* @param followDateEnd 关注结束日期
* @return 是否在范围内
*/
private
boolean
isUserInFollowDateRange
(
CrowdPackageUserVO
user
,
Date
followDateStart
,
Date
followDateEnd
)
{
Date
userGmtCreate
=
user
.
getGmtCreate
();
if
(
userGmtCreate
==
null
)
{
// 用户创建时间为空,不符合条件
return
false
;
}
// 检查是否在开始日期之后(包含)
if
(
followDateStart
!=
null
)
{
Date
startDate
=
DateUtil
.
beginOfDay
(
followDateStart
);
if
(
userGmtCreate
.
before
(
startDate
))
{
return
false
;
}
}
// 检查是否在结束日期之前(包含)
if
(
followDateEnd
!=
null
)
{
Date
endDate
=
DateUtil
.
endOfDay
(
followDateEnd
);
if
(
userGmtCreate
.
after
(
endDate
))
{
return
false
;
}
}
return
true
;
}
}
}
src/main/java/com/yaoyaozw/customer/controller/CrowdPackageController.java
浏览文件 @
c4b72ec8
...
@@ -6,6 +6,7 @@ import com.yaoyaozw.customer.common.BaseResult;
...
@@ -6,6 +6,7 @@ import com.yaoyaozw.customer.common.BaseResult;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageSaveDTO
;
import
com.yaoyaozw.customer.service.CrowdPackageService
;
import
com.yaoyaozw.customer.service.CrowdPackageService
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -30,15 +31,10 @@ public class CrowdPackageController {
...
@@ -30,15 +31,10 @@ public class CrowdPackageController {
@ApiOperation
(
"新增人群包"
)
@ApiOperation
(
"新增人群包"
)
@
Ge
tMapping
(
"/insertPackage"
)
@
Pos
tMapping
(
"/insertPackage"
)
@OperateLog
(
module
=
"人群包"
,
desc
=
"新增人群包"
)
@OperateLog
(
module
=
"人群包"
,
desc
=
"新增人群包"
)
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
@RequestParam
(
required
=
false
)
Long
id
,
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
@RequestBody
CrowdPackageSaveDTO
saveDTO
)
{
@RequestParam
(
required
=
false
)
String
name
,
return
crowdPackageService
.
insertCrowdPackage
(
saveDTO
);
@RequestParam
(
required
=
false
)
Double
activeTimeMin
,
@RequestParam
(
required
=
false
)
Double
activeTimeMax
,
@RequestParam
(
required
=
false
)
Integer
followTimeMin
,
@RequestParam
(
required
=
false
)
Integer
followTimeMax
)
{
return
crowdPackageService
.
insertCrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
,
followTimeMin
,
followTimeMax
);
}
}
@ApiOperation
(
"向人群包内新增条件"
)
@ApiOperation
(
"向人群包内新增条件"
)
...
@@ -99,6 +95,4 @@ public class CrowdPackageController {
...
@@ -99,6 +95,4 @@ public class CrowdPackageController {
return
crowdPackageService
.
updateUserPackageBatch
(
openIdList
);
return
crowdPackageService
.
updateUserPackageBatch
(
openIdList
);
}
}
}
}
src/main/java/com/yaoyaozw/customer/dto/crowd/CrowdPackageSaveDTO.java
浏览文件 @
c4b72ec8
...
@@ -17,5 +17,7 @@ public class CrowdPackageSaveDTO implements Serializable {
...
@@ -17,5 +17,7 @@ public class CrowdPackageSaveDTO implements Serializable {
private
Double
activeTimeMax
;
private
Double
activeTimeMax
;
private
Integer
followTimeMin
;
private
Integer
followTimeMin
;
private
Integer
followTimeMax
;
private
Integer
followTimeMax
;
private
String
followDateStart
;
private
String
followDateEnd
;
}
}
src/main/java/com/yaoyaozw/customer/entity/CrowdPackage.java
浏览文件 @
c4b72ec8
package
com
.
yaoyaozw
.
customer
.
entity
;
package
com
.
yaoyaozw
.
customer
.
entity
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
@@ -11,6 +14,7 @@ import com.yaoyaozw.customer.constants.CrowdPackageCommonConstant;
...
@@ -11,6 +14,7 @@ import com.yaoyaozw.customer.constants.CrowdPackageCommonConstant;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageSaveDTO
;
/**
/**
* 人群中包
* 人群中包
...
@@ -60,6 +64,18 @@ public class CrowdPackage implements Serializable {
...
@@ -60,6 +64,18 @@ public class CrowdPackage implements Serializable {
private
Integer
followTimeMax
;
private
Integer
followTimeMax
;
/**
/**
* 关注开始日期
*/
@TableField
(
"follow_date_start"
)
private
Date
followDateStart
;
/**
* 关注结束日期
*/
@TableField
(
"follow_date_end"
)
private
Date
followDateEnd
;
/**
* 人群包用户人数
* 人群包用户人数
*/
*/
@TableField
(
"crowd_num"
)
@TableField
(
"crowd_num"
)
...
@@ -97,11 +113,13 @@ public class CrowdPackage implements Serializable {
...
@@ -97,11 +113,13 @@ public class CrowdPackage implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
CrowdPackage
(
Long
id
,
String
packageName
,
Double
activeTimeMin
,
Double
activeTimeMax
,
Integer
followTimeMin
,
Integer
followTimeMax
)
{
public
CrowdPackage
(
Long
id
,
String
packageName
,
Double
activeTimeMin
,
Double
activeTimeMax
,
Integer
followTimeMin
,
Integer
followTimeMax
,
String
followDateStart
,
String
followDateEnd
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
packageName
=
packageName
;
this
.
packageName
=
packageName
;
this
.
followTimeMin
=
followTimeMin
==
null
||
followTimeMin
==
0
?
null
:
followTimeMin
;
this
.
followTimeMin
=
followTimeMin
==
null
||
followTimeMin
==
0
?
null
:
followTimeMin
;
this
.
followTimeMax
=
followTimeMax
==
null
||
followTimeMax
==
0
?
null
:
followTimeMax
;
this
.
followTimeMax
=
followTimeMax
==
null
||
followTimeMax
==
0
?
null
:
followTimeMax
;
this
.
followDateStart
=
parseStringToDate
(
followDateStart
);
this
.
followDateEnd
=
parseStringToDate
(
followDateEnd
);
if
(
ObjectUtil
.
isNotNull
(
activeTimeMin
))
{
if
(
ObjectUtil
.
isNotNull
(
activeTimeMin
))
{
Double
v
=
activeTimeMin
*
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
Double
v
=
activeTimeMin
*
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
...
@@ -113,6 +131,42 @@ public class CrowdPackage implements Serializable {
...
@@ -113,6 +131,42 @@ public class CrowdPackage implements Serializable {
}
}
}
}
public
CrowdPackage
(
CrowdPackageSaveDTO
saveDTO
)
{
this
.
id
=
saveDTO
.
getId
();
this
.
packageName
=
saveDTO
.
getName
();
this
.
followTimeMin
=
saveDTO
.
getFollowTimeMin
()
==
null
||
saveDTO
.
getFollowTimeMin
()
==
0
?
null
:
saveDTO
.
getFollowTimeMin
();
this
.
followTimeMax
=
saveDTO
.
getFollowTimeMax
()
==
null
||
saveDTO
.
getFollowTimeMax
()
==
0
?
null
:
saveDTO
.
getFollowTimeMax
();
this
.
followDateStart
=
parseStringToDate
(
saveDTO
.
getFollowDateStart
());
this
.
followDateEnd
=
parseStringToDate
(
saveDTO
.
getFollowDateEnd
());
if
(
ObjectUtil
.
isNotNull
(
saveDTO
.
getActiveTimeMin
()))
{
Double
v
=
saveDTO
.
getActiveTimeMin
()
*
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
this
.
activeTimeMin
=
v
.
longValue
();
}
if
(
ObjectUtil
.
isNotNull
(
saveDTO
.
getActiveTimeMax
()))
{
Double
v
=
(
saveDTO
.
getActiveTimeMax
()
*
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
);
this
.
activeTimeMax
=
v
.
longValue
();
}
}
/**
* 将字符串日期转换为Date对象
* @param dateStr 日期字符串,格式:yyyy-MM-dd
* @return Date对象,如果输入为空或转换失败返回null
*/
private
Date
parseStringToDate
(
String
dateStr
)
{
if
(
StrUtil
.
isBlank
(
dateStr
))
{
return
null
;
}
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
return
sdf
.
parse
(
dateStr
);
}
catch
(
ParseException
e
)
{
// 日期格式错误,返回null
return
null
;
}
}
public
void
handleInfo
(
Date
now
,
Long
userId
,
Boolean
isCreate
)
{
public
void
handleInfo
(
Date
now
,
Long
userId
,
Boolean
isCreate
)
{
if
(
isCreate
)
{
if
(
isCreate
)
{
this
.
createTime
=
now
;
this
.
createTime
=
now
;
...
...
src/main/java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
浏览文件 @
c4b72ec8
...
@@ -109,7 +109,7 @@ public class SchedulingTask {
...
@@ -109,7 +109,7 @@ public class SchedulingTask {
crowdPackageService
.
updateCrowdPackageNumFromRedis
();
crowdPackageService
.
updateCrowdPackageNumFromRedis
();
}
}
@Scheduled
(
cron
=
"0 3 1 * * ?"
)
@Scheduled
(
cron
=
"0 3 1
,9
* * ?"
)
public
void
refreshCustomrMaterialSendNum
()
{
public
void
refreshCustomrMaterialSendNum
()
{
log
.
info
(
"开始刷新客服消息送达人数..."
);
log
.
info
(
"开始刷新客服消息送达人数..."
);
...
...
src/main/java/com/yaoyaozw/customer/service/CrowdPackageService.java
浏览文件 @
c4b72ec8
...
@@ -6,6 +6,7 @@ import com.yaoyaozw.customer.common.BaseResult;
...
@@ -6,6 +6,7 @@ import com.yaoyaozw.customer.common.BaseResult;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.common.GenericsResult
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageSaveDTO
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -20,15 +21,10 @@ public interface CrowdPackageService extends IService<CrowdPackage> {
...
@@ -20,15 +21,10 @@ public interface CrowdPackageService extends IService<CrowdPackage> {
/**
/**
* 插入人群包
* 插入人群包
*
*
* @param id 人群包id
* @param saveDTO 人群包保存DTO
* @param name 人群包名
* @param activeTimeMin 活跃时间左边界
* @param activeTimeMax 活跃时间右边界
* @param followTimeMin 关注天数左边界
* @param followTimeMax 关注天数右边界
* @return {@link BaseResult}
* @return {@link BaseResult}
*/
*/
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
Long
id
,
String
name
,
Double
activeTimeMin
,
Double
activeTimeMax
,
Integer
followTimeMin
,
Integer
followTimeMax
);
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
CrowdPackageSaveDTO
saveDTO
);
/**
/**
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CrowdPackageServiceImpl.java
浏览文件 @
c4b72ec8
...
@@ -16,6 +16,7 @@ import com.yaoyaozw.customer.constants.CrowdPackageCommonConstant;
...
@@ -16,6 +16,7 @@ import com.yaoyaozw.customer.constants.CrowdPackageCommonConstant;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageSaveDTO
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
com.yaoyaozw.customer.entity.CrowdPackageCondition
;
import
com.yaoyaozw.customer.entity.CrowdPackageCondition
;
import
com.yaoyaozw.customer.entity.CrowdPackageConditionMatch
;
import
com.yaoyaozw.customer.entity.CrowdPackageConditionMatch
;
...
@@ -66,19 +67,19 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
...
@@ -66,19 +67,19 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
@Override
@Override
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
Long
id
,
String
name
,
Double
activeTimeMin
,
Double
activeTimeMax
,
Integer
followTimeMin
,
Integer
followTimeMax
)
{
public
GenericsResult
<
CrowdPackageCommonIdVO
>
insertCrowdPackage
(
CrowdPackageSaveDTO
saveDTO
)
{
// 根据是否传了主键判断是创建还是更新
// 根据是否传了主键判断是创建还是更新
boolean
isCreate
=
ObjectUtil
.
isNull
(
id
);
boolean
isCreate
=
ObjectUtil
.
isNull
(
saveDTO
.
getId
()
);
// 获取操作人
// 获取操作人
Long
userId
=
tokenManager
.
getUserIdFromToken
();
Long
userId
=
tokenManager
.
getUserIdFromToken
();
CrowdPackage
crowdPackage
=
new
CrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
,
followTimeMin
,
followTimeMax
);
CrowdPackage
crowdPackage
=
new
CrowdPackage
(
saveDTO
);
crowdPackage
.
handleInfo
(
new
Date
(),
userId
,
isCreate
);
crowdPackage
.
handleInfo
(
new
Date
(),
userId
,
isCreate
);
if
(
ObjectUtil
.
isNotNull
(
name
))
{
if
(
ObjectUtil
.
isNotNull
(
saveDTO
.
getName
()
))
{
// 判断是否有重名
// 判断是否有重名
QueryWrapper
<
CrowdPackage
>
nameRepeatWrapper
=
new
QueryWrapper
<
CrowdPackage
>().
eq
(
"package_name"
,
name
).
ne
(
"id"
,
id
);
QueryWrapper
<
CrowdPackage
>
nameRepeatWrapper
=
new
QueryWrapper
<
CrowdPackage
>().
eq
(
"package_name"
,
saveDTO
.
getName
()).
ne
(
"id"
,
saveDTO
.
getId
()
);
int
count
=
super
.
count
(
nameRepeatWrapper
);
int
count
=
super
.
count
(
nameRepeatWrapper
);
if
(
count
!=
0
)
{
if
(
count
!=
0
)
{
LOCAL_LOG
.
info
(
"人群包名: '{}' 已存在"
,
name
);
LOCAL_LOG
.
info
(
"人群包名: '{}' 已存在"
,
saveDTO
.
getName
()
);
return
new
GenericsResult
<>(
false
,
"人群包名已存在!"
);
return
new
GenericsResult
<>(
false
,
"人群包名已存在!"
);
}
}
}
}
...
@@ -90,8 +91,8 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
...
@@ -90,8 +91,8 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
}
}
// 添加人群包人群的更新
// 添加人群包人群的更新
if
(
result
&&
ObjectUtil
.
isNotNull
(
name
))
{
if
(
result
&&
ObjectUtil
.
isNotNull
(
saveDTO
.
getName
()
))
{
asyncComponent
.
addMatchUserIntoPackage
(
id
,
true
);
asyncComponent
.
addMatchUserIntoPackage
(
saveDTO
.
getId
()
,
true
);
}
}
return
result
?
new
GenericsResult
<>(
new
CrowdPackageCommonIdVO
(
crowdPackage
.
getId
(),
null
))
:
new
GenericsResult
<>(
false
,
"新增人群包失败!"
);
return
result
?
new
GenericsResult
<>(
new
CrowdPackageCommonIdVO
(
crowdPackage
.
getId
(),
null
))
:
new
GenericsResult
<>(
false
,
"新增人群包失败!"
);
...
...
src/main/java/com/yaoyaozw/customer/vo/crowd/CrowdPackageDetailVO.java
浏览文件 @
c4b72ec8
...
@@ -11,6 +11,8 @@ import lombok.Data;
...
@@ -11,6 +11,8 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -45,6 +47,18 @@ public class CrowdPackageDetailVO implements Serializable {
...
@@ -45,6 +47,18 @@ public class CrowdPackageDetailVO implements Serializable {
*/
*/
private
Integer
followTimeMax
;
private
Integer
followTimeMax
;
/**
* 关注开始日期
*/
@ApiModelProperty
(
"关注开始日期"
)
private
String
followDateStart
;
/**
* 关注结束日期
*/
@ApiModelProperty
(
"关注结束日期"
)
private
String
followDateEnd
;
@ApiModelProperty
(
"已配置的人群包条件"
)
@ApiModelProperty
(
"已配置的人群包条件"
)
private
List
<
CrowdPackageConditionMatchVO
>
conditionList
;
private
List
<
CrowdPackageConditionMatchVO
>
conditionList
;
...
@@ -53,6 +67,8 @@ public class CrowdPackageDetailVO implements Serializable {
...
@@ -53,6 +67,8 @@ public class CrowdPackageDetailVO implements Serializable {
this
.
packageName
=
byId
.
getPackageName
();
this
.
packageName
=
byId
.
getPackageName
();
this
.
followTimeMin
=
byId
.
getFollowTimeMin
();
this
.
followTimeMin
=
byId
.
getFollowTimeMin
();
this
.
followTimeMax
=
byId
.
getFollowTimeMax
();
this
.
followTimeMax
=
byId
.
getFollowTimeMax
();
this
.
followDateStart
=
formatDateToString
(
byId
.
getFollowDateStart
());
this
.
followDateEnd
=
formatDateToString
(
byId
.
getFollowDateEnd
());
if
(
ObjectUtil
.
isNotNull
(
byId
.
getActiveTimeMin
()))
{
if
(
ObjectUtil
.
isNotNull
(
byId
.
getActiveTimeMin
()))
{
this
.
activeTimeMin
=
byId
.
getActiveTimeMin
().
doubleValue
()
/
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
this
.
activeTimeMin
=
byId
.
getActiveTimeMin
().
doubleValue
()
/
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
...
@@ -61,4 +77,17 @@ public class CrowdPackageDetailVO implements Serializable {
...
@@ -61,4 +77,17 @@ public class CrowdPackageDetailVO implements Serializable {
this
.
activeTimeMax
=
byId
.
getActiveTimeMax
().
doubleValue
()
/
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
this
.
activeTimeMax
=
byId
.
getActiveTimeMax
().
doubleValue
()
/
CrowdPackageCommonConstant
.
HOUR_TO_MILLION_RATE
;
}
}
}
}
/**
* 将Date对象格式化为字符串
* @param date Date对象
* @return 格式化后的日期字符串,格式:yyyy-MM-dd,如果输入为null返回null
*/
private
String
formatDateToString
(
Date
date
)
{
if
(
ObjectUtil
.
isNull
(
date
))
{
return
null
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
return
sdf
.
format
(
date
);
}
}
}
src/main/java/com/yaoyaozw/customer/vo/customer/CrowdPackageUserVO.java
浏览文件 @
c4b72ec8
...
@@ -32,4 +32,6 @@ public class CrowdPackageUserVO implements Serializable {
...
@@ -32,4 +32,6 @@ public class CrowdPackageUserVO implements Serializable {
private
Integer
dateDiff
;
private
Integer
dateDiff
;
private
Date
gmtCreate
;
}
}
src/main/resources/mapper/MaterialCrowdPackageMapper.xml
浏览文件 @
c4b72ec8
...
@@ -48,7 +48,10 @@
...
@@ -48,7 +48,10 @@
<update
id=
"updatePackageFollowTime"
>
<update
id=
"updatePackageFollowTime"
>
update crowd_package_main
update crowd_package_main
set follow_time_min = #{crowdPackage.followTimeMin}, follow_time_max = #{crowdPackage.followTimeMax}
set follow_time_min = #{crowdPackage.followTimeMin},
follow_time_max = #{crowdPackage.followTimeMax},
follow_date_start = #{crowdPackage.followDateStart},
follow_date_end = #{crowdPackage.followDateEnd}
where id = #{crowdPackage.id}
where id = #{crowdPackage.id}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper/RegisterUserEntityMapper.xml
浏览文件 @
c4b72ec8
...
@@ -28,7 +28,8 @@
...
@@ -28,7 +28,8 @@
rue.setup_id as setupId,
rue.setup_id as setupId,
rue.open_id as openId,
rue.open_id as openId,
rue.in_package as inPackage,
rue.in_package as inPackage,
ai.store_type as storeType
ai.store_type as storeType,
rue.gmt_create as gmtCreate
from register_user_entity rue
from register_user_entity rue
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论