Commit 0b8ef04f by 周立明

fix: 修复线上对账业务的事务和空指针问题

1. 将insertOrUpdate方法的事务传播级别改为REQUIRES_NEW,避免外部事务影响
2. 增加payOrder非空判断,防止空指针异常
1 parent 1dd592e6
...@@ -75,7 +75,7 @@ public class OnlineStatementAccountDailyBalanceService { ...@@ -75,7 +75,7 @@ public class OnlineStatementAccountDailyBalanceService {
} }
@GlsxDistributeLockable(name="'OnlineStatementAccountDailyBalanceService_' + #record.yqMerchantId",timeoutException=RpcServiceException.class,time=60) @GlsxDistributeLockable(name="'OnlineStatementAccountDailyBalanceService_' + #record.yqMerchantId",timeoutException=RpcServiceException.class,time=60)
@Transactional(propagation= Propagation.REQUIRED,rollbackFor= RpcServiceException.class) @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= RpcServiceException.class)
public void insertOrUpdate(OnlineStatementAccountDailyBalance record,boolean updateNext) { public void insertOrUpdate(OnlineStatementAccountDailyBalance record,boolean updateNext) {
try { try {
if(record.getId() == null) { if(record.getId() == null) {
......
...@@ -123,6 +123,7 @@ public class OnlineStatementAccountTradeDetailService { ...@@ -123,6 +123,7 @@ public class OnlineStatementAccountTradeDetailService {
continue; continue;
}else{ }else{
PayOrder payOrder = payOrderService.getById(detail.getPayOrderId()); PayOrder payOrder = payOrderService.getById(detail.getPayOrderId());
if(payOrder != null){
setDetailRealityPlatform(detail,payOrder); setDetailRealityPlatform(detail,payOrder);
if(detail.getRealityPlatformMerchantId() != null){ if(detail.getRealityPlatformMerchantId() != null){
onlineStatementAccountTradeDetailMapper.updateByPrimaryKeySelective(OnlineStatementAccountTradeDetail.builder() onlineStatementAccountTradeDetailMapper.updateByPrimaryKeySelective(OnlineStatementAccountTradeDetail.builder()
...@@ -133,6 +134,7 @@ public class OnlineStatementAccountTradeDetailService { ...@@ -133,6 +134,7 @@ public class OnlineStatementAccountTradeDetailService {
continue; continue;
} }
} }
}
notIdList.add(detail.getId()); notIdList.add(detail.getId());
} catch (Exception e) { } catch (Exception e) {
log.error("updateDetailTask", e); log.error("updateDetailTask", e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!