mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
修改异步推送
This commit is contained in:
@@ -32,7 +32,6 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional
|
||||
public class AsyncSendCasesRecommendService {
|
||||
|
||||
@Resource
|
||||
@@ -51,6 +50,7 @@ public class AsyncSendCasesRecommendService {
|
||||
|
||||
|
||||
@Async
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void sendCasesRecommend(CasesRecommend casesRecommend) {
|
||||
log.info("异步推送任务开始了 {}", casesRecommend.getId());
|
||||
List<CasesRecommendPushRecord> casesRecommendPushRecords = casesRecommendPushRecordDao.findList(FieldFilters.eq("pushStatus", CasesPushStatusEnum.WAIT_PUSH.getStatus()), FieldFilters.eq("recommendId", casesRecommend.getId()));
|
||||
|
||||
@@ -141,9 +141,11 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(pushRecords)) {
|
||||
log.info("本次推送纪录条数 {}", pushRecords.size());
|
||||
casesRecommendPushRecordDao.saveList(pushRecords);
|
||||
}
|
||||
try {
|
||||
log.info("发送推送案例消息 {}", JSONUtil.toJsonStr(casesRecommend));
|
||||
//发送推送案例消息
|
||||
asyncSendCasesRecommendService.sendCasesRecommend(casesRecommend);
|
||||
log.info("执行完成耗时 {} 秒 ", (System.currentTimeMillis() - t1) / 1000);
|
||||
|
||||
Reference in New Issue
Block a user