From 6c3f781630bc0c559ceca1a69d4c9e7e33e5daf1 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 23 九月 2025 17:47:32 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java |   61 ++++++++++++++++++++++++++----
 1 files changed, 53 insertions(+), 8 deletions(-)

diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
index a1502ea..439951f 100644
--- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
+++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
@@ -1,6 +1,8 @@
 package com.ruoyi.shop.controller.console;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.constant.CacheConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.exception.ServiceException;
@@ -14,6 +16,7 @@
 import com.ruoyi.shop.service.task.ShopTaskService;
 import com.ruoyi.system.api.constant.AppErrorConstant;
 import com.ruoyi.system.api.domain.dto.*;
+import com.ruoyi.system.api.domain.poji.config.OneClinkSyncing;
 import com.ruoyi.system.api.domain.poji.shop.Shop;
 import com.ruoyi.system.api.domain.poji.sys.SysUser;
 import com.ruoyi.system.api.domain.vo.*;
@@ -21,10 +24,7 @@
 import com.ruoyi.system.api.model.QwUserDetailDto;
 import com.ruoyi.system.api.service.RemoteUserService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-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;
@@ -169,12 +169,19 @@
     }
 
     @PostMapping("/getShopByUserId")
-    public R<ShopRelUserVo> getShopByUserId(@RequestBody Long userId)
-    {
+    public R<ShopRelUserVo> getShopByUserId(@RequestBody Long userId) {
+        System.err.println("查询商户的用户id:" + userId);
         List<ShopRelUser> shopRelUser = shopRelUserService.getByUserId(userId);
         Optional.ofNullable(shopRelUser).orElseThrow(() -> new ServiceException("未查询到用户关联商户"));
         ShopRelUserVo shopRelUserVo = new ShopRelUserVo();
-        ShopRelUser shopRelUser1 = shopRelUser.stream().filter(s -> s.getIsDefault() == 1).collect(Collectors.toList()).get(0);
+        Optional<ShopRelUser> first = shopRelUser.stream().filter(s -> s.getIsDefault() == 1).findFirst();
+        ShopRelUser shopRelUser1 = null;
+        if(first.isPresent()){
+            shopRelUser1 = first.get();
+        }
+        if(null == shopRelUser1){
+            shopRelUser1 = shopRelUser.get(0);
+        }
         shopRelUserVo.setShopId(shopRelUser1.getShopId());
         shopRelUserVo.setUserName(shopRelUser1.getUserName());
         Shop shop = shopService.getById(shopRelUser1.getShopId());
@@ -451,8 +458,46 @@
      * @param shopId
      * @return
      */
-    @PostMapping("/shop/getFranchiseeIdsBYDealerId")
+    @PostMapping("/getFranchiseeIdsBYDealerId")
     List<Shop> getFranchiseeIdsBYDealerId(@RequestBody Long shopId){
         return shopService.getFranchiseeIdsBYDealerId(shopId);
     }
+
+    /**
+     * 根据shopIds分页查看
+     * @param dto
+     * @return
+     */
+    @PostMapping("/getMgtShopPageVoByShopIds")
+    Page<MgtOneClinkSyncingShopPageVo> getMgtShopPageVoByShopIds(@RequestBody MGtOneClinkSyncingShopPageDTO dto){
+        return  shopService.getMgtShopPageVoByShopIds(dto);
+    }
+
+    /**
+     * 一键同步商户信息
+     */
+    @PostMapping("/updateShopByOneClinkSyncing")
+    R updateShopByOneClinkSyncing(@RequestBody OneClinkSyncing oneClinkSyncing){
+        return shopService.updateShopByOneClinkSyncing(oneClinkSyncing);
+    }
+
+    /**
+     * 根据shopName模糊查询门店集合
+     */
+    @PostMapping("/getShopListByShopName")
+    List<Shop> getShopListByShopName(@RequestBody String content){
+        return  shopService.getBaseMapper().selectList(new LambdaQueryWrapper<Shop>().like(Shop::getShopName, content));
+    }
+    
+    
+    /**
+     * 获取有跟进任务的用户id
+     * @param shopId
+     * @return
+     */
+    @PostMapping("/getMemberIngTotal")
+    public R<List<Integer>> getMemberIngTotal(@RequestParam("shopId") Long shopId){
+        List<Integer> list = memberTaskService.getMemberIngTotal(shopId);
+        return R.ok(list);
+    }
 }

--
Gitblit v1.7.1