小程序获取店铺会员信息修改
This commit is contained in:
parent
a4f89151f4
commit
c667d1fa09
|
|
@ -26,6 +26,6 @@ public class UShopUserController {
|
|||
*/
|
||||
@GetMapping
|
||||
public CzgResult<ShopUser> get() {
|
||||
return CzgResult.success(shopUserService.queryChain().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getId, StpKit.USER.getLoginIdAsLong()).one());
|
||||
return CzgResult.success(shopUserService.getShopUserInfo(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ public interface ShopUserService extends IService<ShopUser> {
|
|||
Boolean updateMoney(Long shopId, ShopUserMoneyEditDTO shopUserEditDTO);
|
||||
|
||||
ShopUserSummaryDTO getSummary(Long shopId, Integer isVip);
|
||||
|
||||
ShopUser getShopUserInfo(Long shopId, long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
|||
import com.czg.account.dto.shopuser.ShopUserSummaryDTO;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.ShopUserFlow;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.account.service.UserInfoService;
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.sa.StpKit;
|
||||
|
|
@ -31,6 +33,8 @@ import java.math.RoundingMode;
|
|||
public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> implements ShopUserService {
|
||||
@Resource
|
||||
private ShopUserFlowService shopUserFlowService;
|
||||
@Resource
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
private ShopUser getUserInfo(Long shopUserId, Long shopId) {
|
||||
ShopUser shopUser = queryChain().eq(ShopUser::getShopId, shopId).eq(ShopUser::getId, shopUserId).one();
|
||||
|
|
@ -83,4 +87,19 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser>
|
|||
public ShopUserSummaryDTO getSummary(Long shopId, Integer isVip) {
|
||||
return mapper.selectUserSummary(shopId, isVip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopUser getShopUserInfo(Long shopId, long userId) {
|
||||
ShopUser shopUser = queryChain().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getId, StpKit.USER.getLoginIdAsLong()).one();
|
||||
if (shopUser == null) {
|
||||
shopUser = new ShopUser();
|
||||
UserInfo userInfo = userInfoService.getById(userId);
|
||||
BeanUtil.copyProperties(userInfo, shopUser);
|
||||
shopUser.setShopId(shopId);
|
||||
shopUser.setUserId(userId);
|
||||
shopUser.setId(null);
|
||||
save(shopUser);
|
||||
}
|
||||
return shopUser;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue