|
@@ -221,7 +221,6 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
|
|
|
//请求三方
|
|
|
SysUser withdrawalUser = sysUserService.findUserById(build.getUserId());
|
|
|
- Boolean flag = false;
|
|
|
if (authOperaReq.getPass()) {
|
|
|
//请求三方接口
|
|
|
//交易流水号生成
|
|
@@ -234,14 +233,15 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
if (withdraw.getStatus() && withdraw.getData()) {
|
|
|
build.setTradeStatus(TradeStatusEnum.pending);
|
|
|
build.setTransNo(transNo.toString());
|
|
|
- flag = true;
|
|
|
} else {
|
|
|
build.setTradeStatus(TradeStatusEnum.failed);
|
|
|
build.setErrorMsg("请求三方接口返回失败");
|
|
|
}
|
|
|
}
|
|
|
+ updateById(build);
|
|
|
+
|
|
|
//修改系统中账户
|
|
|
- if (!authOperaReq.getPass() || !flag) {
|
|
|
+ if (!authOperaReq.getPass()) {
|
|
|
//审核不通过,账户解冻
|
|
|
UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
|
|
|
build.getUserId(), build.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
|
|
@@ -250,8 +250,11 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_BACK);
|
|
|
accountRecordDto.setSaveRecord(false);
|
|
|
userAccountService.accountChange(accountRecordDto);
|
|
|
+
|
|
|
+ //发生结算成功通知
|
|
|
+ unpassSend(build.getUserId(), build.getPhone(), authOperaReq.getReason());
|
|
|
}
|
|
|
- updateById(build);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -327,6 +330,18 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
detail.setTradeNo(callback.getOrderNo());
|
|
|
detail.setErrorCode(callback.getErrorCode());
|
|
|
detail.setErrorMsg(callback.getErrorMsg());
|
|
|
+
|
|
|
+ //审核不通过,账户解冻
|
|
|
+ UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
|
|
|
+ detail.getUserId(), detail.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
|
|
|
+ detail.getId(), "老师结算", null
|
|
|
+ );
|
|
|
+ accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_BACK);
|
|
|
+ accountRecordDto.setSaveRecord(false);
|
|
|
+ userAccountService.accountChange(accountRecordDto);
|
|
|
+
|
|
|
+ //发生结算失败通知
|
|
|
+ unpassSend(detail.getUserId(), detail.getPhone(), "结算失败,请重新提交。");
|
|
|
} else {
|
|
|
return;
|
|
|
}
|
|
@@ -360,6 +375,16 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void unpassSend(Long userId, String phone, String reason) {
|
|
|
+ Map<Long, String> receivers = new HashMap<>();
|
|
|
+ receivers.put(userId, phone);
|
|
|
+ try {
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.TEACHER_WITHDRAW_UNPASS,
|
|
|
+ receivers, null, 0, null, ClientEnum.TEACHER.getCode(), reason);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("老师结算极光消息推送异常,userId={}", userId);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/***
|
|
|
* 入结算表
|