Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
e4dc4299
提交
e4dc4299
authored
3月 27, 2025
作者:
李聪
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加人群包时 增加[关注日期]范围 选择框
上级
35db6694
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
75 行增加
和
14 行删除
+75
-14
CrowdPackageController.java
.../yaoyaozw/customer/controller/CrowdPackageController.java
+6
-5
CrowdPackage.java
src/main/java/com/yaoyaozw/customer/entity/CrowdPackage.java
+16
-1
CrowdPackageService.java
...va/com/yaoyaozw/customer/service/CrowdPackageService.java
+2
-3
CrowdPackageServiceImpl.java
...oyaozw/customer/service/impl/CrowdPackageServiceImpl.java
+30
-5
CrowdPackageDetailVO.java
.../com/yaoyaozw/customer/vo/crowd/CrowdPackageDetailVO.java
+21
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/controller/CrowdPackageController.java
浏览文件 @
e4dc4299
...
@@ -4,8 +4,8 @@ import com.github.pagehelper.PageInfo;
...
@@ -4,8 +4,8 @@ import com.github.pagehelper.PageInfo;
import
com.yaoyaozw.customer.annotations.OperateLog
;
import
com.yaoyaozw.customer.annotations.OperateLog
;
import
com.yaoyaozw.customer.common.BaseResult
;
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.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
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
;
...
@@ -13,7 +13,6 @@ import io.swagger.annotations.ApiOperation;
...
@@ -13,7 +13,6 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -37,8 +36,10 @@ public class CrowdPackageController {
...
@@ -37,8 +36,10 @@ public class CrowdPackageController {
@RequestParam
(
required
=
false
)
Double
activeTimeMin
,
@RequestParam
(
required
=
false
)
Double
activeTimeMin
,
@RequestParam
(
required
=
false
)
Double
activeTimeMax
,
@RequestParam
(
required
=
false
)
Double
activeTimeMax
,
@RequestParam
(
required
=
false
)
Integer
followTimeMin
,
@RequestParam
(
required
=
false
)
Integer
followTimeMin
,
@RequestParam
(
required
=
false
)
Integer
followTimeMax
)
{
@RequestParam
(
required
=
false
)
Integer
followTimeMax
,
return
crowdPackageService
.
insertCrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
,
followTimeMin
,
followTimeMax
);
@RequestParam
(
required
=
false
)
String
followDateStart
,
@RequestParam
(
required
=
false
)
String
followDateEnd
)
{
return
crowdPackageService
.
insertCrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
,
followTimeMin
,
followTimeMax
,
followDateStart
,
followDateEnd
);
}
}
@ApiOperation
(
"向人群包内新增条件"
)
@ApiOperation
(
"向人群包内新增条件"
)
...
@@ -53,6 +54,7 @@ public class CrowdPackageController {
...
@@ -53,6 +54,7 @@ public class CrowdPackageController {
public
GenericsResult
<
PageInfo
<
CrowdPackageListVO
>>
pageList
(
@RequestBody
CrowdPackageQueryDTO
queryDto
)
{
public
GenericsResult
<
PageInfo
<
CrowdPackageListVO
>>
pageList
(
@RequestBody
CrowdPackageQueryDTO
queryDto
)
{
return
crowdPackageService
.
pageList
(
queryDto
);
return
crowdPackageService
.
pageList
(
queryDto
);
}
}
@ApiOperation
(
"查询所有人群包"
)
@ApiOperation
(
"查询所有人群包"
)
@PostMapping
(
"/allPackage"
)
@PostMapping
(
"/allPackage"
)
public
GenericsResult
<
List
<
CrowdPackageListVO
>>
getAllPackage
(
@RequestBody
CrowdPackageQueryDTO
queryDto
)
{
public
GenericsResult
<
List
<
CrowdPackageListVO
>>
getAllPackage
(
@RequestBody
CrowdPackageQueryDTO
queryDto
)
{
...
@@ -100,5 +102,4 @@ public class CrowdPackageController {
...
@@ -100,5 +102,4 @@ public class CrowdPackageController {
}
}
}
}
src/main/java/com/yaoyaozw/customer/entity/CrowdPackage.java
浏览文件 @
e4dc4299
...
@@ -60,6 +60,18 @@ public class CrowdPackage implements Serializable {
...
@@ -60,6 +60,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 +109,14 @@ public class CrowdPackage implements Serializable {
...
@@ -97,11 +109,14 @@ 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
,
Date
followDateStart
,
Date
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
=
followDateStart
;
this
.
followDateEnd
=
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
;
...
...
src/main/java/com/yaoyaozw/customer/service/CrowdPackageService.java
浏览文件 @
e4dc4299
...
@@ -4,11 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,11 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.yaoyaozw.customer.common.BaseResult
;
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.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
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
java.util.List
;
import
java.util.List
;
...
@@ -28,7 +27,7 @@ public interface CrowdPackageService extends IService<CrowdPackage> {
...
@@ -28,7 +27,7 @@ public interface CrowdPackageService extends IService<CrowdPackage> {
* @param followTimeMax 关注天数右边界
* @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
(
Long
id
,
String
name
,
Double
activeTimeMin
,
Double
activeTimeMax
,
Integer
followTimeMin
,
Integer
followTimeMax
,
String
followDateStart
,
String
followDateEnd
);
/**
/**
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CrowdPackageServiceImpl.java
浏览文件 @
e4dc4299
...
@@ -14,8 +14,8 @@ import com.yaoyaozw.customer.components.CustomerServiceCommonAsyncComponent;
...
@@ -14,8 +14,8 @@ import com.yaoyaozw.customer.components.CustomerServiceCommonAsyncComponent;
import
com.yaoyaozw.customer.components.TokenManager
;
import
com.yaoyaozw.customer.components.TokenManager
;
import
com.yaoyaozw.customer.constants.CrowdPackageCommonConstant
;
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.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageConditionDTO
;
import
com.yaoyaozw.customer.dto.crowd.CrowdPackageQueryDTO
;
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
;
...
@@ -26,8 +26,8 @@ import com.yaoyaozw.customer.mapper.RegisterUserEntityMapper;
...
@@ -26,8 +26,8 @@ import com.yaoyaozw.customer.mapper.RegisterUserEntityMapper;
import
com.yaoyaozw.customer.service.CrowdPackageConditionMatchService
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionMatchService
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionService
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionService
;
import
com.yaoyaozw.customer.service.CrowdPackageService
;
import
com.yaoyaozw.customer.service.CrowdPackageService
;
import
com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
com.yaoyaozw.customer.vo.crowd.*
;
import
com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -36,6 +36,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -36,6 +36,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -66,12 +68,32 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
...
@@ -66,12 +68,32 @@ 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
(
Long
id
,
String
name
,
Double
activeTimeMin
,
Double
activeTimeMax
,
Integer
followTimeMin
,
Integer
followTimeMax
,
String
startFollowDate
,
String
endFollowDate
)
{
// 关注日期 转换
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
followDateStart
=
null
;
Date
followDateEnd
=
null
;
if
(!
""
.
equals
(
startFollowDate
)
&&
ObjectUtil
.
isNotNull
(
startFollowDate
))
{
try
{
followDateStart
=
simpleDateFormat
.
parse
(
startFollowDate
);
}
catch
(
ParseException
e
)
{
log
.
error
(
"日期转换错误, 错误日期为"
+
startFollowDate
);
}
}
if
(!
""
.
equals
(
endFollowDate
)
&&
ObjectUtil
.
isNotNull
(
endFollowDate
))
{
try
{
followDateEnd
=
simpleDateFormat
.
parse
(
endFollowDate
);
}
catch
(
ParseException
e
)
{
log
.
error
(
"日期转换错误, 错误日期为"
+
endFollowDate
);
}
}
// 根据是否传了主键判断是创建还是更新
// 根据是否传了主键判断是创建还是更新
boolean
isCreate
=
ObjectUtil
.
isNull
(
id
);
boolean
isCreate
=
ObjectUtil
.
isNull
(
id
);
// 获取操作人
// 获取操作人
Long
userId
=
tokenManager
.
getUserIdFromToken
();
Long
userId
=
tokenManager
.
getUserIdFromToken
();
CrowdPackage
crowdPackage
=
new
CrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
,
followTimeMin
,
followTimeMax
);
LOCAL_LOG
.
info
(
"关注日期-开始{}"
,
followDateStart
);
LOCAL_LOG
.
info
(
"关注日期-结束{}"
,
followDateEnd
);
CrowdPackage
crowdPackage
=
new
CrowdPackage
(
id
,
name
,
activeTimeMin
,
activeTimeMax
,
followTimeMin
,
followTimeMax
,
followDateStart
,
followDateEnd
);
crowdPackage
.
handleInfo
(
new
Date
(),
userId
,
isCreate
);
crowdPackage
.
handleInfo
(
new
Date
(),
userId
,
isCreate
);
if
(
ObjectUtil
.
isNotNull
(
name
))
{
if
(
ObjectUtil
.
isNotNull
(
name
))
{
// 判断是否有重名
// 判断是否有重名
...
@@ -82,11 +104,14 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
...
@@ -82,11 +104,14 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
return
new
GenericsResult
<>(
false
,
"人群包名已存在!"
);
return
new
GenericsResult
<>(
false
,
"人群包名已存在!"
);
}
}
}
}
LOCAL_LOG
.
info
(
"crowdPackage={}"
,
crowdPackage
);
// 执行保存
// 执行保存
boolean
result
=
super
.
saveOrUpdate
(
crowdPackage
);
boolean
result
=
super
.
saveOrUpdate
(
crowdPackage
);
if
(
crowdPackage
.
getId
()
!=
null
)
{
if
(
crowdPackage
.
getId
()
!=
null
)
{
// 手写sql更新关注时间(因为mp update方法不更新null值)
// 手写sql更新关注时间(因为mp update方法不更新null值)
this
.
baseMapper
.
updatePackageFollowTime
(
crowdPackage
);
this
.
baseMapper
.
updatePackageFollowTime
(
crowdPackage
);
// 手写sql更新关注日期 (因为mp update方法不更新null值)
this
.
baseMapper
.
updatePackageFollowDate
(
crowdPackage
);
}
}
// 添加人群包人群的更新
// 添加人群包人群的更新
...
@@ -303,7 +328,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
...
@@ -303,7 +328,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
* @param match 匹配
* @param match 匹配
* @param conditionDto 条件dto
* @param conditionDto 条件dto
*/
*/
private
void
constructOperator
(
CrowdPackageConditionMatch
match
,
CrowdPackageConditionDTO
conditionDto
){
private
void
constructOperator
(
CrowdPackageConditionMatch
match
,
CrowdPackageConditionDTO
conditionDto
)
{
LOCAL_LOG
.
info
(
"构造运算表达式"
);
LOCAL_LOG
.
info
(
"构造运算表达式"
);
CrowdPackageCondition
conditionInfo
=
conditionService
.
getById
(
conditionDto
.
getConditionId
());
CrowdPackageCondition
conditionInfo
=
conditionService
.
getById
(
conditionDto
.
getConditionId
());
if
(
ObjectUtil
.
isNull
(
conditionInfo
))
{
if
(
ObjectUtil
.
isNull
(
conditionInfo
))
{
...
...
src/main/java/com/yaoyaozw/customer/vo/crowd/CrowdPackageDetailVO.java
浏览文件 @
e4dc4299
...
@@ -11,6 +11,7 @@ import lombok.Data;
...
@@ -11,6 +11,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.text.SimpleDateFormat
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -45,6 +46,12 @@ public class CrowdPackageDetailVO implements Serializable {
...
@@ -45,6 +46,12 @@ 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 +60,20 @@ public class CrowdPackageDetailVO implements Serializable {
...
@@ -53,6 +60,20 @@ 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
();
// 定义日期格式化工具
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 转换 followDateStart
if
(
byId
.
getFollowDateStart
()
!=
null
)
{
this
.
followDateStart
=
dateFormat
.
format
(
byId
.
getFollowDateStart
());
}
else
{
this
.
followDateStart
=
null
;
}
// 转换 followDateEnd
if
(
byId
.
getFollowDateEnd
()
!=
null
)
{
this
.
followDateEnd
=
dateFormat
.
format
(
byId
.
getFollowDateEnd
());
}
else
{
this
.
followDateEnd
=
null
;
}
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
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论