提交 ec604a7b 作者: 沈振路

刷新客服消息送达人数的测试类接口

上级 90e6c2cc
......@@ -2,9 +2,11 @@ package com.yaoyaozw.customer.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yaoyaozw.customer.constants.CustomerMaterialConstant;
import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import com.yaoyaozw.customer.entity.CustomerFollowReply;
import com.yaoyaozw.customer.entity.CustomerGraphics;
import com.yaoyaozw.customer.mapper.KanbanCommonMapper;
import com.yaoyaozw.customer.service.AccountOrderService;
import com.yaoyaozw.customer.service.CustomerDelayPublishService;
......@@ -18,9 +20,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -111,5 +111,26 @@ public class TestController {
}
}
@GetMapping("/refreshSendNum")
public void refreshSendNum() {
List<CustomerGraphics> list = customerGraphicsService.list(new QueryWrapper<CustomerGraphics>().lt("post_time", new Date()));
Map<Object, Object> customerCount = redisTemplate.opsForHash().entries("CUSTOMER_COUNT");
Map<Long, Integer> map = new HashMap<>();
for (Map.Entry<Object, Object> objectObjectEntry : customerCount.entrySet()) {
map.put(Long.valueOf(objectObjectEntry.getKey().toString()), Integer.valueOf(objectObjectEntry.getValue().toString()));
}
List<CustomerGraphics> updateList = new ArrayList<>();
for (CustomerGraphics customerGraphics : list) {
CustomerGraphics entity = new CustomerGraphics();
entity.setId(customerGraphics.getId());
entity.setSendNum(map.getOrDefault(customerGraphics.getId(), 0));
updateList.add(entity);
}
customerGraphicsService.updateBatchById(updateList);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论