工资提现退回接通

This commit is contained in:
tianfeng 2025-11-18 20:49:22 +08:00
parent d5f1645375
commit 19db7c0f6d
6 changed files with 30 additions and 22 deletions

View File

@ -44,6 +44,8 @@ public class SalaryWithdrawInnerCmd implements Serializable {
*/ */
private Long serviceCharge; private Long serviceCharge;
private String salaryType;
/** /**
* 备注. * 备注.
*/ */

View File

@ -818,17 +818,10 @@ public class UserBankBalanceBackServiceImpl implements UserBankBalanceBackServic
) )
); );
if (WithdrawMoneyApprovalProcessStatus.NOT_PASS.equals(status)) {
}
// 如果是驳回则将金额还给用户银行卡账户且插入返还日志 // 如果是驳回则将金额还给用户银行卡账户且插入返还日志
// if (Objects.isNull(apply.getAmountType())) { if (Objects.isNull(apply.getAmountType())) {
// saveUserBankBalance(param, apply); saveUserBankBalance(param, apply);
// } else if (Objects.equals(apply.getAmountType(), TeamPolicyTypeEnum.SALARY_DIAMOND.name())){ }
// saveUserBankDiamondBalance(param, apply);
// }
} }
@Override @Override
@ -911,6 +904,15 @@ public class UserBankBalanceBackServiceImpl implements UserBankBalanceBackServic
return; return;
} }
SalaryWithdrawInnerCmd withdrawInnerCmd = new SalaryWithdrawInnerCmd();
withdrawInnerCmd.setUserId(apply.getSubmitUserId());
withdrawInnerCmd.setOpUserId(param.getUpdateUser());
withdrawInnerCmd.setSysOrigin(apply.getSysOrigin());
withdrawInnerCmd.setRemark(param.getRemark());
withdrawInnerCmd.setSalaryType("BD_SALARY");
withdrawInnerCmd.setAmount(apply.getAmount());
userSalaryAccountClient.withdrawRefund(withdrawInnerCmd);
ResponseAssert.requiredSuccess(userBankBalanceClient.incr( ResponseAssert.requiredSuccess(userBankBalanceClient.incr(
new UserBankBalanceIncrCmd() new UserBankBalanceIncrCmd()
.setUserId(apply.getSubmitUserId()) .setUserId(apply.getSubmitUserId())

View File

@ -3,6 +3,7 @@ package com.red.circle.wallet.app.command.salary;
import com.red.circle.wallet.app.convertor.SalaryAccountConvertor; import com.red.circle.wallet.app.convertor.SalaryAccountConvertor;
import com.red.circle.wallet.app.dto.cmd.SalaryWithdrawCmd; import com.red.circle.wallet.app.dto.cmd.SalaryWithdrawCmd;
import com.red.circle.wallet.domain.gateway.SalaryAccountGateway; import com.red.circle.wallet.domain.gateway.SalaryAccountGateway;
import com.red.circle.wallet.domain.salary.SalaryReceipt;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -17,8 +18,7 @@ public class SalaryWithdrawRefundCmdExe {
private final SalaryAccountConvertor salaryAccountConvertor; private final SalaryAccountConvertor salaryAccountConvertor;
public void execute(SalaryWithdrawCmd cmd) { public void execute(SalaryWithdrawCmd cmd) {
// 提现回退 SalaryReceipt receipt = salaryAccountConvertor.toWithdrawRefundReceipt(cmd);
salaryAccountGateway.changeBalance(receipt);
} }
} }

View File

@ -15,7 +15,7 @@ import com.red.circle.wallet.domain.salary.SalaryReceiptRes;
import com.red.circle.wallet.domain.salary.SalaryType; import com.red.circle.wallet.domain.salary.SalaryType;
import com.red.circle.wallet.infra.database.rds.entity.salary.SalaryAccountBalance; import com.red.circle.wallet.infra.database.rds.entity.salary.SalaryAccountBalance;
import com.red.circle.wallet.infra.database.rds.entity.salary.SalaryAccountRunningWater; import com.red.circle.wallet.infra.database.rds.entity.salary.SalaryAccountRunningWater;
import java.math.BigDecimal;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Objects; import java.util.Objects;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -46,19 +46,20 @@ public class SalaryAccountConvertor {
.setOpUserId(cmd.getReqUserId()); .setOpUserId(cmd.getReqUserId());
} }
public SalaryReceipt toWithdrawReceipt(SalaryWithdrawCmd cmd) { public SalaryReceipt toWithdrawRefundReceipt(SalaryWithdrawCmd cmd) {
SalaryReceipt receipt = new SalaryReceipt() SalaryReceipt receipt = new SalaryReceipt()
.setReceiptType(ReceiptType.EXPENDITURE) .setReceiptType(ReceiptType.INCOME)
.setUserId(cmd.getReqUserId()) .setUserId(cmd.getReqUserId())
.setAcceptUserId(cmd.getReqUserId())
.setSysOrigin(cmd.getReqSysOrigin().getOrigin()) .setSysOrigin(cmd.getReqSysOrigin().getOrigin())
.setSalaryType(SalaryType.of(cmd.getSalaryType())) .setSalaryType(SalaryType.of(cmd.getSalaryType()))
.setSalaryEvent(SalaryEvent.WITHDRAW) .setSalaryEvent(SalaryEvent.WITHDRAW_REFUND)
.setAmount(PennyAmount.ofDollar(cmd.getAmount())) .setAmount(PennyAmount.ofDollar(cmd.getAmount()))
.setTrackId(IdWorkerUtils.getIdStr()) .setTrackId(IdWorkerUtils.getIdStr())
.setEventDesc("提现") .setEventDesc("提现退回")
.setRemark(cmd.getRemark()) .setRemark(cmd.getRemark())
.setOpUserType(OpUserType.APP) .setOpUserType(OpUserType.APP)
.setOpUserId(cmd.getReqUserId()); .setOpUserId(cmd.getOpUserId());
// if (Objects.nonNull(cmd.getServiceCharge()) && cmd.getServiceCharge() > 0) { // if (Objects.nonNull(cmd.getServiceCharge()) && cmd.getServiceCharge() > 0) {
// receipt.setServiceCharge(cmd.getServiceCharge()); // receipt.setServiceCharge(cmd.getServiceCharge());

View File

@ -38,6 +38,8 @@ public class SalaryWithdrawCmd extends AppExtCommand {
*/ */
// private Long serviceCharge; // private Long serviceCharge;
private Long opUserId;
/** /**
* 备注. * 备注.
*/ */

View File

@ -52,11 +52,12 @@ public class SalaryAccountInnerConvertor {
SalaryWithdrawCmd cmd = new SalaryWithdrawCmd(); SalaryWithdrawCmd cmd = new SalaryWithdrawCmd();
cmd.setAmount(innerCmd.getAmount()); cmd.setAmount(innerCmd.getAmount());
cmd.setRemark(innerCmd.getRemark()); cmd.setRemark(innerCmd.getRemark());
cmd.setSalaryType(innerCmd.getSalaryType());
// 设置请求来源信息 // 设置请求来源信息
cmd.setReqSysOrigin(ReqSysOrigin.of(innerCmd.getSysOrigin())); cmd.setReqSysOrigin(ReqSysOrigin.of(innerCmd.getSysOrigin()));
cmd.setReqUserId(innerCmd.getOpUserId()); cmd.setReqUserId(innerCmd.getUserId());
cmd.setOpUserId(innerCmd.getOpUserId());
return cmd; return cmd;
} }