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

View File

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