|
@@ -1,7 +1,10 @@
|
|
|
package com.etotem.cfc.controller.admin;
|
|
package com.etotem.cfc.controller.admin;
|
|
|
|
|
|
|
|
import com.etotem.cfc.common.Result;
|
|
import com.etotem.cfc.common.Result;
|
|
|
|
|
+import com.etotem.cfc.dto.ProductOrderDTO;
|
|
|
import com.etotem.cfc.service.ProductOrderService;
|
|
import com.etotem.cfc.service.ProductOrderService;
|
|
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestAttribute;
|
|
import org.springframework.web.bind.annotation.RequestAttribute;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -13,11 +16,53 @@ import java.util.Map;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/api/admin/product/order")
|
|
@RequestMapping("/api/admin/product/order")
|
|
|
|
|
+@Tag(name = "管理端-订单管理")
|
|
|
public class AdminProductOrderController {
|
|
public class AdminProductOrderController {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private ProductOrderService orderService;
|
|
private ProductOrderService orderService;
|
|
|
|
|
|
|
|
|
|
+ @Operation(summary = "订单列表")
|
|
|
|
|
+ @PostMapping("/list")
|
|
|
|
|
+ public Result<Map<String, Object>> list(@RequestBody Map<String, Object> params) {
|
|
|
|
|
+ String status = (String) params.get("status");
|
|
|
|
|
+ Integer page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ Integer size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 20;
|
|
|
|
|
+ return orderService.adminOrderPage(page, size, status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Operation(summary = "订单详情")
|
|
|
|
|
+ @PostMapping("/detail")
|
|
|
|
|
+ public Result<ProductOrderDTO> detail(@RequestBody Map<String, Object> params) {
|
|
|
|
|
+ String orderNo = (String) params.get("orderNo");
|
|
|
|
|
+ if (orderNo == null || orderNo.isEmpty()) {
|
|
|
|
|
+ return Result.error("orderNo不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ return orderService.adminOrderDetail(orderNo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Operation(summary = "订单发货")
|
|
|
|
|
+ @PostMapping("/ship")
|
|
|
|
|
+ public Result<String> ship(@RequestBody Map<String, Object> params,
|
|
|
|
|
+ @RequestAttribute("userId") Long adminId) {
|
|
|
|
|
+ String orderNo = (String) params.get("orderNo");
|
|
|
|
|
+ String trackingNumber = (String) params.get("trackingNumber");
|
|
|
|
|
+ String expressCompany = (String) params.get("expressCompany");
|
|
|
|
|
+ return orderService.ship(orderNo, trackingNumber, expressCompany);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Operation(summary = "关闭订单")
|
|
|
|
|
+ @PostMapping("/close")
|
|
|
|
|
+ public Result<String> close(@RequestBody Map<String, Object> params,
|
|
|
|
|
+ @RequestAttribute("userId") Long adminId) {
|
|
|
|
|
+ String orderNo = (String) params.get("orderNo");
|
|
|
|
|
+ if (orderNo == null || orderNo.isEmpty()) {
|
|
|
|
|
+ return Result.error("orderNo不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ return orderService.adminClose(orderNo, adminId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Operation(summary = "退款审核通过")
|
|
|
@PostMapping("/refund/approve")
|
|
@PostMapping("/refund/approve")
|
|
|
public Result<String> approveRefund(@RequestBody Map<String, Object> params,
|
|
public Result<String> approveRefund(@RequestBody Map<String, Object> params,
|
|
|
@RequestAttribute("userId") Long adminId) {
|
|
@RequestAttribute("userId") Long adminId) {
|
|
@@ -25,6 +70,7 @@ public class AdminProductOrderController {
|
|
|
return orderService.approveRefund(orderNo, adminId);
|
|
return orderService.approveRefund(orderNo, adminId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Operation(summary = "退款审核拒绝")
|
|
|
@PostMapping("/refund/reject")
|
|
@PostMapping("/refund/reject")
|
|
|
public Result<String> rejectRefund(@RequestBody Map<String, Object> params,
|
|
public Result<String> rejectRefund(@RequestBody Map<String, Object> params,
|
|
|
@RequestAttribute("userId") Long adminId) {
|
|
@RequestAttribute("userId") Long adminId) {
|