From 736ab0090700c75af37b8a3456b01609e4e2d329 Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期三, 17 七月 2024 11:09:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java |  234 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 168 insertions(+), 66 deletions(-)

diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
index 835bc67..fbb3eb7 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -11,10 +11,7 @@
 import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
 import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
 import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
-import com.stylefeng.guns.modular.system.model.Driver;
-import com.stylefeng.guns.modular.system.model.OrderCancel;
-import com.stylefeng.guns.modular.system.model.OrderPosition;
-import com.stylefeng.guns.modular.system.model.UserInfo;
+import com.stylefeng.guns.modular.system.model.*;
 import com.stylefeng.guns.modular.system.service.*;
 import com.stylefeng.guns.modular.system.util.*;
 import com.stylefeng.guns.modular.system.util.Tingg.model.*;
@@ -36,6 +33,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -81,9 +79,6 @@
     @Autowired
     private IOrderCrossCityService orderCrossCityService;
 
-    /*@Autowired
-    private ICBCPayUtil icbcPayUtil;*/
-
     @Autowired
     private IOrderLogisticsService orderLogisticsService;
 
@@ -101,10 +96,15 @@
 
     @Autowired
     private PayMoneyUtil payMoneyUtil;
-
+    
+    @Autowired
+    private IRedEnvelopePaymentSettingsService redEnvelopePaymentSettingsService;
 
     @Value("${filePath}")
     private String filePath;
+    
+    @Autowired
+    private IUserRedPacketRecordService userRedPacketRecordService;
 
     /**
      * 获取正在进行中的订单
@@ -136,6 +136,7 @@
                 orderStatusWarpper.setOrderId(orderPrivateCar.getId());
                 orderStatusWarpper.setOrderType(1);
                 orderStatusWarpper.setState(orderPrivateCar.getState());
+                orderStatusWarpper.setTripId(orderPrivateCar.getTripId());
                 data.add(orderStatusWarpper);
             }
             List<OrderTaxi> list = orderTaxiService.queryOrder(uid, 1, 2, 3, 4, 5, 6, 7, 11, 12);
@@ -147,6 +148,7 @@
                 orderStatusWarpper.setOrderId(orderTaxi.getId());
                 orderStatusWarpper.setOrderType(2);
                 orderStatusWarpper.setState(orderTaxi.getState());
+//                orderStatusWarpper.setTripId(orderTaxi.getTripId());
                 data.add(orderStatusWarpper);
             }
             List<OrderCrossCity> orderCrossCities = orderCrossCityService.queryOrder(uid, 1, 2, 3, 4, 5, 6, 7, 11, 12);
@@ -158,6 +160,7 @@
                 orderStatusWarpper.setOrderId(orderCrossCity.getId());
                 orderStatusWarpper.setOrderType(3);
                 orderStatusWarpper.setState(orderCrossCity.getState());
+//                orderStatusWarpper.setTripId(orderPrivateCar.getTripId());
                 data.add(orderStatusWarpper);
             }
             return ResultUtil.success(data);
@@ -227,13 +230,13 @@
      */
     @ResponseBody
     @PostMapping("/api/order/queryMyTravelRecord")
