소스 검색

接口归类

LuoDLeo 3 달 전
부모
커밋
678c9e244b

+ 65 - 0
src/main/java/org/springblade/modules/api/controller/ApiMerchantOrderController.java

@@ -0,0 +1,65 @@
+package org.springblade.modules.api.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+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 lombok.AllArgsConstructor;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.log.annotation.ApiLog;
+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.modules.finance.entity.Order;
+import org.springblade.modules.finance.entity.OrderGoods;
+import org.springblade.modules.finance.service.IOrderGoodsService;
+import org.springblade.modules.finance.service.IOrderService;
+import org.springblade.modules.finance.vo.MerchantDetailOrderVO;
+import org.springblade.modules.finance.vo.MerchantPageOrderVO;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 商家端
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping(CommonConstant.API_URL + "/orderShop")
+@Api(value = "商品订单接口-商家", tags = "商品订单接口-商家")
+public class ApiMerchantOrderController {
+
+    private final IOrderGoodsService iOrderGoodsService;
+    private final IOrderService iOrderService;
+
+    @ApiLog("订单列表(订单管理)")
+    @PostMapping("/pageOrder")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "订单列表(订单管理)")
+    public R<IPage<MerchantPageOrderVO>> getMerchantOrder(MerchantPageOrderVO merchantPageOrderVO, Query query) {
+        merchantPageOrderVO.setUserId(AuthUtil.getUserId());
+        IPage<MerchantPageOrderVO> pages = iOrderGoodsService.getMerchantOrder(Condition.getPage(query), merchantPageOrderVO);
+        return R.data(pages);
+    }
+
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "获取订单详情")
+    public R<MerchantDetailOrderVO> detail(Long orderId) {
+        Order order = iOrderService.getById(orderId);
+        Assert.notNull(order, "未查询到订单信息");
+        OrderGoods orderGoods = iOrderGoodsService.getOne(Wrappers.lambdaQuery(OrderGoods.class)
+                .eq(OrderGoods::getOrderId, orderId));
+        Assert.notNull(orderGoods, "未查询到商品订单信息");
+        MerchantDetailOrderVO merchantDetailOrderVO = new MerchantDetailOrderVO();
+        BeanUtil.copyProperties(order,merchantDetailOrderVO);
+        return R.data(merchantDetailOrderVO);
+    }
+
+
+}

+ 0 - 10
src/main/java/org/springblade/modules/api/controller/ApiOrderController.java

@@ -3,7 +3,6 @@ package org.springblade.modules.api.controller;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.enums.AfterSalesTypeEnum;
 import org.springblade.common.enums.OrderStateEnum;
@@ -18,7 +17,6 @@ import org.springblade.modules.api.request.GroupOrderRequest;
 import org.springblade.modules.api.request.SubmitOrderRequest;
 import org.springblade.modules.api.response.GrouponOrderResponse;
 import org.springblade.modules.api.response.SubmitOrderResponse;
-import org.springblade.modules.api.response.UserOrderDetailResponse;
 import org.springblade.modules.api.service.SubmitOrderService;
 import org.springblade.modules.api.service.impl.GrouponOrderServiceImpl;
 import org.springblade.modules.finance.entity.Order;
@@ -76,14 +74,6 @@ public class ApiOrderController extends BladeController {
         return R.data(grouponOrderService.getGroupOrderData(request));
     }
 
-    @GetMapping("/user/detail")
-    @ApiOperationSupport(order = 4)
-    @ApiOperation(value = "获取用户订单详情")
-    public R<UserOrderDetailResponse> getUserOrderDetail(Long orderId, @RequestParam(required = false) Long afterSalesId,
-                                                         @ApiParam("经度") Double longitude, @ApiParam("纬度") Double latitude) {
-        return R.data(orderService.getUserOrderDetail(orderId, afterSalesId, longitude, latitude));
-    }
-
     @PostMapping("cancel")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "取消订单", notes = "传入订单号")

+ 4 - 4
src/main/java/org/springblade/modules/api/controller/ApiOrderGoodsController.java

@@ -17,7 +17,7 @@ import org.springblade.modules.finance.entity.Order;
 import org.springblade.modules.finance.entity.OrderGoods;
 import org.springblade.modules.finance.service.IOrderGoodsService;
 import org.springblade.modules.finance.service.IOrderService;
-import org.springblade.modules.finance.vo.MerchantOrderVO;
+import org.springblade.modules.finance.vo.MerchantPageOrderVO;
 import org.springblade.modules.finance.vo.OrderGoodsVO;
 import org.springblade.modules.finance.wrapper.OrderGoodsWrapper;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -52,9 +52,9 @@ public class ApiOrderGoodsController {
     @PostMapping("/getMerchantOrder")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "通用下单")
-    public R<IPage<MerchantOrderVO>> getMerchantOrder(MerchantOrderVO merchantOrderVO, Query query) {
-        merchantOrderVO.setUserId(AuthUtil.getUserId());
-        IPage<MerchantOrderVO> pages = iOrderGoodsService.getMerchantOrder(Condition.getPage(query), merchantOrderVO);
+    public R<IPage<MerchantPageOrderVO>> getMerchantOrder(MerchantPageOrderVO merchantPageOrderVO, Query query) {
+        merchantPageOrderVO.setUserId(AuthUtil.getUserId());
+        IPage<MerchantPageOrderVO> pages = iOrderGoodsService.getMerchantOrder(Condition.getPage(query), merchantPageOrderVO);
         return R.data(pages);
     }
 

+ 2 - 2
src/main/java/org/springblade/modules/finance/mapper/OrderGoodsMapper.java

@@ -18,7 +18,7 @@ package org.springblade.modules.finance.mapper;
 
 import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.finance.entity.OrderGoods;
-import org.springblade.modules.finance.vo.MerchantOrderVO;
+import org.springblade.modules.finance.vo.MerchantPageOrderVO;
 import org.springblade.modules.finance.vo.OrderGoodsVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -49,6 +49,6 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
 	 */
     List<OrderGoodsVO> selectUserOrder(IPage<OrderGoodsVO> page, @Param("p") OrderGoodsVO orderGoods);
 
-    List<MerchantOrderVO> getMerchantOrder(IPage page, @Param("param") MerchantOrderVO merchantOrderVO);
+    List<MerchantPageOrderVO> getMerchantOrder(IPage page, @Param("param") MerchantPageOrderVO merchantPageOrderVO);
 
 }

+ 1 - 1
src/main/java/org/springblade/modules/finance/mapper/OrderGoodsMapper.xml

@@ -48,7 +48,7 @@
         WHERE o.is_delete = 0 and o.user_id = #{p.userId}
     </select>
 
-    <select id="getMerchantOrder" resultType="org.springblade.modules.finance.vo.MerchantOrderVO">
+    <select id="getMerchantOrder" resultType="org.springblade.modules.finance.vo.MerchantPageOrderVO">
         SELECT
             og.*,
             o.order_state,

+ 2 - 2
src/main/java/org/springblade/modules/finance/service/IOrderGoodsService.java

@@ -17,7 +17,7 @@
 package org.springblade.modules.finance.service;
 
 import org.springblade.modules.finance.entity.OrderGoods;
-import org.springblade.modules.finance.vo.MerchantOrderVO;
+import org.springblade.modules.finance.vo.MerchantPageOrderVO;
 import org.springblade.modules.finance.vo.OrderGoodsVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -47,6 +47,6 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
 	 */
 	IPage<OrderGoodsVO> selectUserOrder(IPage<OrderGoodsVO> page, OrderGoodsVO orderGoods);
 
-    IPage<MerchantOrderVO> getMerchantOrder(IPage<MerchantOrderVO> page, MerchantOrderVO merchantOrderVO);
+    IPage<MerchantPageOrderVO> getMerchantOrder(IPage<MerchantPageOrderVO> page, MerchantPageOrderVO merchantPageOrderVO);
 
 }

+ 3 - 3
src/main/java/org/springblade/modules/finance/service/impl/OrderGoodsServiceImpl.java

@@ -12,7 +12,7 @@ import org.springblade.modules.business.service.IShopService;
 import org.springblade.modules.finance.entity.Order;
 import org.springblade.modules.finance.entity.OrderGoods;
 import org.springblade.modules.finance.service.IOrderService;
-import org.springblade.modules.finance.vo.MerchantOrderVO;
+import org.springblade.modules.finance.vo.MerchantPageOrderVO;
 import org.springblade.modules.finance.vo.OrderGoodsVO;
 import org.springblade.modules.finance.mapper.OrderGoodsMapper;
 import org.springblade.modules.finance.service.IOrderGoodsService;
@@ -51,8 +51,8 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
 	}
 
 	@Override
-	public IPage<MerchantOrderVO> getMerchantOrder(IPage page, MerchantOrderVO merchantOrderVO){
-		return page.setRecords(baseMapper.getMerchantOrder(page, merchantOrderVO));
+	public IPage<MerchantPageOrderVO> getMerchantOrder(IPage page, MerchantPageOrderVO merchantPageOrderVO){
+		return page.setRecords(baseMapper.getMerchantOrder(page, merchantPageOrderVO));
 	}
 
 	@Transactional

+ 21 - 0
src/main/java/org/springblade/modules/finance/vo/MerchantDetailOrderVO.java

@@ -0,0 +1,21 @@
+package org.springblade.modules.finance.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.finance.entity.Order;
+
+/**
+ * 商家端订单详情对象-商家
+ *
+ * @author BladeXorderStateDesc
+ * @since 2023-02-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "商家端订单详情对象", description = "商家端订单详情对象")
+public class MerchantDetailOrderVO extends Order {
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 2 - 2
src/main/java/org/springblade/modules/finance/vo/MerchantOrderVO.java → src/main/java/org/springblade/modules/finance/vo/MerchantPageOrderVO.java

@@ -31,8 +31,8 @@ import org.springblade.modules.finance.entity.Order;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@ApiModel(value = "MerchantOrderVO对象", description = "订单主表")
-public class MerchantOrderVO extends Order {
+@ApiModel(value = "商家端订单分页参数对象", description = "商家端订单分页参数对象")
+public class MerchantPageOrderVO extends Order {
 
     private static final long serialVersionUID = 1L;