提交 892d50f3 作者: gh

重命名delayItem

上级 9a109186
......@@ -4,10 +4,9 @@ import com.yaoyaozw.customer.common.BaseResult;
import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.dto.customer.DelayCustomerQueryDTO;
import com.yaoyaozw.customer.dto.customer.DelayCustomerSaveDTO;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import com.yaoyaozw.customer.vo.customer.DelayCustomerItemVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
......@@ -38,7 +37,7 @@ public class DelayCustomerController {
@ApiOperation("查询")
@PostMapping("/pageList")
public GenericsResult<List<DelayCustomerListVO>> pageList(@RequestBody DelayCustomerQueryDTO queryDto) {
public GenericsResult<List<DelayCustomerItemVO>> pageList(@RequestBody DelayCustomerQueryDTO queryDto) {
return new GenericsResult<>(new ArrayList<>());
}
......
......@@ -3,7 +3,7 @@ package com.yaoyaozw.customer.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import com.yaoyaozw.customer.vo.customer.DelayCustomerItemVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -20,5 +20,5 @@ public interface CustomerGraphicsDelayMapper extends BaseMapper<CustomerGraphics
* @param appidList
* @return
*/
List<DelayCustomerListVO> findAllDelayCustomerMessage(@Param("appidList") Set<String> appidList);
List<DelayCustomerItemVO> findAllDelayCustomerMessage(@Param("appidList") Set<String> appidList);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yaoyaozw.customer.scheduling;
import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import com.yaoyaozw.customer.service.AccountOrderService;
import com.yaoyaozw.customer.service.RegisterUserEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -14,6 +15,9 @@ public class SchedulingTask {
@Autowired
private AccountOrderService accountOrderService;
@Autowired
private RegisterUserEntityService registerUserEntityService;
/**
* 拉取付费订单(每15min一次)
......@@ -50,10 +54,19 @@ public class SchedulingTask {
/**
* 每段时间扫描一次正常客服
* 每10min扫描一次正常客服
*/
public void publishCustomerMessage(){
}
/**
* 每1min扫延时客服
*/
public void publishDelayCustomerMessage(){
}
}
......@@ -2,7 +2,7 @@ package com.yaoyaozw.customer.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import com.yaoyaozw.customer.vo.customer.DelayCustomerItemVO;
import java.util.List;
import java.util.Set;
......@@ -13,6 +13,6 @@ import java.util.Set;
*/
public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsDelay> {
List<DelayCustomerListVO> findAllDelayCustomerMessage(Set<String> appidList);
List<DelayCustomerItemVO> findAllDelayCustomerMessage(Set<String> appidList);
}
......@@ -5,6 +5,9 @@ import com.yaoyaozw.customer.entity.RegisterUserEntity;
import com.baomidou.mybatisplus.extension.service.IService;
public interface RegisterUserEntityService extends IService<RegisterUserEntity>{
void sendCustomerMessage(IntegrationRequestDTO integrationRequestDTO);
......
......@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper;
import com.yaoyaozw.customer.service.CustomerGraphicsDelayService;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import com.yaoyaozw.customer.vo.customer.DelayCustomerItemVO;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -20,7 +20,7 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
@Override
public List<DelayCustomerListVO> findAllDelayCustomerMessage(Set<String> appidList) {
public List<DelayCustomerItemVO> findAllDelayCustomerMessage(Set<String> appidList) {
return baseMapper.findAllDelayCustomerMessage(appidList);
......
......@@ -3,12 +3,10 @@ package com.yaoyaozw.customer.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import com.yaoyaozw.customer.entity.AuthorizerToken;
import com.yaoyaozw.customer.entity.CustomerGraphics;
import com.yaoyaozw.customer.service.AuthorizerTokenService;
import com.yaoyaozw.customer.service.CustomerGraphicsDelayService;
import com.yaoyaozw.customer.service.CustomerGraphicsService;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import org.checkerframework.checker.units.qual.A;
import com.yaoyaozw.customer.vo.customer.DelayCustomerItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -55,30 +53,40 @@ public class RegisterUserEntityServiceImpl extends ServiceImpl<RegisterUserEntit
Set<String> appidSet = allPostUser.stream().map(RegisterUserEntity::getAppId).collect(Collectors.toSet());
if (!allPostUser.isEmpty()){
//号-发送序列-用户
Map<String, Map<Integer, List<RegisterUserEntity>>> userMap = allPostUser.stream().collect(Collectors.groupingBy(RegisterUserEntity::getAppId, Collectors.groupingBy(RegisterUserEntity::getCustomerSort)));
//号-用户
Map<String, List<RegisterUserEntity>> userMap = allPostUser.stream().collect(Collectors.groupingBy(RegisterUserEntity::getAppId));
List<DelayCustomerListVO> allDelayCustomerMessage = customerGraphicsDelayService.findAllDelayCustomerMessage(appidSet);
List<DelayCustomerItemVO> allDelayCustomerMessage = customerGraphicsDelayService.findAllDelayCustomerMessage(appidSet);
if (allDelayCustomerMessage!=null&&!allDelayCustomerMessage.isEmpty()){
//号-发送序列-客服id
Map<String, Map<Byte, List<DelayCustomerListVO>>> customerMap = allDelayCustomerMessage.stream().collect(Collectors.groupingBy(DelayCustomerListVO::getAppId, Collectors.groupingBy(DelayCustomerListVO::getPostSort)));
Map<String, Map<Integer, List<DelayCustomerItemVO>>> customerMap = allDelayCustomerMessage.stream().collect(Collectors.groupingBy(DelayCustomerItemVO::getAppId, Collectors.groupingBy(DelayCustomerItemVO::getPostSort)));
//找token
List<AuthorizerToken> tokenList = authorizerTokenService.list();
//找token
Map<String, String> tokenMap = tokenList.stream().collect(Collectors.toMap(AuthorizerToken::getAuthorizerAppid, AuthorizerToken::getAuthorizerAccessToken));
for (Map.Entry<String, Map<Integer, List<RegisterUserEntity>>> userEntry : userMap.entrySet()) {
for (Map.Entry<String, List<RegisterUserEntity>> userEntry : userMap.entrySet()) {
String appid = userEntry.getKey();
Map<Byte, List<DelayCustomerListVO>> byteListMap = customerMap.get(appid);
Map<Integer, List<RegisterUserEntity>> value = userEntry.getValue();
//该号下延时客服
Map<Integer, List<DelayCustomerItemVO>> delaySortMap = customerMap.get(appid);
//所有的用户
List<RegisterUserEntity> userList = userEntry.getValue();
if (delaySortMap!=null&&!delaySortMap.isEmpty()){
for (RegisterUserEntity user : userList) {
Integer customerSort = user.getCustomerSort();
}
}
}
}
}
......
......@@ -10,7 +10,7 @@ import java.io.Serializable;
* @date 2022/9/16 10:45
*/
@Data
public class DelayCustomerListVO implements Serializable {
public class DelayCustomerItemVO implements Serializable {
/**
* appid
......@@ -25,7 +25,7 @@ public class DelayCustomerListVO implements Serializable {
/**
* 发送序列
*/
private Byte postSort;
private Integer postSort;
/**
* 间隔时间
......
......@@ -21,7 +21,7 @@
</sql>
<select id="findAllDelayCustomerMessage" resultType="com.yaoyaozw.customer.vo.customer.DelayCustomerListVO">
<select id="findAllDelayCustomerMessage" resultType="com.yaoyaozw.customer.vo.customer.DelayCustomerItemVO">
select * from customer_graphics_delay
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论