余额明细修改

This commit is contained in:
张松
2025-11-13 09:47:19 +08:00
parent d47aba8add
commit c555369f12
3 changed files with 4 additions and 1 deletions

View File

@@ -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)

View File

@@ -35,6 +35,7 @@ public class ShopUserFlow implements Serializable {
private Long id;
private Long userId;
private Long shopUserId;
private Long shopId;
/**

View File

@@ -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()));