-    @ApiOperation(value = "获取消费记录", tags = {"用户端-个人中心"}, notes = "")
+    @ApiOperation(value = "获取消费记录【2.0】", tags = {"用户端-个人中心"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "页码(首页1)", name = "pageNum", required = true, dataType = "int"),
             @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil<List<TravelRecordWarpper>> queryMyTravelRecord(Integer pageNum, Integer size, Integer language, HttpServletRequest request){
+    public ResultUtil<List<TravelRecordListWarpper>> queryMyTravelRecord(Integer pageNum, Integer size, Integer language, HttpServletRequest request){
         try {
             Integer uid = userInfoService.getUserIdFormRedis(request);
             if(null == uid){
@@ -260,26 +263,26 @@
             for (Map<String, Object> map : list3) {
                 map.put("name", name);
             }
-            List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>().eq("state", 1)
-                    .eq("type", 1).eq("userType", 1).eq("userId", uid).eq("orderType", 3).like("remark", "%跨城订单取消退款%"));
-            List<Map<String, Object>> list4 = new ArrayList<>();
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-            for(TransactionDetails transactionDetails1 : transactionDetails){
-                Map<String, Object> map = new HashMap<>();
-                map.put("money", transactionDetails1.getMoney());
-                map.put("time", DateUtil.conversionFormat(language, sdf.format(transactionDetails1.getInsertTime())));
-                map.put("name", "跨城订单取消退款");
-                map.put("insertTime", Double.valueOf(transactionDetails1.getInsertTime().getTime() / 1000).intValue());
-                list4.add(map);
-            }
+//            List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>().eq("state", 1)
+//                    .eq("type", 1).eq("userType", 1).eq("userId", uid).eq("orderType", 3).like("remark", "%跨城订单取消退款%"));
+//            List<Map<String, Object>> list4 = new ArrayList<>();
+//            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+//            for(TransactionDetails transactionDetails1 : transactionDetails){
+//                Map<String, Object> map = new HashMap<>();
+//                map.put("money", transactionDetails1.getMoney());
+//                map.put("time", DateUtil.conversionFormat(language, sdf.format(transactionDetails1.getInsertTime())));
+//                map.put("name", "跨城订单取消退款");
+//                map.put("insertTime", Double.valueOf(transactionDetails1.getInsertTime().getTime() / 1000).intValue());
+//                list4.add(map);
+//            }
             list.addAll(maps);
-//            list.addAll(list1);
-//            list.addAll(list2);
             list.addAll(list3);
 //            list.addAll(list4);
 
-            List<TravelRecordWarpper> orderWarpper = TravelRecordWarpper.getTravelRecordWarpper(list);
-
+            List<TravelRecordListWarpper> orderWarpper = TravelRecordListWarpper.getTravelRecordWarpper(list);
+    
+            double sum = orderWarpper.stream().mapToDouble(TravelRecordListWarpper::getMoney).sum();
+    
             //分页
             if(orderWarpper.size() >= (pageNum + 1) * size){
                 orderWarpper = orderWarpper.subList(pageNum, pageNum + size);
@@ -288,6 +291,9 @@
             }else{
                 orderWarpper = new ArrayList<>();
             }
+            orderWarpper.forEach(s->{
+                s.setTotal(sum);
+            });
             return ResultUtil.success(orderWarpper);
         }catch (Exception e){
             e.printStackTrace();
@@ -431,7 +437,7 @@
      */
     @ResponseBody
     @PostMapping("/api/order/queryOrderInfo")
-    @ApiOperation(value = "获取服务中的详情数据【1.0】", tags = {"用户端-服务中"}, notes = "")
+    @ApiOperation(value = "获取服务中的详情数据【2.0】", tags = {"用户端-服务中"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=同城小件,5=跨城小件)", name = "orderType", required = true, dataType = "int"),
@@ -461,16 +467,8 @@
                 map.put("driverPhone", map.get("telX"));
             }
             OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map);
-//            String driverName = orderInfoWarpper.getDriverName();
-//            if(language == 2){
-//                driverName = "Master " + driverName.replace("师傅", "");
-//            }
-//            if(language == 3){
-//                driverName = "Maître " + driverName.replace("师傅", "");
-//            }
-//            orderInfoWarpper.setDriverName(driverName);
 
-            File file = new File(filePath + orderId + "_1.txt");
+            File file = new File(filePath + orderId + "_" + orderType + ".txt");
             if(file.exists()){
                 //读取文件(字符流)
                 BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
@@ -558,7 +556,7 @@
     @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=专车,2=出租车,3=城际,4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
     public ResultUtil<OrderInfoWarpper> queryCancelPage(Integer orderId, Integer orderType, Integer language){
@@ -580,16 +578,13 @@
                     ResultUtil<BaseWarpper> r = orderCrossCityService.queryCancleAmount(orderId);
                     map.put("cancelPayMoney", r.getData().getAmount());
                     break;
+                case 4://同城小件物流
+                    map = orderLogisticsService.queryOrderInfo(language, orderId);
+                    ResultUtil<BaseWarpper> r1 = orderLogisticsService.queryCancleAmount(orderId, language);
+                    map.put("cancelPayMoney", r1.getData().getAmount());
+                    break;
             }
             OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map);
-//            String driverName = orderInfoWarpper.getDriverName();
-//            if(language == 2){
-//                driverName = "Master " + driverName.replace("师傅", "");
-//            }
-//            if(language == 3){
-//                driverName = "Maître " + driverName.replace("师傅", "");
-//            }
-//            orderInfoWarpper.setDriverName(driverName);
             return ResultUtil.success(orderInfoWarpper);
         }catch (Exception e){
             e.printStackTrace();
@@ -836,7 +831,7 @@
     @ApiOperation(value = "获取取消订单需要支付的费用金额", tags = {"用户端-出租车", "用户端-专车"}, notes = "返回金额为0则不需要支付")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城, 4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
     public ResultUtil<BaseWarpper> queryCancleAmount(Integer id, Integer orderType, Integer language){
@@ -848,6 +843,8 @@
                     return orderTaxiService.queryCancleAmount(id);
                 case 3:
                     return orderCrossCityService.queryCancleAmount(id);
+                case 4:
+                    return orderLogisticsService.queryCancleAmount(id, language);
             }
             return ResultUtil.success();
         }catch (Exception e){
@@ -869,16 +866,19 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/addCancle")
-    @ApiOperation(value = "添加取消记录", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @ApiOperation(value = "添加取消记录【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
             @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "取消原因", name = "reason", required = true, dataType = "string"),
+            @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "Double"),
+            @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "Double"),
+            @ApiImplicitParam(value = "详细地址", name = "address", required = true, dataType = "string"),
             @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"),
             @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Integer language, HttpServletRequest request){
+    public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Double lon, Double lat, String address, Integer language, HttpServletRequest request){
         try {
             Integer uid = userInfoService.getUserIdFormRedis(request);
             if(null == uid){
@@ -886,13 +886,13 @@
             }
             switch (orderType){
                 case 1:
-                    return orderPrivateCarService.addCancle(id, reason, remark, uid, language);
+                    return orderPrivateCarService.addCancle(id, reason, remark, uid, lon, lat, address, language);
 //                case 2:
 //                    return orderTaxiService.addCancle(id, reason, remark, uid);
 //                case 3:
 //                    return orderCrossCityService.addCancle(id, reason, remark, uid);
                 case 4:
-                    return orderLogisticsService.addCancle(id, reason, remark, uid, language);
+                    return orderLogisticsService.addCancle(id, reason, remark, uid, lon, lat, address, language);
 //                case 5:
 //                    return orderLogisticsService.addCancle(id, reason, remark, uid);
 //                case 6:
@@ -956,10 +956,10 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/cancleOrderTaxi")
-    @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额)", name = "payType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"),
             @ApiImplicitParam(value = "取消单id(取消操作返回)", name = "cancleId", required = false, dataType = "int"),
@@ -979,6 +979,8 @@
 //                    return orderTaxiService.cancleOrderTaxi(id, payType, cancleId, type);
 //                case 3:
 //                    return orderCrossCityService.cancleOrderCrossCity(id, payType, cancleId, type);
+                case 4:
+                    return orderLogisticsService.cancleOrderPrivateCar(id, payType, bankCardId, cancleId, type, language);
             }
             return ResultUtil.success();
         }catch (Exception e){
@@ -999,21 +1001,23 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/complaintService")
-    @ApiOperation(value = "添加投诉操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @ApiOperation(value = "添加投诉操作【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
     @ApiImplicitParams({
+            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "投诉原因", name = "reason", required = true, dataType = "String"),
             @ApiImplicitParam(value = "投诉描述", name = "description", required = true, dataType = "String"),
             @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil complaintService(Integer driverId, String reason, String description, Integer language, HttpServletRequest request){
+    public ResultUtil complaintService(Integer orderId, Integer orderType, Integer driverId, String reason, String description, Integer language, HttpServletRequest request){
         try {
             Integer uid = userInfoService.getUserIdFormRedis(request);
             if(null == uid){
                 return ResultUtil.tokenErr();
             }
-            complaintService.saveData(driverId, reason, description, uid, language);
+            complaintService.saveData(orderId, orderType, driverId, reason, description, uid, language);
             return ResultUtil.success();
         }catch (Exception e){
             e.printStackTrace();
@@ -1044,9 +1048,12 @@
                 return ResultUtil.tokenErr();
             }
             Map<String, Object> map = new HashMap<>();
+            Double payMoney = 0D;
             switch (orderType){
                 case 1:
                     map = orderPrivateCarService.queryBalance(orderId, uid);
+                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
+                    payMoney = orderPrivateCar.getPayMoney();
                     break;
 //                case 2:
 //                    map = orderTaxiService.queryBalance(orderId, uid);
@@ -1056,10 +1063,21 @@
 //                    break;
                 case 4:
                     map = orderLogisticsService.queryBalance(orderId, uid);
+                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
+                    payMoney = orderLogistics.getPayMoney();
                     break;
 //                case 5:
 //                    map = orderLogisticsService.queryBalance(orderId, uid);
 //                    break;
+            }
+            Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid);
+            map.put("redTotal", aDouble);
+            RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings();
+            if(null == redEnvelopePaymentSettings){
+                map.put("deductionAmount", 0D);
+            }else{
+                Double deductionAmount = new BigDecimal(payMoney).multiply(redEnvelopePaymentSettings.getDeductionRatio().divide(new BigDecimal(100))).doubleValue();
+                map.put("deductionAmount", deductionAmount);
             }
             return ResultUtil.success(map);
         }catch (Exception e){
@@ -1080,10 +1098,10 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/queryCoupon")
-    @ApiOperation(value = "获取支付页面的优惠券列表", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @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=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
             @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -1131,17 +1149,18 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/payTaxiOrder")
-    @ApiOperation(value = "订单完成支付订单操作【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
+    @ApiOperation(value = "订单完成支付订单操作【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额,4=线下支付)", name = "payType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"),
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "优惠券id", name = "couponId", required = false, dataType = "int"),
+            @ApiImplicitParam(value = "是否红包抵扣(0=否,1=是)", name = "redDeduction", required = false, dataType = "int"),
             @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil payTaxiOrder(Integer payType, Integer bankCardId, Integer orderId, Integer orderType, Integer couponId, Integer type, Integer language, HttpServletRequest request){
+    public ResultUtil payTaxiOrder(Integer payType, Integer bankCardId, Integer orderId, Integer orderType, Integer couponId, Integer redDeduction, Integer type, Integer language, HttpServletRequest request){
         try {
             Integer uid = userInfoService.getUserIdFormRedis(request);
             if(null == uid){
@@ -1149,13 +1168,13 @@
             }
             switch (orderType){
                 case 1:
-                    return orderPrivateCarService.payPrivateCarOrder(payType, bankCardId, orderId, couponId, type, language);
+                    return orderPrivateCarService.payPrivateCarOrder(payType, bankCardId, orderId, couponId, redDeduction, type, language);
 //                case 2:
 //                    return orderTaxiService.payTaxiOrder(payType, orderId, couponId, type);
 //                case 3:
 //                    return orderCrossCityService.payCrossCityOrder(payType, orderId, couponId, type);
                 case 4:
-                    return orderLogisticsService.payLogisticsOrder(payType, bankCardId, orderId,couponId, type, language);
+                    return orderLogisticsService.payLogisticsOrder(payType, bankCardId, orderId,couponId, redDeduction, type, language);
 //                case 5:
 //                    return orderLogisticsService.payLogisticsOrder(payType, orderId, type, language);
             }
@@ -1177,10 +1196,10 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/orderEvaluate")
-    @ApiOperation(value = "订单完成后添加评价操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @ApiOperation(value = "订单完成后添加评价操作【2.0】", 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=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(value = "评分", name = "fraction", required = true, dataType = "int"),
             @ApiImplicitParam(value = "评价内容", name = "content", required = false, dataType = "String"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -1205,6 +1224,11 @@
                         orderCrossCity.setState(9);
                         orderCrossCityService.updateById(orderCrossCity);
                         break;
+                    case 4:
+                        OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
+                        orderLogistics.setState(9);
+                        orderLogisticsService.updateById(orderLogistics);
+                        break;
                 }
             }
             return resultUtil.getCode() == 200 ? ResultUtil.success() : resultUtil;
@@ -1223,10 +1247,10 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/queryRedMoney")
-    @ApiOperation(value = "评论成功后获取红包金额", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @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=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
     public ResultUtil<BaseWarpper> queryRedMoney(Integer orderId, Integer orderType){
@@ -1238,6 +1262,8 @@
                     return orderTaxiService.queryRedMoney(orderId);
                 case 3:
                     return orderCrossCityService.queryRedMoney(orderId);
+                case 4:
+                    return orderLogisticsService.queryRedMoney(orderId);
             }
             return ResultUtil.success();
         }catch (Exception e){
@@ -1256,7 +1282,7 @@
      */
     @ResponseBody
     @PostMapping("/api/taxi/shareRedEnvelope")
-    @ApiOperation(value = "分享成功后添加红包操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
+    @ApiOperation(value = "分享成功后添加红包操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"),
@@ -1272,6 +1298,8 @@
                     return orderTaxiService.shareRedEnvelope(orderId);
                 case 3:
                     return orderCrossCityService.shareRedEnvelope(orderId);
+                case 4:
+                    return orderLogisticsService.shareRedEnvelope(orderId, language);
             }
             return ResultUtil.success();
         }catch (Exception e){
@@ -1321,6 +1349,9 @@
 //                        case 3:
 //                            orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1);
 //                            break;
+                        case 4:
+                            orderLogisticsService.payCancelOrderPrivateCar(id, order_id, language);
+                            break;
                     }
                     callbackResponse.setCheckout_request_id(order_id);
                     callbackResponse.setMerchant_transaction_id(out_trade_no);
@@ -1595,4 +1626,75 @@
         payoutCallbackResponse.setResults(results);
         return payoutCallbackResponse;
     }
+    
+    
+    
+    @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 = "终点经度", name = "endLon", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "终点纬度", name = "endLat", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "终点地址", name = "endAddress", required = true, dataType = "String"),
+            @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, String endLon, String endLat, String endAddress){
+        switch (orderType){
+            case 1:
+                orderPrivateCarService.updateEndAddress(orderId, endLon, endLat, endAddress);
+                break;
+            case 4:
+                orderLogisticsService.updateEndAddress(orderId, endLon, endLat, endAddress);
+                break;
+        }
+        return ResultUtil.success();
+    }
+    
+    
+    @ResponseBody
+    @PostMapping("/api/taxi/redEnvelopeDeductionAmount")
+    @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 = "语言", name = "language", required = true, dataType = "int"),
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+    })
+    public ResultUtil redEnvelopeDeductionAmount(Integer orderId, Integer orderType, HttpServletRequest request){
+        try {
+            Integer uid = userInfoService.getUserIdFormRedis(request);
+            if(null == uid){
+                return ResultUtil.tokenErr();
+            }
+            Double payMoney = 0D;
+            switch (orderType){
+                case 1:
+                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
+                    payMoney = orderPrivateCar.getPayMoney();
+                    break;
+                case 4:
+                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
+                    payMoney = orderLogistics.getPayMoney();
+                    break;
+            }
+            
+            Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid);
+            Map<String, Object> map = new HashMap<>();
+            map.put("redTotal", aDouble);
+            RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings();
+            if(null == redEnvelopePaymentSettings){
+                map.put("deductionAmount", 0D);
+                return ResultUtil.success(map);
+            }
+            Double deductionAmount = new BigDecimal(payMoney).multiply(redEnvelopePaymentSettings.getDeductionRatio().divide(new BigDecimal(100))).doubleValue();
+            map.put("deductionAmount", deductionAmount);
+            return ResultUtil.success(map);
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+    }
 }

--
Gitblit v1.7.1