店铺会员返回会员折扣信息

This commit is contained in:
张松 2025-10-24 10:09:37 +08:00
parent 3b2a657ea4
commit 826d91b64d
2 changed files with 15 additions and 0 deletions

View File

@ -153,7 +153,10 @@ public class ShopUser implements Serializable {
private LocalDateTime deliverTime;
private LocalDateTime nextDeliverTime;
@Column(ignore = true)
private String memberName;
private String openType;
@Column(ignore = true)
private Integer discount;
}

View File

@ -12,11 +12,14 @@ 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.market.entity.MemberLevelConfig;
import com.czg.market.service.MemberLevelConfigService;
import com.czg.service.account.mapper.ShopUserMapper;
import com.czg.utils.MyQueryWrapper;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.transaction.annotation.Transactional;
@ -40,6 +43,8 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
private UserInfoService userInfoService;
@Resource
private ShopInfoService shopInfoService;
@DubboReference
private MemberLevelConfigService memberLevelConfigService;
private ShopUser getUserInfo(Long shopUserId) {
ShopUser shopUser = queryChain().eq(ShopUser::getId, shopUserId).one();
@ -73,6 +78,13 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
shopUser.setId(null);
save(shopUser);
}
if (shopUser.getMemberLevelId() != null) {
MemberLevelConfig memberLevelConfig = memberLevelConfigService.getById(shopUser.getMemberLevelId());
if (memberLevelConfig != null) {
shopUser.setMemberName(memberLevelConfig.getName());
shopUser.setDiscount(memberLevelConfig.getDiscount());
}
}
return shopUser;
}