From 7ee466ebc953bb5640bcf42f2b8e2a87aa471c21 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 15 四月 2026 20:12:21 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/gtzxinglijicun

---
 server/web/src/main/java/com/doumee/api/web/OrdersApi.java |  172 ++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 104 insertions(+), 68 deletions(-)

diff --git a/server/web/src/main/java/com/doumee/api/web/OrdersApi.java b/server/web/src/main/java/com/doumee/api/web/OrdersApi.java
index fe1eea4..e2b9e33 100644
--- a/server/web/src/main/java/com/doumee/api/web/OrdersApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/OrdersApi.java
@@ -1,112 +1,148 @@
 package com.doumee.api.web;
 
 import com.doumee.core.annotation.LoginRequired;
+import com.doumee.core.annotation.LoginShopRequired;
 import com.doumee.core.annotation.trace.Trace;
 import com.doumee.core.model.ApiResponse;
-import com.doumee.dao.business.model.Areas;
-import com.doumee.dao.business.model.Banner;
-import com.doumee.dao.business.model.Category;
-import com.doumee.dao.dto.CalculateLocalPriceDTO;
-import com.doumee.dao.dto.CalculateRemotePriceDTO;
-import com.doumee.dao.vo.AccountResponse;
-import com.doumee.dao.vo.PriceCalculateVO;
-import com.doumee.service.business.AreasService;
-import com.doumee.service.business.BannerService;
-import com.doumee.service.business.CategoryService;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.dto.CancelOrderDTO;
+import com.doumee.dao.dto.CreateOrderDTO;
+import com.doumee.dao.dto.DriverVerifyDTO;
+import com.doumee.dao.dto.ShopVerifyDTO;
+import com.doumee.dao.dto.MyOrderDTO;
+import com.doumee.dao.vo.MyOrderDetailVO;
+import com.doumee.dao.vo.MyOrderVO;
+import com.doumee.dao.vo.OverdueFeeVO;
+import com.doumee.dao.vo.PayResponse;
 import com.doumee.service.business.OrdersService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
-import java.math.BigDecimal;
-import java.util.List;
+import java.util.Objects;
 
 /**
- * Created by IntelliJ IDEA.
+ * 璁㈠崟鎺ュ彛
  *
  * @Author : Rk
  * @create 2025/7/15 15:49
  */
-@Api(tags = "閰嶇疆绫绘帴鍙�")
+@Api(tags = "璁㈠崟鎺ュ彛")
 @Trace(exclude = true)
 @RestController
-@RequestMapping("/web/config")
+@RequestMapping("/web/order")
 @Slf4j
-public class ConfigApi extends ApiController{
-
-    @Autowired
-    private CategoryService categoryService;
-
-    @Autowired
-    private AreasService areasService;
-
-    @Autowired
-    private BannerService bannerService;
+public class OrdersApi extends ApiController {
 
     @Autowired
     private OrdersService ordersService;
 
-    @ApiOperation(value = "鑾峰彇鍒嗙被鍒楄〃", notes = "灏忕▼搴忕")
-    @GetMapping("/getCategoryList")
-    @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type", value = "绫诲瀷:1=杞﹁締绫诲瀷;2=鐗╁搧鍒嗙被;3=鐗╁搧绛夌骇;4=鐗╁搧灏哄;", required = true)
-    })
-    public ApiResponse<List<Category>> getCategoryList(@RequestParam Integer type) {
-        return  ApiResponse.success("鎿嶄綔鎴愬姛",categoryService.getCategoryList(type));
-    }
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
 
