This commit is contained in:
skjia 2025-04-10 18:41:15 +08:00
commit 31ef454db0
1 changed files with 57 additions and 50 deletions

View File

@ -37,6 +37,7 @@ import org.springframework.stereotype.Service;
import com.bonus.canteen.core.account.mapper.AccWalletInfoMapper; import com.bonus.canteen.core.account.mapper.AccWalletInfoMapper;
import com.bonus.canteen.core.account.domain.AccWalletInfo; import com.bonus.canteen.core.account.domain.AccWalletInfo;
import com.bonus.canteen.core.account.service.IAccWalletInfoService; import com.bonus.canteen.core.account.service.IAccWalletInfoService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -194,7 +195,9 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
// SecurityUtils.getUserId().toString(), DateUtils.toLocalDateTime(new Date())); // SecurityUtils.getUserId().toString(), DateUtils.toLocalDateTime(new Date()));
// } // }
@Transactional(rollbackFor = Exception.class)
public void acWalletBalanceOperation(WalletBalanceOperation operation) { public void acWalletBalanceOperation(WalletBalanceOperation operation) {
try{
switch (WalletBalanceOperationEnum.getEnum(operation.getOperationType())) { switch (WalletBalanceOperationEnum.getEnum(operation.getOperationType())) {
case ADD_BAL: case ADD_BAL:
addAccWalletInfo(operation); addAccWalletInfo(operation);
@ -246,5 +249,9 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
accTradeWalletDetail.setTradeTime(DateUtils.getNowDate()); accTradeWalletDetail.setTradeTime(DateUtils.getNowDate());
accTradeWalletDetail.setCreateBy(SecurityUtils.getUsername()); accTradeWalletDetail.setCreateBy(SecurityUtils.getUsername());
this.accTradeWalletDetailService.insertAccTradeWalletDetail(accTradeWalletDetail); this.accTradeWalletDetailService.insertAccTradeWalletDetail(accTradeWalletDetail);
}catch (Exception ex) {
log.error("修改钱包失败", ex);
throw new ServiceException("修改钱包失败");
}
} }
} }