提交 b835bc88 作者: 沈振路

人群包列表标签列

上级 392d9e31
...@@ -3,6 +3,7 @@ package com.yaoyaozw.customer; ...@@ -3,6 +3,7 @@ package com.yaoyaozw.customer;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
...@@ -12,6 +13,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -12,6 +13,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@MapperScan("com.yaoyaozw.customer.mapper") @MapperScan("com.yaoyaozw.customer.mapper")
@EnableAsync
public class CustomerServiceApplication { public class CustomerServiceApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(CustomerServiceApplication.class, args); SpringApplication.run(CustomerServiceApplication.class, args);
......
package com.yaoyaozw.customer.components;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
/**
* @author darker
* @date 2022/9/28 15:16
*/
@Component
public class CustomerServiceCommonAsyncComponent {
@Async("myExecutor")
public void updateUserPackage() {
}
}
package com.yaoyaozw.customer.configs;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author darker
* @date 2022/8/2 15:01
*/
@Configuration
@EnableAsync
public class ThreadConfig {
/** 核心线程数(默认线程数) */
private static final int CORE_POOL_SIZE = 15;
/** 最大线程数 */
private static final int MAX_POOL_SIZE = 50;
/** 允许线程空闲时间(单位:默认为秒) */
private static final int KEEP_ALIVE_TIME = 60;
/** 缓冲队列大小 */
private static final int QUEUE_CAPACITY = 100;
/** 线程池名前缀 */
private static final String THREAD_NAME_PREFIX = "Async-Service-";
@Bean("myExecutor")
public ThreadPoolTaskExecutor myExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(CORE_POOL_SIZE);
executor.setMaxPoolSize(MAX_POOL_SIZE);
executor.setQueueCapacity(QUEUE_CAPACITY);
executor.setKeepAliveSeconds(KEEP_ALIVE_TIME);
executor.setThreadNamePrefix(THREAD_NAME_PREFIX);
// 线程池对拒绝任务的处理策略
// CallerRunsPolicy:由调用线程(提交任务的线程)处理该任务
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// 初始化
executor.initialize();
return executor;
}
}
...@@ -15,10 +15,15 @@ import java.io.Serializable; ...@@ -15,10 +15,15 @@ import java.io.Serializable;
public class CustomerMessageSaveDTO implements Serializable { public class CustomerMessageSaveDTO implements Serializable {
private static final long serialVersionUID = -4269904448093268275L; private static final long serialVersionUID = -4269904448093268275L;
@ApiModelProperty("客服消息人群包ID")
private Long packageId;
@ApiModelProperty("客服消息名称") @ApiModelProperty("客服消息名称")
private String messageName; private String messageName;
@ApiModelProperty("消息发送时间")
private String postTime;
@ApiModelProperty("客服消息类型(图文、文本)") @ApiModelProperty("客服消息类型(图文、文本)")
private Integer messageType; private Integer messageType;
......
...@@ -58,6 +58,12 @@ public class CrowdPackageConditionMatch implements Serializable { ...@@ -58,6 +58,12 @@ public class CrowdPackageConditionMatch implements Serializable {
@TableField("operator_description") @TableField("operator_description")
private String operatorDescription; private String operatorDescription;
/**
* 是否是静态条件
*/
@TableField("is_static")
private Integer isStatic;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
...@@ -198,6 +198,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap ...@@ -198,6 +198,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
if (ObjectUtil.isNull(conditionInfo)) { if (ObjectUtil.isNull(conditionInfo)) {
throw new RuntimeException("无法获取条件"); throw new RuntimeException("无法获取条件");
} }
match.setIsStatic(conditionInfo.getIsStatic());
String conditionType = conditionInfo.getConditionType(); String conditionType = conditionInfo.getConditionType();
LOCAL_LOG.info("当前条件类型: {}", conditionType); LOCAL_LOG.info("当前条件类型: {}", conditionType);
// 是需要比较的类型, 获取对应的比较符号的数据 // 是需要比较的类型, 获取对应的比较符号的数据
...@@ -290,7 +291,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap ...@@ -290,7 +291,7 @@ public class CrowdPackageServiceImpl extends ServiceImpl<MaterialCrowdPackageMap
if (ObjectUtil.isNull(responseVo) || CollectionUtil.isEmpty(responseVo.getOptionList())) { if (ObjectUtil.isNull(responseVo) || CollectionUtil.isEmpty(responseVo.getOptionList())) {
throw new RuntimeException("找不到条件的选项"); throw new RuntimeException("找不到条件的选项");
} }
StringBuilder descriptionBuilder = new StringBuilder(conditionInfo.getConditionName() + "范围: "); StringBuilder descriptionBuilder = new StringBuilder(conditionInfo.getConditionName() + ": ");
for (CommonOptionResponseVO commonOptionResponseVo : responseVo.getOptionList()) { for (CommonOptionResponseVO commonOptionResponseVo : responseVo.getOptionList()) {
// 如果选中了这个选项,则拼接其name // 如果选中了这个选项,则拼接其name
if (multipleOptions.contains(commonOptionResponseVo.getKey())) { if (multipleOptions.contains(commonOptionResponseVo.getKey())) {
......
...@@ -23,6 +23,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap ...@@ -23,6 +23,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
@Override @Override
public BaseResult insertCustomerMessage(CustomerMessageSaveDTO saveDto) { public BaseResult insertCustomerMessage(CustomerMessageSaveDTO saveDto) {
// TODO: 2022/9/28 根据人群包找到下面的人所在的公众号,进行链接获取
return null; return null;
} }
......
package com.yaoyaozw.customer.vo.crowd; package com.yaoyaozw.customer.vo.crowd;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -23,6 +24,9 @@ public class CrowdPackageListVO implements Serializable { ...@@ -23,6 +24,9 @@ public class CrowdPackageListVO implements Serializable {
@ApiModelProperty("人群包名称") @ApiModelProperty("人群包名称")
private String packageName; private String packageName;
@ApiModelProperty("人群包标签")
private String packageLabel;
@ApiModelProperty("人群包中的人数") @ApiModelProperty("人群包中的人数")
private Integer numOfCrowdInPackage; private Integer numOfCrowdInPackage;
...@@ -41,4 +45,10 @@ public class CrowdPackageListVO implements Serializable { ...@@ -41,4 +45,10 @@ public class CrowdPackageListVO implements Serializable {
@ApiModelProperty("修改人") @ApiModelProperty("修改人")
private String modifiedUser; private String modifiedUser;
public String getPackageLabel() {
if (ObjectUtil.isNull(this.packageLabel)) {
return null;
}
return packageLabel.replaceAll(",", "<br/>");
}
} }
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
cpm.id, cpm.package_name as packageName, cpm.id, cpm.package_name as packageName,
cpm.crowd_num as numOfCrowdInPackage, cpm.last_count_time as lastCountTime, cpm.crowd_num as numOfCrowdInPackage, cpm.last_count_time as lastCountTime,
cpm.create_time as createTime, cpm.modified_time as modifiedTime, cpm.create_time as createTime, cpm.modified_time as modifiedTime,
cau.nick_name as createUser, mau.nick_name as modifiedUser cau.nick_name as createUser, mau.nick_name as modifiedUser,
group_concat(concat('【', mat.operator_description, '】')) as packageLabel
from crowd_package_main cpm from crowd_package_main cpm
left join acl_user cau left join acl_user cau
...@@ -29,8 +30,13 @@ ...@@ -29,8 +30,13 @@
left join acl_user mau left join acl_user mau
on cpm.modified_user = mau.id on cpm.modified_user = mau.id
left join crowd_package_condition_match mat
on cpm.id = mat.package_id
where cpm.package_name is not null where cpm.package_name is not null
group by cpm.id
</select> </select>
<delete id="removeCondition"> <delete id="removeCondition">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论