用户列表折扣信息
This commit is contained in:
@@ -99,6 +99,7 @@ public class AShopUserServiceImpl implements AShopUserService {
|
||||
PageInfo<ShopUserDTO> shopUserDTOPageInfo = new PageInfo<>(shopUserMapper.selectPageByKeyAndIsVip(mainIdByShopId, isVip, key, amount));
|
||||
shopUserDTOPageInfo.getList().forEach(item -> {
|
||||
item.setNew(consumeDiscountService.isNewUser(item, StpKit.USER.getShopId()));
|
||||
setUserDiscount(item);
|
||||
});
|
||||
return PageUtil.convert(shopUserDTOPageInfo);
|
||||
}
|
||||
@@ -182,6 +183,16 @@ public class AShopUserServiceImpl implements AShopUserService {
|
||||
return shopUserService.save(shopUser);
|
||||
}
|
||||
|
||||
private void setUserDiscount(ShopUserDTO shopUserDTO) {
|
||||
if (shopUserDTO.getMemberLevelId() != null) {
|
||||
MemberLevelConfig memberLevelConfig = memberLevelConfigService.getById(shopUserDTO.getMemberLevelId());
|
||||
shopUserDTO.setMemberLevelName(memberLevelConfig == null ? null : memberLevelConfig.getName());
|
||||
if (memberLevelConfig != null) {
|
||||
shopUserDTO.setDiscount(memberLevelConfig.getDiscount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopUser getDetail(Integer id, Integer userId) {
|
||||
Long mainId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
|
||||
|
||||
Reference in New Issue
Block a user