| | |
| | | { |
| | | return fundFlowMapper.deleteFundFlowById(id); |
| | | } |
| | | |
| | | /** |
| | | * 确认资金流水(将状态改为待认领) |
| | | * |
| | | * @param id 资金流水ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int confirmFundFlow(Integer id) |
| | | { |
| | | // 先查询资金流水信息 |
| | | FundFlow fundFlow = fundFlowMapper.selectFundFlowById(id); |
| | | if (fundFlow == null) { |
| | | throw new RuntimeException("资金流水不存在"); |
| | | } |
| | | |
| | | // 判断状态是否为0(正常)才能确认 |
| | | if (!"0".equals(fundFlow.getStatus())) { |
| | | throw new RuntimeException("只有状态为草稿的资金流水才能确认"); |
| | | } |
| | | |
| | | // 将状态改为"1"(待认领) |
| | | fundFlow.setStatus("1"); |
| | | return fundFlowMapper.updateFundFlow(fundFlow); |
| | | } |
| | | } |