-    @ApiOperation(value = "鑾峰彇寮�鏀惧煄甯傚垪琛�", notes = "杩斿洖宸插紑鏀惧煄甯傦紝鍚瀛楁瘝锛屾寜棣栧瓧姣嶆帓搴�")
-    @GetMapping("/getOpenCityList")
-    public ApiResponse<List<Areas>> getOpenCityList() {
-        return ApiResponse.success("鎿嶄綔鎴愬姛", areasService.getOpenCityList());
-    }
-
-    @ApiOperation(value = "鑾峰彇杞挱鍥惧垪琛�", notes = "鏍规嵁浣嶇疆杩斿洖杞挱鍥撅紝鍚浘鐗囧叏璺緞")
-    @GetMapping("/getBannerList")
-    @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "position", value = "浣嶇疆:0=浼氬憳绔椤佃疆鎾�;1=鍙告満APP寮曞椤�;", required = true)
-    })
-    public ApiResponse<List<Banner>> getBannerList(@RequestParam Integer position) {
-        return ApiResponse.success("鎿嶄綔鎴愬姛", bannerService.findListByPosition(position));
-    }
-
-    @ApiOperation(value = "鑾峰彇鍩庡競宸插紑閫氱墿鍝佸昂瀵�", notes = "鏍规嵁鍩庡競涓婚敭鏌ヨ宸插紑閫氱殑鐗╁搧灏哄(category type=4)")
-    @GetMapping("/getCitySizeList")
-    @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "cityId", value = "鍩庡競涓婚敭", required = true)
-    })
-    public ApiResponse<List<Category>> getCitySizeList(@RequestParam Integer cityId) {
-        return ApiResponse.success("鎿嶄綔鎴愬姛", categoryService.getCitySizeList(cityId));
+    @LoginRequired
+    @ApiOperation(value = "鍒涘缓璁㈠崟", notes = "鍒涘缓灏卞湴/寮傚湴瀵勫瓨璁㈠崟锛岃繑鍥炲井淇℃敮浠樺弬鏁�")
+    @PostMapping("/create")
+    public ApiResponse<PayResponse> createOrder(@RequestBody @Valid CreateOrderDTO dto) {
+        PayResponse payResponse = ordersService.createOrder(dto, getMemberId());
+        if (Objects.nonNull(payResponse) && StringUtils.isNotBlank(payResponse.getLockKey())) {
+            redisTemplate.delete(payResponse.getLockKey());
+        }
+        return ApiResponse.success("鎿嶄綔鎴愬姛", payResponse);
     }
 
     @LoginRequired
-    @ApiOperation(value = "璁$畻淇濅环璐圭敤", notes = "鏍规嵁鎶ヤ环閲戦璁$畻淇濅环璐圭敤")
-    @GetMapping("/calculateInsuranceFee")
+    @ApiOperation(value = "缁х画鏀粯", notes = "寰呮敮浠樿鍗曢噸鏂板敜璧峰井淇℃敮浠�")
+    @PostMapping("/continuePay/{orderId}")
+    public ApiResponse<PayResponse> continuePay(@PathVariable Integer orderId) {
+        return ApiResponse.success("鎿嶄綔鎴愬姛", ordersService.continuePay(orderId, getMemberId()));
+    }
+
+    @LoginRequired
+    @ApiOperation(value = "浼氬憳璁㈠崟鍒嗛〉", notes = "灏忕▼搴忕锛屾寜鐘舵�佺瓫閫�")
+    @PostMapping("/myPage")
     @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "query", dataType = "BigDecimal", name = "declaredValue", value = "鎶ヤ环閲戦", required = true),
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "鐢ㄦ埛token鍊�", required = true),
+    })
+    public ApiResponse<PageData<MyOrderVO>> myPage(@RequestBody @Validated PageWrap<MyOrderDTO> pageWrap) {
+        return ApiResponse.success("鏌ヨ鎴愬姛", ordersService.findMyOrderPage(pageWrap, getMemberId()));
+    }
+
+    @LoginRequired
+    @ApiOperation(value = "浼氬憳璁㈠崟璇︽儏", notes = "灏忕▼搴忕锛屾煡璇㈠綋鍓嶄細鍛樼殑璁㈠崟璇︽儏")
+    @GetMapping("/detail/{orderId}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "orderId", value = "璁㈠崟涓婚敭", required = true),
             @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "鐢ㄦ埛token鍊�", required = true)
     })
-    public ApiResponse<BigDecimal> calculateInsuranceFee(@RequestParam BigDecimal declaredValue) {
-        return ApiResponse.success("鎿嶄綔鎴愬姛", ordersService.calculateInsuranceFee(declaredValue));
+    public ApiResponse<MyOrderDetailVO> detail(@PathVariable Integer orderId) {
+        return ApiResponse.success("鏌ヨ鎴愬姛", ordersService.findMyOrderDetail(orderId, getMemberId()));
     }
 
     @LoginRequired
-    @ApiOperation(value = "璁$畻灏卞湴瀛樺彇棰勪及璐圭敤", notes = "鏍规嵁鍩庡競銆佸ぉ鏁般�佺墿鍝佺被鍨嬪拰鏁伴噺璁$畻灏卞湴瀛樺彇棰勪及璐圭敤")
-    @PostMapping("/calculateLocalPrice")
-    public ApiResponse<PriceCalculateVO> calculateLocalPrice(@RequestBody @Valid CalculateLocalPriceDTO dto) {
-        return ApiResponse.success("鎿嶄綔鎴愬姛", ordersService.calculateLocalPrice(dto));
+    @ApiOperation(value = "浼氬憳鍙栨秷璁㈠崟", notes = "浠呭紓鍦板瘎瀛樿鍗曞彲鍙栨秷")
+    @PostMapping("/cancel")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "鐢ㄦ埛token鍊�", required = true)
+    })
+    public ApiResponse cancel(@RequestBody @Validated CancelOrderDTO dto) {
+        ordersService.cancelOrder(dto.getOrderId(), getMemberId(), dto.getCancelReason());
+        return ApiResponse.success("鎿嶄綔鎴愬姛");
     }
 
     @LoginRequired
