From 656ac293601d6da08d25e892a79604fe3edcd086 Mon Sep 17 00:00:00 2001
From: zhibing.pu <393733352@qq.com>
Date: 星期四, 01 八月 2024 16:04:46 +0800
Subject: [PATCH] 修改2.0 bug

---
 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java |   79 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 69 insertions(+), 10 deletions(-)

diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
index 33eb76b..1c5428f 100644
--- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
+++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -3,8 +3,11 @@
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.stylefeng.guns.core.util.ToolUtil;
+import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread;
 import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
+import com.stylefeng.guns.modular.smallLogistics.server.impl.OrderLogisticsSpreadService;
 import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
 import com.stylefeng.guns.modular.system.model.OrderPosition;
 import com.stylefeng.guns.modular.system.model.Reassign;
@@ -27,6 +30,8 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
@@ -149,7 +154,7 @@
      */
     @ResponseBody
     @PostMapping("/api/order/queryMyAllOrder")
-    @ApiOperation(value = "获取我的订单列表", tags = {"司机端-首页"}, notes = "")
+    @ApiOperation(value = "获取我的订单列表【2.0】", tags = {"司机端-首页"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "数据类型(1=全部,2=待支付,3=已取消,4=已完成)", name = "state", required = true, dataType = "int"),
             @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
@@ -230,6 +235,9 @@
         }
     }
 
+
+    @Autowired
+    private OrderLogisticsSpreadService spreadService;
     /**
      * 获取服务中页面订单详情
      * @param orderId
@@ -238,7 +246,7 @@
      */
     @ResponseBody
     @PostMapping("/api/order/queryOrderInfo")
-    @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "",response = OrderInfoWarpper.class)
+    @ApiOperation(value = "获取服务中页面订单详情【2.0】", tags = {"司机端-服务中"}, notes = "",response = OrderInfoWarpper.class)
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"),
@@ -263,6 +271,22 @@
             }else{
                 orderInfoWarpper.setOrderPositionList("");
             }
+
+            List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderId));
+            if (!orderLogisticsId.isEmpty()){
+                double sum =  0;
+                for (OrderLogisticsSpread orderLogisticsSpread : orderLogisticsId) {
+
+                    if (orderLogisticsSpread.getPayType()!=null&&orderLogisticsSpread.getPayType() == 4) {
+                        Double payMoney = orderLogisticsSpread.getPayMoney();
+                        sum = sum + payMoney;
+                    }
+                }
+                sum = sum+orderInfoWarpper.getPayMoney();
+                orderInfoWarpper.setPayMoney(sum);
+            }
+
+
             return ResultUtil.success(orderInfoWarpper);
         }catch (Exception e){
             e.printStackTrace();
@@ -417,8 +441,8 @@
     @ApiOperation(value = "司机确认费用", tags = {"司机端-服务中"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "支付方式(1=OK平台收款,2=其他方式收款)", name = "type", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
+//            @ApiImplicitParam(value = "支付方式(1=OK平台收款,2=其他方式收款)", name = "type", required = true, dataType = "int"),
             @ApiImplicitParam(value = "行程费用(出租车必传)", name = "travelFee", required = false, dataType = "double"),
             @ApiImplicitParam(value = "停车费", name = "parkingFee", required = false, dataType = "double"),
             @ApiImplicitParam(value = "过路费", name = "crossingFee", required = false, dataType = "double"),
@@ -506,11 +530,11 @@
             //更新小号绑定关系
             orderService.RebindMidAxbBindSend(orderId, orderType);
 
-            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("driverId"))), 2,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType);
+            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("driverId"))), 2,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType, "");
 
-            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("userId"))), 1,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType);
+            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("userId"))), 1,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType, "");
             pushUtil.pushOrderState(1, Integer.valueOf(String.valueOf(map.get("userId"))), Integer.valueOf(String.valueOf(map.get("orderId"))), orderType,
-                    Integer.valueOf(String.valueOf(map.get("orderState"))));
+                    Integer.valueOf(String.valueOf(map.get("orderState"))), 0, "");
             return JSON.toJSONString(ResultUtil.success());
         }catch (Exception e){
             e.printStackTrace();
@@ -634,7 +658,7 @@
     @ApiOperation(value = "手动确认订单完成", tags = {"司机端-服务中"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车)", name = "orderType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
     public ResultUtil completeOrder(Integer orderId, Integer orderType, Integer language){
@@ -650,10 +674,10 @@
 
     @ResponseBody
     @PostMapping("/api/order/queryMoneyInfo")
-    @ApiOperation(value = "获取订单费用明细", tags = {"司机端-服务中"}, notes = "")
+    @ApiOperation(value = "获取订单费用明细【2.0】", tags = {"司机端-服务中"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "订单类型(1=专车)", name = "orderType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
     public ResultUtil<MoneyInfoWarpper> queryMoneyInfo(Integer orderId, Integer orderType){
@@ -666,6 +690,7 @@
         }
     }
 
+    
     @ResponseBody
     @PostMapping("/api/order/fillInPickUpCode")
     @ApiOperation(value = "验证小件物流取件码", tags = {"司机端-服务中"}, notes = "")
@@ -799,4 +824,38 @@
         }
         return callbackResponse;
     }
+    
+    
+    
+    
+    @ResponseBody
+    @PostMapping("/api/taxi/updateEndAddress")
+    @ApiOperation(value = "处理乘客修改目的地【2.0】", tags = {"用户端-专车", "用户端-小件物流"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "状态(2=同意,3=拒绝)", name = "status", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"),
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+    })
+    public ResultUtil updateEndAddress(Integer orderId, Integer orderType, Integer status){
+        if(null == orderId){
+            return ResultUtil.error("订单id不能为空");
+        }
+        if(null == orderType){
+            return ResultUtil.error("订单类型不能为空");
+        }
+        if(null == status){
+            return ResultUtil.error("状态不能为空");
+        }
+        switch (orderType){
+            case 1:
+                orderPrivateCarService.updateEndAddress(orderId, status);
+                break;
+            case 4:
+                orderLogisticsService.updateEndAddress(orderId, status);
+                break;
+        }
+        return ResultUtil.success();
+    }
 }

--
Gitblit v1.7.1