From e809f5955584e600d8612540ea814977c49774c2 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 27 八月 2025 23:51:54 +0800
Subject: [PATCH] 修改bug

---
 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TAbnormalOrderCarController.java |  164 +++++++++++++++++++++++++-----------------------------
 1 files changed, 77 insertions(+), 87 deletions(-)

diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TAbnormalOrderCarController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TAbnormalOrderCarController.java
index f1d7a5a..42aec37 100644
--- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TAbnormalOrderCarController.java
+++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TAbnormalOrderCarController.java
@@ -112,7 +112,7 @@
     public String tOrderPrivateCarUpdate(Integer tOrderPrivateCarId,Integer type, Model model) {
         if(type==1){
             Map<String, Object> item = tOrderPrivateCarService.getPrivateCarOrderDetailById(tOrderPrivateCarId);
-
+            TOrderPrivateCar tOrderPrivateCar1 = tOrderPrivateCarService.selectById(tOrderPrivateCarId);
             Object o1 = item.get("abnormalImg");
             if(o1!=null){
                 String[] split = o1.toString().split(",");
@@ -121,12 +121,11 @@
                 model.addAttribute("abnormalImg",new String[]{});
             }
             // money是修改后的金额
-            model.addAttribute("money",0);
+            model.addAttribute("money","");
             Object o2 = item.get("responsibilityType");
             if(o2!=null){
                 if(Integer.valueOf(o2.toString())>2){
-                    TAbnormalPayOrder tAbnormalPayOrder = tAbnormalPayOrderService.selectOne(new EntityWrapper<TAbnormalPayOrder>().eq("type", 1).eq("orderNum",tOrderPrivateCarId));
-                    model.addAttribute("money",tAbnormalPayOrder.getPayMoney());
+                    model.addAttribute("money", tOrderPrivateCar1.getResponsibilityMoney());
                 }
             }
             model.addAttribute("item",item);
@@ -144,6 +143,7 @@
             model.addAttribute("maps",maps);
         }else if(type==2){
             Map<String, Object> item = tOrderCrossCityService.getCrossCityOrderDetailById(tOrderPrivateCarId);
+            TOrderCrossCity tOrderCrossCity = tOrderCrossCityService.selectById(tOrderPrivateCarId);
             Object o1 = item.get("abnormalImg");
             if(o1!=null){
                 String[] split = o1.toString().split(",");
@@ -152,18 +152,18 @@
                 model.addAttribute("abnormalImg",new String[]{});
             }
             Object o2 = item.get("responsibilityType");
-            model.addAttribute("money",0);
+            model.addAttribute("money","");
             model.addAttribute("show",0);
             if(o2!=null){
                 if(Integer.valueOf(o2.toString())>2){
-                    TAbnormalPayOrder tAbnormalPayOrder = tAbnormalPayOrderService.selectOne(new EntityWrapper<TAbnormalPayOrder>().eq("type", 2).eq("orderNum",tOrderPrivateCarId));
-                    model.addAttribute("money",tAbnormalPayOrder.getPayMoney());
+                    model.addAttribute("money", tOrderCrossCity.getResponsibilityMoney());
                 }
             }
             model.addAttribute("type",2);
             model.addAttribute("item",item);
         }else if(type==3){
             Map<String, Object> item = tOrderTaxiService.getTaxiOrderDetailById(tOrderPrivateCarId);
+            TOrderTaxi tOrderTaxi = tOrderTaxiService.selectById(tOrderPrivateCarId);
             Object o1 = item.get("abnormalImg");
             if(o1!=null){
                 String[] split = o1.toString().split(",");
@@ -171,13 +171,12 @@
             }else {
                 model.addAttribute("abnormalImg",new String[]{});
             }
-            model.addAttribute("money",0);
+            model.addAttribute("money","");
             model.addAttribute("show",0);
             Object o2 = item.get("responsibilityType");
             if(o2!=null){
                 if(Integer.valueOf(o2.toString())>2){
-                    TAbnormalPayOrder tAbnormalPayOrder = tAbnormalPayOrderService.selectOne(new EntityWrapper<TAbnormalPayOrder>().eq("type", 3).eq("orderNum",tOrderPrivateCarId));
-                    model.addAttribute("money",tAbnormalPayOrder.getPayMoney());
+                    model.addAttribute("money", tOrderTaxi.getResponsibilityMoney());
                 }
             }
             model.addAttribute("type",3);
@@ -309,7 +308,7 @@
         // 快车
         if(type==1){
             page.setRecords(tOrderPrivateCarService.getPrivateCarOrderList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(),
-                    orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, state, rideType, abnormal, promotion, promotionUser,abnormalStatus));
+                    orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, state, rideType, abnormal, promotion, promotionUser,abnormalStatus, null));
             return super.packForBT(page);
             // 跨城
         }else if(type==2){
@@ -689,37 +688,9 @@
         if(type==1){
             TOrderPrivateCar tOrderPrivateCar = tOrderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>().eq("id",orderNum));
             userId = tOrderPrivateCar.getUserId();
-            tOrderPrivateCar.setResponsibilityType(responsibilityTypeVal);
-            tOrderPrivateCar.setAbnormalStatus(2);
-            if(responsibilityTypeVal>3){
-                tOrderPrivateCar.setResponsibilityMoney(tOrderPrivateCar.getPayMoney());
-                tOrderPrivateCar.setOrderMoney(new BigDecimal(money));
-            }
-            if(responsibilityTypeVal>2){
-                // 追偿订单记录表
-                TAbnormalPayOrder tAbnormalPayOrder = new TAbnormalPayOrder();
-                tAbnormalPayOrder.setOrderNum(orderNum);
-                tAbnormalPayOrder.setOrderNo(tOrderPrivateCar.getOrderNum());
-                tAbnormalPayOrder.setType(1);
-                tAbnormalPayOrder.setUserId(tOrderPrivateCar.getUserId());
-                tAbnormalPayOrder.setPayStatus(1);
-                tAbnormalPayOrder.setPayTime(new Date());
-                if(responsibilityTypeVal==3){
-                    tAbnormalPayOrder.setPayMoney(tOrderPrivateCar.getPayMoney());
-                }else {
-                    tAbnormalPayOrder.setPayMoney(new BigDecimal( money));
-                }
-                tAbnormalPayOrder.setCompanyId(tOrderPrivateCar.getCompanyId());
-                tAbnormalPayOrderService.insert(tAbnormalPayOrder);
-            }
 
-            if(responsibilityTypeVal<3){
-                tOrderPrivateCar.setState(9);
-            }
-            tOrderPrivateCar.setAbnormalRemark(remark);
-            tOrderPrivateCarService.updateById(tOrderPrivateCar);
-            //平台全责和司机全责需要调起备付金支付
-            if(9 == tOrderPrivateCar.getState()){
+            //平台全责需要调起备付金支付
+            if(1 == responsibilityTypeVal){
                 TDriver driver = tDriverService.selectById(tOrderPrivateCar.getDriverId());
                 TCompany company = tCompanyMapper.selectById(driver.getCompanyId());
                 TUser userInfo = userService.selectById(tOrderPrivateCar.getUserId());
@@ -788,37 +759,59 @@
                     }
                     OrderUtil.modifyTravelItinerary(request1);
                 }
+
+                tOrderPrivateCar.setPayType(5);
+                tOrderPrivateCar.setPayMoney(tOrderPrivateCar.getOrderMoney());
+                tOrderPrivateCar.setState(9);
+                tOrderPrivateCar.setResponsibilityMoney(tOrderPrivateCar.getOrderMoney());
             }
