mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 提现逻辑优化
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user