发放传参

This commit is contained in:
2025-12-05 14:09:33 +08:00
parent e345c409dd
commit 0879143285
6 changed files with 36 additions and 15 deletions

View File

@@ -63,6 +63,12 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
return shopUser;
}
@Override
public ShopUser getUserInfo(Long shopId, Long userId) {
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
return getOne(QueryWrapper.create().eq(ShopUser::getUserId, userId).eq(ShopUser::getMainShopId, mainShopId));
}
@Override
public boolean updateInfo(ShopUser shopUser) {
return super.updateById(shopUser);
@@ -71,13 +77,9 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
@Override
public ShopUser getShopUserInfo(Long shopId, long userId) {
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
ShopUser shopUser = queryChain().eq(ShopUser::getUserId, userId).and(q -> {
q.eq(ShopUser::getMainShopId, mainShopId).or(q1 -> {
q1.eq(ShopUser::getSourceShopId, shopId);
});
}).one();
ShopUser shopUser = getUserInfo(shopId, userId);
if (shopUser == null) {
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
shopUser = new ShopUser();
UserInfo userInfo = userInfoService.getById(userId);
BeanUtil.copyProperties(userInfo, shopUser);