update 提现逻辑优化

This commit is contained in:
2023-08-08 10:32:30 +08:00
parent 7dd0b1cdfc
commit 304ba6b2e1
5 changed files with 9 additions and 6 deletions

View File

@@ -462,7 +462,7 @@ public class AdapayMemberService {
BigDecimal cashAmt = adapayAccountBalanceVO.getAvlBalance().subtract(feeAmt);
// 可提现金额减去手续费后需大于0
if (cashAmt.compareTo(BigDecimal.ZERO) < 0) {
if (cashAmt.compareTo(BigDecimal.ZERO) <= 0) {
throw new BusinessException(ReturnCodeEnum.CODE_INSUFFICIENT_BALANCE_ERROR);
}
@@ -499,7 +499,7 @@ public class AdapayMemberService {
clearingWithdrawInfoService.insertOrUpdate(record);
// 修改清分账单为提现中
List<ClearingBillInfo> list = clearingBillInfoService.selectByMerchantId(dto.getMerchantId());
List<ClearingBillInfo> list = clearingBillInfoService.selectByMerchantId(dto.getMerchantId(), "2");
List<Integer> clearingBillIds = list.stream().map(ClearingBillInfo::getId).collect(Collectors.toList());
String billStatus = "3";
clearingBillInfoService.updateStatus(clearingBillIds, billStatus);

View File

@@ -48,7 +48,7 @@ public interface ClearingBillInfoMapper {
*/
int updateByPrimaryKey(ClearingBillInfo record);
List<ClearingBillInfo> selectByMerchantId(@Param("merchantId") String merchantId);
List<ClearingBillInfo> selectByMerchantId(@Param("merchantId") String merchantId, @Param("billStatus") String billStatus);
void updateStatus(@Param("clearingBillIds") List<Integer> clearingBillIds, @Param("billStatus") String billStatus);
}

View File

@@ -19,7 +19,7 @@ public interface ClearingBillInfoService{
int updateByPrimaryKey(ClearingBillInfo record);
List<ClearingBillInfo> selectByMerchantId(String merchantId);
List<ClearingBillInfo> selectByMerchantId(String merchantId, String billStatus);
void updateStatus(List<Integer> clearingBillIds, String billStatus);
}

View File

@@ -47,8 +47,8 @@ public class ClearingBillInfoServiceImpl implements ClearingBillInfoService{
}
@Override
public List<ClearingBillInfo> selectByMerchantId(String merchantId) {
return clearingBillInfoMapper.selectByMerchantId(merchantId);
public List<ClearingBillInfo> selectByMerchantId(String merchantId, String billStatus) {
return clearingBillInfoMapper.selectByMerchantId(merchantId, billStatus);
}
@Override

View File

@@ -242,6 +242,9 @@
from clearing_bill_info
where del_flag = '0'
and merchant_id = #{merchantId,jdbcType=VARCHAR}
<if test="billStatus != null and billStatus != ''">
and bill_status = #{billStatus,jdbcType=VARCHAR}
</if>
</select>
<update id="updateStatus">