工资提现退回接通
This commit is contained in:
parent
d5f1645375
commit
19db7c0f6d
@ -44,6 +44,8 @@ public class SalaryWithdrawInnerCmd implements Serializable {
|
||||
*/
|
||||
private Long serviceCharge;
|
||||
|
||||
private String salaryType;
|
||||
|
||||
/**
|
||||
* 备注.
|
||||
*/
|
||||
|
||||
@ -818,17 +818,10 @@ public class UserBankBalanceBackServiceImpl implements UserBankBalanceBackServic
|
||||
)
|
||||
);
|
||||
|
||||
if (WithdrawMoneyApprovalProcessStatus.NOT_PASS.equals(status)) {
|
||||
|
||||
}
|
||||
|
||||
// 如果是驳回则将金额还给用户银行卡账户且插入返还日志
|
||||
// if (Objects.isNull(apply.getAmountType())) {
|
||||
// saveUserBankBalance(param, apply);
|
||||
// } else if (Objects.equals(apply.getAmountType(), TeamPolicyTypeEnum.SALARY_DIAMOND.name())){
|
||||
// saveUserBankDiamondBalance(param, apply);
|
||||
// }
|
||||
|
||||
if (Objects.isNull(apply.getAmountType())) {
|
||||
saveUserBankBalance(param, apply);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -911,6 +904,15 @@ public class UserBankBalanceBackServiceImpl implements UserBankBalanceBackServic
|
||||
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(
|
||||
new UserBankBalanceIncrCmd()
|
||||
.setUserId(apply.getSubmitUserId())
|
||||
|
||||
@ -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.dto.cmd.SalaryWithdrawCmd;
|
||||
import com.red.circle.wallet.domain.gateway.SalaryAccountGateway;
|
||||
import com.red.circle.wallet.domain.salary.SalaryReceipt;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -17,8 +18,7 @@ public class SalaryWithdrawRefundCmdExe {
|
||||
private final SalaryAccountConvertor salaryAccountConvertor;
|
||||
|
||||
public void execute(SalaryWithdrawCmd cmd) {
|
||||
// 提现回退
|
||||
|
||||
|
||||
SalaryReceipt receipt = salaryAccountConvertor.toWithdrawRefundReceipt(cmd);
|
||||
salaryAccountGateway.changeBalance(receipt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.infra.database.rds.entity.salary.SalaryAccountBalance;
|
||||
import com.red.circle.wallet.infra.database.rds.entity.salary.SalaryAccountRunningWater;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.util.Objects;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -46,19 +46,20 @@ public class SalaryAccountConvertor {
|
||||
.setOpUserId(cmd.getReqUserId());
|
||||
}
|
||||
|
||||
public SalaryReceipt toWithdrawReceipt(SalaryWithdrawCmd cmd) {
|
||||
public SalaryReceipt toWithdrawRefundReceipt(SalaryWithdrawCmd cmd) {
|
||||
SalaryReceipt receipt = new SalaryReceipt()
|
||||
.setReceiptType(ReceiptType.EXPENDITURE)
|
||||
.setReceiptType(ReceiptType.INCOME)
|
||||
.setUserId(cmd.getReqUserId())
|
||||
.setAcceptUserId(cmd.getReqUserId())
|
||||
.setSysOrigin(cmd.getReqSysOrigin().getOrigin())
|
||||
.setSalaryType(SalaryType.of(cmd.getSalaryType()))
|
||||
.setSalaryEvent(SalaryEvent.WITHDRAW)
|
||||
.setSalaryEvent(SalaryEvent.WITHDRAW_REFUND)
|
||||
.setAmount(PennyAmount.ofDollar(cmd.getAmount()))
|
||||
.setTrackId(IdWorkerUtils.getIdStr())
|
||||
.setEventDesc("提现")
|
||||
.setEventDesc("提现退回")
|
||||
.setRemark(cmd.getRemark())
|
||||
.setOpUserType(OpUserType.APP)
|
||||
.setOpUserId(cmd.getReqUserId());
|
||||
.setOpUserId(cmd.getOpUserId());
|
||||
|
||||
// if (Objects.nonNull(cmd.getServiceCharge()) && cmd.getServiceCharge() > 0) {
|
||||
// receipt.setServiceCharge(cmd.getServiceCharge());
|
||||
|
||||
@ -38,6 +38,8 @@ public class SalaryWithdrawCmd extends AppExtCommand {
|
||||
*/
|
||||
// private Long serviceCharge;
|
||||
|
||||
private Long opUserId;
|
||||
|
||||
/**
|
||||
* 备注.
|
||||
*/
|
||||
|
||||
@ -52,11 +52,12 @@ public class SalaryAccountInnerConvertor {
|
||||
SalaryWithdrawCmd cmd = new SalaryWithdrawCmd();
|
||||
cmd.setAmount(innerCmd.getAmount());
|
||||
cmd.setRemark(innerCmd.getRemark());
|
||||
cmd.setSalaryType(innerCmd.getSalaryType());
|
||||
|
||||
// 设置请求来源信息
|
||||
cmd.setReqSysOrigin(ReqSysOrigin.of(innerCmd.getSysOrigin()));
|
||||
cmd.setReqUserId(innerCmd.getOpUserId());
|
||||
|
||||
cmd.setReqSysOrigin(ReqSysOrigin.of(innerCmd.getSysOrigin()));
|
||||
cmd.setReqUserId(innerCmd.getUserId());
|
||||
cmd.setOpUserId(innerCmd.getOpUserId());
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user