From a5c5fc7c86c37519dbe42b148b47ebfc00f89ca9 Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期三, 09 七月 2025 10:56:42 +0800
Subject: [PATCH] bug修改
---
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java | 49 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 39 insertions(+), 10 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 db9e9a5..892640a 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,7 +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.mapper.EntityWrapper;
+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;
@@ -15,8 +16,8 @@
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.vo.ShopProportionVo;
import com.ruoyi.system.api.domain.poji.sys.SysUser;
import com.ruoyi.system.api.domain.vo.*;
import com.ruoyi.system.api.model.QwH5LoginVo;
@@ -32,7 +33,6 @@
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
-import java.util.stream.Stream;
/**
* @author jqs34
@@ -174,17 +174,20 @@
@PostMapping("/getShopByUserId")
public R<ShopRelUserVo> getShopByUserId(@RequestBody Long userId)
{
- ShopRelUser shopRelUser = shopRelUserService.getByUserId(userId);
+ List<ShopRelUser> shopRelUser = shopRelUserService.getByUserId(userId);
Optional.ofNullable(shopRelUser).orElseThrow(() -> new ServiceException("未查询到用户关联商户"));
ShopRelUserVo shopRelUserVo = new ShopRelUserVo();
- shopRelUserVo.setShopId(shopRelUser.getShopId());
- shopRelUserVo.setUserName(shopRelUser.getUserName());
+ ShopRelUser shopRelUser1 = shopRelUser.stream().filter(s -> s.getIsDefault() == 1).collect(Collectors.toList()).get(0);
+ shopRelUserVo.setShopId(shopRelUser1.getShopId());
+ shopRelUserVo.setUserName(shopRelUser1.getUserName());
+ Shop shop = shopService.getById(shopRelUser1.getShopId());
+ shopRelUserVo.setShopName(shop.getShopName());
+ shopRelUserVo.setShopNum(shopRelUser.size());
return R.ok(shopRelUserVo);
}
-
+
@PostMapping("/getShopByBelongUserId")
- public R<ShopRelUserVo> getShopByBelongUserId(@RequestBody Long userId)
- {
+ public R<ShopRelUserVo> getShopByBelongUserId(@RequestBody Long userId) {
List<Shop> shopList = shopService.getShopByBelongUserId(userId);
Optional.ofNullable(shopList.get(0)).orElseThrow(() -> new ServiceException("未查询到商户信息"));
ShopRelUserVo shopRelUserVo = new ShopRelUserVo();
@@ -451,8 +454,34 @@
* @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));
+ }
}
--
Gitblit v1.7.1