-    @ApiOperation(value = "璁$畻寮傚湴瀛樺彇棰勪及璐圭敤", notes = "鏍规嵁璺濈銆佺墿鍝佺被鍨嬪拰鏁伴噺璁$畻寮傚湴瀛樺彇棰勪及璐圭敤")
-    @PostMapping("/calculateRemotePrice")
-    public ApiResponse<PriceCalculateVO> calculateRemotePrice(@RequestBody @Valid CalculateRemotePriceDTO dto) {
-        return ApiResponse.success("鎿嶄綔鎴愬姛", ordersService.calculateRemotePrice(dto));
+    @ApiOperation(value = "鏌ヨ瓒呮椂璐圭敤", notes = "鏌ヨ璁㈠崟閫炬湡澶╂暟鍜岄�炬湡璐圭敤")
+    @GetMapping("/overdueFee/{orderId}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "orderId", value = "璁㈠崟涓婚敭", required = true),
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "鐢ㄦ埛token鍊�", required = true)
+    })
+    public ApiResponse<OverdueFeeVO> overdueFee(@PathVariable Integer orderId) {
+        return ApiResponse.success("鏌ヨ鎴愬姛", ordersService.calculateOverdueFee(orderId));
+    }
+
+    @LoginShopRequired
+    @ApiOperation(value = "闂ㄥ簵鏍搁攢鏀朵欢", notes = "闂ㄥ簵閫氳繃鏍搁攢鐮佺‘璁ゆ敹浠�/鍙栦欢")
+    @PostMapping("/shopVerify")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "闂ㄥ簵token鍊�", required = true)
+    })
+    public ApiResponse shopVerify(@RequestBody @Validated ShopVerifyDTO dto) {
+        ordersService.shopVerifyOrder(dto.getVerifyCode(), getShopId(), dto.getImages(), dto.getRemark());
+        return ApiResponse.success("鏍搁攢鎴愬姛");
+    }
+
+    @LoginShopRequired
+    @ApiOperation(value = "鏍搁攢鍙告満鐮�", notes = "寮傚湴瀵勫瓨涓旀湁鍙栦欢闂ㄥ簵鐨勮鍗曪紝閫氳繃鍙告満鏍搁攢鐮佺‘璁ゅ埌搴�")
+    @PostMapping("/driverVerify")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "鐢ㄦ埛token鍊�", required = true)
+    })
+    public ApiResponse driverVerify(@RequestBody @Validated DriverVerifyDTO dto) {
+        ordersService.driverVerifyOrder(dto.getVerifyCode(), dto.getImages(), dto.getRemark(), getShopId());
+        return ApiResponse.success("鏍搁攢鎴愬姛");
+    }
+
+    @LoginShopRequired
+    @ApiOperation(value = "闂ㄥ簵璁㈠崟璇︽儏", notes = "闂ㄥ簵绔煡璇㈣鍗曡鎯咃紝鏀寔璁㈠崟涓婚敭鎴栨牳閿�鐮佹煡璇�")
+    @GetMapping("/shopDetail")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "闂ㄥ簵token鍊�", required = true),
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "orderId", value = "璁㈠崟涓婚敭"),
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "verifyCode", value = "鏍搁攢鐮�")
+    })
+    public ApiResponse<MyOrderDetailVO> shopDetail(@RequestParam(required = false) Integer orderId,
+                                                    @RequestParam(required = false) String verifyCode) {
+        return ApiResponse.success("鏌ヨ鎴愬姛", ordersService.findShopOrderDetail(orderId, verifyCode));
     }
 
 

--
Gitblit v1.9.3