|
|
|
@ -53,7 +53,6 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
|
|
|
|
|
@Resource
|
|
|
|
|
private StringRedisTemplate stringRedisTemplate;
|
|
|
|
|
private final String REDIS_UNREADMSG_PREFIX = "REDIS_UNREADMSG_PREFIX";
|
|
|
|
|
private final String REDIS_UNREADMSG_SEND_PREFIX = "REDIS_UNREADMSG_SEND_PREFIX";
|
|
|
|
|
|
|
|
|
|
@Value("${im.openim.appkey}")
|
|
|
|
|
private String appkey;
|
|
|
|
@ -151,7 +150,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
|
|
|
|
|
if (StringUtils.isEmpty(uid) || StringUtils.isEmpty(tuid)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
BoundListOperations<String, String> ops = stringRedisTemplate.boundListOps("REDIS_UNREADMSG_PREFIX" + tuid);
|
|
|
|
|
BoundListOperations<String, String> ops = stringRedisTemplate.boundListOps(REDIS_UNREADMSG_PREFIX + tuid);
|
|
|
|
|
for (int i = 0; i < ops.size(); i++) {
|
|
|
|
|
String jStr = ops.index(i);
|
|
|
|
|
if (jStr.contains(uid)) {
|
|
|
|
@ -171,7 +170,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
|
|
|
|
|
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
|
|
|
|
|
servants.parallelStream().forEach(p -> {
|
|
|
|
|
p.getString("user_id");
|
|
|
|
|
BoundListOperations<String, String> ops = stringRedisTemplate.boundListOps("REDIS_UNREADMSG_PREFIX" + p.getString("user_id"));
|
|
|
|
|
BoundListOperations<String, String> ops = stringRedisTemplate.boundListOps(REDIS_UNREADMSG_PREFIX + p.getString("user_id"));
|
|
|
|
|
if (ops.size() < 1) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -183,7 +182,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
|
|
|
|
|
}
|
|
|
|
|
TemplateMessage msg = initUnreadMsg(unreadMsg, clients, p.getString("wx_openid"), paymentApi.getTemplateId("commission"));
|
|
|
|
|
paymentApi.sendTemplateMessage(msg);
|
|
|
|
|
stringRedisTemplate.delete("REDIS_UNREADMSG_PREFIX" + p.getString("user_id"));
|
|
|
|
|
stringRedisTemplate.delete(REDIS_UNREADMSG_PREFIX + p.getString("user_id"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|