From 342161498b55526ff3ec897885cec30a373bd6fb Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 27 十二月 2024 13:49:25 +0800
Subject: [PATCH] 123

---
 manage/src/main/java/com/jilongda/manage/vo/TOrderGoodsVO.java                      |   28 +++++++++
 manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java |   45 +++++++++++++--
 manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java                |    5 +
 manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java                |    3 +
 manage/src/main/java/com/jilongda/manage/vo/TOrderAccountVO.java                    |   51 +++++++++++++++++
 5 files changed, 124 insertions(+), 8 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..cebff63 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,19 @@
 
 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.util.List;
 
 /**
  * <p>
@@ -34,6 +35,10 @@
     private TOrderService orderService;
     @Autowired
     private TOrderAccountingService orderAccountingService;
+    @Autowired
+    private TAppUserService appUserService;
+    @Autowired
+    private TOptometryDetailService optometryDetailService;
     @ApiOperation(value = "核算订单分页列表")
     @PostMapping(value = "/pageList")
     public ApiResult<PageInfo<TOrderVO>> pageList(@RequestBody TOrderAccountingQuery query) {
@@ -46,9 +51,37 @@
     }
     @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);
+//        res.setOrderGoods();
+//        res.setStoreName();
+//        res.setOrderMoney();
+//        res.setCouponMoney();
+//        res.setPayMoney();
+//        res.setPayType();
+//        res.setRealPayMoney();
+//        res.setCommission();
+//        res.setProfitMoney();
+//        res.setProfitRating();
 
-        return ApiResult.success();
+
+
+        return ApiResult.success(res);
     }
     @ApiOperation(value = "确认核算操作")
     @PostMapping(value = "/confirm")
diff --git a/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java b/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java
index 90c37aa..63499d3 100644
--- a/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java
+++ b/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java
@@ -72,6 +72,9 @@
     @ApiModelProperty(value = "门店id")
     @TableField("storeId")
     private Integer storeId;
+    @ApiModelProperty(value = "订单id")
+    @TableField("orderId")
+    private Integer orderId;
 
     @ApiModelProperty(value = "左眼右眼 1为L 2为R")
     @TableField("status")
diff --git a/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java b/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java
index f90621d..0f12f0d 100644
--- a/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java
+++ b/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java
@@ -56,7 +56,7 @@
 
     @ApiModelProperty(value = "手续费")
     @TableField("commission")
-    private Integer commission;
+    private BigDecimal commission;
 
     @ApiModelProperty(value = "镜片右毛利")
     @TableField("rLensProfit")
@@ -72,7 +72,8 @@
 
     @ApiModelProperty(value = "实收金额")
     @TableField("payMoney")
-    private String payMoney;
+    private BigDecimal payMoney;
+
 
     @ApiModelProperty(value = "本单毛利")
     @TableField("profitMoney")
diff --git a/manage/src/main/java/com/jilongda/manage/vo/TOrderAccountVO.java b/manage/src/main/java/com/jilongda/manage/vo/TOrderAccountVO.java
new file mode 100644
index 0000000..194e7b0
--- /dev/null
+++ b/manage/src/main/java/com/jilongda/manage/vo/TOrderAccountVO.java
@@ -0,0 +1,51 @@
+package com.jilongda.manage.vo;
+
+import com.jilongda.manage.model.TOptometryDetail;
+import com.jilongda.manage.model.TOrder;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@ApiModel(value = "核算订单详情VO")
+public class TOrderAccountVO  {
+
+    @ApiModelProperty(value = "用户信息-微信昵称")
+    private String name;
+    @ApiModelProperty(value = "用户信息-手机号")
+    private String phone;
+    @ApiModelProperty(value = "用户信息-年龄")
+    private Integer age;
+    @ApiModelProperty(value = "用户信息-姓名")
+    private String realName;
+    @ApiModelProperty(value = "用户信息-性别 1男2女")
+    private Integer gender;
+
+    @ApiModelProperty(value = "配镜处方")
+    private List<TOptometryDetail> optometryDetails;
+    @ApiModelProperty(value = "商品核算")
+    private List<TOrderGoodsVO> orderGoods;
+    @ApiModelProperty(value = "门店名称")
+    private String storeName;
+    @ApiModelProperty(value = "商品小计")
+    private BigDecimal orderMoney;
+    @ApiModelProperty(value = "优惠金额")
+    private BigDecimal couponMoney;
+    @ApiModelProperty(value = "合计金额")
+    private BigDecimal payMoney;
+    @ApiModelProperty(value = "支付方式")
+    private String payType;
+    @ApiModelProperty(value = "实收金额")
+    private BigDecimal realPayMoney;
+    @ApiModelProperty(value = "手续费扣除")
+    private BigDecimal commission;
+    @ApiModelProperty(value = "笨蛋毛利")
+    private BigDecimal profitMoney;
+    @ApiModelProperty(value = "毛利率")
+    private BigDecimal profitRating;
+
+}
diff --git a/manage/src/main/java/com/jilongda/manage/vo/TOrderGoodsVO.java b/manage/src/main/java/com/jilongda/manage/vo/TOrderGoodsVO.java
new file mode 100644
index 0000000..4729c97
--- /dev/null
+++ b/manage/src/main/java/com/jilongda/manage/vo/TOrderGoodsVO.java
@@ -0,0 +1,28 @@
+package com.jilongda.manage.vo;
+
+import com.jilongda.manage.model.TOptometryDetail;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@ApiModel(value = "核算订单详情VO")
+public class TOrderGoodsVO {
+
+    @ApiModelProperty(value = "商品名称")
+    private String name;
+    @ApiModelProperty(value = "数量")
+    private String phone;
+    @ApiModelProperty(value = "单价")
+    private BigDecimal sale;
+    @ApiModelProperty(value = "成本价")
+    private BigDecimal cost;
+    @ApiModelProperty(value = "核算成本价")
+    private BigDecimal accountCost;
+    @ApiModelProperty(value = "单品毛利")
+    private BigDecimal profitMoney;
+
+}

--
Gitblit v1.7.1