From a323bb6fbfdd9fa7bc03465b7fbed2baf6d0fa84 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 27 十二月 2024 09:34:47 +0800
Subject: [PATCH] 合并代码

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java           |    5 ++++-
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java          |    6 ++++--
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/RechargeDto.java                     |    2 +-
 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml                         |   10 +---------
 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java                     |    3 +++
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java    |   16 +++++++++++++++-
 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java        |    3 ++-
 ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml                  |    2 +-
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RechargeSetController.java    |    2 +-
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java |    3 ++-
 10 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
index afc03e9..3a5830a 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -118,6 +118,9 @@
     @TableField("lave_point")
     private Integer lavePoint;
 
+    @TableField(exist = false)
+    private Integer laveUsePoint;
+
     @ApiModelProperty(value = "门店分佣总金额")
     @TableField("giveaway_all_money")
     private BigDecimal giveawayAllMoney;
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
index 220b9ff..74b4afc 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
@@ -5,6 +5,7 @@
 import com.ruoyi.other.api.domain.CouponInfo;
 import com.ruoyi.other.api.factory.CouponClientFallbackFactory;
 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;
 
@@ -16,7 +17,7 @@
 public interface CouponClient {
 
 
-    @PostMapping("/coupon-info/detail")
+    @GetMapping("/coupon-info/detail")
     R<CouponInfo> detail(@RequestParam("id") Integer id);
 	
 	
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
index 486420f..d455ab3 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -393,6 +393,20 @@
                                             @ApiParam("每一页数据大小") Integer pageSize,
                                             AppUser appUser) {
         IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageNum, pageSize, appUser);
+        for (AppUser record : appuserPage.getRecords()) {
+            if (record.getInviteUserId() != null) {
+                AppUser byId1 = appUserService.getById(record.getInviteUserId());
+                if (byId1!=null) {
+                    record.setInviteUserName(byId1.getName());
+                }
+            }
+            if (record.getShopId()!=null){
+                R<Shop> shopById = shopClient.getShopById(record.getShopId());
+                if (shopById.getData()!=null){
+                    record.setShopName(shopById.getData().getName());
+                }
+            }
+        }
         return R.ok(appuserPage);
     }
 
@@ -540,7 +554,7 @@
         //推广人
         if (byId.getInviteUserId() != null) {
             AppUser byId1 = appUserService.getById(byId.getInviteUserId());
-            byId1.setInviteUserName(byId1.getInviteUserName());
+            byId.setInviteUserName(byId1.getInviteUserName());
         }
         //最后下单时间
         R<Order> lastOrder = remoteOrderGoodsClient.getLastOrder(id);
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
index 3428da9..da4254c 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -121,7 +121,8 @@
         Long userid = tokenService.getLoginUserApplet().getUserid();
         AppUser byId = appUserService.getById(userid);
 
-        CouponInfo data = couponClient.detail(couponId).getData();
+        R<CouponInfo> detail = couponClient.detail(couponId);
+        CouponInfo data = detail.getData();
         //检验当前优惠券是否存在
         if (data==null){
             return  R.fail("当前优惠券不存在,请刷新后重试");
diff --git a/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml b/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
index c870ac5..4827216 100644
--- a/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
+++ b/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
@@ -53,7 +53,7 @@
     </select>
 
     <select id="getAppuserPage" resultType="com.ruoyi.account.api.model.AppUser">
-        SELECT ta.id, ta.`name`, ta.vip_id, ta.shop_id
+        SELECT *
         FROM t_app_user ta
         <where>
             ta.del_flag = 0
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RechargeSetController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RechargeSetController.java
index 9812889..0da5cf3 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RechargeSetController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RechargeSetController.java
@@ -38,7 +38,7 @@
     public R<List<RechargeSet>> detail(@RequestBody RechargeDto rechargeDto) {
         List<RechargeSet> list = rechargeSetService.list();
         rechargeSetService.removeBatchByIds(list);
-        rechargeSetService.saveBatch(rechargeDto.getRechargeSets());
+        rechargeSetService.saveBatch(rechargeDto.getRechargeDto());
         return R.ok();
     }
 
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
index 8114a0d..b26b0fa 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
@@ -185,8 +185,10 @@
         for (Share record : page.getRecords()) {
             if (record.getAddType() == 2) {
                 AppUser appUserById = appUserClient.getAppUserById(Long.valueOf(record.getObjectId()));
-                record.setAuthName(appUserById.getName());
-                record.setAuthPhone(appUserById.getPhone());
+                if (appUserById!=null) {
+                    record.setAuthName(appUserById.getName());
+                    record.setAuthPhone(appUserById.getPhone());
+                }
             }
             if (record.getAddType() == 3) {
                 R<Shop> shopById = shopClient.getShopById(Integer.valueOf(record.getObjectId()));
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
index 5ecf015..617ff88 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -135,6 +135,9 @@
     @ApiOperation(value = "门店列表", tags = {"管理后台-门店管理"})
     public R<IPage<Shop>> list(@ApiParam("页码") @RequestParam Integer pageNum,@ApiParam("每一页数据大小") Integer pageSize,Shop shop){
         IPage<Shop> shopIPage = shopService.getShopList(pageNum, pageSize, shop);
+        for (Shop record : shopIPage.getRecords()) {
+            record.setLaveUsePoint(record.getLavePoint());
+        }
         return R.ok(shopIPage);
     }
 
@@ -259,7 +262,7 @@
 
     @ResponseBody
     @PostMapping("/getShopByUserId")
-    public R<List<Shop>> getShopByUserId(@RequestParam("id") Integer id){
+    public R<List<Shop>> getShopByUserId(@RequestParam("id") Long id){
         List<Shop> list = shopService.lambdaQuery().eq(Shop::getAppUserId, id).list();
         return R.ok(list);
     }
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/RechargeDto.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/RechargeDto.java
index e92b73a..fd03b95 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/RechargeDto.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/RechargeDto.java
@@ -12,5 +12,5 @@
  */
 @Data
 public class RechargeDto {
-    private List<RechargeSet> rechargeSets;
+    private List<RechargeSet> rechargeDto;
 }
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
index ce19e5c..93820f1 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
@@ -55,15 +55,7 @@
     </select>
     <select id="selectShopList" resultType="com.ruoyi.other.api.domain.Shop">
         SELECT
-            ts.id,
-            ts.`name`,
-            ts.business_date,
-            ts.start_time,
-            ts.end_time,
-            ts.phone,
-            ts.address,
-            ts.`status`,
-            ts.shop_manager
+            ts.*
         FROM
             t_shop ts
         <where>

--
Gitblit v1.7.1