1.
phpcjl
2024-12-10 e3c9bc3a6aa412cbc8682f845796e29cced0a66c
1.
1 文件已重命名
6个文件已修改
104 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/BaseSetting.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/VerifiableShopVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/BaseSetting.java
@@ -26,7 +26,7 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "1:合伙人积分设置一    2:合伙人积分设置二    3:会员说明设置    4:活动管理-活动设置 1开0关  5:售后设置")
    @ApiModelProperty(value = "1:合伙人积分设置一    2:合伙人积分设置二    3:会员说明设置    4:活动管理-活动设置 1开0关  5:售后设置 6:充值设置")
    @TableId("id")
    private Integer id;
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
@@ -1,11 +1,19 @@
package com.ruoyi.order.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.service.ShoppingCartService;
import com.ruoyi.order.vo.*;
import com.ruoyi.other.api.domain.GoodsShop;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.feignClient.GoodsShopClient;
import com.ruoyi.other.api.feignClient.ShopClient;
import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds;
import com.ruoyi.system.api.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -14,6 +22,9 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/shopping-cart")
@@ -25,6 +36,11 @@
    
    @Resource
    private TokenService tokenService;
    @Resource
    private GoodsShopClient goodsShopClient;
    @Resource
    private ShopClient shopClient;
    
    
    
@@ -93,4 +109,33 @@
    }
    
    
    @ResponseBody
    @GetMapping("/getVerifiableShop")
    @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"})
    public R<List<VerifiableShopVo>> getVerifiableShop(){
        LoginUser loginUser = tokenService.getLoginUser();
        List<ShoppingCart> shoppingCarts = shoppingCartService.list(new LambdaQueryWrapper<ShoppingCart>()
                .eq(ShoppingCart::getAppUserId, loginUser.getUserid()));
        List<Integer> goodsIds = shoppingCarts.stream().map(ShoppingCart::getGoodsId).collect(Collectors.toList());
        GetGoodsShopByGoodsIds goodsShopByGoodsIds = new GetGoodsShopByGoodsIds();
        goodsShopByGoodsIds.setGoodsIds(goodsIds);
        R<List<GoodsShop>> r = goodsShopClient.getGoodsShopByGoodsIds(goodsShopByGoodsIds);
        List<GoodsShop> goodsShops = r.getData();
        List<VerifiableShopVo> verifiableShopVoList = new ArrayList<>();
        if (CollectionUtil.isNotEmpty(goodsShops)){
            for (GoodsShop goodsShop : goodsShops) {
                R<Shop> shopR = shopClient.getShopById(goodsShop.getShopId());
                if (R.isSuccess(shopR)){
                    VerifiableShopVo verifiableShopVo = new VerifiableShopVo();
                    verifiableShopVo.setId(shopR.getData().getId());
                    verifiableShopVo.setName(shopR.getData().getName());
                    verifiableShopVoList.add(verifiableShopVo);
                }
            }
        }
        return R.ok(verifiableShopVoList);
    }
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/VerifiableShopVo.java
File was renamed from ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/VerifiableShopVo.java
@@ -1,4 +1,4 @@
package com.ruoyi.other.vo;
package com.ruoyi.order.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java
@@ -1,14 +1,13 @@
package com.ruoyi.other.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.GoodsCategory;
import com.ruoyi.other.service.GoodsCategoryService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -28,6 +27,34 @@
    @Resource
    private GoodsCategoryService goodsCategoryService;
    @PostMapping("/addGoodsCategory")
    @ApiOperation(value = "添加商品分类", tags = {"管理后台-商品分类"})
    public R<Void> addGoodsCategory(GoodsCategory goodsCategory){
        goodsCategoryService.save(goodsCategory);
        return R.ok();
    }
    @PutMapping("/updateGoodsCategory")
    @ApiOperation(value = "修改商品分类", tags = {"管理后台-商品分类"})
    public R<Void> updateGoodsCategory(GoodsCategory goodsCategory){
        goodsCategoryService.updateById(goodsCategory);
        return R.ok();
    }
    @GetMapping("/getGoodsCategoryById")
    @ApiOperation(value = "商品分类详情", tags = {"管理后台-商品分类"})
    public R<GoodsCategory> getGoodsCategoryById(@RequestParam("id") Integer id){
        return R.ok(goodsCategoryService.getById(id));
    }
    @GetMapping("/getList")
    @ApiOperation(value = "商品分类列表", tags = {"管理后台-商品分类"})
    public R<List<GoodsCategory>> list(IPage<GoodsCategory> page, GoodsCategory goodsCategory){
        return R.ok(goodsCategoryService.list());
    }
    @GetMapping("/index/list")
    @ApiOperation(value = "商品分类", tags = {"小程序-首页"})
    public R<List<GoodsCategory>> indexlist(){
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -31,6 +31,14 @@
    @Resource
    private GoodsService goodsService;
    /**
     * 添加商品
     */
    @PostMapping("/addGoods")
    @ApiOperation(value = "添加商品", tags = {"管理后台-发布商品"})
    public R<Void> addGoods(@RequestBody Goods goods) {
        return R.ok();
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java
@@ -49,7 +49,9 @@
    @ResponseBody
    @PostMapping("/getGoodsShopByGoodsIds")
    public R<List<GoodsShop>> getGoodsShopByGoodsIds(@RequestBody GetGoodsShopByGoodsIds goodsIds) {
        List<GoodsShop> list = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getShopId, goodsIds.getShopId()).in(GoodsShop::getGoodsId, goodsIds.getGoodsIds()));
        List<GoodsShop> list = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>()
                .eq(goodsIds.getShopId() != null,GoodsShop::getShopId, goodsIds.getShopId())
                .in(goodsIds.getGoodsIds() !=null ,GoodsShop::getGoodsId, goodsIds.getGoodsIds()));
        return R.ok(list);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -16,7 +16,6 @@
import com.ruoyi.other.service.TechnicianService;
import com.ruoyi.other.vo.NearbyShopVO;
import com.ruoyi.other.vo.ShopDetailVO;
import com.ruoyi.other.vo.VerifiableShopVo;
import com.ruoyi.system.api.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -116,15 +115,6 @@
        return R.ok();
    }
    @ResponseBody
    @GetMapping("/getVerifiableShop")
    @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"})
    public R<List<VerifiableShopVo>> getVerifiableShop(){
        // todo 待完善 pu
        return R.ok();
    }
    
    
    /**