返回会员等级信息
This commit is contained in:
parent
8223dc8d97
commit
c2e4ccc124
|
|
@ -24,4 +24,5 @@ public class ShopUserDTO extends ShopUser {
|
||||||
* 充值金额
|
* 充值金额
|
||||||
*/
|
*/
|
||||||
private BigDecimal rechargeAmount;
|
private BigDecimal rechargeAmount;
|
||||||
|
private String memberLevelName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ import com.czg.account.service.ShopInfoService;
|
||||||
import com.czg.account.service.ShopUserService;
|
import com.czg.account.service.ShopUserService;
|
||||||
import com.czg.account.service.UserInfoService;
|
import com.czg.account.service.UserInfoService;
|
||||||
import com.czg.exception.ApiNotPrintException;
|
import com.czg.exception.ApiNotPrintException;
|
||||||
|
import com.czg.market.entity.MemberLevelConfig;
|
||||||
import com.czg.market.entity.MkShopCouponRecord;
|
import com.czg.market.entity.MkShopCouponRecord;
|
||||||
|
import com.czg.market.service.MemberLevelConfigService;
|
||||||
import com.czg.market.service.MkShopCouponRecordService;
|
import com.czg.market.service.MkShopCouponRecordService;
|
||||||
import com.czg.order.entity.OrderInfo;
|
import com.czg.order.entity.OrderInfo;
|
||||||
import com.czg.order.service.OrderInfoService;
|
import com.czg.order.service.OrderInfoService;
|
||||||
|
|
@ -56,6 +58,8 @@ public class AShopUserServiceImpl implements AShopUserService {
|
||||||
private MkShopCouponRecordService couponRecordService;
|
private MkShopCouponRecordService couponRecordService;
|
||||||
@Resource
|
@Resource
|
||||||
private ShopInfoService shopInfoService;
|
private ShopInfoService shopInfoService;
|
||||||
|
@DubboReference
|
||||||
|
private MemberLevelConfigService memberLevelConfigService;
|
||||||
|
|
||||||
private ShopUser getUserInfo(Long shopUserId) {
|
private ShopUser getUserInfo(Long shopUserId) {
|
||||||
ShopUser shopUser = shopUserService.queryChain().eq(ShopUser::getId, shopUserId).one();
|
ShopUser shopUser = shopUserService.queryChain().eq(ShopUser::getId, shopUserId).one();
|
||||||
|
|
@ -133,6 +137,8 @@ public class AShopUserServiceImpl implements AShopUserService {
|
||||||
ShopUserDTO shopUserDTO = BeanUtil.copyProperties(shopUser, ShopUserDTO.class);
|
ShopUserDTO shopUserDTO = BeanUtil.copyProperties(shopUser, ShopUserDTO.class);
|
||||||
shopUserDTO.setCouponNum(count);
|
shopUserDTO.setCouponNum(count);
|
||||||
shopUserDTO.setOrderNumber(orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, userId).eq(OrderInfo::getShopId, StpKit.USER.getShopId(0L)).eq(OrderInfo::getStatus, "done")));
|
shopUserDTO.setOrderNumber(orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, userId).eq(OrderInfo::getShopId, StpKit.USER.getShopId(0L)).eq(OrderInfo::getStatus, "done")));
|
||||||
|
MemberLevelConfig memberLevelConfig = memberLevelConfigService.getById(shopUser.getMemberLevelId());
|
||||||
|
shopUserDTO.setMemberLevelName(memberLevelConfig == null ? null : memberLevelConfig.getName());
|
||||||
return shopUserDTO;
|
return shopUserDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,11 @@
|
||||||
a.*,
|
a.*,
|
||||||
IFNULL(c.couponNum, 0) AS couponNum,
|
IFNULL(c.couponNum, 0) AS couponNum,
|
||||||
IFNULL(d.orderNumber, 0) AS orderNumber,
|
IFNULL(d.orderNumber, 0) AS orderNumber,
|
||||||
IFNULL(f.rechargeAmount, 0) AS rechargeAmount
|
IFNULL(f.rechargeAmount, 0) AS rechargeAmount,
|
||||||
|
c.name as memberLevelName
|
||||||
FROM tb_shop_user a
|
FROM tb_shop_user a
|
||||||
LEFT JOIN tb_user_info b ON b.id = a.user_id
|
LEFT JOIN tb_user_info b ON b.id = a.user_id
|
||||||
|
LEFT JOIN tb_member_level_config c on c.id=a.member_level_id
|
||||||
|
|
||||||
-- 预计算优惠券数量
|
-- 预计算优惠券数量
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import com.czg.market.entity.MemberLevelConfig;
|
import com.czg.market.entity.MemberLevelConfig;
|
||||||
import com.czg.market.service.MemberLevelConfigService;
|
import com.czg.market.service.MemberLevelConfigService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -23,7 +25,7 @@ import java.util.List;
|
||||||
* @author zs
|
* @author zs
|
||||||
* @since 2025-09-10
|
* @since 2025-09-10
|
||||||
*/
|
*/
|
||||||
@Service
|
@DubboService
|
||||||
public class TbMemberLevelConfigServiceImpl extends ServiceImpl<TbMemberLevelConfigMapper, MemberLevelConfig> implements MemberLevelConfigService{
|
public class TbMemberLevelConfigServiceImpl extends ServiceImpl<TbMemberLevelConfigMapper, MemberLevelConfig> implements MemberLevelConfigService{
|
||||||
@Resource
|
@Resource
|
||||||
private ShopCouponService shopCouponService;
|
private ShopCouponService shopCouponService;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue