From c5d38d650d2ac4101b1293a4f17346e7d5420076 Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期五, 04 七月 2025 20:39:58 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0 --- ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java | 30 ++++++++++++++++++++++++------ 1 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java index 408fcfc..775ab8b 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java @@ -22,15 +22,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; +import java.rmi.server.ServerCloneException; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -170,6 +168,13 @@ } } } + if(null != mgtShopPageDto.getDeptId()){ + R<List<SysUser>> r = sysUserService.getUsersByDeptId(mgtShopPageDto.getDeptId()); + List<Long> collect = r.getData().stream().map(SysUser::getUserId).collect(Collectors.toList()); + List<Shop> shops = shopService.getShopBySysUserIds(collect); + scope.addAll(shops.stream().map(Shop::getShopId).collect(Collectors.toList())); + } + Page<MgtShopPageVo> page = new Page<>(); page.setSize(mgtShopPageDto.getPageSize()); page.setCurrent(mgtShopPageDto.getPageNum()); @@ -223,6 +228,12 @@ } } } + if(null != mgtShopPageDto.getDeptId()){ + R<List<SysUser>> r = sysUserService.getUsersByDeptId(mgtShopPageDto.getDeptId()); + List<Long> collect = r.getData().stream().map(SysUser::getUserId).collect(Collectors.toList()); + List<Shop> shops = shopService.getShopBySysUserIds(collect); + scope.addAll(shops.stream().map(Shop::getShopId).collect(Collectors.toList())); + } List<MgtShopPageVo> mgtShopPageVoList = shopService.pageMgtShop(page,mgtShopPageDto,scope); ExcelUtil<MgtShopPageVo> util = new ExcelUtil<MgtShopPageVo>(MgtShopPageVo.class); util.exportExcel(response, mgtShopPageVoList, "商户列表"); @@ -230,7 +241,7 @@ @RequestMapping(value = "/createMgtShop", method = RequestMethod.POST) @Log(title = "商户管理", businessType = BusinessType.UPDATE,operContent = "编辑商户") - @ApiOperation(value = "平台编辑商户") + @ApiOperation(value = "平台编辑商户【2.0】") public R createMgtShop(@Validated @RequestBody MgtEditShopDto mgtEditShopDto) { Long userId = SecurityUtils.getUserId(); mgtEditShopDto.setUserId(userId); @@ -239,7 +250,7 @@ } @RequestMapping(value = "/getMgtShopInfo", method = RequestMethod.POST) - @ApiOperation(value = "获取商户详情") + @ApiOperation(value = "获取商户详情【2.0】") public R<MgtShopInfoVo> getMgtShopInfo(@RequestBody MgtBaseGetDto mgtBaseGetDto) { MgtShopInfoVo mgtShopInfoVo = shopService.getMgtShopInfo(Long.valueOf(mgtBaseGetDto.getId())); return R.ok(mgtShopInfoVo); @@ -619,4 +630,11 @@ List<Map<String, String>> bankBranchCode = bankBranchCodeService.getBankBranchCode(dto.getBankNumber()); return R.ok(bankBranchCode); } + + @RequestMapping(value = "/changeShopType", method = RequestMethod.GET) + @ApiOperation(value = "修改商户类型(转为经销商,转为加盟商)【2.0】") + public R<Void> changeShopType(@RequestParam Long shopId){ + return shopService.changeShopType(shopId); + } + } -- Gitblit v1.7.1