@Test public void remove() { incomeService.remove(getUser().getId(), incomeDAO.findAll().get(0).getId()); }
@Override @LogMethod("删除收益记录") public void remove(String userId, String incomeId) { Income income = incomeDAO.getById(incomeId); if (ObjectUtil.isNotNull(income)) { updateAssetBalance(userId, income.getMoney() * income.getType() * -1); incomeDAO.deleteById(incomeId); } }
IncomeServiceImpl implements IncomeService { @Override @LogMethod("删除收益记录") public void remove(String userId, String incomeId) { Income income = incomeDAO.getById(incomeId); if (ObjectUtil.isNotNull(income)) { updateAssetBalance(userId, income.getMoney() * income.getType() * -1); incomeDAO.deleteById(incomeId); } } }
IncomeServiceImpl implements IncomeService { @Override @LogMethod("删除收益记录") public void remove(String userId, String incomeId) { Income income = incomeDAO.getById(incomeId); if (ObjectUtil.isNotNull(income)) { updateAssetBalance(userId, income.getMoney() * income.getType() * -1); incomeDAO.deleteById(incomeId); } } @Autowired  IncomeServiceImpl(AssetDAO assetDAO, IncomeDAO incomeDAO, MongoTemplate mongoTemplate,
                             RedisTemplate<String, Asset> assetRedisTemplate); }
IncomeServiceImpl implements IncomeService { @Override @LogMethod("删除收益记录") public void remove(String userId, String incomeId) { Income income = incomeDAO.getById(incomeId); if (ObjectUtil.isNotNull(income)) { updateAssetBalance(userId, income.getMoney() * income.getType() * -1); incomeDAO.deleteById(incomeId); } } @Autowired  IncomeServiceImpl(AssetDAO assetDAO, IncomeDAO incomeDAO, MongoTemplate mongoTemplate,
                             RedisTemplate<String, Asset> assetRedisTemplate); @Override @LogMethod("查询资产可用余额") Long getAssetBalance(String userId); @Override @LogMethod("查询收益记录") List<Income> listIncome(String userId, String category, Date start, Date end); @Override @LogMethod("查询年度账单") List<IncomeBillVO> listYear(String userId, Integer startYear, Integer endYear); @Override @LogMethod("查询月度账单") List<IncomeBillVO> listMonth(String userId, String startMonth, String endMonth); @Override @LogMethod("更新收益记录") Income updateIncome(String userId, String incomeId, IncomeVO incomeVO); @Override @LogMethod("删除收益记录") void remove(String userId, String incomeId); @Override @LogMethod("添加收益记录") Income saveIncome(String userId, IncomeVO incomeVO); }
IncomeServiceImpl implements IncomeService { @Override @LogMethod("删除收益记录") public void remove(String userId, String incomeId) { Income income = incomeDAO.getById(incomeId); if (ObjectUtil.isNotNull(income)) { updateAssetBalance(userId, income.getMoney() * income.getType() * -1); incomeDAO.deleteById(incomeId); } } @Autowired  IncomeServiceImpl(AssetDAO assetDAO, IncomeDAO incomeDAO, MongoTemplate mongoTemplate,
                             RedisTemplate<String, Asset> assetRedisTemplate); @Override @LogMethod("查询资产可用余额") Long getAssetBalance(String userId); @Override @LogMethod("查询收益记录") List<Income> listIncome(String userId, String category, Date start, Date end); @Override @LogMethod("查询年度账单") List<IncomeBillVO> listYear(String userId, Integer startYear, Integer endYear); @Override @LogMethod("查询月度账单") List<IncomeBillVO> listMonth(String userId, String startMonth, String endMonth); @Override @LogMethod("更新收益记录") Income updateIncome(String userId, String incomeId, IncomeVO incomeVO); @Override @LogMethod("删除收益记录") void remove(String userId, String incomeId); @Override @LogMethod("添加收益记录") Income saveIncome(String userId, IncomeVO incomeVO);  }