|
@@ -95,7 +95,7 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
|
|
SysUserCashAccountDetail detail = new SysUserCashAccountDetail();
|
|
SysUserCashAccountDetail detail = new SysUserCashAccountDetail();
|
|
detail.setAmount(decimal);
|
|
detail.setAmount(decimal);
|
|
detail.setBalance(cashAccount.getBalance().add(decimal));
|
|
detail.setBalance(cashAccount.getBalance().add(decimal));
|
|
- detail.setComment(memo);
|
|
|
|
|
|
+ detail.setComment(memo + "-" + sysUserFeignService.queryUserInfo().getId());
|
|
detail.setCreateTime(date);
|
|
detail.setCreateTime(date);
|
|
detail.setStatus(DealStatusEnum.SUCCESS);
|
|
detail.setStatus(DealStatusEnum.SUCCESS);
|
|
detail.setType(type);
|
|
detail.setType(type);
|
|
@@ -176,6 +176,10 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
|
|
@Override
|
|
@Override
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
public boolean updateCourseBalance(Integer userId, BigDecimal decimal, BigDecimal amount, String description) {
|
|
public boolean updateCourseBalance(Integer userId, BigDecimal decimal, BigDecimal amount, String description) {
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+ if (sysUser == null) {
|
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
|
+ }
|
|
SysUserCashAccount cashAccount = sysUserCashAccountDao.getLocked(userId);
|
|
SysUserCashAccount cashAccount = sysUserCashAccountDao.getLocked(userId);
|
|
if (cashAccount == null) {
|
|
if (cashAccount == null) {
|
|
throw new BizException("用户[{}]现金账户不存在", userId);
|
|
throw new BizException("用户[{}]现金账户不存在", userId);
|
|
@@ -187,7 +191,6 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
|
|
sysUserCashAccountDao.update(cashAccount);
|
|
sysUserCashAccountDao.update(cashAccount);
|
|
|
|
|
|
if (amount.compareTo(BigDecimal.ZERO) != 0) {
|
|
if (amount.compareTo(BigDecimal.ZERO) != 0) {
|
|
- SysUser sysUser = sysUserFeignService.queryUserById(userId);
|
|
|
|
SysUserCoursesAccountDetail sysUserCoursesAccountDetail = new SysUserCoursesAccountDetail();
|
|
SysUserCoursesAccountDetail sysUserCoursesAccountDetail = new SysUserCoursesAccountDetail();
|
|
sysUserCoursesAccountDetail.setUserId(userId);
|
|
sysUserCoursesAccountDetail.setUserId(userId);
|
|
sysUserCoursesAccountDetail.setAmount(amount);
|
|
sysUserCoursesAccountDetail.setAmount(amount);
|
|
@@ -196,7 +199,6 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
|
|
sysUserCoursesAccountDetail.setStatus(DealStatusEnum.SUCCESS);
|
|
sysUserCoursesAccountDetail.setStatus(DealStatusEnum.SUCCESS);
|
|
sysUserCoursesAccountDetailDao.insert(sysUserCoursesAccountDetail);
|
|
sysUserCoursesAccountDetailDao.insert(sysUserCoursesAccountDetail);
|
|
}
|
|
}
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|