余额明细修改
This commit is contained in:
@@ -90,7 +90,8 @@ public class UShopUserController {
|
||||
*/
|
||||
@GetMapping("/moneyRecord")
|
||||
public CzgResult<Page<ShopUserFlowInfoVO>> getMoneyRecord(@RequestParam Long shopId) {
|
||||
return CzgResult.success(shopUserFlowService.pageAs(PageUtil.buildPage(), new MyQueryWrapper().eq(ShopUserFlow::getShopId, shopId)
|
||||
ShopUser shopUserInfo = shopUserService.getShopUserInfo(shopId, StpKit.USER.getLoginIdAsLong());
|
||||
return CzgResult.success(shopUserFlowService.pageAs(PageUtil.buildPage(), new MyQueryWrapper().eq(ShopUserFlow::getShopUserId, shopUserInfo.getId())
|
||||
.selectAll(ShopUserFlow.class)
|
||||
.eq(ShopUserFlow::getUserId, StpKit.USER.getLoginIdAsLong()).leftJoin(ShopInfo.class).on(ShopUserFlow::getShopId, ShopInfo::getId)
|
||||
.select(ShopInfo::getShopName)
|
||||
|
||||
@@ -35,6 +35,7 @@ public class ShopUserFlow implements Serializable {
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
private Long shopUserId;
|
||||
|
||||
private Long shopId;
|
||||
/**
|
||||
|
||||
@@ -135,6 +135,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
userInfo.setAmount(BigDecimal.ZERO);
|
||||
}
|
||||
userFlow.setUserId(userInfo.getUserId());
|
||||
userFlow.setShopUserId(shopUserEditDTO.getId());
|
||||
userFlow.setShopId(userInfo.getSourceShopId());
|
||||
userFlow.setAmount(shopUserEditDTO.getType() == 0 ? shopUserEditDTO.getMoney().negate() : shopUserEditDTO.getMoney());
|
||||
userFlow.setBalance(shopUserEditDTO.getType() == 0 ? userInfo.getAmount().subtract(shopUserEditDTO.getMoney()) : userInfo.getAmount().add(shopUserEditDTO.getMoney()));
|
||||
|
||||
Reference in New Issue
Block a user