UserAccountService.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package com.zsElectric.boot.business.service;
  2. import com.zsElectric.boot.business.model.entity.UserAccount;
  3. import com.zsElectric.boot.business.model.form.UserAccountForm;
  4. import com.zsElectric.boot.business.model.query.UserAccountQuery;
  5. import com.zsElectric.boot.business.model.vo.UserAccountVO;
  6. import com.baomidou.mybatisplus.core.metadata.IPage;
  7. import com.baomidou.mybatisplus.extension.service.IService;
  8. /**
  9. * 个人账户服务类
  10. *
  11. * @author zsElectric
  12. * @since 2025-12-12 10:20
  13. */
  14. public interface UserAccountService extends IService<UserAccount> {
  15. /**
  16. *个人账户分页列表
  17. *
  18. * @return {@link IPage<UserAccountVO>} 个人账户分页列表
  19. */
  20. IPage<UserAccountVO> getUserAccountPage(UserAccountQuery queryParams);
  21. /**
  22. * 获取个人账户表单数据
  23. *
  24. * @param id 个人账户ID
  25. * @return 个人账户表单数据
  26. */
  27. UserAccountForm getUserAccountFormData(Long id);
  28. /**
  29. * 新增个人账户
  30. *
  31. * @param formData 个人账户表单对象
  32. * @return 是否新增成功
  33. */
  34. boolean saveUserAccount(UserAccountForm formData);
  35. /**
  36. * 修改个人账户
  37. *
  38. * @param id 个人账户ID
  39. * @param formData 个人账户表单对象
  40. * @return 是否修改成功
  41. */
  42. boolean updateUserAccount(Long id, UserAccountForm formData);
  43. /**
  44. * 删除个人账户
  45. *
  46. * @param ids 个人账户ID,多个以英文逗号(,)分割
  47. * @return 是否删除成功
  48. */
  49. boolean deleteUserAccounts(String ids);
  50. /**
  51. * 更新账户余额并记录日志
  52. *
  53. * @param userId 用户ID
  54. * @param changeAmount 变更金额(正数为增加,负数为减少)
  55. * @param changeType 变更类型(1-增加,2-减少)
  56. * @param changeNote 变更备注
  57. * @param changeId 变更记录编号(订单号或充电订单号)
  58. * @return 更新后的用户账户信息
  59. */
  60. UserAccount updateAccountBalanceAndLog(Long userId, java.math.BigDecimal changeAmount,
  61. Integer changeType, String changeNote, Long changeId);
  62. }