Просмотр исходного кода

feat: 添加商家端设备管理接口

pangqijun 3 месяцев назад
Родитель
Сommit
bc0a1d46e1
19 измененных файлов с 286 добавлено и 24 удалено
  1. 56 5
      src/main/java/org/springblade/modules/api/controller/ApiFacilityCargoWayController.java
  2. 73 0
      src/main/java/org/springblade/modules/api/controller/ApiFacilityController.java
  3. 8 0
      src/main/java/org/springblade/modules/api/controller/ApiGoodsController.java
  4. 0 16
      src/main/java/org/springblade/modules/api/controller/ApiGrouponController.java
  5. 1 0
      src/main/java/org/springblade/modules/api/controller/ApiMerchantUserController.java
  6. 13 0
      src/main/java/org/springblade/modules/api/controller/BaseController.java
  7. 1 1
      src/main/java/org/springblade/modules/business/controller/FacilityCargoWayController.java
  8. 1 1
      src/main/java/org/springblade/modules/business/controller/FacilityController.java
  9. 7 0
      src/main/java/org/springblade/modules/business/service/IFacilityService.java
  10. 7 0
      src/main/java/org/springblade/modules/business/service/IShopService.java
  11. 46 0
      src/main/java/org/springblade/modules/business/service/impl/FacilityServiceImpl.java
  12. 15 0
      src/main/java/org/springblade/modules/business/service/impl/ShopServiceImpl.java
  13. 16 0
      src/main/java/org/springblade/modules/business/vo/FacilityCargoWayVO.java
  14. 1 0
      src/main/java/org/springblade/modules/system/controller/UserMerchantController.java
  15. 5 0
      src/main/java/org/springblade/modules/system/entity/UserMerchant.java
  16. 9 0
      src/main/java/org/springblade/modules/system/service/IUserMerchantService.java
  17. 15 0
      src/main/java/org/springblade/modules/system/service/impl/UserMerchantServiceImpl.java
  18. 8 1
      src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
  19. 4 0
      src/main/java/org/springblade/modules/system/vo/UserMerchantVO.java

+ 56 - 5
src/main/java/org/springblade/modules/api/controller/ApiFacilityCargoWayController.java

@@ -1,19 +1,32 @@
 package org.springblade.modules.api.controller;
 
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.common.base.BaseEntity;
 import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.modules.business.entity.FacilityCargoWay;
 import org.springblade.modules.business.service.IFacilityCargoWayService;
-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.springblade.modules.business.vo.FacilityCargoWayVO;
+import org.springblade.modules.business.wrapper.FacilityCargoWayWrapper;
+import org.springblade.modules.mall.entity.GoodsInfo;
+import org.springblade.modules.mall.service.IGoodsInfoService;
+import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 @RestController
 @AllArgsConstructor
