| | |
| | |
|
| | |
|
| | | @Override
|
| | | public void addTaoLiJin(Long uid, BigDecimal money, boolean canSelf) {
|
| | | if (uid == null || money == null) {
|
| | | return;
|
| | | }
|
| | | |
| | | UserMoneyExtra record = new UserMoneyExtra();
|
| | | record.setUid(uid);
|
| | | |
| | | UserMoneyExtra existExtra = userMoneyExtraMapper.selectByPrimaryKey(record.getUid());
|
| | | if (existExtra == null) {
|
| | | record.setTlj(money);
|
| | | |
| | | if (canSelf) {
|
| | | record.setTljSelf(money);
|
| | | } else {
|
| | | record.setTljSelf(new BigDecimal(0));
|
| | | }
|
| | | |
| | | record.setCreateTime(new Date());
|
| | | record.setUpdateTime(new Date());
|
| | | userMoneyExtraMapper.insertSelective(record);
|
| | | } else {
|
| | | BigDecimal tlj = existExtra.getTlj();
|
| | | record.setTlj(MoneyBigDecimalUtil.add(tlj, money));
|
| | | |
| | | if (canSelf) {
|
| | | BigDecimal tljSelf = existExtra.getTljSelf();
|
| | | record.setTljSelf(MoneyBigDecimalUtil.add(tljSelf, money));
|
| | | }
|
| | | |
| | | record.setUpdateTime(new Date());
|
| | | userMoneyExtraMapper.updateByPrimaryKeySelective(record); |
| | | }
|
| | | public void listValid(int page, int count) {
|
| | | userMoneyExtraMapper.listValid((page-1) * count, count);
|
| | | }
|
| | |
|
| | | }
|