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

@@ -4,6 +4,8 @@ import com.jsowell.pile.domain.MemberWalletInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface MemberWalletInfoMapper {
/**
@@ -63,4 +65,6 @@ public interface MemberWalletInfoMapper {
* @return
*/
MemberWalletInfo selectByMemberId(@Param("memberId") String memberId, @Param("merchantId") String merchantId);
List<MemberWalletInfo> selectByMemberWalletList(@Param("memberId") String memberId);
}

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;
}
}

View File

@@ -0,0 +1,35 @@
package com.jsowell.pile.vo.base;
import lombok.*;
import java.math.BigDecimal;
/**
* 会员钱包VO
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MemberWalletVO {
/**
* 会员id
*/
private String memberId;
/**
* 钱包编号
*/
private String walletCode;
/**
* 所属运营商id
*/
private String merchantId;
/**
* 本金金额
*/
private BigDecimal principalBalance;
}