@@ -22,16 +35,54 @@ import javax.validation.Valid;
 public class ApiFacilityCargoWayController {
 
     private final IFacilityCargoWayService iFacilityCargoWayService;
+    private final IGoodsInfoService iGoodsInfoService;
 
     /**
      * 设置货道商品
      */
     @PostMapping("/goods/setting")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 1)
     @ApiOperation(value = "设置货道商品", notes = "传入facilityCargoWay")
     public R<Void> submit(@Valid @RequestBody FacilityCargoWay facilityCargoWay) {
         return R.status(iFacilityCargoWayService.saveOrUpdate(facilityCargoWay));
     }
 
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "查询货道列表", notes = "传入facilityCargoWay")
+    public R<List<FacilityCargoWayVO>> list(@ApiParam(value = "设备id", required = true) @RequestParam Long facilityId) {
+        List<FacilityCargoWay> list = iFacilityCargoWayService.list(Wrappers.lambdaQuery(FacilityCargoWay.class).eq(FacilityCargoWay::getFacilityId, facilityId));
+        List<FacilityCargoWayVO> vos = FacilityCargoWayWrapper.build().listVO(list);
+        if (CollUtil.isNotEmpty(vos)) {
+            Set<Long> collect = vos.stream().map(FacilityCargoWay::getGoodsId).collect(Collectors.toSet());
+            List<GoodsInfo> goodsInfos = iGoodsInfoService.list(Wrappers.lambdaQuery(GoodsInfo.class).in(BaseEntity::getId, collect));
+            Map<Long, GoodsInfo> map = goodsInfos.stream().collect(Collectors.toMap(BaseEntity::getId, Function.identity()));
+            for (FacilityCargoWayVO vo : vos) {
+                GoodsInfo goodsInfo = map.get(vo.getGoodsId());
+                vo.setGoodsName(goodsInfo.getGoodsName());
+                vo.setGoodsCover(goodsInfo.getGoodsCover());
+            }
+        }
+        return R.data(vos);
+    }
+
+    @PostMapping("/discount/setting")
+    @ApiOperationSupport(order =3 )
+    @ApiOperation(value = "批量设置折扣", notes = "传入facilityCargoWay")
+    public R<Void> discountSetting(@RequestBody FacilityCargoWayVO facilityCargoWay) {
+        List<FacilityCargoWay> list = iFacilityCargoWayService.list(Wrappers.lambdaQuery(FacilityCargoWay.class)
+                .in(BaseEntity::getId, facilityCargoWay.getCargoWayIds()));
+        for (FacilityCargoWay cargoWay : list) {
+            cargoWay.setDiscount(facilityCargoWay.getDiscount());
+        }
+        return R.status(iFacilityCargoWayService.updateBatchById(list));
+    }
 
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "详情", notes = "传入facilityCargoWay")
+    public R<FacilityCargoWayVO> detail(FacilityCargoWay facilityCargoWay) {
+        FacilityCargoWay detail = iFacilityCargoWayService.getOne(Condition.getQueryWrapper(facilityCargoWay));
+        return R.data(FacilityCargoWayWrapper.build().entityVO(detail));
+    }
 }

+ 73 - 0
src/main/java/org/springblade/modules/api/controller/ApiFacilityController.java

@@ -0,0 +1,73 @@
+package org.springblade.modules.api.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.business.entity.Facility;
+import org.springblade.modules.business.service.IFacilityService;
+import org.springblade.modules.business.service.IShopService;
+import org.springblade.modules.business.vo.FacilityVO;
+import org.springblade.modules.business.wrapper.FacilityWrapper;
+import org.springblade.modules.system.service.IUserMerchantService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping(CommonConstant.API_URL + "/facility")
+@Api(value = "设备管理接口", tags = "设备管理接口")
+public class ApiFacilityController extends BaseController {
+
+    private final IFacilityService iFacilityService;
+    private final IShopService iShopService;
+    private final IUserMerchantService iUserMerchantService;
+
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "添加设备", notes = "传入facility")
+    public R<Void> save(@Valid @RequestBody Facility facility) {
+        return R.status(iFacilityService.add(facility));
+    }
+
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "查询设备列表", notes = "传入facility")
+    public R<IPage<FacilityVO>> list(Query query) {
+        LambdaQueryWrapper<Facility> wrapper = Wrappers.lambdaQuery(Facility.class);
+        if (isMerchant()) {
+            List<Long> merchantShopIds = iShopService.getMerchantShopIds(AuthUtil.getUserId());
+            if (CollUtil.isEmpty(merchantShopIds)) {
+                return R.data(new Page<>());
+            }
+            wrapper.in(Facility::getShopId, merchantShopIds);
+        } else {
+            List<Long> authShopId = iUserMerchantService.getAuthShopId(AuthUtil.getUserId());
+            wrapper.in(Facility::getShopId, authShopId);
+        }
+        IPage<Facility> pages = iFacilityService.page(Condition.getPage(query), wrapper);
+        return R.data(FacilityWrapper.build().pageVO(pages));
+    }
+
+    @PostMapping("/delete")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "删除设备", notes = "传入ids")
+    public R<Void> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(iFacilityService.removeByIds(Func.toLongList(ids)));
+    }
+
+}

+ 8 - 0
src/main/java/org/springblade/modules/api/controller/ApiGoodsController.java

@@ -105,4 +105,12 @@ public class ApiGoodsController extends BladeController {
         return R.data(goods);
     }
 
+    @GetMapping("/goods/detail")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "商品详情", notes = "传入goodsInfo")
+    public R<GoodsInfoVO> detail(GoodsInfo goodsInfo) {
+        GoodsInfo detail = goodsInfoService.detail(goodsInfo.getId());
+        return R.data(GoodsInfoWrapper.build().entityVO(detail));
+    }
+
 }

