Commit db69a3f5 by 林永健

fix(integral): 优化渠道账户赋值及签约记录查询逻辑

- 修正渠道账户赋值方式,先初始化空对象再根据存在记录赋值
- 确保渠道账户字段赋值统一处理,避免空指针异常
- 修改签约记录查询逻辑,改为查询列表并取最新一条记录
- 优化签约状态判断,避免重复触发第三方签约请求
1 parent 8e93bc2e
...@@ -758,15 +758,17 @@ public class IntegralTransferOutService { ...@@ -758,15 +758,17 @@ public class IntegralTransferOutService {
record.setPayDate(new Date()); record.setPayDate(new Date());
record.setChannel(request.getChannel()); record.setChannel(request.getChannel());
record.setChannelProvider(request.getChannelProvider()); record.setChannelProvider(request.getChannelProvider());
IntegralChannelAccountDTO channelAccount = getChannelAccount(request); IntegralChannelAccountDTO channelAccount = new IntegralChannelAccountDTO();
if (channelAccount != null) { IntegralChannelAccountDTO existChannelAccount = getChannelAccount(request);
record.setPaymentEntityCode(channelAccount.getPaymentEntityCode()); if (existChannelAccount != null) {
record.setPaymentEntityName(channelAccount.getPaymentEntityName()); channelAccount = existChannelAccount;
record.setLevyCode(channelAccount.getLevyCode());
record.setLevyName(channelAccount.getLevyName());
record.setLevyChannelCode(channelAccount.getLevyChannelCode());
record.setLevyChannelName(channelAccount.getLevyChannelName());
} }
record.setPaymentEntityCode(channelAccount.getPaymentEntityCode());
record.setPaymentEntityName(channelAccount.getPaymentEntityName());
record.setLevyCode(channelAccount.getLevyCode());
record.setLevyName(channelAccount.getLevyName());
record.setLevyChannelCode(channelAccount.getLevyChannelCode());
record.setLevyChannelName(channelAccount.getLevyChannelName());
updateSelectiveByIds(record, request.getIds()); updateSelectiveByIds(record, request.getIds());
// 2025-12-08 加入签约流程,异步发起即可 // 2025-12-08 加入签约流程,异步发起即可
...@@ -1478,7 +1480,12 @@ public class IntegralTransferOutService { ...@@ -1478,7 +1480,12 @@ public class IntegralTransferOutService {
if (signCache.containsKey(key)) { if (signCache.containsKey(key)) {
signData = signCache.get(key); signData = signCache.get(key);
}else { }else {
IntegralTransferSign existSign = integralTransferSignRecordMapper.selectOne(IntegralTransferSign.buildByOrder(order)); IntegralTransferSign existSign = null;
List<IntegralTransferSign> existSignList = integralTransferSignRecordMapper.select(IntegralTransferSign.buildByOrder(order));
if (CollectionUtils.isNotEmpty(existSignList)) {
// 取最新一条
existSign = existSignList.get(existSignList.size() - 1);
}
// 签约记录存在,且为成功状态,则无需触发第三方签约 (签约失败还是得发起第三方查询,防止遗漏) // 签约记录存在,且为成功状态,则无需触发第三方签约 (签约失败还是得发起第三方查询,防止遗漏)
if (Objects.nonNull(existSign) if (Objects.nonNull(existSign)
&& IntegralTransferSignStatusEnum.isSuccess(existSign.getSignStatus())) { && IntegralTransferSignStatusEnum.isSuccess(existSign.getSignStatus())) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!