From a0ee72503f51825f465f4564dc8c19b727d00c6e Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 27 十二月 2024 14:59:19 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/eyes

---
 manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java |   55 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java b/manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java
index 5e5e1ac..94ff402 100644
--- a/manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java
+++ b/manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java
@@ -3,18 +3,20 @@
 
 import com.jilongda.common.basic.ApiResult;
 import com.jilongda.common.basic.PageInfo;
-import com.jilongda.manage.model.TLineUp;
+import com.jilongda.manage.model.*;
 import com.jilongda.manage.query.TLineUpQuery;
 import com.jilongda.manage.query.TOrderAccountingQuery;
-import com.jilongda.manage.service.TOrderAccountingService;
-import com.jilongda.manage.service.TOrderService;
-import com.jilongda.manage.service.TStoreService;
+import com.jilongda.manage.service.*;
+import com.jilongda.manage.vo.TOrderAccountVO;
 import com.jilongda.manage.vo.TOrderVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * <p>
@@ -34,6 +36,12 @@
     private TOrderService orderService;
     @Autowired
     private TOrderAccountingService orderAccountingService;
+    @Autowired
+    private TAppUserService appUserService;
+    @Autowired
+    private TOptometryDetailService optometryDetailService;
+    @Autowired
+    private TOrderGoodsService orderGoodsService;
     @ApiOperation(value = "核算订单分页列表")
     @PostMapping(value = "/pageList")
     public ApiResult<PageInfo<TOrderVO>> pageList(@RequestBody TOrderAccountingQuery query) {
@@ -46,9 +54,44 @@
     }
     @ApiOperation(value = "核算详情页面")
     @GetMapping(value = "/detail")
-    public ApiResult detail(Integer id) {
+    public ApiResult<TOrderAccountVO> detail(Integer id) {
+        TOrderAccountVO res = new TOrderAccountVO();
+        TOrder byId = orderService.getById(id);
+        TOrderAccounting one = orderAccountingService.lambdaQuery().eq(TOrderAccounting::getOrderId, id).one();
+        if (byId.getUserId()!=null){
+            TAppUser byId1 = appUserService.getById(byId.getUserId());
+            if(byId1!=null){
+                res.setName(byId1.getName());
+                res.setPhone(byId1.getPhone());
+            }
+        }
+        res.setAge(byId.getAge());
+        res.setRealName(byId.getRealName());
+        res.setGender(byId.getGender());
+        List<TOptometryDetail> list = optometryDetailService.lambdaQuery().eq(TOptometryDetail::getOrderId, id)
+                .eq(TOptometryDetail::getType, 1).list();
+        res.setOptometryDetails(list);
+        List<TOrderGoods> orderGoods = orderGoodsService.lambdaQuery()
+                .eq(TOrderGoods::getOrderId, id).list();
+        BigDecimal bigDecimal = new BigDecimal("0");
+        for (TOrderGoods orderGood : orderGoods) {
+            bigDecimal =bigDecimal.add(orderGood.getGoodsMoney());
+        }
+        res.setOrderGoods(orderGoods);
+        TStore byId1 = storeService.getById(byId.getStoreId());
+        res.setStoreName(byId1.getName());
+        res.setOrderMoney(bigDecimal);
+        res.setCouponMoney(byId.getCouponMoney());
+        res.setPayMoney(byId.getPayMoney());
+//        res.setPayType();
+//        res.setRealPayMoney();
+//        res.setCommission();
+//        res.setProfitMoney();
+//        res.setProfitRating();
 
-        return ApiResult.success();
+
+
+        return ApiResult.success(res);
     }
     @ApiOperation(value = "确认核算操作")
     @PostMapping(value = "/confirm")

--
Gitblit v1.7.1