|
|
@@ -60,7 +60,7 @@ public class AfDianRechargeServiceImpl implements AfDianRechargeService {
|
|
|
|
|
|
@Override
|
|
|
public AfDianCardKeyResp afDianValidateCardKey(String cardKey) throws Exception {
|
|
|
- String BASE_URL = gptRechargeCardKeyChannelService.getCardKeyDomain(null);
|
|
|
+ String BASE_URL = gptRechargeCardKeyChannelService.getCardKeyDomain(cardKey);
|
|
|
String url = BASE_URL + "/cdks/public/check";
|
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
@@ -73,7 +73,7 @@ public class AfDianRechargeServiceImpl implements AfDianRechargeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String confirmRecharge(GroupsRelation relation, CmsUser cmsUser) {
|
|
|
+ public String confirmRecharge(GroupsRelation relation, String cardKey, CmsUser cmsUser) {
|
|
|
Long relationId = relation.getId();
|
|
|
String gptCardKey = relation.getCardKey();
|
|
|
//校验卡密是否可用
|
|
|
@@ -138,13 +138,9 @@ public class AfDianRechargeServiceImpl implements AfDianRechargeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public TaskResult getTaskResult(String taskId) {
|
|
|
- log.info("开始查询任务结果: {}", taskId);
|
|
|
+ public TaskResult getTaskResult(GroupsRelation relation) {
|
|
|
try {
|
|
|
- GroupsRelation relation = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).eq(GroupsRelation::getGptTaskId, taskId).last("limit 1"));
|
|
|
- if (relation == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
+ String taskId = relation.getGptTaskId();
|
|
|
String cardKey = relation.getCardKey();
|
|
|
String BASE_URL = gptRechargeCardKeyChannelService.getCardKeyDomain(cardKey);
|
|
|
String url = BASE_URL + "/stocks/public/outstock/" + taskId;
|
|
|
@@ -278,7 +274,11 @@ public class AfDianRechargeServiceImpl implements AfDianRechargeService {
|
|
|
relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class).set(rechargeStatus == GroupsRelation.RechargeStatus.recharge_error, GroupsRelation::getRechargeRemainNum, rechargeRemainNum + 1).set(GroupsRelation::getRechargeStatus, rechargeStatus).set(expiryTime != null, GroupsRelation::getStartTime, startTime).set(expiryTime != null, GroupsRelation::getExpiryTime, expiryTime).set(StrUtil.isNotEmpty(rechargeErrorInfo), GroupsRelation::getRechargeErrorInfo, rechargeErrorInfo).eq(GroupsRelation::getId, relation.getId()).le(GroupsRelation::getRechargeRemainNum, relation.getRechargeNum()).eq(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging));
|
|
|
//记录代充记录
|
|
|
if (rechargeStatus == GroupsRelation.RechargeStatus.complete) {
|
|
|
- gptUserRechargeRecordService.recordGptUserRechargeNum(relation.getUserId(), relation.getId(), relation.getAccount(), -1, null, "自动代充");
|
|
|
+ String remark = "自动代充";
|
|
|
+ if (StrUtil.isNotBlank(relation.getOperator())) {
|
|
|
+ remark = "后台自动代充";
|
|
|
+ }
|
|
|
+ gptUserRechargeRecordService.recordGptUserRechargeNum(relation.getUserId(), relation.getId(), relation.getAccount(), -1, relation.getOperator(), remark);
|
|
|
//修改对应订单状态
|
|
|
if (gptRechargeCardKey != null) {
|
|
|
Long orderId = gptRechargeCardKey.getOrderId();
|