package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.domain.FundsLog; import com.ruoyi.system.domain.OperationType; import com.ruoyi.system.mapper.FundsLogMapper; import com.ruoyi.system.service.FundsLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.List; @Service public class FundsLogServiceImpl extends ServiceImpl implements FundsLogService { @Override public void addLog(Integer userId, String account, BigDecimal amount, OperationType operationType) { // 创建资金日志记录 FundsLog fundsLog = new FundsLog(); fundsLog.setUserId(userId); fundsLog.setAccount(account); fundsLog.setOperationType(operationType.getCode()); fundsLog.setAmount(amount); save(fundsLog); } }