|
@@ -35,6 +35,7 @@ import com.cyksj.service.recharge.GptRechargeCardKeyChannelService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
@@ -145,6 +146,7 @@ public class Auto17RechargeServiceImpl implements Auto17RechargeService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public TaskResult getTaskResult(GroupsRelation relation) {
|
|
public TaskResult getTaskResult(GroupsRelation relation) {
|
|
|
try {
|
|
try {
|
|
|
Auto17OrderStatusResponse response = queryOrderStatus(relation.getCardKey(), relation.getGptTaskId());
|
|
Auto17OrderStatusResponse response = queryOrderStatus(relation.getCardKey(), relation.getGptTaskId());
|
|
@@ -361,8 +363,10 @@ public class Auto17RechargeServiceImpl implements Auto17RechargeService {
|
|
|
if (!"completed".equals(status) && !"failed".equals(status)) {
|
|
if (!"completed".equals(status) && !"failed".equals(status)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ String taskId = relation.getGptTaskId();
|
|
|
relation = relationMapper.selectById(relation.getId());
|
|
relation = relationMapper.selectById(relation.getId());
|
|
|
- if (relation == null || relation.getRechargeStatus() != GroupsRelation.RechargeStatus.recharging) {
|
|
|
|
|
|
|
+ if (relation == null || relation.getRechargeStatus() != GroupsRelation.RechargeStatus.recharging
|
|
|
|
|
+ || !StrUtil.equals(taskId, relation.getGptTaskId())) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -416,6 +420,7 @@ public class Auto17RechargeServiceImpl implements Auto17RechargeService {
|
|
|
.set(expiryTime != null, GroupsRelation::getExpiryTime, expiryTime)
|
|
.set(expiryTime != null, GroupsRelation::getExpiryTime, expiryTime)
|
|
|
.set((!completed || specialSuccess) && StrUtil.isNotBlank(message), GroupsRelation::getRechargeErrorInfo, message)
|
|
.set((!completed || specialSuccess) && StrUtil.isNotBlank(message), GroupsRelation::getRechargeErrorInfo, message)
|
|
|
.eq(GroupsRelation::getId, relation.getId())
|
|
.eq(GroupsRelation::getId, relation.getId())
|
|
|
|
|
+ .eq(GroupsRelation::getGptTaskId, taskId)
|
|
|
.eq(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging));
|
|
.eq(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging));
|
|
|
if (update == 0 || !completed) {
|
|
if (update == 0 || !completed) {
|
|
|
return;
|
|
return;
|