From 0e0995a1aa2bf36015c556509de79077f749a8a2 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 18 十二月 2024 16:31:20 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/eyes

---
 applet/src/main/java/com/jilongda/applet/controller/TOrderController.java |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/applet/src/main/java/com/jilongda/applet/controller/TOrderController.java b/applet/src/main/java/com/jilongda/applet/controller/TOrderController.java
index fbfa5c6..3f6c176 100644
--- a/applet/src/main/java/com/jilongda/applet/controller/TOrderController.java
+++ b/applet/src/main/java/com/jilongda/applet/controller/TOrderController.java
@@ -1,9 +1,24 @@
 package com.jilongda.applet.controller;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.jilongda.applet.model.TOptometryDetail;
+import com.jilongda.applet.model.TOrder;
+import com.jilongda.applet.model.TStore;
+import com.jilongda.applet.query.TOrderQuery;
+import com.jilongda.applet.service.*;
+import com.jilongda.applet.utils.LoginInfoUtil;
+import com.jilongda.applet.vo.TOrderVO;
+import com.jilongda.common.basic.ApiResult;
+import com.jilongda.common.basic.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * <p>
@@ -13,9 +28,47 @@
  * @author 无关风月
  * @since 2024-12-09
  */
+@Api(tags = "销售订单")
 @RestController
 @RequestMapping("/t-order")
 public class TOrderController {
 
+    @Autowired
+    private TOrderService tOrderService;
+    @Autowired
+    private LoginInfoUtil loginInfoUtil;
+    @Autowired
+    private TStoreService tStoreService;
+    @Autowired
+    private TOptometryDetailService optometryDetailService;
+    @ApiOperation(value = "查询订单列表")
+    @PostMapping(value = "/pageList")
+    public ApiResult pageList(@RequestBody TOrderQuery query) {
+        Integer userId = loginInfoUtil.getUserId();
+        query.setUserId(userId);
+        PageInfo<TOrderVO> pageInfo = tOrderService.pageList(query);
+        return ApiResult.success(pageInfo);
+    }
+
+    @ApiOperation(value = "查询订单详情")
+    @GetMapping(value = "/getDetailById")
+    public ApiResult getDetailById(@RequestParam Integer id) {
+
+        TOrder order = tOrderService.getById(id);
+        TOrderVO tOrderVO = new TOrderVO();
+        BeanUtils.copyProperties(order, tOrderVO);
+        // 查询门店
+        TStore store = tStoreService.getById(order.getStoreId());
+        if(Objects.nonNull(store)){
+            tOrderVO.setStoreName(store.getName());
+        }
+        // 查询配镜处方
+        List<TOptometryDetail> list = optometryDetailService.list(Wrappers.lambdaQuery(TOptometryDetail.class)
+                .eq(TOptometryDetail::getOptometryId, order.getOptometryId()));
+        tOrderVO.setOptometryDetails(list);
+
+        return ApiResult.success(tOrderVO);
+    }
+
 }
 

--
Gitblit v1.7.1