This commit is contained in:
@@ -28,8 +28,6 @@ import org.springframework.util.StringUtils;
|
||||
public class WithdrawalServiceImpl extends ServiceImpl<WithdrawalRequestMapper, WithdrawalRequestEntity>
|
||||
implements IWithdrawalService {
|
||||
|
||||
private static final long PAYEE_CONFIRMATION_MAX_MINUTES = 10L;
|
||||
|
||||
@Resource
|
||||
private IEarningsService earningsService;
|
||||
@Resource
|
||||
@@ -49,13 +47,10 @@ public class WithdrawalServiceImpl extends ServiceImpl<WithdrawalRequestMapper,
|
||||
if (payeeProfile == null || !StringUtils.hasText(payeeProfile.getQrCodeUrl())) {
|
||||
throw new CustomException("请先上传支付宝收款码");
|
||||
}
|
||||
|
||||
if (payeeProfile.getLastConfirmedAt() == null) {
|
||||
throw new CustomException("请确认本次使用的收款码");
|
||||
}
|
||||
Duration sinceConfirm = Duration.between(payeeProfile.getLastConfirmedAt(), now);
|
||||
if (sinceConfirm.isNegative() || sinceConfirm.toMinutes() > PAYEE_CONFIRMATION_MAX_MINUTES) {
|
||||
throw new CustomException("收款码确认已过期,请重新确认");
|
||||
}
|
||||
|
||||
// pick and reserve lines
|
||||
List<EarningsLineEntity> lines = earningsService.findWithdrawable(clerkId, amount, now);
|
||||
|
||||
Reference in New Issue
Block a user