From cb490e56ee7bccbc3b56d6964e9b68e5aa8ec475 Mon Sep 17 00:00:00 2001
From: phpcjl <phpcjl@gmail.com>
Date: 星期一, 16 十二月 2024 17:16:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java |   46 +++++++++++++++++++++-------------------------
 1 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java
index 7164b6d..9867001 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java
@@ -64,8 +64,6 @@
     /**
      * 根据商品id和会员等级获取门店特价
      *
-     * @param goodsBargainPrice
-     * @return
      */
     @PostMapping("/getGoodsBargainPrice")
     public R<GoodsBargainPriceDetail> getGoodsBargainPrice(@RequestBody GetGoodsBargainPrice goodsBargainPrice) {
@@ -88,7 +86,7 @@
      * 新增
      */
     @PostMapping("/add")
-    @ApiOperation(value = "商品管理-门店特殊售价-新增", tags = {"管理后台"})
+    @ApiOperation(value = "新增", tags = {"管理后台-商品管理-门店特殊售价"})
     @Transactional(rollbackFor = Exception.class)
     public R<Void> add(@RequestBody GoodsBargainPrice goodsBargainPrice) {
         LoginUser loginUserApplet = tokenService.getLoginUserApplet();
@@ -114,7 +112,7 @@
      * 删除
      */
     @DeleteMapping("/delete")
-    @ApiOperation(value = "商品管理-门店特殊售价-删除", tags = {"管理后台"})
+    @ApiOperation(value = "删除", tags = {"管理后台-商品管理-门店特殊售价-"})
     public R<Void> delete(@ApiParam("id") @RequestParam("id") Integer id) {
         goodsBargainPriceService.removeById(id);
         goodsBargainPriceDetailService.remove(new LambdaQueryWrapper<GoodsBargainPriceDetail>()
@@ -126,7 +124,7 @@
      * 修改
      */
     @PutMapping("/edit")
-    @ApiOperation(value = "商品管理-门店特殊售价-修改", tags = {"管理后台"})
+    @ApiOperation(value = "修改", tags = {"管理后台-商品管理-门店特殊售价"})
     @Transactional(rollbackFor = Exception.class)
     public R<Void> edit(@RequestBody GoodsBargainPrice goodsBargainPrice) {
         goodsBargainPriceService.updateById(goodsBargainPrice);
@@ -140,7 +138,7 @@
      * 详情
      */
     @GetMapping("/detail")
-    @ApiOperation(value = "商品管理-门店特殊售价-详情", tags = {"管理后台"})
+    @ApiOperation(value = "详情", tags = {"管理后台-商品管理-门店特殊售价"})
     public R<GoodsBargainPrice> detail(@ApiParam("id") @RequestParam("id") Integer id) {
         GoodsBargainPrice goodsBargainPrice = goodsBargainPriceService.getById(id);
         List<GoodsBargainPriceDetail> goodsBargainPriceDetailList = goodsBargainPriceDetailService.list(new LambdaQueryWrapper<GoodsBargainPriceDetail>()
@@ -153,7 +151,7 @@
      * 列表
      */
     @GetMapping("/list")
-    @ApiOperation(value = "商品管理-门店特殊售价-列表", tags = {"管理后台"})
+    @ApiOperation(value = "列表", tags = {"管理后台-商品管理-门店特殊售价"})
     public R<Page<GoodsBargainPrice>> list(@ApiParam("页码") @RequestParam(value = "pageNum", required = false) Integer pageNum,
                                            @ApiParam("每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize,
                                            @ApiParam("商品id") @RequestParam(value = "goodsId", required = false) Integer goodsId,
@@ -176,24 +174,22 @@
                 .eq(!CollectionUtils.isEmpty(goodsIds), GoodsBargainPrice::getGoodsId, goodsId)
                 .eq(auditStatus != null, GoodsBargainPrice::getAuditStatus, auditStatus));
 
-        page.getRecords().forEach(goodsBargainPrice -> {
-            goodsList.stream()
-                    .filter(goods -> goods.getId().equals(goodsBargainPrice.getGoodsId()))
-                    .findFirst().ifPresent(g -> {
-                        GoodsCategory goodsCategory = goodsCategoryService.getById(g.getGoodsCategoryId());
-                        Integer shopId = goodsBargainPrice.getShopId();
-                        Shop shop = shopService.getById(shopId);
-                        R<AppUser> r = appUserClient.getAppUserByPhone(shop.getPhone());
-                        if (R.isError(r)){
-                            throw new RuntimeException("获取店长信息失败");
-                        }
-                        goodsBargainPrice.setOwnerName(r.getData().getName());
-                        goodsBargainPrice.setOwnerPhone(shop.getPhone());
-                        goodsBargainPrice.setShopName(shop.getName());
-                        goodsBargainPrice.setGoodsName(g.getName());
-                        goodsBargainPrice.setCategoryName(goodsCategory.getName());
-                    });
-        });
+        page.getRecords().forEach(goodsBargainPrice -> goodsList.stream()
+                .filter(goods -> goods.getId().equals(goodsBargainPrice.getGoodsId()))
+                .findFirst().ifPresent(g -> {
+                    GoodsCategory goodsCategory = goodsCategoryService.getById(g.getGoodsCategoryId());
+                    Integer shopId = goodsBargainPrice.getShopId();
+                    Shop shop = shopService.getById(shopId);
+                    R<AppUser> r = appUserClient.getAppUserByPhone1(shop.getPhone());
+                    if (R.isError(r)){
+                        throw new RuntimeException("获取店长信息失败");
+                    }
+                    goodsBargainPrice.setOwnerName(r.getData().getName());
+                    goodsBargainPrice.setOwnerPhone(shop.getPhone());
+                    goodsBargainPrice.setShopName(shop.getName());
+                    goodsBargainPrice.setGoodsName(g.getName());
+                    goodsBargainPrice.setCategoryName(goodsCategory.getName());
+                }));
 
         return R.ok(page);
     }

--
Gitblit v1.7.1