+
+            //司机全责
+            if(responsibilityTypeVal == 2){
+                tOrderPrivateCar.setState(9);
+                tOrderPrivateCar.setPayMoney(BigDecimal.ZERO);
+                tOrderPrivateCar.setResponsibilityMoney(BigDecimal.ZERO);
+            }
+            //乘客全责,不做任何修改
+            if(responsibilityTypeVal == 3){
+                tOrderPrivateCar.setResponsibilityMoney(tOrderPrivateCar.getOrderMoney());
+            }
+            //平台部分责任/司机部分责任
+            if(responsibilityTypeVal == 4 || responsibilityTypeVal == 5){
+                tOrderPrivateCar.setResponsibilityMoney(new BigDecimal(money));
+            }
+            tOrderPrivateCar.setResponsibilityType(responsibilityTypeVal);
+            tOrderPrivateCar.setAbnormalStatus(2);
+            tOrderPrivateCar.setAbnormalRemark(remark);
+            tOrderPrivateCar.setAbnormalTime(new Date());
+            tOrderPrivateCarService.updateById(tOrderPrivateCar);
+
         }
         if(type==2){
             TOrderCrossCity tOrderCrossCity = tOrderCrossCityService.selectOne(new EntityWrapper<TOrderCrossCity>().eq("id", orderNum));
             userId = tOrderCrossCity.getUserId();
             tOrderCrossCity.setResponsibilityType(responsibilityTypeVal);
             tOrderCrossCity.setAbnormalStatus(2);
-            if(responsibilityTypeVal>3) {
-                tOrderCrossCity.setResponsibilityMoney(tOrderCrossCity.getPayMoney());
-                tOrderCrossCity.setOrderMoney(new BigDecimal(money));
-            }
-            if(responsibilityTypeVal>2){
-                // 追偿订单记录表
-                TAbnormalPayOrder tAbnormalPayOrder = new TAbnormalPayOrder();
-                tAbnormalPayOrder.setOrderNum(orderNum);
-
-                tAbnormalPayOrder.setOrderNo(tOrderCrossCity.getOrderNum());
-                tAbnormalPayOrder.setType(2);
-                tAbnormalPayOrder.setUserId(tOrderCrossCity.getUserId());
-                tAbnormalPayOrder.setPayStatus(1);
-                tAbnormalPayOrder.setPayTime(new Date());
-                if(responsibilityTypeVal==3){
-                    tAbnormalPayOrder.setPayMoney(tOrderCrossCity.getPayMoney());
-                }else {
-                    tAbnormalPayOrder.setPayMoney(new BigDecimal(money));
-                }
-                tAbnormalPayOrder.setCompanyId(tOrderCrossCity.getCompanyId());
-                tAbnormalPayOrderService.insert(tAbnormalPayOrder);
-            }
-            if(responsibilityTypeVal<3){
+            //平台全责
+            if(responsibilityTypeVal == 1) {
+                tOrderCrossCity.setPayType(5);
+                tOrderCrossCity.setPayMoney(tOrderCrossCity.getOrderMoney());
                 tOrderCrossCity.setState(9);
+                tOrderCrossCity.setResponsibilityMoney(tOrderCrossCity.getOrderMoney());
+            }
+            //司机全责
+            if(responsibilityTypeVal == 2){
+                tOrderCrossCity.setState(9);
+                tOrderCrossCity.setPayMoney(BigDecimal.ZERO);
+                tOrderCrossCity.setResponsibilityMoney(BigDecimal.ZERO);
+            }
+            //乘客全责,不做任何修改
+            if(responsibilityTypeVal == 3){
+                tOrderCrossCity.setResponsibilityMoney(tOrderCrossCity.getOrderMoney());
+            }
+            //平台部分责任/司机部分责任
+            if(responsibilityTypeVal == 4 || responsibilityTypeVal == 5){
+                tOrderCrossCity.setResponsibilityMoney(new BigDecimal(money));
             }
             tOrderCrossCity.setAbnormalRemark(remark);
             tOrderCrossCityService.updateById(tOrderCrossCity);
@@ -829,32 +822,29 @@
             userId = tOrderTaxi.getUserId();
             tOrderTaxi.setResponsibilityType(responsibilityTypeVal);
             tOrderTaxi.setAbnormalStatus(2);
-            if(responsibilityTypeVal>3) {
-                tOrderTaxi.setResponsibilityMoney(tOrderTaxi.getPayMoney());
-                tOrderTaxi.setOrderMoney(new BigDecimal(money));
-            }
-            if(responsibilityTypeVal>2){
-                // 追偿订单记录表
-                TAbnormalPayOrder tAbnormalPayOrder = new TAbnormalPayOrder();
-                tAbnormalPayOrder.setOrderNum(orderNum);
-                tAbnormalPayOrder.setOrderNo(tOrderTaxi.getOrderNum());
-                tAbnormalPayOrder.setType(3);
-                tAbnormalPayOrder.setUserId(tOrderTaxi.getUserId());
-                tAbnormalPayOrder.setPayStatus(1);
-                tAbnormalPayOrder.setPayTime(new Date());
-                if(responsibilityTypeVal==3){
-                    tAbnormalPayOrder.setPayMoney(tOrderTaxi.getPayMoney());
-                }else {
-                    tAbnormalPayOrder.setPayMoney(new BigDecimal( money));
-                }
-
-                tAbnormalPayOrder.setCompanyId(tOrderTaxi.getCompanyId());
-                tAbnormalPayOrderService.insert(tAbnormalPayOrder);
-            }
-            if(responsibilityTypeVal<3){
+            //平台全责
+            if(responsibilityTypeVal == 1) {
+                tOrderTaxi.setPayType(5);
+                tOrderTaxi.setPayMoney(tOrderTaxi.getOrderMoney());
+                tOrderTaxi.setResponsibilityMoney(tOrderTaxi.getOrderMoney());
                 tOrderTaxi.setState(9);
             }
+            //司机全责
+            if(responsibilityTypeVal == 2){
+                tOrderTaxi.setState(9);
+                tOrderTaxi.setPayMoney(BigDecimal.ZERO);
+                tOrderTaxi.setResponsibilityMoney(BigDecimal.ZERO);
+            }
+            //乘客全责,不做任何修改
+            if(responsibilityTypeVal == 3){
+                tOrderTaxi.setResponsibilityMoney(tOrderTaxi.getOrderMoney());
+            }
+            //平台部分责任/司机部分责任
+            if(responsibilityTypeVal == 4 || responsibilityTypeVal == 5){
+                tOrderTaxi.setResponsibilityMoney(new BigDecimal(money));
+            }
             tOrderTaxi.setAbnormalRemark(remark);
+            tOrderTaxi.setAbnormalTime(new Date());
             tOrderTaxiService.updateById(tOrderTaxi);
         }
 

--
Gitblit v1.7.1