| | |
| | | package com.yeshi.fanli.service.inter.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDebtException;
|
| | |
|
| | | public interface UserMoneyDebtService {
|
| | | /**
|
| | | * 添加用户借钱记录
|
| | | * |
| | | * @param debt
|
| | | * @throws UserMoneyDebtException
|
| | | */
|
| | | public void addUserMoneyDebt(UserMoneyDebt debt) throws UserMoneyDebtException;
|
| | |
|
| | | /**
|
| | | * 根据类型与源ID获取
|
| | | * |
| | | * @param type
|
| | | * @param sourceId
|
| | | * @return
|
| | | */
|
| | | public UserMoneyDebt selectByTypeAndSourceId(UserMoneyDebtTypeEnum type, Long sourceId);
|
| | |
|
| | | /**
|
| | | * 偿还
|
| | | * |
| | | * @param debt
|
| | | * @throws UserMoneyDebtException
|
| | | */
|
| | | public void repayDebt(UserMoneyDebt debt,BigDecimal money) throws UserMoneyDebtException;
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.service.inter.money; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt; |
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum; |
| | | import com.yeshi.fanli.exception.money.UserMoneyDebtException; |
| | | |
| | | public interface UserMoneyDebtService { |
| | | /** |
| | | * 添加用户借钱记录 |
| | | * |
| | | * @param debt |
| | | * @throws UserMoneyDebtException |
| | | */ |
| | | public void addUserMoneyDebt(UserMoneyDebt debt) throws UserMoneyDebtException; |
| | | |
| | | /** |
| | | * 根据类型与源ID获取 |
| | | * |
| | | * @param type |
| | | * @param sourceId |
| | | * @return |
| | | */ |
| | | public UserMoneyDebt selectByTypeAndSourceId(UserMoneyDebtTypeEnum type, Long sourceId); |
| | | |
| | | /** |
| | | * 偿还 |
| | | * |
| | | * @param debt |
| | | * @throws UserMoneyDebtException |
| | | */ |
| | | public void repayDebt(UserMoneyDebt debt, BigDecimal money) throws UserMoneyDebtException; |
| | | |
| | | /** |
| | | * 偿还 |
| | | * |
| | | * @param uid |
| | | */ |
| | | public void repayDebt(Long uid); |
| | | |
| | | /** |
| | | * 是否有账务待还 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public boolean isHaveDebtToRepay(Long uid); |
| | | |
| | | |
| | | /** |
| | | * 查询需要偿还的用户列表 |
| | | * |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<Long> listNeedRepayDebtUser(int page, int pageSize); |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | public long countNeedRepayDebtUser(); |
| | | } |