|
@@ -2,6 +2,7 @@ package com.citu.module.trade.controller.app.order;
|
|
|
|
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
|
import com.citu.framework.common.pojo.PageResult;
|
|
|
+import com.citu.framework.security.core.annotations.PreAuthenticated;
|
|
|
import com.citu.module.pay.api.notify.dto.PayOrderNotifyReqDTO;
|
|
|
import com.citu.module.trade.controller.app.order.vo.*;
|
|
|
import com.citu.module.trade.controller.app.order.vo.item.AppTradeOrderItemCommentCreateReqVO;
|
|
@@ -58,6 +59,7 @@ public class AppTradeOrderController {
|
|
|
private TradeOrderProperties tradeOrderProperties;
|
|
|
|
|
|
@GetMapping("/settlement")
|
|
|
+ @PreAuthenticated
|
|
|
@Operation(summary = "获得订单结算信息")
|
|
|
public CommonResult<AppTradeOrderSettlementRespVO> settlementOrder(@Valid AppTradeOrderSettlementReqVO settlementReqVO) {
|
|
|
return success(tradeOrderUpdateService.settlementOrder(getLoginUserId(), settlementReqVO));
|
|
@@ -66,12 +68,13 @@ public class AppTradeOrderController {
|
|
|
@GetMapping("/settlement-product")
|
|
|
@Operation(summary = "获得商品结算信息", description = "用于商品列表、商品详情,获得参与活动后的价格信息")
|
|
|
@Parameter(name = "spuIds", description = "商品 SPU 编号数组")
|
|
|
- @PermitAll
|
|
|
+ @PreAuthenticated
|
|
|
public CommonResult<List<AppTradeProductSettlementRespVO>> settlementProduct(@RequestParam("spuIds") List<Long> spuIds) {
|
|
|
return success(priceService.calculateProductPrice(getLoginUserId(), spuIds));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
+ @PreAuthenticated
|
|
|
@Operation(summary = "创建订单")
|
|
|
public CommonResult<AppTradeOrderCreateRespVO> createOrder(@Valid @RequestBody AppTradeOrderCreateReqVO createReqVO) {
|
|
|
TradeOrderDO order = tradeOrderUpdateService.createOrder(getLoginUserId(), createReqVO);
|
|
@@ -89,6 +92,7 @@ public class AppTradeOrderController {
|
|
|
|
|
|
@GetMapping("/get-detail")
|
|
|
@Operation(summary = "获得交易订单")
|
|
|
+ @PreAuthenticated
|
|
|
@Parameters({
|
|
|
@Parameter(name = "id", description = "交易订单编号"),
|
|
|
@Parameter(name = "sync", description = "是否同步支付状态", example = "true")
|
|
@@ -119,6 +123,7 @@ public class AppTradeOrderController {
|
|
|
|
|
|
@GetMapping("/get-express-track-list")
|
|
|
@Operation(summary = "获得交易订单的物流轨迹")
|
|
|
+ @PreAuthenticated
|
|
|
@Parameter(name = "id", description = "交易订单编号")
|
|
|
public CommonResult<List<AppOrderExpressTrackRespDTO>> getOrderExpressTrackList(@RequestParam("id") Long id) {
|
|
|
return success(TradeOrderConvert.INSTANCE.convertList02(
|
|
@@ -126,6 +131,7 @@ public class AppTradeOrderController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
+ @PreAuthenticated
|
|
|
@Operation(summary = "获得交易订单分页")
|
|
|
public CommonResult<PageResult<AppTradeOrderPageItemRespVO>> getOrderPage(AppTradeOrderPageReqVO reqVO) {
|
|
|
// 查询订单
|
|
@@ -138,6 +144,7 @@ public class AppTradeOrderController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get-count")
|
|
|
+ @PreAuthenticated
|
|
|
@Operation(summary = "获得交易订单数量")
|
|
|
public CommonResult<Map<String, Long>> getOrderCount() {
|
|
|
Map<String, Long> orderCount = Maps.newLinkedHashMapWithExpectedSize(5);
|
|
@@ -162,6 +169,7 @@ public class AppTradeOrderController {
|
|
|
|
|
|
@PutMapping("/receive")
|
|
|
@Operation(summary = "确认交易订单收货")
|
|
|
+ @PreAuthenticated
|
|
|
@Parameter(name = "id", description = "交易订单编号")
|
|
|
public CommonResult<Boolean> receiveOrder(@RequestParam("id") Long id) {
|
|
|
tradeOrderUpdateService.receiveOrderByMember(getLoginUserId(), id);
|
|
@@ -170,6 +178,7 @@ public class AppTradeOrderController {
|
|
|
|
|
|
@DeleteMapping("/cancel")
|
|
|
@Operation(summary = "取消交易订单")
|
|
|
+ @PreAuthenticated
|
|
|
@Parameter(name = "id", description = "交易订单编号")
|
|
|
public CommonResult<Boolean> cancelOrder(@RequestParam("id") Long id) {
|
|
|
tradeOrderUpdateService.cancelOrderByMember(getLoginUserId(), id);
|
|
@@ -178,6 +187,7 @@ public class AppTradeOrderController {
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除交易订单")
|
|
|
+ @PreAuthenticated
|
|
|
@Parameter(name = "id", description = "交易订单编号")
|
|
|
public CommonResult<Boolean> deleteOrder(@RequestParam("id") Long id) {
|
|
|
tradeOrderUpdateService.deleteOrder(getLoginUserId(), id);
|
|
@@ -188,6 +198,7 @@ public class AppTradeOrderController {
|
|
|
|
|
|
@GetMapping("/item/get")
|
|
|
@Operation(summary = "获得交易订单项")
|
|
|
+ @PreAuthenticated
|
|
|
@Parameter(name = "id", description = "交易订单项编号")
|
|
|
public CommonResult<AppTradeOrderItemRespVO> getOrderItem(@RequestParam("id") Long id) {
|
|
|
TradeOrderItemDO item = tradeOrderQueryService.getOrderItem(getLoginUserId(), id);
|
|
@@ -195,6 +206,7 @@ public class AppTradeOrderController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/item/create-comment")
|
|
|
+ @PreAuthenticated
|
|
|
@Operation(summary = "创建交易订单项的评价")
|
|
|
public CommonResult<Long> createOrderItemComment(@RequestBody AppTradeOrderItemCommentCreateReqVO createReqVO) {
|
|
|
return success(tradeOrderUpdateService.createOrderItemCommentByMember(getLoginUserId(), createReqVO));
|