update 会员钱包

This commit is contained in:
2023-11-21 14:57:58 +08:00
parent c9d1050cb2
commit 2f4ba1f243
9 changed files with 110 additions and 10 deletions

View File

@@ -1,6 +1,9 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.MemberWalletInfo;
import com.jsowell.pile.vo.base.MemberWalletVO;
import java.util.List;
public interface MemberWalletInfoService {
int deleteByPrimaryKey(Integer id);
@@ -16,4 +19,6 @@ public interface MemberWalletInfoService {
int updateByPrimaryKeySelective(MemberWalletInfo record);
int updateByPrimaryKey(MemberWalletInfo record);
List<MemberWalletVO> selectByMemberWalletList(String memberId);
}

View File

@@ -1,11 +1,15 @@
package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists;
import com.jsowell.pile.domain.MemberWalletInfo;
import com.jsowell.pile.mapper.MemberWalletInfoMapper;
import com.jsowell.pile.service.MemberWalletInfoService;
import com.jsowell.pile.vo.base.MemberWalletVO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
@@ -48,4 +52,23 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
return memberWalletInfoMapper.updateByPrimaryKey(record);
}
@Override
public List<MemberWalletVO> selectByMemberWalletList(String memberId) {
List<MemberWalletVO> resultList = Lists.newArrayList();
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()
);
}
}
return resultList;
}
}