Pu Zhibing
2024-12-25 7405ce915a649b92c51c2120b0a60b6d599454d1
Merge remote-tracking branch 'origin/master'
17个文件已修改
112 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/VipGood.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsVipClientFallbackFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsVipClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/PointSettingClient.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsVipController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PointSettingController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipGoodController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsBargainPriceServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/VipGood.java
@@ -34,8 +34,8 @@
    private Integer vipId;
    @ApiModelProperty(value = "指定购买后升级商品的json快照")
    @TableField("good_id")
    private Integer goodId;
    @TableField("good_json")
    private String good_json;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsVipClientFallbackFactory.java
@@ -18,7 +18,7 @@
            
            
            @Override
            public R<GoodsVip> getGoodsVip(Integer vip) {
            public R<GoodsVip> getGoodsVip(Integer goodsId, Integer vip) {
                return R.fail("获取会员价格配置失败:" + cause.getMessage());
            }
        };
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsVipClient.java
@@ -22,5 +22,5 @@
     * @return
     */
    @PostMapping("/goods-vip/getGoodsVip")
    R<GoodsVip> getGoodsVip(@RequestParam("vip") Integer vip);
    R<GoodsVip> getGoodsVip(@RequestParam("goodsId") Integer goodsId, @RequestParam("vip") Integer vip);
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/PointSettingClient.java
@@ -6,11 +6,12 @@
import com.ruoyi.other.api.factory.PointSettingClientFallbackFactory;
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.RequestParam;
@FeignClient(contextId = "PointSettingClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = PointSettingClientFallbackFactory.class)
public interface PointSettingClient {
    @GetMapping("/point-setting/getPointSetting")
    @PostMapping("/point-setting/getPointSetting")
    R<PointSetting> getPointSetting(@RequestParam("id") Integer id);
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipGoodClient.java
@@ -7,6 +7,7 @@
import com.ruoyi.other.api.factory.VipGoodClientFallbackFactory;
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.RequestParam;
import java.util.List;
@@ -14,9 +15,9 @@
@FeignClient(contextId = "VipGoodClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = VipGoodClientFallbackFactory.class)
public interface VipGoodClient {
    @GetMapping("/vip-good/getVipGoodsByVipId")
    @PostMapping("/vip-good/getVipGoodsByVipId")
    R<List<VipGood>> getVipGoodsByVipId(@RequestParam("vipId") Integer vipId);
    @GetMapping("/vip-setting/getVipSettingById")
    @PostMapping("/vip-setting/getVipSettingById1")
    R<VipSetting> getVipSettingById(@RequestParam("id") Integer id);
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java
@@ -1,5 +1,6 @@
package com.ruoyi.account.controller;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.account.service.VipCenterService;
import com.ruoyi.account.service.VipSettingService;
@@ -94,12 +95,7 @@
                if (vipGoodList != null && !vipGoodList.isEmpty()) {
                    List<String> goodsNames = new ArrayList<>();
                    vipGoodList.forEach(vipGood -> {
                        Integer goodId = vipGood.getGoodId();
                        R<Goods> goodsR = goodsClient.getGoodsById(goodId);
                        if (R.isError(goodsR)) {
                         throw new ServiceException("商品信息获取失败");
                        }
                        Goods goods = goodsR.getData();
                        Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                        goodsNames.add(goods.getName());
                    });
                    level.setGoodsNames(goodsNames);
@@ -130,7 +126,7 @@
    private Map<Integer, R<GoodsVip>> getGoodsVips(List<Integer> vipIds) {
        Map<Integer, R<GoodsVip>> result = new HashMap<>();
        for (Integer vipId : vipIds) {
            R<GoodsVip> goodsVipR = goodsVipClient.getGoodsVip(vipId);
            R<GoodsVip> goodsVipR = goodsVipClient.getGoodsVip(null, vipId);
            result.put(vipId, goodsVipR);
        }
        return result;
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
@@ -48,8 +48,10 @@
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation.ANONYMOUS.optional;
import static sun.plugin.util.ProgressMonitor.get;
/**
 * <p>
@@ -234,6 +236,7 @@
            code += Double.valueOf(Math.random() * 10).intValue();
        }
        SMSUtil.sendSms("[\"" + code + "\"]", smsCode.getPhone(), "8824121211029", "39533d100b2b4aee8ed198aa49fe99dd");
        redisService.setCacheObject(smsCode.getPhone(), code, 300L, TimeUnit.SECONDS);
        return R.ok();
    }
    
@@ -330,7 +333,7 @@
                Region region = regionClient.getRegionBiCode(citycode).getData();
                appUser.setDistrict(region.getName());
                appUser.setDistrictCode(citycode);
                region = regionClient.getRegionBiCode(citycode.substring(0, 3) + "00").getData();
                region = regionClient.getRegionBiCode(citycode.substring(0, 4) + "00").getData();
                appUser.setCity(region.getName());
                appUser.setCityCode(region.getCode());
                region = regionClient.getRegionBiCode(citycode.substring(0, 2) + "0000").getData();
@@ -495,8 +498,14 @@
    }
    
    public AppUser getTopAppUser(List<AppUser> list, Long id){
        AppUser appUser = list.stream().filter(s -> s.getId().equals(id)).findFirst().get();
        if(null == appUser.getInviteUserId()){
        Optional<AppUser> first = list.stream().filter(s -> s.getId().equals(id)).findFirst();
        AppUser appUser = null;
        if(first.isPresent()){
            appUser = first.get();
        }else{
            return this.getById(1);
        }
        if( null == appUser.getInviteUserId()){
            return appUser;
        }
        return getTopAppUser(list, appUser.getInviteUserId());
@@ -518,7 +527,7 @@
    public List<AppUser> getSubordinate(List<AppUser> list, List<Long> ids, List<AppUser> result){
        List<Long> idss = new ArrayList<>();
        for (Long id : ids) {
            List<AppUser> collect = list.stream().filter(s -> s.getInviteUserId().equals(id)).collect(Collectors.toList());
            List<AppUser> collect = list.stream().filter(s -> null != s.getInviteUserId() && s.getInviteUserId().equals(id)).collect(Collectors.toList());
            if(collect.size() == 0){
                return result;
            }else{
@@ -543,7 +552,7 @@
        //使用地图获取省市区数据
        String citycode = TencentMapUtil.inverseGeographicalAnalysis(nearbyReferrer.getLongitude(), nearbyReferrer.getLatitude(), false);
        if(null != citycode){
            String cityCode = citycode.substring(0, 3) + "00";
            String cityCode = citycode.substring(0, 4) + "00";
            List<NearbyReferrerVo> list = this.baseMapper.getNearbyReferrer(cityCode, nearbyReferrer);
            return list;
        }
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java
@@ -1,6 +1,7 @@
package com.ruoyi.account.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.account.api.model.AppUser;
@@ -87,12 +88,7 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    Integer goodId = vipGood.getGoodId();
                    R<Goods> goodsR = goodsClient.getGoodsById(goodId);
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -149,12 +145,7 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId());
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -226,11 +217,7 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId());
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -178,7 +178,7 @@
                GoodsArea goodsArea = goodsAreaClient.getGoodsArea(area).getData();
                if(null == goodsArea){
                    //没有地区价格,则使用会员价格
                    GoodsVip goodsVip = goodsVipClient.getGoodsVip(appUser.getVipId()).getData();
                    GoodsVip goodsVip = goodsVipClient.getGoodsVip(goodsId, appUser.getVipId()).getData();
                    if(null == goodsVip){
                        //没有配置价格,直接使用原始基础价格
                        return null;
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java
@@ -171,7 +171,7 @@
    
    
    @ResponseBody
    @GetMapping("/addGoodsBargainPrice/{id}")
    @PostMapping("/addGoodsBargainPrice")
    @ApiOperation(value = "保存商品特殊售价", tags = {"门店后台-商品管理"})
    public R addGoodsBargainPrice(@RequestBody AddGoodsBargainPriceVo vo){
        return goodsBargainPriceService.addGoodsBargainPrice(vo);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsVipController.java
@@ -31,8 +31,8 @@
     * @return
     */
    @PostMapping("/getGoodsVip")
    public R<GoodsVip> getGoodsVip(@RequestParam("vip") Integer vip){
        GoodsVip one = goodsVipService.getOne(new LambdaQueryWrapper<GoodsVip>().eq(GoodsVip::getVip, vip));
    public R<GoodsVip> getGoodsVip(@RequestParam("goodsId") Integer goodsId, @RequestParam("vip") Integer vip){
        GoodsVip one = goodsVipService.getOne(new LambdaQueryWrapper<GoodsVip>().eq(GoodsVip::getGoodsId, goodsId).eq(GoodsVip::getVip, vip));
        return R.ok(one);
    }
    
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PointSettingController.java
@@ -28,6 +28,13 @@
    @Resource
    private PointSettingService pointSettingService;
    @PostMapping("/getPointSetting")
    public R<PointSetting> getPointSetting(@RequestParam("id") Integer id) {
        PointSetting pointSetting = pointSettingService.getById(id);
        return R.ok(pointSetting);
    }
    @GetMapping("/getBaseSetting")
    public R<PointSetting> getBaseSetting(@RequestParam Integer id) {
        PointSetting pointSetting = pointSettingService.getById(id);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipGoodController.java
@@ -6,10 +6,7 @@
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.other.api.domain.VipGood;
import com.ruoyi.other.service.VipGoodService;
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 org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -28,7 +25,7 @@
    @Resource
    private VipGoodService vipGoodService;
    @GetMapping("getVipGoodsByVipId")
    @PostMapping("getVipGoodsByVipId")
    public R<List<VipGood>> getVipGoodsByVipId(@RequestParam("vipId") Integer vipId){
        return R.ok(vipGoodService.list(new LambdaQueryWrapper<VipGood>()
                .eq(VipGood::getVipId, vipId)));
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
@@ -113,6 +113,13 @@
    }
    @PostMapping("getVipSettingById1")
    public R<VipSetting> getVipSettingById1(@RequestParam("id") Integer id) {
        return R.ok(vipSettingService.getById(id));
    }
    /**
     * 查询会员配置
     * @param id
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsBargainPriceServiceImpl.java
@@ -90,7 +90,7 @@
        bargainPrice.setDelFlag(0);
        bargainPrice.setCreateTime(LocalDateTime.now());
        bargainPrice.setCreateUserId(userid);
        this.updateById(bargainPrice);
        this.save(bargainPrice);
        //添加明细
        List<GoodsBargainPriceDetail> list = vo.getList();
        for (GoodsBargainPriceDetail goodsBargainPriceDetail : list) {
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -85,7 +85,7 @@
            goodsVO.setGoodsId(goods.getId());
            goodsVO.setGoodsName(goods.getName());
            R<Price> r = remoteOrderGoodsClient.getGoodsPrice(loginUserApplet.getUserid(), goods.getId(), null);
            if (R.isSuccess(r)){
            if (null != r.getData()){
                Price price = r.getData();
                goodsVO.setSellingPrice(price.getCash());
                goodsVO.setIntegral(price.getPoint());
@@ -103,8 +103,8 @@
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        AppUser appUser = appUserClient.getAppUserById(loginUserApplet.getUserid());
        BigDecimal sellingPrice;
        Integer integral;
        BigDecimal sellingPrice = BigDecimal.ZERO;
        Integer integral = 0;
        GoodsArea goodsArea = goodsAreaMapper.selectOne(new LambdaQueryWrapper<GoodsArea>()
                .eq(GoodsArea::getGoodsId, goodsId)
@@ -120,9 +120,10 @@
            GoodsVip goodsVip = goodsVipService.getOne(new LambdaQueryWrapper<GoodsVip>()
                    .eq(GoodsVip::getVip, vipSetting.getId())
                    .eq(GoodsVip::getGoodsId, goodsId));
            sellingPrice = goodsVip.getSellingPrice();
            integral = goodsVip.getIntegral();
            if(null != goodsVip){
                sellingPrice = goodsVip.getSellingPrice();
                integral = goodsVip.getIntegral();
            }
        }
        Goods goods = this.getById(goodsId);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -46,7 +46,7 @@
    @Override
    public List<SeckillActivityVO> listSeckillActivity(Goods goods) {
        LoginUser loginUserApplet = tokenService.getLoginUser();
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        AppUser appUser = appUserClient.getAppUserById(loginUserApplet.getUserid());
        goods.setVipId(appUser.getVipId());
        return seckillActivityInfoMapper.listSeckillActivity(goods);