Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java
| | |
| | | import factory.RemoteOrderGoodsFallbackFactory; |
| | | import model.OrderGood; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
New file |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_region") |
| | | @ApiModel(value="Region对象", description="") |
| | | public class Region implements Serializable { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String name; |
| | | |
| | | private String code; |
| | | |
| | | private String citycode; |
| | | |
| | | private Long parentId; |
| | | |
| | | private String english; |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | @Slf4j |
| | | public class RemoteVipSettingFallbackFactory implements FallbackFactory<RemoteVipSettingClient> { |
| | | @Override |
| | | public RemoteVipSettingClient create(Throwable cause) { |
| | | return new RemoteVipSettingClient(){ |
| | | @Override |
| | | public R<VipSetting> getVipSettingById(Integer id) { |
| | | log.error("获取会员设置信息失败:{}", cause.getMessage()); |
| | | throw new ServiceException("获取会员设置信息失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.factory.RemoteVipSettingFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | @FeignClient(contextId = "RemoteOrderGoodsClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteVipSettingFallbackFactory.class) |
| | | public interface RemoteVipSettingClient { |
| | | |
| | | @GetMapping("/vip-setting/getVipSettingById") |
| | | R<VipSetting> getVipSettingById(Integer id); |
| | | } |
| | |
| | | double WGS72 = getDistanceMeter(source, target, Ellipsoid.WGS72); |
| | | double Clarke1858 = getDistanceMeter(source, target, Ellipsoid.Clarke1858); |
| | | double Clarke1880 = getDistanceMeter(source, target, Ellipsoid.Clarke1880); |
| | | // System.out.println("Sphere坐标系计算结果:"+Sphere + "米"); |
| | | // System.out.println("WGS84坐标系计算结果:"+WGS84 + "米"); |
| | | // System.out.println("GRS80坐标系计算结果:"+GRS80 + "米"); |
| | | // System.out.println("GRS67坐标系计算结果:"+GRS67 + "米"); |
| | | // System.out.println("ANS坐标系计算结果:"+ANS + "米"); |
| | | // System.out.println("WGS72坐标系计算结果:"+WGS72 + "米"); |
| | | // System.out.println("Clarke1858坐标系计算结果:"+Clarke1858 + "米"); |
| | | // System.out.println("Clarke1880坐标系计算结果:"+Clarke1880 + "米"); |
| | | System.out.println("Sphere坐标系计算结果:"+Sphere + "米"); |
| | | System.out.println("WGS84坐标系计算结果:"+WGS84 + "米"); |
| | | System.out.println("GRS80坐标系计算结果:"+GRS80 + "米"); |
| | | System.out.println("GRS67坐标系计算结果:"+GRS67 + "米"); |
| | | System.out.println("ANS坐标系计算结果:"+ANS + "米"); |
| | | System.out.println("WGS72坐标系计算结果:"+WGS72 + "米"); |
| | | System.out.println("Clarke1858坐标系计算结果:"+Clarke1858 + "米"); |
| | | System.out.println("Clarke1880坐标系计算结果:"+Clarke1880 + "米"); |
| | | map.put("Sphere", Sphere); |
| | | map.put("WGS84", WGS84); |
| | | map.put("GRS80", GRS80); |
| | |
| | | |
| | | public static void main(String[] ages){ |
| | | GeodesyUtil geodesyUtil = new GeodesyUtil(); |
| | | Map<String, Double> distance = geodesyUtil.getDistance("115.481028,39.989643", "114.465302,40.004717"); |
| | | Map<String, Double> distance = geodesyUtil.getDistance("104.063855,30.575442", "104.679931,31.471814"); |
| | | System.err.println(distance); |
| | | } |
| | | } |
| | |
| | | // |
| | | DistributedLock annotation = method.getAnnotation(DistributedLock.class); |
| | | String lockName = getLockName(annotation, pjp.getArgs(), method); |
| | | //log.info("lockName:"+lockName); |
| | | log.info("lockName:"+lockName); |
| | | RLock lock = redissonClient.getLock(lockName); |
| | | lock.lock(); |
| | | try { |
New file |
| | |
| | | package com.ruoyi.account; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | public enum WithdrawalAuditStatus { |
| | | WAIT_AUDIT(1, "待审核"), |
| | | AUDIT_SUCCESS(2, "审核通过"), |
| | | AUDIT_FAIL(3, "审核拒绝"); |
| | | private final Integer code; |
| | | private final String desc; |
| | | WithdrawalAuditStatus(Integer code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import com.ruoyi.account.service.WalletService; |
| | | import com.ruoyi.account.vo.WalletVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | public class WalletController extends BaseController { |
| | | @Resource |
| | | private BalanceChangeRecordService balanceChangeRecordService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private WalletService walletService; |
| | | |
| | | /** |
| | | * 钱包详情 |
| | |
| | | @GetMapping("detail") |
| | | @ApiOperation(value = "钱包详情", notes = "钱包详情", tags = {"小程序-个人中心-我的钱包-钱包详情"}) |
| | | public R<WalletVO> detail() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | // TODO 查询钱包详情 |
| | | WalletVO walletVO = new WalletVO(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | WalletVO walletVO = walletService.getWalletByUserId(loginUserApplet.getUserid()); |
| | | return R.ok(walletVO); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.ruoyi.account.vo.WalletVO; |
| | | |
| | | public interface WalletService { |
| | | |
| | | WalletVO getWalletByUserId(Long userId); |
| | | } |
| | |
| | | loginUser.setUsername(appUser.getName()); |
| | | Map<String, Object> tokenApplet = tokenService.createTokenApplet(loginUser); |
| | | loginVo.setToken(tokenApplet.get("access_token").toString()); |
| | | loginVo.setFailureTime(Long.valueOf(tokenApplet.get("expires_in").toString())); |
| | | loginVo.setFailureTime(Long.valueOf(tokenApplet.get("expires_in").toString())); |
| | | return AjaxResult.success(loginVo); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.WithdrawalAuditStatus; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.WalletService; |
| | | import com.ruoyi.account.service.WithdrawalRequestsService; |
| | | import com.ruoyi.account.vo.WalletVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class WalletServiceImpl implements WalletService { |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private RemoteVipSettingClient remoteVipSettingClient; |
| | | @Resource |
| | | private WithdrawalRequestsService withdrawalRequestsService; |
| | | |
| | | @Override |
| | | public WalletVO getWalletByUserId(Long userId) { |
| | | AppUser appUser = appUserService.getById(userId); |
| | | if (appUser == null) { |
| | | throw new RuntimeException("用户不存在"); |
| | | } |
| | | Integer vipId = appUser.getVipId(); |
| | | R<VipSetting> r = remoteVipSettingClient.getVipSettingById(vipId); |
| | | if (r == null || r.getCode() != R.SUCCESS) { |
| | | throw new RuntimeException("获取会员设置信息失败"); |
| | | } |
| | | VipSetting data = r.getData(); |
| | | if (data == null) { |
| | | throw new RuntimeException("会员设置信息为空"); |
| | | } |
| | | |
| | | // 获取提现审核中的金额 |
| | | List<WithdrawalRequests> waitAuditList = withdrawalRequestsService.list(new LambdaQueryWrapper<WithdrawalRequests>() |
| | | .eq(WithdrawalRequests::getAppUserId, userId) |
| | | .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT)); |
| | | |
| | | WalletVO walletVO = new WalletVO(); |
| | | walletVO.setWithdrawalAmount(appUser.getWithdrawalAmount()); |
| | | walletVO.setWithdrawnAmount(appUser.getWithdrawnAmount()); |
| | | walletVO.setVipWithdrawalMinAmount(data.getVipWithdrawalMinAmount()); |
| | | walletVO.setTotalRechargeAmount(appUser.getTotalRechargeAmount()); |
| | | walletVO.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount()); |
| | | walletVO.setTotalDistributionAmount(appUser.getTotalDistributionAmount()); |
| | | walletVO.setAuditAmount(waitAuditList.stream() |
| | | .map(WithdrawalRequests::getWithdrawalAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | |
| | | return walletVO; |
| | | } |
| | | |
| | | } |
| | |
| | | public class WalletVO { |
| | | |
| | | @ApiModelProperty(value = "可提现金额") |
| | | private BigDecimal withdrawal_amount; |
| | | private BigDecimal withdrawalAmount; |
| | | |
| | | @ApiModelProperty(value = "已提现金额") |
| | | private BigDecimal withdrawn_amount; |
| | | private BigDecimal withdrawnAmount; |
| | | |
| | | @ApiModelProperty(value = "最低提现门槛") |
| | | private BigDecimal vipWithdrawalMinAmount; |
| | | |
| | | @ApiModelProperty(value = "提现审核中金额") |
| | | private BigDecimal audit_amount; |
| | | private BigDecimal auditAmount; |
| | | |
| | | @ApiModelProperty(value = "充值总金额") |
| | | private BigDecimal total_recharge_amount; |
| | | private BigDecimal totalRechargeAmount; |
| | | |
| | | @ApiModelProperty(value = "红包总金额") |
| | | private BigDecimal total_red_packet_amount; |
| | | private BigDecimal totalRedPacketAmount; |
| | | |
| | | @ApiModelProperty(value = "分销总金额") |
| | | private BigDecimal total_distribution_amount; |
| | | private BigDecimal totalDistributionAmount; |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int", paramType="query"), |
| | | }) |
| | | @GetMapping("/check/{orderId}/{shopId}") |
| | | public R<Boolean> check(@PathVariable("orderId") Long orderId, @PathVariable("shopId") Long shopId){ |
| | | return R.ok(orderService.check(orderId, shopId)); |
| | | @GetMapping("/check/{orderNumber}/{shopId}") |
| | | public R<Boolean> check(@PathVariable("orderNumber") String orderNumber, @PathVariable("shopId") Long shopId){ |
| | | return R.ok(orderService.check(orderNumber, shopId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | OrderDetailVO getOrderDetail(Long orderId); |
| | | |
| | | boolean check(Long orderId, Long shopId); |
| | | boolean check(String orderNumber, Long shopId); |
| | | } |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.service.OrderService; |
| | |
| | | |
| | | @Override |
| | | public List<OrderVO> getOrderList(Integer status) { |
| | | // TODO 待实现 |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetailVO getOrderDetail(Long orderId) { |
| | | // TODO 待实现 |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public boolean check(Long orderId, Long shopId) { |
| | | // TODO 待实现 |
| | | return false; |
| | | public boolean check(String orderNumber, Long shopId) { |
| | | Order order = getOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getOrderNumber, orderNumber) |
| | | .eq(Order::getShopId, shopId)); |
| | | return order != null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.service.RegionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/region") |
| | | @Api("地区") |
| | | public class RegionController { |
| | | @Resource |
| | | private RegionService regionService; |
| | | |
| | | /** |
| | | * 获取省份列表 |
| | | */ |
| | | @GetMapping("/getProvinceList") |
| | | @ApiOperation("获取省份列表") |
| | | public R<List<Region>> getProvinceList() { |
| | | return R.ok(regionService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId, 0))); |
| | | } |
| | | |
| | | /** |
| | | * 获取下级地区列表 |
| | | */ |
| | | @GetMapping("/getNextRegionList") |
| | | @ApiOperation("获取下级地区列表") |
| | | public R<List<Region>> getNextRegionList(@ApiParam("父级id") @RequestParam Long id) { |
| | | return R.ok(regionService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId, id))); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 分享添加 |
| | | */ |
| | | @ApiOperation(value = "小程序-个人中心-门店管理-分享添加", tags = {"分享添加-小程序"}) |
| | | @ApiOperation(value = "分享添加", tags = {"小程序-个人中心-门店管理-分享添加"}) |
| | | @PostMapping |
| | | public R<Void> add(@RequestBody Share share){ |
| | | share.setAddType(ShareAddType.STORE.getCode()); |
| | |
| | | */ |
| | | @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理-分享详情-小程序"}) |
| | | @GetMapping("/detail/{id}") |
| | | public R<Void> detail(@PathVariable("id") Integer id){ |
| | | shareService.getById(id); |
| | | return R.ok(); |
| | | public R<Share> detail(@PathVariable("id") Integer id){ |
| | | return R.ok(shareService.getById(id)); |
| | | } |
| | | |
| | | |
| | |
| | | * 门店详情 |
| | | */ |
| | | @GetMapping("/shopDetail") |
| | | @ApiOperation(value = "门店详情", tags = {"门店详情-小程序"}) |
| | | @ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"}) |
| | | public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId, |
| | | @ApiParam("经度") @RequestParam String longitude, |
| | | @ApiParam("纬度") @RequestParam String latitude) { |
| | |
| | | * 查询当前店长所属门店 |
| | | */ |
| | | @GetMapping("/shopByUser") |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页-关联门店列表"}) |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页"}, notes = "可绑定的门店列表") |
| | | public R<List<Shop>> shopByUser() { |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() |
| | | .eq(Shop::getAppUserId, SecurityUtils.getUserId()) |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/vip-setting") |
| | | @Api("会员设置") |
| | | public class VipSettingController { |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | @GetMapping("getVipSettingById") |
| | | @ApiOperation(value = "获取会员设置") |
| | | public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") Integer id){ |
| | | return R.ok(vipSettingService.getById(id)); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | |
| | | public interface RegionMapper extends BaseMapper<Region> { |
| | | } |
| | |
| | | */ |
| | | public interface VipGoodMapper extends BaseMapper<VipGood> { |
| | | |
| | | /** |
| | | * 查询指定商品的指定会员价格 |
| | | */ |
| | | VipGood selectVipGood(Long goodsId, Integer vipId); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | |
| | | public interface RegionService extends IService<Region> { |
| | | } |
| | |
| | | */ |
| | | public interface VipSettingService extends IService<VipSetting> { |
| | | |
| | | VipSetting getVipSettingByUserId(Long userId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.enums.GoodsStatus; |
| | | import com.ruoyi.other.mapper.GoodsMapper; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService { |
| | | @Resource |
| | | private GoodsMapper goodsMapper; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | @Override |
| | | public List<GoodsVO> goodsList(Goods search) { |
| | |
| | | |
| | | @Override |
| | | public GoodsVO goodsDetail(Long goodsId) { |
| | | // TODO 根据会员等级展示价格 |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid()); |
| | | |
| | | // TODO 根据会员等级计算价格、积分 |
| | | Goods goods = this.getById(goodsId); |
| | | if (Objects.nonNull(goods)){ |
| | | GoodsVO goodsVO = new GoodsVO(); |
New file |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.mapper.RegionMapper; |
| | | import com.ruoyi.other.service.RegionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService { |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.other.mapper.VipSettingMapper; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class VipSettingServiceImpl extends ServiceImpl<VipSettingMapper, VipSetting> implements VipSettingService { |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Override |
| | | public VipSetting getVipSettingByUserId(Long userId) { |
| | | AppUser appUser = appUserClient.getAppUserById(userId); |
| | | if(null == appUser){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | return this.getById(appUser.getVipId()); |
| | | } |
| | | } |