+ 0 - 16
src/main/java/org/springblade/modules/api/controller/ApiGrouponController.java

@@ -95,22 +95,6 @@ public class ApiGrouponController {
         return R.data(grouponService.detail(grouponId));
     }
 
-    @GetMapping("/goods/detail")
-    @ApiOperationSupport(order = 4)
-    @ApiOperation(value = "商品详情接口", notes = "传入商品id")
-    public R<GoodsInfoVO> detail(@RequestParam("id") Long id, @RequestParam("grouponId") Long grouponId) {
-        GoodsInfo detail = goodsInfoService.detail(id);
-        GoodsInfoVO goodsInfoVO = GoodsInfoWrapper.build().entityVO(detail);
-        // 增加浏览量
-        detail.setTotalViews(detail.getTotalViews() + 1);
-        goodsInfoService.updateById(detail);
-
-        GrouponGoods one = grouponGoodsService.lambdaQuery().eq(GrouponGoods::getGrouponId, grouponId).eq(GrouponGoods::getGoodsId, id).one();
-        Assert.notNull(one, "未查询到团购商品数据");
-        goodsInfoVO.setGrouponPrice(one.getGrouponPrice());
-        return R.data(goodsInfoVO);
-    }
-
     @PostMapping("/groupon/publish")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "发布团购", notes = "传入groupon")

+ 1 - 0
src/main/java/org/springblade/modules/api/controller/ApiMerchantUserController.java

@@ -84,6 +84,7 @@ public class ApiMerchantUserController {
         userMerchant.setUserId(user.getId());
         userMerchant.setParentId(AuthUtil.getUserId());
         userMerchant.setAuditStatus(AuditStatusEnum.PASS.getValue());
+        userMerchant.setAuthShop(request.getAuthShopIds());
         iUserMerchantService.save(userMerchant);
 
         return R.success("添加成功");

+ 13 - 0
src/main/java/org/springblade/modules/api/controller/BaseController.java

@@ -0,0 +1,13 @@
+package org.springblade.modules.api.controller;
+
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.secure.utils.AuthUtil;
+
+public class BaseController extends BladeController {
+
+    public boolean isMerchant() {
+        Long parentId = AuthUtil.getUser().getDetail().getLong("parentId");
+        return parentId == 0;
+    }
+
+}

+ 1 - 1
src/main/java/org/springblade/modules/business/controller/FacilityCargoWayController.java

@@ -43,7 +43,7 @@ import javax.validation.Valid;
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("blade-demo/facilitycargoway")
+@RequestMapping("facilitycargoway")
 @Api(value = "售货机货表", tags = "售货机货表接口")
 public class FacilityCargoWayController extends BladeController {
 

+ 1 - 1
src/main/java/org/springblade/modules/business/controller/FacilityController.java

@@ -90,7 +90,7 @@ public class FacilityController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入facility")
 	public R save(@Valid @RequestBody Facility facility) {
-		return R.status(facilityService.save(facility));
+		return R.status(facilityService.add(facility));
 	}
 
 	/**

+ 7 - 0
src/main/java/org/springblade/modules/business/service/IFacilityService.java

@@ -48,4 +48,11 @@ public interface IFacilityService extends IService<Facility> {
 	 * @return 商品列表
 	 */
     List<GoodsInfoVO> getGoods(Long deviceId);
+
+	/**
+	 * 添加设备
+	 * @param facility
+	 * @return
+	 */
+	Boolean add(Facility facility);
 }

+ 7 - 0
src/main/java/org/springblade/modules/business/service/IShopService.java

@@ -21,6 +21,8 @@ import org.springblade.modules.business.vo.ShopVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.List;
+
 /**
  * 门店表 服务类
  *
@@ -38,4 +40,9 @@ public interface IShopService extends IService<Shop> {
 	 */
 	IPage<ShopVO> selectShopPage(IPage<ShopVO> page, ShopVO shop);
 
+	/**
+	 * 获取商家下所有门店的id集合
+	 */
+	List<Long> getMerchantShopIds(Long userId);
+
 }

+ 46 - 0
src/main/java/org/springblade/modules/business/service/impl/FacilityServiceImpl.java

@@ -16,7 +16,12 @@
  */
 package org.springblade.modules.business.service.impl;
 
+import lombok.AllArgsConstructor;
+import org.springblade.common.enums.StatusEnum;
 import org.springblade.modules.business.entity.Facility;
+import org.springblade.modules.business.entity.FacilityCargoWay;
+import org.springblade.modules.business.mapper.FacilityCargoWayMapper;
+import org.springblade.modules.business.service.IFacilityCargoWayService;
 import org.springblade.modules.business.vo.FacilityVO;
 import org.springblade.modules.business.mapper.FacilityMapper;
 import org.springblade.modules.business.service.IFacilityService;
@@ -25,7 +30,10 @@ import org.springblade.modules.mall.entity.GoodsInfo;
 import org.springblade.modules.mall.vo.GoodsInfoVO;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -37,6 +45,9 @@ import java.util.List;
 @Service
 public class FacilityServiceImpl extends ServiceImpl<FacilityMapper, Facility> implements IFacilityService {
 
+	@Resource
+	private IFacilityCargoWayService iFacilityCargoWayService;
+
 	@Override
 	public IPage<FacilityVO> selectFacilityPage(IPage<FacilityVO> page, FacilityVO facility) {
 		return page.setRecords(baseMapper.selectFacilityPage(page, facility));
@@ -47,4 +58,39 @@ public class FacilityServiceImpl extends ServiceImpl<FacilityMapper, Facility> i
 		return baseMapper.selectGoods(deviceId);
 	}
 
+	@Transactional
+	@Override
+	public Boolean add(Facility facility) {
+		this.save(facility);
+		List<FacilityCargoWay> list = new ArrayList<>();
+
+		for (int i = 1; i <= this.getCargoQuantity(); i++) {
+			FacilityCargoWay facilityCargoWay = new FacilityCargoWay();
+			facilityCargoWay.setFacilityId(facility.getId());
+			facilityCargoWay.setCargoNo(i + "");
+			facilityCargoWay.setVolume(this.getCargoCapacity());
+			facilityCargoWay.setCargoStatus(StatusEnum.ENABLE.getValue());
+			facilityCargoWay.setEnable(StatusEnum.ENABLE.getValue());
+			facilityCargoWay.setDiscount(0.0);
+			list.add(facilityCargoWay);
+		}
+
+		// 生成货道信息
+		return iFacilityCargoWayService.saveBatch(list);
+	}
+
+	/**
+	 * 获取货道数量
+	 */
+	private Integer getCargoQuantity() {
+		return 8;
+	}
+
+	/**
+	 * 获取货道容量
+	 */
+	private Integer getCargoCapacity() {
+		return 8;
+	}
+
 }

+ 15 - 0
src/main/java/org/springblade/modules/business/service/impl/ShopServiceImpl.java

@@ -16,6 +16,9 @@
  */
 package org.springblade.modules.business.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.common.base.BaseEntity;
 import org.springblade.modules.business.entity.Shop;
 import org.springblade.modules.business.vo.ShopVO;
 import org.springblade.modules.business.mapper.ShopMapper;
@@ -24,6 +27,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * 门店表 服务实现类
  *
@@ -38,4 +44,13 @@ public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements IS
 		return page.setRecords(baseMapper.selectShopPage(page, shop));
 	}
 
+	@Override
+	public List<Long> getMerchantShopIds(Long userId) {
+		List<Shop> shops = baseMapper.selectList(Wrappers.lambdaQuery(Shop.class).eq(Shop::getMerchantId, userId));
+		if (CollUtil.isNotEmpty(shops)) {
+			return shops.stream().map(BaseEntity::getId).collect(Collectors.toList());
+		}
+		return null;
+	}
+
 }

+ 16 - 0
src/main/java/org/springblade/modules/business/vo/FacilityCargoWayVO.java

@@ -16,11 +16,14 @@
  */
 package org.springblade.modules.business.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.springblade.modules.business.entity.FacilityCargoWay;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 
+import java.util.List;
+
 /**
  * 售货机货表视图实体类
  *
@@ -33,4 +36,17 @@ import io.swagger.annotations.ApiModel;
 public class FacilityCargoWayVO extends FacilityCargoWay {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 商品名称
+	 */
+	@ApiModelProperty(value = "商品名称")
+	private String goodsName;
+	/**
+	 * 商品图片
+	 */
+	@ApiModelProperty(value = "商品图片")
+	private String goodsCover;
+
+	@ApiModelProperty(value = "货道id集合")
+	private List<Long> cargoWayIds;
 }

+ 1 - 0
src/main/java/org/springblade/modules/system/controller/UserMerchantController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.system.controller;
 
+import cn.hutool.core.collection.CollUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;

+ 5 - 0
src/main/java/org/springblade/modules/system/entity/UserMerchant.java

@@ -80,6 +80,11 @@ public class UserMerchant implements Serializable {
 	 */
 	@ApiModelProperty(value = "授权门店")
 	private String authShop;
+	/**
+	 * 授权门店描述
+	 */
+	@ApiModelProperty(value = "授权门店描述")
+	private String authShopDesc;
 	/**
 	 * 审核状态 1-已审核 0-待审核
 	 */

+ 9 - 0
src/main/java/org/springblade/modules/system/service/IUserMerchantService.java

@@ -21,6 +21,8 @@ import org.springblade.modules.system.vo.UserMerchantVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.List;
+
 /**
  * 商家用户表 服务类
  *
@@ -45,4 +47,11 @@ public interface IUserMerchantService extends IService<UserMerchant> {
 	 */
 	UserMerchantVO getByUserId(Long userId);
 
+	/**
+	 * 获取授权门店
+	 * @param userId
+	 * @return
+	 */
+	List<Long> getAuthShopId(Long userId);
+
 }

+ 15 - 0
src/main/java/org/springblade/modules/system/service/impl/UserMerchantServiceImpl.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.system.service.impl;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springblade.modules.system.entity.UserMerchant;
 import org.springblade.modules.system.vo.UserMerchantVO;
@@ -26,6 +27,9 @@ import org.springblade.modules.system.wrapper.UserMerchantWrapper;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * 商家用户表 服务实现类
  *
@@ -46,4 +50,15 @@ public class UserMerchantServiceImpl extends ServiceImpl<UserMerchantMapper, Use
 		return UserMerchantWrapper.build().entityVO(one);
 	}
 
+	@Override
+	public List<Long> getAuthShopId(Long userId) {
+		UserMerchant one = getOne(Wrappers.lambdaQuery(UserMerchant.class).eq(UserMerchant::getUserId, userId));
+		String[] split = one.getAuthShop().split(",");
+		List<Long> ids = new ArrayList<>();
+		for (String s : split) {
+			ids.add(Long.parseLong(s));
+		}
+		return ids;
+	}
+
 }

+ 8 - 1
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java

@@ -49,6 +49,7 @@ import org.springblade.modules.system.mapper.UserMapper;
 import org.springblade.modules.system.service.*;
 import org.springblade.modules.system.vo.UserAppVO;
 import org.springblade.modules.system.vo.UserLvVo;
+import org.springblade.modules.system.vo.UserMerchantVO;
 import org.springblade.modules.system.vo.UserVO;
 import org.springblade.modules.system.wrapper.UserWrapper;
 import org.springframework.stereotype.Service;
@@ -80,9 +81,10 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 	private IApiService apiService;
 	@Resource
 	private BladeTenantProperties tenantProperties;
-
 	@Resource
 	private UserAppService userAppService;
+	@Resource
+	private IUserMerchantService iUserMerchantService;
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
@@ -272,6 +274,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 				//是否用于预收款付款、特殊账号
 				detail.set("enableAuth", query.getEnableAuth());
 			}
+		} else if (userEnum == UserEnum.MERCHANT) {
+			UserMerchantVO vo = iUserMerchantService.getByUserId(user.getId());
+			if (vo != null) {
+				detail.set("parentId", vo.getParentId());
+			}
 		} else {
 			UserOther userOther = new UserOther();
 			UserOther query = userOther.selectOne(Wrappers.<UserOther>lambdaQuery().eq(UserOther::getUserId, user.getId()));

+ 4 - 0
src/main/java/org/springblade/modules/system/vo/UserMerchantVO.java

@@ -53,4 +53,8 @@ public class UserMerchantVO extends UserMerchant {
 	 * 子账号id
 	 */
 	private Long childAccountId;
+	/**
+	 * 授权门店描述
+	 */
+	private String authShopDesc;
 }