mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
添加事务标记
This commit is contained in:
@@ -15,6 +15,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -31,6 +32,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional
|
||||
public class AsyncSendCasesRecommendService {
|
||||
|
||||
@Resource
|
||||
@@ -50,7 +52,7 @@ public class AsyncSendCasesRecommendService {
|
||||
|
||||
@Async
|
||||
public void sendCasesRecommend(CasesRecommend casesRecommend) {
|
||||
log.info("异步推送任务开始了 {}",casesRecommend.getId());
|
||||
log.info("异步推送任务开始了 {}", casesRecommend.getId());
|
||||
List<Integer> pushStatusList = new ArrayList<>();
|
||||
pushStatusList.add(CasesPushStatusEnum.WAIT_PUSH.getStatus());
|
||||
List<CasesRecommendPushRecord> casesRecommendPushRecords = casesRecommendPushRecordDao.findList(FieldFilters.in("pushStatus", pushStatusList), FieldFilters.eqField("recommendId", casesRecommend.getId()));
|
||||
@@ -69,7 +71,7 @@ public class AsyncSendCasesRecommendService {
|
||||
}
|
||||
//修改为推送完成 --- 无数据 无需推送
|
||||
updateProcessStatus(casesRecommend.getId(), CasesPushStatusEnum.PUSH_SUCCESS.getStatus());
|
||||
log.info("异步推送任务结束了 {}",casesRecommend.getId());
|
||||
log.info("异步推送任务结束了 {}", casesRecommend.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user