提交 7d88ec1e 作者: gh

Merge remote-tracking branch 'origin/master'

...@@ -223,6 +223,13 @@ ...@@ -223,6 +223,13 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency> </dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>-->
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId> <artifactId>httpcore</artifactId>
......
...@@ -12,7 +12,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -12,7 +12,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* @date 2022/9/15 18:13 * @date 2022/9/15 18:13
*/ */
@SpringBootApplication @SpringBootApplication
@EnableScheduling //@EnableScheduling
@MapperScan("com.yaoyaozw.customer.mapper") @MapperScan("com.yaoyaozw.customer.mapper")
@EnableFeignClients @EnableFeignClients
@EnableAsync @EnableAsync
......
...@@ -19,6 +19,7 @@ import com.yaoyaozw.customer.mapper.CustomerGraphicsMapper; ...@@ -19,6 +19,7 @@ import com.yaoyaozw.customer.mapper.CustomerGraphicsMapper;
import com.yaoyaozw.customer.mapper.KanbanCommonMapper; import com.yaoyaozw.customer.mapper.KanbanCommonMapper;
import com.yaoyaozw.customer.mapper.MaterialCommonMapper; import com.yaoyaozw.customer.mapper.MaterialCommonMapper;
import com.yaoyaozw.customer.service.CrowdPackageConditionMatchService; import com.yaoyaozw.customer.service.CrowdPackageConditionMatchService;
import com.yaoyaozw.customer.service.CustomerServiceCommonService;
import com.yaoyaozw.customer.service.ReferralEntityService; import com.yaoyaozw.customer.service.ReferralEntityService;
import com.yaoyaozw.customer.service.RegisterUserEntityService; import com.yaoyaozw.customer.service.RegisterUserEntityService;
import com.yaoyaozw.customer.vo.AuthInfoVO; import com.yaoyaozw.customer.vo.AuthInfoVO;
...@@ -34,6 +35,7 @@ import org.springframework.stereotype.Component; ...@@ -34,6 +35,7 @@ import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -56,11 +58,11 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -56,11 +58,11 @@ public class CustomerServiceCommonAsyncComponent {
@Autowired @Autowired
private CrowdPackageConditionMatchService matchService; private CrowdPackageConditionMatchService matchService;
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate<String, Object> redisTemplate;
@Autowired @Autowired
private ReferralFeignClient referralFeignClient; private ReferralFeignClient referralFeignClient;
@Autowired @Autowired
private MaterialCommonMapper materialCommonMapper; private CustomerServiceCommonService customerServiceCommonService;
@Autowired @Autowired
private CustomerGraphicsMapper customerGraphicsMapper; private CustomerGraphicsMapper customerGraphicsMapper;
@Autowired @Autowired
...@@ -236,7 +238,7 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -236,7 +238,7 @@ public class CustomerServiceCommonAsyncComponent {
LOCAL_LOG.info("当前处理书城: {}", storeType); LOCAL_LOG.info("当前处理书城: {}", storeType);
// 去重提取公众号 // 去重提取公众号
Set<String> accountSet = userVoList.stream().map(CrowdPackageUserVO::getAccountId).collect(Collectors.toSet()); Set<String> accountSet = userVoList.stream().map(CrowdPackageUserVO::getAccountId).collect(Collectors.toSet());
List<AuthInfoVO> authInfoList = materialCommonMapper.getAuthInfoList(accountSet); List<AuthInfoVO> authInfoList = customerServiceCommonService.getAuthInfoList(accountSet);
// 定义 // 定义
List<ReferralEntity> referralEntityList = new ArrayList<>(accountSet.size()); List<ReferralEntity> referralEntityList = new ArrayList<>(accountSet.size());
for (AuthInfoVO authInfoVo : authInfoList) { for (AuthInfoVO authInfoVo : authInfoList) {
...@@ -303,7 +305,7 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -303,7 +305,7 @@ public class CustomerServiceCommonAsyncComponent {
if (isLegal) { if (isLegal) {
// 去重提取公众号 // 去重提取公众号
Set<String> accountSet = userVoList.stream().map(CrowdPackageUserVO::getAccountId).collect(Collectors.toSet()); Set<String> accountSet = userVoList.stream().map(CrowdPackageUserVO::getAccountId).collect(Collectors.toSet());
List<AuthInfoVO> authInfoList = materialCommonMapper.getAuthInfoList(accountSet); List<AuthInfoVO> authInfoList = customerServiceCommonService.getAuthInfoList(accountSet);
// 定义 // 定义
List<ReferralEntity> referralEntityList = new ArrayList<>(accountSet.size()); List<ReferralEntity> referralEntityList = new ArrayList<>(accountSet.size());
...@@ -334,12 +336,16 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -334,12 +336,16 @@ public class CustomerServiceCommonAsyncComponent {
private void generateMessageUsualLink(Map<String, List<CrowdPackageUserVO>> storeGroupMap, ReferralEntity customerReferral) { private void generateMessageUsualLink(Map<String, List<CrowdPackageUserVO>> storeGroupMap, ReferralEntity customerReferral) {
Map<String, String> storeEntityMap = getStoreEntityMap(storeGroupMap.keySet()); Map<String, String> storeEntityMap = getStoreEntityMap(storeGroupMap.keySet());
// 获取常用链接映射关系
Map<String, Map<String, String>> storeToCurrentToOriginMap = customerServiceCommonService.storeCommonLinkMap(customerReferral.getName());
storeGroupMap.forEach((storeType, userVoList) -> { storeGroupMap.forEach((storeType, userVoList) -> {
LOCAL_LOG.info("当前处理书城: {}", storeType); LOCAL_LOG.info("当前处理书城: {}", storeType);
// 去重提取公众号 // 去重提取公众号
Set<String> accountSet = userVoList.stream().map(CrowdPackageUserVO::getAccountId).collect(Collectors.toSet()); Set<String> accountSet = userVoList.stream().map(CrowdPackageUserVO::getAccountId).collect(Collectors.toSet());
List<AuthInfoVO> authInfoList = materialCommonMapper.getAuthInfoList(accountSet); List<AuthInfoVO> authInfoList = customerServiceCommonService.getAuthInfoList(accountSet);
Map<String, String> currentToOriginMap = storeToCurrentToOriginMap.get(storeType.replaceAll("_[0-9]", ""));
// 定义 // 定义
List<ReferralEntity> referralEntityList = new ArrayList<>(accountSet.size()); List<ReferralEntity> referralEntityList = new ArrayList<>(accountSet.size());
...@@ -352,6 +358,13 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -352,6 +358,13 @@ public class CustomerServiceCommonAsyncComponent {
referralEntity.setAccountId(authInfoVo.getAccountId()); referralEntity.setAccountId(authInfoVo.getAccountId());
referralEntity.setStoreTypeName(storeEntityMap.get(storeType)); referralEntity.setStoreTypeName(storeEntityMap.get(storeType));
String name = referralEntity.getName();
LOCAL_LOG.info("获取到常用链接当前key: {}", name);
String originKey = currentToOriginMap.get(name);
LOCAL_LOG.info("获取到原始常用链接key: {}", originKey);
referralEntity.setName(originKey);
// 常用链接不需要日期
getCopyReferral(null, authInfoVo, referralEntity); getCopyReferral(null, authInfoVo, referralEntity);
referralEntityList.add(referralEntity); referralEntityList.add(referralEntity);
...@@ -588,4 +601,6 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -588,4 +601,6 @@ public class CustomerServiceCommonAsyncComponent {
} }
} }
package com.yaoyaozw.customer.configs;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
* @author darker
* @date 2022/10/21 16:04
*/
//@Configuration
public class RabbitConfig {
/* @Bean
public Queue directQueue(){
Map<String, Object> map = new HashMap<>(4);
map.put("x-dead-letter-exchange", "DEATH_EXCHANGE");
map.put("x-dead-letter-routing-key", "death");
map.put("x-message-ttl", 60000);
return new Queue("YG_ACCESS_LIMIT", true, false, false, map);
}
@Bean
public DirectExchange directExchange(){
return new DirectExchange("TTL_EXCHANGE");
}
@Bean
public Queue deathQueue(){
return new Queue("DEATH_QUEUE");
}
@Bean
public DirectExchange deathExchange(){
return new DirectExchange("DEATH_EXCHANGE");
}
@Bean
public Binding bindingDirect(){
return BindingBuilder.bind(directQueue()).to(directExchange()).with("yg_limit");
}
@Bean
public Binding bindingDeath(){
return BindingBuilder.bind(deathQueue()).to(deathExchange()).with("death");
}*/
}
...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author darker * @author darker
...@@ -31,9 +32,15 @@ public class CustomerCommonController { ...@@ -31,9 +32,15 @@ public class CustomerCommonController {
} }
@GetMapping("/getCoverPicList") @GetMapping("/getCoverPicList")
@ApiOperation("获取书城列表") @ApiOperation("获取封面图列表")
public GenericsResult<List<CommonOptionResponseVO>> getCoverPicList() { public GenericsResult<List<CommonOptionResponseVO>> getCoverPicList() {
return commonService.getCoverPicList(); return commonService.getCoverPicList();
} }
@GetMapping("/getCommonLinkList")
@ApiOperation("获取合并书城之后的常用链接列表")
public GenericsResult<List<CommonOptionResponseVO>> getCommonLinkList() {
return commonService.getCommonLinkList();
}
} }
package com.yaoyaozw.customer.entity;
import lombok.Data;
import java.io.Serializable;
/**
* @author darker
* @date 2022/10/22 14:58
*/
@Data
public class CustomerCommonLink implements Serializable {
private Long id;
private String storeType;
private String originKey;
private String originName;
private String dictCurrentKey;
}
package com.yaoyaozw.customer.mapper; package com.yaoyaozw.customer.mapper;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.entity.CustomerCommonLink;
import com.yaoyaozw.customer.vo.AuthInfoVO; import com.yaoyaozw.customer.vo.AuthInfoVO;
import com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO; import com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -40,4 +42,19 @@ public interface MaterialCommonMapper { ...@@ -40,4 +42,19 @@ public interface MaterialCommonMapper {
*/ */
List<CommonOptionResponseVO> getCoverPicList(); List<CommonOptionResponseVO> getCoverPicList();
/**
* 让常见链接列表
*
* @return {@link List}<{@link CommonOptionResponseVO}
*/
List<CommonOptionResponseVO> getCommonLinkList();
/**
* 让共同链接映射
*
* @param currentKey 当前key
* @return {@link List}<{@link CustomerCommonLink}>
*/
List<CustomerCommonLink> getCommonLinkMapping(@Param("currentKey") String currentKey);
} }
package com.yaoyaozw.customer.service; package com.yaoyaozw.customer.service;
import com.yaoyaozw.customer.common.GenericsResult; import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.vo.AuthInfoVO;
import com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO; import com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* @author darker * @author darker
...@@ -32,4 +35,29 @@ public interface CustomerServiceCommonService { ...@@ -32,4 +35,29 @@ public interface CustomerServiceCommonService {
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>> * @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/ */
GenericsResult<List<CommonOptionResponseVO>> getCoverPicList(); GenericsResult<List<CommonOptionResponseVO>> getCoverPicList();
/**
* 让常见链接列表
*
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
GenericsResult<List<CommonOptionResponseVO>> getCommonLinkList();
/**
* 让常见链接列表
*
* @param accountSet 帐户设置
* @return {@link List}<{@link AuthInfoVO}>
*/
List<AuthInfoVO> getAuthInfoList(Set<String> accountSet);
/**
* 获取书城常用链接映射
*
* @param currentKey 当前key
* @return {@link Map}<{@link String}, {@link Map}<{@link String}, {@link String}>>
*/
Map<String, Map<String, String>> storeCommonLinkMap(String currentKey);
} }
...@@ -169,7 +169,7 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe ...@@ -169,7 +169,7 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
mainH5Content.append("\n").append("\n"); mainH5Content.append("\n").append("\n");
} }
// 将链接中的占位符换成链接 // 将链接中的占位符换成链接
customerContentVO.setContent(context.replace(CustomerCommonConstant.CUSTOMER_TEXT_URL_PLACEHOLDER + idx, "#")); customerContentVO.setContent(context.replace(CustomerCommonConstant.CUSTOMER_TEXT_URL_PLACEHOLDER, "#"));
} }
// 赋值链接信息 // 赋值链接信息
......
...@@ -2,15 +2,17 @@ package com.yaoyaozw.customer.service.impl; ...@@ -2,15 +2,17 @@ package com.yaoyaozw.customer.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.yaoyaozw.customer.common.GenericsResult; import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.entity.CustomerCommonLink;
import com.yaoyaozw.customer.mapper.KanbanCommonMapper; import com.yaoyaozw.customer.mapper.KanbanCommonMapper;
import com.yaoyaozw.customer.mapper.MaterialCommonMapper; import com.yaoyaozw.customer.mapper.MaterialCommonMapper;
import com.yaoyaozw.customer.service.CustomerServiceCommonService; import com.yaoyaozw.customer.service.CustomerServiceCommonService;
import com.yaoyaozw.customer.vo.AuthInfoVO;
import com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO; import com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.List; import java.util.stream.Collectors;
/** /**
* @author darker * @author darker
...@@ -44,4 +46,28 @@ public class CustomerServiceCommonServiceImpl implements CustomerServiceCommonSe ...@@ -44,4 +46,28 @@ public class CustomerServiceCommonServiceImpl implements CustomerServiceCommonSe
return new GenericsResult<>(coverPicList); return new GenericsResult<>(coverPicList);
} }
@Override
public GenericsResult<List<CommonOptionResponseVO>> getCommonLinkList() {
List<CommonOptionResponseVO> commonLinkList = materialCommonMapper.getCommonLinkList();
return new GenericsResult<>(commonLinkList);
}
@Override
public List<AuthInfoVO> getAuthInfoList(Set<String> accountSet) {
return materialCommonMapper.getAuthInfoList(accountSet);
}
@Override
public Map<String, Map<String, String>> storeCommonLinkMap(String currentKey) {
List<CustomerCommonLink> commonLinkMapping = materialCommonMapper.getCommonLinkMapping(currentKey);
return commonLinkMapping.stream().collect(
Collectors.groupingBy(CustomerCommonLink::getStoreType,
// 第二层map
HashMap::new, Collectors.groupingBy(CustomerCommonLink::getDictCurrentKey,
// 处理内层list
HashMap::new, Collectors.collectingAndThen(Collectors.toList(), item -> item.get(0).getOriginKey()))));
}
} }
...@@ -26,6 +26,8 @@ public class CustomerDelayListVO implements Serializable { ...@@ -26,6 +26,8 @@ public class CustomerDelayListVO implements Serializable {
@ApiModelProperty("客服消息类型(图文、文本)") @ApiModelProperty("客服消息类型(图文、文本)")
private String type; private String type;
private String payType;
@ApiModelProperty("标题") @ApiModelProperty("标题")
private String name; private String name;
...@@ -38,6 +40,8 @@ public class CustomerDelayListVO implements Serializable { ...@@ -38,6 +40,8 @@ public class CustomerDelayListVO implements Serializable {
@ApiModelProperty("时间间隔") @ApiModelProperty("时间间隔")
private String timeInterval; private String timeInterval;
private Integer peopleNum;
private Long timeStamp; private Long timeStamp;
@ApiModelProperty("发送状态值") @ApiModelProperty("发送状态值")
......
...@@ -46,10 +46,12 @@ ...@@ -46,10 +46,12 @@
cgd.id, cgd.id,
cgd.name, cgd.name,
cgd.type, cgd.type,
if(cgd.is_pay = -1, '不限', if(cgd.is_pay = 0, '未支付', '已支付')) as payType,
ai.nick_name as accountName, ai.nick_name as accountName,
cgd.post_sort as postSort, cgd.post_sort as postSort,
cgd.time_interval as `timestamp` , cgd.time_interval as `timestamp` ,
s_dic.dic_value as sendStatus s_dic.dic_value as sendStatus,
cgd.send_num as peopleNum
from customer_graphics_delay cgd from customer_graphics_delay cgd
left join authorizer_info ai left join authorizer_info ai
...@@ -60,7 +62,7 @@ ...@@ -60,7 +62,7 @@
and s_dic.dic_key = cgd.send_status and s_dic.dic_key = cgd.send_status
where cgd.is_deleted = 0 where cgd.is_deleted = 0
<if test="queryDto.appId != null and queryDto.appId != ''"> <if test="queryDto.appId != null">
and cgd.app_id = #{queryDto.appId} and cgd.app_id = #{queryDto.appId}
</if> </if>
......
...@@ -33,4 +33,22 @@ ...@@ -33,4 +33,22 @@
order by sort order by sort
</select> </select>
<select id="getCommonLinkList" resultType="com.yaoyaozw.customer.vo.kanban.CommonOptionResponseVO">
select
dic_key as `value`,
dic_value as `label`
from sys_dictionary
where is_deleted = 0
and group_id = 'CUSTOMER_COMMON_LINK'
and level = 3
order by sort
</select>
<select id="getCommonLinkMapping" resultType="com.yaoyaozw.customer.entity.CustomerCommonLink">
select * from customer_common_link
<if test="currentKey != null and currentKey != ''">
where dict_current_key = #{currentKey}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论