Helius
2020-12-24 76f93da5aabffcd237be71e21c3ad7e8eb991804
zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java
@@ -9,8 +9,10 @@
import com.matrix.system.app.dto.OrderListDto;
import com.matrix.system.app.dto.ShoppingGoodsListDto;
import com.matrix.system.app.vo.OrderDetailVo;
import com.matrix.system.app.vo.ShoppingGoodsDetailVo;
import com.matrix.system.app.vo.ShoppingGoodsListVo;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.bean.ShoppingGoodsCategory;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hive.pojo.ShoppingCarItem;
@@ -70,6 +72,20 @@
        return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto));
    }
    @ApiOperation(value = "获取商品详情", notes = "获取商品详情")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = ShoppingGoodsDetailVo.class)
    })
    @GetMapping(value = "/findGoodsDetailById/{goodsId}")
    public AjaxResult findGoodsDetailById(@PathVariable("goodsId") Long goodsId) {
        ShoppingGoodsDetailVo goodsDetail = shoppingGoodsService.findApiShoppingGoodsDetailById(goodsId);
        AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功");
        ajaxResult.putInMap("goods", goodsDetail);
        return ajaxResult;
    }
    @ApiOperation(value = "创建订单", notes = "创建订单")
    @PostMapping(value = "/createOrder")
    public AjaxResult createOrder(@RequestBody @Validated CreateOrderDto createOrderDto) {
@@ -113,13 +129,22 @@
        pageVo.setOffset(offset);
        pageVo.setLimit(limit);
        orderListDto.setShopId(user.getShopId());
        if (!DataAuthUtil.hasAllShopAuth()) {
            orderListDto.setShopId(user.getShopId());
        }
        return AjaxResult.buildSuccessInstance(sysOrderService.findApiOrderListInPage(orderListDto, pageVo), sysOrderService.findApiOrderListTotal(orderListDto));
    }
    @ApiOperation(value = "获取订单详情", notes = "获取订单详情")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = OrderDetailVo.class)
    })
    @GetMapping(value = "/findOrderDetail/{orderId}")
    public AjaxResult findOrderDetail(@PathVariable("orderId") Long orderId) {
        return null;
        OrderDetailVo orderDetail = sysOrderService.findApiOrderDetailByOrderId(orderId);
        AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功");
        ajaxResult.putInMap("orderDetail", orderDetail);
        return ajaxResult;
    }
}
}