update 会员钱包

This commit is contained in:
2023-11-21 15:16:34 +08:00
parent 860f047924
commit f07f71d91d
2 changed files with 23 additions and 8 deletions

View File

@@ -2,7 +2,9 @@ package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists;
import com.jsowell.pile.domain.MemberWalletInfo;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.mapper.MemberWalletInfoMapper;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.service.MemberWalletInfoService;
import com.jsowell.pile.vo.base.MemberWalletVO;
import org.apache.commons.collections4.CollectionUtils;
@@ -10,6 +12,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
@Service
public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
@@ -17,6 +20,9 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
@Resource
private MemberWalletInfoMapper memberWalletInfoMapper;
@Resource
private IPileMerchantInfoService pileMerchantInfoService;
@Override
public int deleteByPrimaryKey(Integer id) {
return memberWalletInfoMapper.deleteByPrimaryKey(id);
@@ -58,14 +64,18 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
List<MemberWalletInfo> list = memberWalletInfoMapper.selectByMemberWalletList(memberId);
if (CollectionUtils.isNotEmpty(list)) {
for (MemberWalletInfo memberWalletInfo : list) {
resultList.add(
MemberWalletVO.builder()
.memberId(memberWalletInfo.getMemberId())
.merchantId(memberWalletInfo.getMerchantId())
.walletCode(memberWalletInfo.getWalletCode())
.principalBalance(memberWalletInfo.getPrincipalBalance())
.build()
);
MemberWalletVO memberWalletVO = MemberWalletVO.builder()
.memberId(memberWalletInfo.getMemberId())
.merchantId(memberWalletInfo.getMerchantId())
.walletCode(memberWalletInfo.getWalletCode())
.principalBalance(memberWalletInfo.getPrincipalBalance())
.build();
// 获取运营商名称
PileMerchantInfo merchantInfo = pileMerchantInfoService.selectPileMerchantInfoById(memberWalletInfo.getMerchantId());
if (Objects.nonNull(merchantInfo)) {
memberWalletVO.setMerchantName(merchantInfo.getMerchantName());
}
resultList.add(memberWalletVO);
}
}
return resultList;

View File

@@ -28,6 +28,11 @@ public class MemberWalletVO {
*/
private String merchantId;
/**
* 所属运营商name
*/
private String merchantName;
/**
* 本金金额
*/