Commit 474ab7fa authored by 赵啸非's avatar 赵啸非

添加消息发送

parent 0d451ada
......@@ -120,7 +120,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
List<FinPersonInfo> finPersonInfos = new ArrayList<>();
List<EndPersonInfo> endPersonInfos = new ArrayList<>();
while (true) {
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_WAITNUM_LIST_CACHE, 10, TimeUnit.SECONDS);
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_WAITNUM_LIST_CACHE, 5, TimeUnit.SECONDS);
WaitPersonInfo waitPersonInfo = JSON.parseObject(value, WaitPersonInfo.class);
// WaitPersonInfo waitPersonInfo = cacheService.blpop(RedisKey.KEY_WAITNUM_LIST_CACHE,10, WaitPersonInfo.class);
if (ObjectUtils.isEmpty(waitPersonInfo)) {
......@@ -131,7 +131,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
}
while (true) {
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_FIN_LIST_CACHE, 10, TimeUnit.SECONDS);
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_FIN_LIST_CACHE, 5, TimeUnit.SECONDS);
FinPersonInfo finPersonInfo = JSON.parseObject(value, FinPersonInfo.class);
// FinPersonInfo finPersonInfo = cacheService.blpop(RedisKey.KEY_FIN_LIST_CACHE,10, FinPersonInfo.class);
if (ObjectUtils.isEmpty(finPersonInfo)) {
......@@ -142,7 +142,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
}
while (true) {
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_FIN_DOWORK_LIST_CACHE, 10, TimeUnit.SECONDS);
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_FIN_DOWORK_LIST_CACHE, 5, TimeUnit.SECONDS);
EndPersonInfo endPersonInfo = JSON.parseObject(value, EndPersonInfo.class);
// FinPersonInfo finPersonInfo = cacheService.blpop(RedisKey.KEY_FIN_LIST_CACHE,10, FinPersonInfo.class);
if (ObjectUtils.isEmpty(endPersonInfo)) {
......@@ -152,6 +152,18 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
}
}
List<CpPersonInfo> cpPersonInfos = new ArrayList<>();
while (true) {
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_CP_LIST_CACHE, 5 , TimeUnit.SECONDS);
log.info("cp:{}",value);
CpPersonInfo cpPersonInfo = JSON.parseObject(value, CpPersonInfo.class);
if (ObjectUtils.isEmpty(cpPersonInfo)) {
break;
} else {
cpPersonInfos.add(cpPersonInfo);
}
}
if (!ObjectUtils.isEmpty(waitPersonInfos)) {
// log.info("waitPersonInfos:{}", JSON.toJSONString(waitPersonInfos));
......@@ -199,7 +211,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
if (!ObjectUtils.isEmpty(finPersonInfo.getAvgWaitTime())) {
int avgWait = finPersonInfo.getAvgWaitTime() / 60;
if (avgWait > 0
&& diff > avgWait) {
&& diff >= avgWait) {
//todo 构造发送消息。
AlarmRecordsEntity recordsEntity = new AlarmRecordsEntity();
recordsEntity.initAttrValue();
......@@ -242,7 +254,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
if (!ObjectUtils.isEmpty(endPersonInfo.getAvgHandleTime())) {
int avgWait = endPersonInfo.getAvgHandleTime() / 60;
if (avgWait > 0
&& diff > avgWait) {
&& diff >= avgWait) {
//todo 构造发送消息。
AlarmRecordsEntity recordsEntity = new AlarmRecordsEntity();
recordsEntity.initAttrValue();
......@@ -266,23 +278,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
}
}
}
}).start();
//好差评
new Thread(() -> {
List<CpPersonInfo> cpPersonInfos = new ArrayList<>();
while (true) {
String value = redisTemplate.opsForList().leftPop(RedisKey.KEY_CP_LIST_CACHE, 10, TimeUnit.SECONDS);
log.info("cp:{}",value);
CpPersonInfo cpPersonInfo = JSON.parseObject(value, CpPersonInfo.class);
if (ObjectUtils.isEmpty(cpPersonInfo)) {
break;
} else {
cpPersonInfos.add(cpPersonInfo);
}
}
// cacheService.select(database);//
if (!ObjectUtils.isEmpty(cpPersonInfos)) {
log.info("cpPersonInfos:{}", JSON.toJSONString(cpPersonInfos));
for (CpPersonInfo cpPersonInfo : cpPersonInfos) {
......@@ -320,7 +316,6 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
}
}).start();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment