2 Коміти 210656c161 ... f402bc58d9

Автор SHA1 Опис Дата
  pangqijun f402bc58d9 feat: 货道管理接口 3 місяців тому
  pangqijun bc0a1d46e1 feat: 添加商家端设备管理接口 3 місяців тому
25 змінених файлів з 332 додано та 37 видалено
  1. 1 1
      src/main/java/org/springblade/common/enums/OrderTypeEnum.java
  2. 64 5
      src/main/java/org/springblade/modules/api/controller/ApiFacilityCargoWayController.java
  3. 73 0
      src/main/java/org/springblade/modules/api/controller/ApiFacilityController.java
  4. 14 0
      src/main/java/org/springblade/modules/api/controller/ApiGoodsController.java
  5. 0 16
      src/main/java/org/springblade/modules/api/controller/ApiGrouponController.java
  6. 13 0
      src/main/java/org/springblade/modules/api/controller/ApiMerchantUserController.java
  7. 13 0
      src/main/java/org/springblade/modules/api/controller/BaseController.java
  8. 1 1
      src/main/java/org/springblade/modules/business/controller/FacilityCargoWayController.java
  9. 1 1
      src/main/java/org/springblade/modules/business/controller/FacilityController.java
  10. 6 6
      src/main/java/org/springblade/modules/business/entity/FacilityCargoWay.java
  11. 2 1
      src/main/java/org/springblade/modules/business/mapper/FacilityMapper.java
  12. 5 1
      src/main/java/org/springblade/modules/business/mapper/FacilityMapper.xml
  13. 7 0
      src/main/java/org/springblade/modules/business/service/IFacilityService.java
  14. 7 0
      src/main/java/org/springblade/modules/business/service/IShopService.java
  15. 47 1
      src/main/java/org/springblade/modules/business/service/impl/FacilityServiceImpl.java
  16. 15 0
      src/main/java/org/springblade/modules/business/service/impl/ShopServiceImpl.java
  17. 16 0
      src/main/java/org/springblade/modules/business/vo/FacilityCargoWayVO.java
  18. 1 1
      src/main/java/org/springblade/modules/finance/service/impl/OrderGoodsServiceImpl.java
  19. 2 0
      src/main/java/org/springblade/modules/mall/vo/GoodsInfoVO.java
  20. 1 0
      src/main/java/org/springblade/modules/system/controller/UserMerchantController.java
  21. 7 2
      src/main/java/org/springblade/modules/system/entity/UserMerchant.java
  22. 9 0
      src/main/java/org/springblade/modules/system/service/IUserMerchantService.java
  23. 15 0
      src/main/java/org/springblade/modules/system/service/impl/UserMerchantServiceImpl.java
  24. 8 1
      src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
  25. 4 0
      src/main/java/org/springblade/modules/system/vo/UserMerchantVO.java

+ 1 - 1
src/main/java/org/springblade/common/enums/OrderTypeEnum.java

@@ -9,7 +9,7 @@ import org.springblade.core.log.exception.ServiceException;
 @Getter
 public enum OrderTypeEnum {
 	NORMAL("拼团订单", 1, "grouponOrderServiceImpl"),
-	GOODS("商品订单", 2, "grouponOrderServiceImpl");
+	GOODS("商品订单", 2, "orderGoodsServiceImpl");
 
 	private String name;
 	private Integer value;

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

@@ -1,19 +1,33 @@
 package org.springblade.modules.api.controller;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.lang.Assert;
+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 +36,61 @@ 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) {
+        FacilityCargoWay cargoWay = iFacilityCargoWayService.getById(facilityCargoWay.getId());
+        Assert.notNull(cargoWay, "未查询到货道信息");
+        if (facilityCargoWay.getGoodsStore() > cargoWay.getVolume()) {
+            return R.fail("商品数量不能大于货道容量");
+        }
         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());
+                if (goodsInfo != null) {
+                    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)));
+    }
+
+}

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

@@ -22,6 +22,8 @@ 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.api.request.GoodsListRequest;
+import org.springblade.modules.business.entity.FacilityCargoWay;
+import org.springblade.modules.business.service.IFacilityCargoWayService;
 import org.springblade.modules.business.service.IFacilityService;
 import org.springblade.modules.mall.entity.CategoryInfo;
 import org.springblade.modules.mall.entity.GoodsInfo;
@@ -50,6 +52,7 @@ public class ApiGoodsController extends BladeController {
     private final ICategoryInfoService categoryInfoService;
     private final IGoodsInfoService goodsInfoService;
     private final IFacilityService iFacilityService;
+    private final IFacilityCargoWayService iFacilityCargoWayService;
 
     @GetMapping("/category/list")
     @ApiOperationSupport(order = 1)
@@ -105,4 +108,15 @@ public class ApiGoodsController extends BladeController {
         return R.data(goods);
     }
 
+    @GetMapping("/goods/detail")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "商品详情", notes = "传入goodsInfo")
+    public R<GoodsInfoVO> detail(GoodsInfoVO goodsInfo) {
+        GoodsInfo detail = goodsInfoService.detail(goodsInfo.getId());
+        FacilityCargoWay cargoWay = iFacilityCargoWayService.getById(goodsInfo.getCargoWayId());
+        Assert.notNull(cargoWay, "未查询到货道信息");
+        detail.setSalePrice(cargoWay.getSalePrice());
+        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")

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

@@ -58,6 +58,18 @@ public class ApiMerchantUserController {
         return R.data(vo);
     }
 
+    @PostMapping("/merchant/update")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "更新用户信息")
+    public R<Void> updateUserInfo(@RequestBody UserMerchantVO userMerchantVO) {
+        User user = iUserService.getById(AuthUtil.getUserId());
+        Assert.notNull(user, "未查询到用户信息");
+//        UserMerchantVO vo = iUserMerchantService.getByUserId(AuthUtil.getUserId());
+//        Assert.notNull(user, "未查询到商户信息");
+        user.setAvatar(userMerchantVO.getAvatar());
+        return R.status(iUserService.updateById(user));
+    }
+
     @PostMapping("/addChildAccount")
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "添加子账号", notes = "传入userMerchant")
@@ -84,6 +96,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));
 	}
 
 	/**

+ 6 - 6
src/main/java/org/springblade/modules/business/entity/FacilityCargoWay.java

@@ -51,32 +51,32 @@ public class FacilityCargoWay extends BaseEntity {
     /**
      * 商品id
      */
-    @ApiModelProperty(name = "商品id")
+    @ApiModelProperty(value = "商品id")
     private Long goodsId;
     /**
      * 售价
      */
-    @ApiModelProperty(name = "售价")
+    @ApiModelProperty(value = "售价")
     private BigDecimal salePrice;
     /**
      * 折扣
      */
-    @ApiModelProperty(name = "折扣")
+    @ApiModelProperty(value = "折扣")
     private Double discount;
     /**
      * 商品库存
      */
-    @ApiModelProperty(name = "商品库存")
+    @ApiModelProperty(value = "商品库存")
     private Integer goodsStore;
     /**
      * 货道总交易数量
      */
-    @ApiModelProperty(name = "货道总交易数量")
+    @ApiModelProperty(value = "货道总交易数量")
     private Integer totalTrade;
     /**
      * 货道总交易金额
      */
-    @ApiModelProperty(name = "货道总交易金额")
+    @ApiModelProperty(value = "货道总交易金额")
     private BigDecimal totalAmount;
 
     public Double getDiscount() {

+ 2 - 1
src/main/java/org/springblade/modules/business/mapper/FacilityMapper.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.business.mapper;
 
+import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.business.entity.Facility;
 import org.springblade.modules.business.vo.FacilityVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -42,5 +43,5 @@ public interface FacilityMapper extends BaseMapper<Facility> {
 	 */
 	List<FacilityVO> selectFacilityPage(IPage page, FacilityVO facility);
 
-    List<GoodsInfoVO> selectGoods(Long deviceId);
+    List<GoodsInfoVO> selectGoods(@Param("deviceId") Long deviceId, @Param("cargoWayId") Long cargoWayId);
 }

+ 5 - 1
src/main/java/org/springblade/modules/business/mapper/FacilityMapper.xml

@@ -33,11 +33,15 @@
             fcw.goods_store totalStock,
             fcw.discount,
             fcw.sale_price,
-            fcw.id cargoWayId
+            fcw.id cargoWayId,
+            fcw.cargo_no cargoWayNo
         FROM
             t_facility_cargo_way fcw
                 JOIN t_goods_info gi ON fcw.goods_id = gi.id
         where fcw.facility_id = #{deviceId}
+        <if test="cargoWayId != null">
+            and fcw.id = #{cargoWayId}
+        </if>
     </select>
 
 </mapper>

+ 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);
+
 }

+ 47 - 1
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));
@@ -44,7 +55,42 @@ public class FacilityServiceImpl extends ServiceImpl<FacilityMapper, Facility> i
 
 	@Override
 	public List<GoodsInfoVO> getGoods(Long deviceId) {
-		return baseMapper.selectGoods(deviceId);
+		return baseMapper.selectGoods(deviceId, null);
+	}
+
+	@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 - 1
src/main/java/org/springblade/modules/finance/service/impl/OrderGoodsServiceImpl.java

@@ -31,7 +31,7 @@ import java.math.BigDecimal;
  * @since 2024-07-17
  */
 @AllArgsConstructor
-@Service
+@Service("orderGoodsServiceImpl")
 public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGoods> implements IOrderGoodsService, SubmitOrderService {
 
 	private final IOrderService iOrderService;

+ 2 - 0
src/main/java/org/springblade/modules/mall/vo/GoodsInfoVO.java

@@ -53,6 +53,8 @@ public class GoodsInfoVO extends GoodsInfo {
 
 	@ApiModelProperty(value = "货道id")
 	private Long cargoWayId;
+	@ApiModelProperty(value = "货道编号")
+	private String cargoWayNo;
 
 	public String getAuditStatusDesc() {
 		return AuditStatusEnum.getNameByValue(this.getAuditStatus());

+ 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;

+ 7 - 2
src/main/java/org/springblade/modules/system/entity/UserMerchant.java

@@ -53,12 +53,12 @@ public class UserMerchant implements Serializable {
 	/**
 	 * 银行卡号
 	 */
-	@ApiModelProperty(name = "银行卡号")
+	@ApiModelProperty(value = "银行卡号")
 	private String bankCardNumber;
 	/**
 	 * 开户行
 	 */
-	@ApiModelProperty(name = "开户行")
+	@ApiModelProperty(value = "开户行")
 	private String openingBank;
 	/**
 	* 地址
@@ -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;
 }