现金充值导出

This commit is contained in:
zt
2025-01-21 17:58:54 +08:00
parent 8259712e17
commit 84ae48ba5e
4 changed files with 11 additions and 6 deletions

View File

@ -69,9 +69,11 @@ public class WxRechargeServiceImpl implements WxRechargeService {
//获取最新余额 //获取最新余额
MemberUserDO memberUserDO = userMapper.selectById(userId); MemberUserDO memberUserDO = userMapper.selectById(userId);
List<MoneyDO> allDebt = moneyService.getAllDebt(userId); List<MoneyDO> allDebt = moneyService.getAllDebt(userId);
List<Long> debtId = new ArrayList<>();
BigDecimal debtAmount = BigDecimal.ZERO; BigDecimal debtAmount = BigDecimal.ZERO;
if(CollectionUtil.isNotEmpty(allDebt)){ if(CollectionUtil.isNotEmpty(allDebt)){
debtAmount = allDebt.stream().map(MoneyDO::getDebtAmount).reduce(BigDecimal.ZERO, BigDecimal::add); debtAmount = allDebt.stream().map(MoneyDO::getDebtAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
debtId= allDebt.stream().map(MoneyDO::getId).collect(Collectors.toList());
} }
BigDecimal wxOldMoney = memberUserDO.getWxAmount(); BigDecimal wxOldMoney = memberUserDO.getWxAmount();
BigDecimal giftOldMoney = memberUserDO.getGiftAmount(); BigDecimal giftOldMoney = memberUserDO.getGiftAmount();
@ -115,7 +117,7 @@ public class WxRechargeServiceImpl implements WxRechargeService {
} }
moneyService.updateList(allDebt); moneyService.updateList(allDebt);
}else { }else {
moneyService.cleanDebt(userId); moneyService.cleanDebt(debtId);
//处理未完全支付订单 //处理未完全支付订单
handleOrderWx(userId, money, wxAmount, giftAmount,null); handleOrderWx(userId, money, wxAmount, giftAmount,null);
if(wxAmount.add(debtAmount).compareTo(BigDecimal.ZERO) >= 0){ if(wxAmount.add(debtAmount).compareTo(BigDecimal.ZERO) >= 0){

View File

@ -68,5 +68,5 @@ public interface MoneyService {
void updateList(List<MoneyDO> moneyDOs); void updateList(List<MoneyDO> moneyDOs);
void cleanDebt(Long userId); void cleanDebt(List<Long> debtId );
} }

View File

@ -103,8 +103,11 @@ public class MoneyServiceImpl implements MoneyService {
} }
@Override @Override
public void cleanDebt(Long userId) { public void cleanDebt(List<Long> debtId) {
moneyMapper.update(new LambdaUpdateWrapper<MoneyDO>().eq(MoneyDO::getUserId, userId) if(CollectionUtil.isNotEmpty(debtId)){
moneyMapper.update(new LambdaUpdateWrapper<MoneyDO>().in(MoneyDO::getId, debtId)
.set(MoneyDO::getDebtAmount, BigDecimal.ZERO)); .set(MoneyDO::getDebtAmount, BigDecimal.ZERO));
} }
}
} }

View File

@ -142,7 +142,7 @@
left join member_tag mt on mu.tag_ids = mt.id left join member_tag mt on mu.tag_ids = mt.id
where subsidy_amount > 0 and mdo.deleted = false where subsidy_amount > 0 and mdo.deleted = false
and mdo.store_id = #{carteenId} and mdo.store_id = #{carteenId}
and DATE_FORMAT(mdo.create_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} and DATE_FORMAT(mdo.create_time, '%Y-%m-%d %H:%i:%s') BETWEEN #{startTime} AND #{endTime}
</select> </select>
<select id="exportCashAmountExcel" resultType="cn.iocoder.yudao.module.member.controller.admin.customizeExcel.vo.CashAmountExcelVO"> <select id="exportCashAmountExcel" resultType="cn.iocoder.yudao.module.member.controller.admin.customizeExcel.vo.CashAmountExcelVO">