余额列表接口

This commit is contained in:
张松
2025-09-26 14:26:36 +08:00
parent a4d36a470c
commit c5b3cfeb72
4 changed files with 56 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import com.czg.market.service.ShopCouponService;
import com.czg.market.vo.CouponInfoVO;
import com.czg.market.vo.MkShopRechargeDetailVO;
import com.czg.market.vo.MkShopRechargeVO;
import com.czg.market.vo.RechargeListVO;
import com.czg.order.entity.OrderInfo;
import com.czg.service.market.enums.OrderStatusEnums;
import com.czg.utils.AssertUtil;
@@ -186,4 +187,23 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
shopUserService.updateMoney(shopUserMoneyEditDTO);
}
@Override
public Object getList(long loginIdAsLong) {
ArrayList<RechargeListVO> rechargeListVOS = new ArrayList<>();
List<ShopUser> shopUserList = shopUserService.list(new QueryWrapper().eq(ShopUser::getUserId, loginIdAsLong));
if (shopUserList.isEmpty()) {
return rechargeListVOS;
}
Set<Long> shopIdList = shopUserList.stream().map(ShopUser::getSourceShopId).collect(Collectors.toSet());
Map<Long, ShopInfo> shopInfoMap = shopInfoService.list(new QueryWrapper().eq(ShopInfo::getId, shopIdList)).stream().collect(Collectors.toMap(ShopInfo::getId, item -> item));
shopUserList.forEach(item -> {
ShopInfo shopInfo = shopInfoMap.getOrDefault(item.getSourceShopId(), new ShopInfo());
rechargeListVOS.add(new RechargeListVO().setShopName(shopInfo.getShopName())
.setShopId(shopInfo.getId())
.setAmount(item.getAmount())
.setLogo(shopInfo.getLogo()));
});
return rechargeListVOS;
}
}