update:
1. update user-point
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
set amount = amount + #{amount} , version = version + 1
|
set amount = amount + #{amount} , version = version + 1
|
||||||
where id = #{userId} and version = #{version}
|
where id = #{userId} and version = #{version}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="deductUserPoint">
|
<update id="deductUserPoint">
|
||||||
update
|
update
|
||||||
user_point
|
user_point
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
|||||||
return page.setRecords(baseMapper.selectCommonUserPointPage(page, commonUserPoint));
|
return page.setRecords(baseMapper.selectCommonUserPointPage(page, commonUserPoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = RuntimeException.class)
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean addUserPoint(CommonUserPointApiDTO dto) {
|
public Boolean addUserPoint(CommonUserPointApiDTO dto) {
|
||||||
CommonUserPointLogEntity userPointLog = saveBenefitPointLog(dto, 1);
|
CommonUserPointLogEntity userPointLog = saveBenefitPointLog(dto, 1);
|
||||||
CommonUserPointEntity userPoint = getById(dto.getUserId());
|
CommonUserPointEntity userPoint = getById(dto.getUserId());
|
||||||
@@ -103,7 +103,6 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
|||||||
if (!userPointLogService.save(userPointLog)) {
|
if (!userPointLogService.save(userPointLog)) {
|
||||||
throw new RuntimeException("商城积分流水记录失败");
|
throw new RuntimeException("商城积分流水记录失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
return userPointLog;
|
return userPointLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user