This commit is contained in:
PQZ 2024-09-23 21:10:00 +08:00
parent feeb5f19b1
commit 6b4dc8cbca
2 changed files with 35 additions and 3 deletions

View File

@ -21,6 +21,17 @@ public interface CustomerBalanceService extends IService<CustomerBalance> {
*/
String createCustomerBalance(@Valid CustomerBalanceSaveReqVO createReqVO);
/**
* 更新用户余额信息
*
* @param cusId 用户id
* @param orderId 订单id
* @param activeId 活动id
* @author PQZ
* @date 21:04 2024/9/23
**/
void saveBalance(String cusId, String orderId, String activeId);
/**
* 更新用户积分余额
*
@ -30,11 +41,12 @@ public interface CustomerBalanceService extends IService<CustomerBalance> {
/**
* 根据用户id更新用户余额表
* @author PQZ
* @date 11:56 2024/9/21
*
* @param balance CustomerBalance
* @return void
**/
* @author PQZ
* @date 11:56 2024/9/21
**/
void updateByCusId(CustomerBalance balance);

View File

@ -5,7 +5,9 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
import cn.iocoder.yudao.module.custom.mapper.CustomerBalanceMapper;
import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceSaveReqVO;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@ -25,6 +27,9 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
@Resource
private CustomerBalanceMapper customerBalanceMapper;
@Resource
private CustomerMainService customerMainService;
@Override
public String createCustomerBalance(CustomerBalanceSaveReqVO createReqVO) {
@ -35,6 +40,21 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
return customerBalance.getId();
}
/**
* 更新用户余额信息
*
* @param cusId 用户id
* @param orderId 订单id
* @param activeId 活动id
* @author PQZ
* @date 21:04 2024/9/23
**/
@Override
public void saveBalance(String cusId, String orderId, String activeId) {
//查询当前登录用户信息
CustomerMainRespVO customer = customerMainService.getCustomerById(cusId);
}
@Override
public void updateCustomerBalance(CustomerBalanceSaveReqVO updateReqVO) {
// 更新