提交 757326a2 作者: gh

Merge branch 'customer-service-wgh'

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